aboutsummaryrefslogtreecommitdiffstats
path: root/src/mslot_class.h
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-11-01 18:11:24 +0100
committerMax <msuraev@sysmocom.de>2017-11-21 10:45:24 +0000
commit842d781b5ef934a16b31f15c625e93c1af38b552 (patch)
tree1f94ecabe7534d3b93e4d85a7afb8ac34a496644 /src/mslot_class.h
parentb709144f1bacd55dfdd460dbdcfb22cd617862f3 (diff)
Move multislot table to separate file
To facilitate testing and addition of support for new multislot classes, hide multislot class struct internals: * introduce mslot_class_get_*() functions * use those functions instead of direct access to array of structs * use ms_class as a parameter to find_multi_slot() instead of entire object Change-Id: Id796bcff1322b1e273a0e3236c66c23b9da8fac6
Diffstat (limited to 'src/mslot_class.h')
-rw-r--r--src/mslot_class.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/mslot_class.h b/src/mslot_class.h
new file mode 100644
index 00000000..f26bd647
--- /dev/null
+++ b/src/mslot_class.h
@@ -0,0 +1,46 @@
+/* mslot_class.h
+ *
+ * Copyright (C) 2012 Ivan Klyuchnikov
+ * Copyright (C) 2012 Andreas Eversberg <jolly@eversberg.eu>
+ * Copyright (C) 2013 by Holger Hans Peter Freyther
+ * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+
+/* 3GPP TS 05.02 Annex B.1 */
+
+#define MS_NA 255 /* N/A *///
+#define MS_A 254 /* 1 with hopping, 0 without */
+#define MS_B 253 /* 1 with hopping, 0 without (change Rx to Tx)*/
+#define MS_C 252 /* 1 with hopping, 0 without (change Tx to Rx)*/
+
+#define DEFAULT_MSLOT_CLASS 12
+
+/* multislot class selection routines */
+uint8_t mslot_class_get_ta(uint8_t ms_cl);
+uint8_t mslot_class_get_tb(uint8_t ms_cl);
+uint8_t mslot_class_get_ra(uint8_t ms_cl);
+uint8_t mslot_class_get_rb(uint8_t ms_cl);
+uint8_t mslot_class_get_tx(uint8_t ms_cl);
+uint8_t mslot_class_get_rx(uint8_t ms_cl);
+uint8_t mslot_class_get_sum(uint8_t ms_cl);
+uint8_t mslot_class_get_type(uint8_t ms_cl);