[MERGED] osmo-pcu[master]: Add multislot classes from latest spec
Harald Welte has submitted this change and it was merged. Change subject: Add multislot classes from latest spec .. 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 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/alloc/MslotTest.ok 7 files changed, 72,880 insertions(+), 3,439 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 12 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max
osmo-pcu[master]: Add multislot classes from latest spec
Patch Set 11: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 11 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No
[PATCH] osmo-pcu[master]: Add multislot classes from latest spec
Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4072 to look at the new patch set (#8). 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 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/alloc/MslotTest.ok 7 files changed, 72,880 insertions(+), 3,439 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/8 -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max
[PATCH] osmo-pcu[master]: Add multislot classes from latest spec
Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4072 to look at the new patch set (#6). 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 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/alloc/MslotTest.ok 7 files changed, 5,598 insertions(+), 1,312 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/6 -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max
[PATCH] osmo-pcu[master]: Add multislot classes from latest spec
Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4072 to look at the new patch set (#5). 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 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/alloc/MslotTest.ok 7 files changed, 5,598 insertions(+), 1,312 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/5 -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max
[PATCH] osmo-pcu[master]: Add multislot classes from latest spec
Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4072 to look at the new patch set (#4). 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 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/alloc/MslotTest.ok 7 files changed, 1,520 insertions(+), 800 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/4 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 471b601..b5edf05 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -469,8 +469,12 @@ 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 19fea3e..12d6d9e 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -27,7 +27,7 @@ #include -/* 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 @@ 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 | TtaTtbTraTrb | */ /* N/A */ { MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, @@ -68,8 +68,22 @@ /* 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_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 @@ return 0; case MS_C: return 1; + case MS_TO: + return ta;
osmo-pcu[master]: Add multislot classes from latest spec
Patch Set 3: Tests are available in the previous commit - see gerrit 4636. -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No
osmo-pcu[master]: Add multislot classes from latest spec
Patch Set 3: Code-Review-1 The Alloctest change still seems to require an update... As I said on the mailinglist. I want to get this patch in first. So it is blocking everything else. -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No
[PATCH] osmo-pcu[master]: Add multislot classes from latest spec
Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4072 to look at the new patch set (#3). 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. 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 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/MslotTest.ok 4 files changed, 651 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/3 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 471b601..b5edf05 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -469,8 +469,12 @@ 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 6d7c09d..936afb3 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -27,7 +27,7 @@ #include -/* 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 @@ 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 | TtaTtbTraTrb | */ /* N/A */ { MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, @@ -68,8 +68,22 @@ /* 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) @@ -104,12 +118,19 @@ } } -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); @@ -118,6 +139,8 @@ 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 f26bd64..3fa507d 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h
osmo-pcu[master]: Add multislot classes from latest spec
Patch Set 2: > Is this addressed? Not yet - as I've said in the comment above, I'll get back to it in next version. The current revision was published to split formatting changes from new classes as per your feedback. -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No
osmo-pcu[master]: Add multislot classes from latest spec
Patch Set 2: (2 comments) > tests/alloc/AllocTest.cpp requires updates to use/test the new classes as > well. ^^^ Is this addressed? https://gerrit.osmocom.org/#/c/4072/2//COMMIT_MSG Commit Message: Line 15: yet - this can be extended once we have such devices to test it. How would you support it? Shall we print a runtime warning once this class is being used? https://gerrit.osmocom.org/#/c/4072/2/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 531: if (ms->ms_class() >= ARRAY_SIZE(gprs_ms_multislot_class)) { I would have avoided the extra reformatting. -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes
osmo-pcu[master]: Add multislot classes from latest spec
Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No
osmo-pcu[master]: Add multislot classes from latest spec
Patch Set 2: > What is the minimal dependency to get this in? Which patch removes the <= 32 > assumption? It's part of this patch. I can split it too if necessary. > tests/alloc/AllocTest.cpp requires updates to use/test the new classes as > well. I'll check and update in next revision. > Any idea why we padded the structs before? No idea. It's added in one commit and I do not see anything in the code relying on it. -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: MaxGerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No
[PATCH] osmo-pcu[master]: Add multislot classes from latest spec
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4072 to look at the new patch set (#2). 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. Also make sure to check index properly when accessing multislot class. Note: classes 35-45 which need TA offset are not properly supported yet - this can be extended once we have such devices to test it. Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 26 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/2 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 2b08cf6..9284406 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -32,12 +32,15 @@ /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 -/* 3GPP TS 05.02 Annex B.1 */ +/* 3GPP TS 45.002 Annex B Table 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)*/ +/* 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 */ +#define MS_TO 0 /* 31 symbol periods (this can be provided by a TA offset, i.e. a minimum TA value) */ struct gprs_ms_multislot_class { uint8_t rx, tx, sum;/* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -45,7 +48,7 @@ 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 | TtaTtbTraTrb | */ /* N/A */ { MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA, MS_NA }, @@ -78,8 +81,22 @@ /* 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, 1 + MS_TO, 1, 1 }, + /* 36 */ { 5, 2, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 37 */ { 5, 3, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 38 */ { 5, 4, 6, 2, 1, 1 + MS_TO, 1, 1 }, + /* 39 */ { 5, 5, 6, 2, 1, 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 char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) @@ -510,13 +527,12 @@ enum {MASK_TT, MASK_TR}; unsigned mask_sel; - if (ms->ms_class() >= 32) { - LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %d out of range.\n", - ms->ms_class()); - return -EINVAL; - } - if (ms->ms_class()) { + if (ms->ms_class() >= ARRAY_SIZE(gprs_ms_multislot_class)) { + LOGP(DRLCMAC, LOGL_ERROR, "Multislot class %u out of range [1, %u].\n", +ms->ms_class(), ARRAY_SIZE(gprs_ms_multislot_class)); + return -EINVAL; + } ms_class = _ms_multislot_class[ms->ms_class()]; LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for " "class %d\n", ms->ms_class()); -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master