Max has submitted this change and it was merged. ( https://gerrit.osmocom.org/12952 )
Change subject: Rewrite EGPRS Packet Uplink IA Rest Octets for MBA ...................................................................... Rewrite EGPRS Packet Uplink IA Rest Octets for MBA Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 ยง10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. That's partially based on reverted commit 529ce885450946d85d1920fb3d1a994c3efe5849. Change-Id: I19cc4226e7e831e7d7f70212b2078f5589a87ff0 Related: OS#3014 --- M src/encoding.cpp 1 file changed, 11 insertions(+), 15 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/encoding.cpp b/src/encoding.cpp index e7e13ac..ba0e474 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -258,26 +258,21 @@ return rc; } -static int write_ia_rest_egprs_uplink_mba(bitvec * dest, uint32_t fn, uint8_t alpha, uint8_t gamma, unsigned& wp) +static int write_ia_rest_egprs_uplink_mba(bitvec * dest, uint32_t fn, uint8_t alpha, uint8_t gamma) { int rc = 0; - bitvec_write_field(dest, &wp, 0, 1); /* multiblock allocation */ + SET_0(dest); /* Multi Block Allocation */ - if (alpha) { - bitvec_write_field(dest, &wp, 0x1, 1); /* ALPHA =yes */ - bitvec_write_field(dest, &wp, alpha, 4); /* ALPHA */ - } else { - bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = no */ - } + rc = write_alpha_gamma(dest, alpha, gamma); + CHECK(rc); - bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power contrl */ - bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5);/* T1' */ - bitvec_write_field(dest, &wp, fn % 51, 6); /* T3 */ - bitvec_write_field(dest, &wp, fn % 26, 5); /* T2 */ - bitvec_write_field(dest, &wp, 0, 2); /* Radio block allocation */ + rc = write_tbf_start_time(dest, fn); + CHECK(rc); - bitvec_write_field(dest, &wp, 0, 1); + SET_0(dest); /* NUMBER OF RADIO BLOCKS ALLOCATED: */ + SET_0(dest); /* 1 radio block reserved for uplink transmission */ + SET_0(dest); /* No P0 */ return rc; } @@ -483,7 +478,8 @@ if (as_ul_tbf(tbf) != NULL) { rc = write_ia_rest_egprs_uplink_sba(as_ul_tbf(tbf), dest, usf, alpha, gamma, wp); } else { - rc = write_ia_rest_egprs_uplink_mba(dest, fn, alpha, gamma, wp); + dest->cur_bit = wp; + rc = write_ia_rest_egprs_uplink_mba(dest, fn, alpha, gamma); } } else { OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled()); -- To view, visit https://gerrit.osmocom.org/12952 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I19cc4226e7e831e7d7f70212b2078f5589a87ff0 Gerrit-Change-Number: 12952 Gerrit-PatchSet: 6 Gerrit-Owner: Max <msur...@sysmocom.de> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: Max <msur...@sysmocom.de> Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de> Gerrit-CC: Vadim Yanitskiy <axilira...@gmail.com>