aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-01-23 20:58:49 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-02-27 22:25:35 +0100
commitacb998c8499508bb367d33427e6ab97d83a1b5ad (patch)
tree3daea1ee3ac610e1bc878fff773c651a97a65e48 /src
parent788ed90ce67bd76eb890e6a762ab2bb5b1d7289f (diff)
Add multislot classes from latest spec
The table B.1 is copy-pasted from 3GPP TS 45.002 and reformatted via Emacs macros into C struct to avoid typos. The test output expanded accordingly. The allocation test expectations and output are adjusted accordingly. Note: classes 35-45 which need TA offset are not properly supported yet. This can be extended once we have such devices available for tests. Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Related: OS#2282
Diffstat (limited to 'src')
-rw-r--r--src/gprs_rlcmac_ts_alloc.cpp8
-rw-r--r--src/mslot_class.c37
-rw-r--r--src/mslot_class.h5
3 files changed, 39 insertions, 11 deletions
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 471b601a..b5edf051 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -469,8 +469,12 @@ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *
Sum = mslot_class_get_sum(mslot_class);
Tta = mslot_class_get_ta(mslot_class);
Ttb = mslot_class_get_tb(mslot_class);
- Tra = mslot_class_get_ra(mslot_class);
- Trb = mslot_class_get_rb(mslot_class);
+
+ /* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly
+ see also "Offset required" bit in 3GPP TS 24.008 ยง10.5.1.7 */
+ Tra = mslot_class_get_ra(mslot_class, 0);
+ Trb = mslot_class_get_rb(mslot_class, 0);
+
Type = mslot_class_get_type(mslot_class);
if (Tx == MS_NA) {
diff --git a/src/mslot_class.c b/src/mslot_class.c
index 19fea3ed..12d6d9e2 100644
--- a/src/mslot_class.c
+++ b/src/mslot_class.c
@@ -27,7 +27,7 @@
#include <errno.h>
-/* 3GPP TS 05.02 Annex B.1 */
+/* 3GPP TS 45.002 Annex B Table B.1 */
struct gprs_ms_multislot_class {
uint8_t rx, tx, sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */
@@ -35,7 +35,7 @@ struct gprs_ms_multislot_class {
uint8_t type; /* Type of Mobile */
};
-static const struct gprs_ms_multislot_class gprs_ms_multislot_class[32] = {
+static const struct gprs_ms_multislot_class gprs_ms_multislot_class[] = {
/* M-S Class | Max # of slots | Min # of slots | Type */
/* | Rx Tx Sum | Tta Ttb Tra Trb | */
/* N/A */ { MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA },
@@ -68,8 +68,22 @@ static const struct gprs_ms_multislot_class gprs_ms_multislot_class[32] = {
/* 27 */ { 8, 4, MS_NA, 2, MS_B, 2, MS_C, 1 },
/* 28 */ { 8, 6, MS_NA, 2, MS_B, 2, MS_C, 1 },
/* 29 */ { 8, 8, MS_NA, 2, MS_B, 2, MS_C, 1 },
-/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA },
-/* N/A */ { MS_NA,MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA },
+ /* 30 */ { 5, 1, 6, 2, 1, 1, 1, 1 },
+ /* 31 */ { 5, 2, 6, 2, 1, 1, 1, 1 },
+ /* 32 */ { 5, 3, 6, 2, 1, 1, 1, 1 },
+ /* 33 */ { 5, 4, 6, 2, 1, 1, 1, 1 },
+ /* 34 */ { 5, 5, 6, 2, 1, 1, 1, 1 },
+ /* 35 */ { 5, 1, 6, 2, 1, MS_TO, 1, 1 },
+ /* 36 */ { 5, 2, 6, 2, 1, MS_TO, 1, 1 },
+ /* 37 */ { 5, 3, 6, 2, 1, MS_TO, 1, 1 },
+ /* 38 */ { 5, 4, 6, 2, 1, MS_TO, 1, 1 },
+ /* 39 */ { 5, 5, 6, 2, 1, MS_TO, 1, 1 },
+ /* 40 */ { 6, 1, 7, 1, 1, 1, MS_TO, 1 },
+ /* 41 */ { 6, 2, 7, 1, 1, 1, MS_TO, 1 },
+ /* 42 */ { 6, 3, 7, 1, 1, 1, MS_TO, 1 },
+ /* 43 */ { 6, 4, 7, 1, 1, 1, MS_TO, 1 },
+ /* 44 */ { 6, 5, 7, 1, 1, 1, MS_TO, 1 },
+ /* 45 */ { 6, 6, 7, 1, 1, 1, MS_TO, 1 },
};
static inline const struct gprs_ms_multislot_class *get_mslot_table(uint8_t ms_cl)
@@ -109,12 +123,19 @@ 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_ra(uint8_t ms_cl, uint8_t ta)
{
- return get_mslot_table(ms_cl)->ra;
+ const struct gprs_ms_multislot_class *t = get_mslot_table(ms_cl);
+
+ switch (t->ra) {
+ case MS_TO:
+ return ta + 1;
+ default:
+ return t->ra;
+ }
}
-uint8_t mslot_class_get_rb(uint8_t ms_cl)
+uint8_t mslot_class_get_rb(uint8_t ms_cl, uint8_t ta)
{
const struct gprs_ms_multislot_class *t = get_mslot_table(ms_cl);
@@ -123,6 +144,8 @@ uint8_t mslot_class_get_rb(uint8_t ms_cl)
return 0;
case MS_C:
return 1;
+ case MS_TO:
+ return ta;
default:
return t->rb;
}
diff --git a/src/mslot_class.h b/src/mslot_class.h
index 9e9dfba5..a6366fc1 100644
--- a/src/mslot_class.h
+++ b/src/mslot_class.h
@@ -32,14 +32,15 @@
#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 MS_TO 251 /* 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value) */
#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_ra(uint8_t ms_cl, uint8_t ta);
+uint8_t mslot_class_get_rb(uint8_t ms_cl, uint8_t ta);
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);