diff options
author | Max <msuraev@sysmocom.de> | 2018-01-23 20:58:49 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-02-27 22:25:35 +0100 |
commit | acb998c8499508bb367d33427e6ab97d83a1b5ad (patch) | |
tree | 3daea1ee3ac610e1bc878fff773c651a97a65e48 /src/mslot_class.c | |
parent | 788ed90ce67bd76eb890e6a762ab2bb5b1d7289f (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/mslot_class.c')
-rw-r--r-- | src/mslot_class.c | 37 |
1 files changed, 30 insertions, 7 deletions
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; } |