lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

May 2023

  • 1 participants
  • 2583 discussions
[XL] Change in osmo-pcu[master]: tbf: Improve TBF name description in logs
by pespin 31 May '23

31 May '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33105 ) Change subject: tbf: Improve TBF name description in logs ...................................................................... tbf: Improve TBF name description in logs Change format to print the state at the end, to resemble more the same format used by FSMs. Furthermore, by moving it at the end, print it only when "enclousure" is requested, aka when not requested by FSM to update its internal name. The consequence of this logc is that log lines printed from FSM don't end up with the same state string printed twice in different places. While at it, shorten the EGPRS/GPRS indicator to one character, which should be understandable enough since it matches what's usually seen in mobile phones to signal one or another. Change-Id: I86b5f042fae77721b22fc026228677bd56768ba9 --- M src/tbf.cpp M tests/alloc/AllocTest.err M tests/app_info/AppInfoTest.err M tests/ms/MsTest.err M tests/tbf/TbfTest.err M tests/types/TypesTest.err M tests/ulc/PdchUlcTest.err 7 files changed, 446,018 insertions(+), 445,999 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33105 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I86b5f042fae77721b22fc026228677bd56768ba9 Gerrit-Change-Number: 33105 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-bts[master]: osmo-bts-trx: remove redundant memset() on receipt of NOPE.ind
by fixeria 31 May '23

31 May '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/33126 ) Change subject: osmo-bts-trx: remove redundant memset() on receipt of NOPE.ind ...................................................................... osmo-bts-trx: remove redundant memset() on receipt of NOPE.ind In all Uplink lchan handlers we do memset() the Rx burst buffer on bid=0 and there is no need to do that again for NOPE.ind. Change-Id: Ia6803b8606d86bd2d011fe21f7a540d2115aa654 --- M src/osmo-bts-trx/sched_lchan_pdtch.c M src/osmo-bts-trx/sched_lchan_tchf.c M src/osmo-bts-trx/sched_lchan_tchh.c M src/osmo-bts-trx/sched_lchan_xcch.c 4 files changed, 15 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/26/33126/1 diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c index 5ff7229..356ce98 100644 --- a/src/osmo-bts-trx/sched_lchan_pdtch.c +++ b/src/osmo-bts-trx/sched_lchan_pdtch.c @@ -88,8 +88,6 @@ break; case 0: /* NOPE.ind, assume GPRS? */ - burst = bursts_p + bi->bid * 116; - memset(burst, 0, 116); n_bursts_bits = GSM0503_GPRS_BURSTS_NBITS; } diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c index f065803..0d3cdd9 100644 --- a/src/osmo-bts-trx/sched_lchan_tchf.c +++ b/src/osmo-bts-trx/sched_lchan_tchf.c @@ -117,8 +117,7 @@ if (bi->burst_len > 0) { memcpy(burst, bi->burst + 3, 58); memcpy(burst + 58, bi->burst + 87, 58); - } else - memset(burst, 0, 116); + } /* wait until complete set of bursts */ if (bi->bid != 3) diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c index 5772e9f..a036b41 100644 --- a/src/osmo-bts-trx/sched_lchan_tchh.c +++ b/src/osmo-bts-trx/sched_lchan_tchh.c @@ -141,8 +141,7 @@ if (bi->burst_len > 0) { memcpy(burst, bi->burst + 3, 58); memcpy(burst + 58, bi->burst + 87, 58); - } else - memset(burst, 0, 116); + } /* wait until complete set of bursts */ if (bi->bid != 1) diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c index 1945d32..41f63ce 100644 --- a/src/osmo-bts-trx/sched_lchan_xcch.c +++ b/src/osmo-bts-trx/sched_lchan_xcch.c @@ -88,8 +88,7 @@ if (bi->burst_len > 0) { memcpy(burst, bi->burst + 3, 58); memcpy(burst + 58, bi->burst + 87, 58); - } else - memset(burst, 0, 58 * 2); + } /* wait until complete set of bursts */ if (bi->bid != 3) -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ia6803b8606d86bd2d011fe21f7a540d2115aa654 Gerrit-Change-Number: 33126 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bts[master]: trx TCH DL: transmit invalid speech blocks instead of dummy FACCH
by fixeria 31 May '23

31 May '23
Attention is currently required from: falconia, pespin, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33069 ) Change subject: trx TCH DL: transmit invalid speech blocks instead of dummy FACCH ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33069 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I78106802a0aa4af39859c75d29fe0e77037899fe Gerrit-Change-Number: 33069 Gerrit-PatchSet: 3 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: falconia <falcon(a)freecalypso.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Wed, 31 May 2023 19:47:20 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-pcu[master]: Document pcu_lsb() function
by pespin 31 May '23

31 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33125 ) Change subject: Document pcu_lsb() function ...................................................................... Document pcu_lsb() function While at it, fix a typo in the test output. This function is nowadays only used in ms_current_pacch_slots(), which is used only to print the PACCH TS (the first common UL & DL TS). Change-Id: Id1d0b681f6866618f9f3a8c64d6a6c809ca50ea7 --- M src/pcu_utils.h M tests/types/TypesTest.cpp M tests/types/TypesTest.ok 3 files changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/25/33125/1 diff --git a/src/pcu_utils.h b/src/pcu_utils.h index 2dd86ac..1b1bf06 100644 --- a/src/pcu_utils.h +++ b/src/pcu_utils.h @@ -72,6 +72,9 @@ return __builtin_popcountll(x); } +/* Trim all 1 bits except the Least Significat Bit, which is kept. + * equivalent of (1 << ffs(u)) / 2 + */ static inline uint8_t pcu_lsb(uint8_t x) { return x & -x; diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 871e0d1..0d936de 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -937,10 +937,10 @@ { uint8_t u = 0; - printf("Testing LBS utility...\n"); + printf("Testing LSB utility...\n"); do { - uint8_t x = pcu_lsb(u); /* equivalent of (1 << ffs(u)) / 2 */ + uint8_t x = pcu_lsb(u); printf("%2X " OSMO_BIT_SPEC ": {%d} %3d\n", u, OSMO_BIT_PRINT(u), pcu_bitcount(u), x); u++; diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok index 27afc71..b99e17e 100644 --- a/tests/types/TypesTest.ok +++ b/tests/types/TypesTest.ok @@ -18,7 +18,7 @@ 06 3f 10 0d 23 6d 7f 03 18 23 00 46 a0 08 00 17 44 0b 2b 2b 2b 2b 2b assignment reject: 06 3a 10 7f 06 36 14 7f 06 36 14 7f 06 36 14 7f 06 36 14 c0 2b 2b assignment reject: 06 3a 10 70 06 36 14 70 06 36 14 70 06 36 14 70 06 36 14 0b 2b 2b -Testing LBS utility... +Testing LSB utility... 0 ........: {0} 0 1 .......1: {1} 1 2 ......1.: {1} 2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33125 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Id1d0b681f6866618f9f3a8c64d6a6c809ca50ea7 Gerrit-Change-Number: 33125 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-pcu[master]: bts: use RFN directly to calculate fn416
by pespin 31 May '23

31 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33122 ) Change subject: bts: use RFN directly to calculate fn416 ...................................................................... bts: use RFN directly to calculate fn416 RFN_MODULUS (42432) used to calculate is a multiple of 416: 416 * 102 = 42432 Hence, (X % 42432) % 416 == X % 416. So, there's no need to derive the full FN. Change-Id: If7a6a15c373a068bcc757d27937dd6eeac2e0bae --- M src/bts.cpp 1 file changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/22/33122/1 diff --git a/src/bts.cpp b/src/bts.cpp index 6cac93f..640405f 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1058,7 +1058,7 @@ int bts_rcv_ptcch_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip) { - uint32_t fn416 = bts_rfn_to_fn(bts, rip->rfn) % 416; + uint16_t fn416 = rip->rfn % 416; struct gprs_rlcmac_pdch *pdch; uint8_t ss; -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: If7a6a15c373a068bcc757d27937dd6eeac2e0bae Gerrit-Change-Number: 33122 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-pcu[master]: encoding: only RFN needed in write_immediate_assignment(_reject)()
by pespin 31 May '23

31 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33123 ) Change subject: encoding: only RFN needed in write_immediate_assignment(_reject)() ...................................................................... encoding: only RFN needed in write_immediate_assignment(_reject)() Those function don't really require the full FN, hence let's pass only the required information. 10.5.2.30 Request Reference: "The purpose of the Request Reference information element is to provide the random access information used in the channel request and the frame number, FN modulo 42432" 10.5.2.38 Starting Time: "The purpose of the Starting Time information element is to provide the start TDMA frame number, FN modulo 42432." Change-Id: If9b758434c00f2a3868534d5be84946809c989a9 --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M tests/types/TypesTest.cpp 4 files changed, 50 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/23/33123/1 diff --git a/src/bts.cpp b/src/bts.cpp index 640405f..8be87be 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1022,7 +1022,7 @@ trx->trx_no, trx->arfcn & ~ARFCN_FLAG_MASK, pdch->ts_no, ta, pdch->tsc, tbf ? tbf->tfi() : -1, usf); plen = Encoding::write_immediate_assignment(pdch, tbf, bv, - false, rip->ra, Fn, ta, usf, false, sb_fn, + false, rip->ra, rip->rfn, ta, usf, false, fn2rfn(sb_fn), bts_get_ms_pwr_alpha(bts), bts->pcu->vty.gamma, -1, rip->burst_type); bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_UL_TBF); @@ -1038,7 +1038,7 @@ send_imm_ass_rej: LOGP(DRLCMAC, LOGL_DEBUG, "Tx Immediate Assignment Reject on AGCH\n"); plen = Encoding::write_immediate_assignment_reject( - bv, rip->ra, Fn, rip->burst_type, + bv, rip->ra, rip->rfn, rip->burst_type, (uint8_t)osmo_tdef_get(bts->T_defs_bts, 3142, OSMO_TDEF_S, -1)); bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_REJ); if (plen >= 0) @@ -1118,7 +1118,7 @@ tbf->trx->trx_no, tbf->trx->arfcn, pdch->ts_no, tbf->ta()); plen = Encoding::write_immediate_assignment(pdch, tbf, immediate_assignment, true, 125, - GSM_TDMA_FN_SUM(pdch->last_rts_fn, 21216), + fn2rfn(GSM_TDMA_FN_SUM(pdch->last_rts_fn, 21216)), tbf->ta(), 7, false, 0, bts_get_ms_pwr_alpha(bts), bts->pcu->vty.gamma, -1, GSM_L1_BURST_TYPE_ACCESS_0); diff --git a/src/encoding.cpp b/src/encoding.cpp index 6b626cc..5695666 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -63,22 +63,22 @@ } /* TBF_STARTING_TIME -- same as 3GPP TS 44.018 ยง10.5.2.38 Starting Time without tag: */ -static int write_tbf_start_time(bitvec *dest, uint32_t fn) +static int write_tbf_start_time(bitvec *dest, uint16_t rfn) { int rc; /* Set values according to 3GPP TS 44.018 Table 10.5.2.38.1 */ /* T1' */ - rc = bitvec_set_u64(dest, (fn / (26 * 51)) % 32, 5, false); + rc = bitvec_set_u64(dest, (rfn / (26 * 51)) % 32, 5, false); CHECK(rc); /* T3 */ - rc = bitvec_set_u64(dest, fn % 51, 6, false); + rc = bitvec_set_u64(dest, rfn % 51, 6, false); CHECK(rc); /* T2 */ - rc = bitvec_set_u64(dest, fn % 26, 5, false); + rc = bitvec_set_u64(dest, rfn % 26, 5, false); CHECK(rc); return rc; @@ -180,7 +180,7 @@ } static int write_ia_rest_downlink(const gprs_rlcmac_dl_tbf *tbf, bitvec * dest, bool polling, bool ta_valid, - uint32_t fn, uint8_t alpha, uint8_t gamma, int8_t ta_idx) + uint16_t rfn, uint8_t alpha, uint8_t gamma, int8_t ta_idx) { int rc = 0; @@ -213,7 +213,7 @@ if (polling) { SET_1(dest); - rc = write_tbf_start_time(dest, fn); + rc = write_tbf_start_time(dest, rfn); CHECK(rc); } else SET_0(dest); @@ -235,7 +235,7 @@ } /* 3GPP TS 44.018 Table 10.5.2.16.1 < Packet Uplink Assignment > -- Single Block Allocation */ -static int write_ia_rest_uplink_sba(bitvec *dest, uint32_t fn, uint8_t alpha, uint8_t gamma) +static int write_ia_rest_uplink_sba(bitvec *dest, uint32_t rfn, uint8_t alpha, uint8_t gamma) { int rc = 0; @@ -248,7 +248,7 @@ SET_0(dest); SET_1(dest); - rc = write_tbf_start_time(dest, fn); + rc = write_tbf_start_time(dest, rfn); CHECK(rc); /* No P0 nor PR_MODE */ @@ -292,7 +292,7 @@ return rc; } -static int write_ia_rest_egprs_uplink_mba(bitvec * dest, uint32_t fn, uint8_t alpha, uint8_t gamma) +static int write_ia_rest_egprs_uplink_mba(bitvec * dest, uint32_t rfn, uint8_t alpha, uint8_t gamma) { int rc = 0; @@ -301,7 +301,7 @@ rc = write_alpha_gamma(dest, alpha, gamma); CHECK(rc); - rc = write_tbf_start_time(dest, fn); + rc = write_tbf_start_time(dest, rfn); CHECK(rc); SET_0(dest); /* NUMBER OF RADIO BLOCKS ALLOCATED: */ @@ -358,7 +358,7 @@ * see GSM 44.018, 9.1.20 + 10.5.2.30 */ int Encoding::write_immediate_assignment_reject(bitvec *dest, uint16_t ra, - uint32_t ref_fn, enum ph_burst_type burst_type, uint8_t t3142) + uint16_t ref_rfn, enum ph_burst_type burst_type, uint8_t t3142) { unsigned wp = 0; int plen; @@ -394,9 +394,9 @@ } bitvec_write_field(dest, &wp, - (ref_fn / (26 * 51)) % 32, 5); // T1' - bitvec_write_field(dest, &wp, ref_fn % 51, 6); // T3 - bitvec_write_field(dest, &wp, ref_fn % 26, 5); // T2 + (ref_rfn / (26 * 51)) % 32, 5); // T1' + bitvec_write_field(dest, &wp, ref_rfn % 51, 6); // T3 + bitvec_write_field(dest, &wp, ref_rfn % 26, 5); // T2 /* 10.5.2.43 Wait Indication */ bitvec_write_field(dest, &wp, t3142, 8); @@ -437,8 +437,8 @@ const struct gprs_rlcmac_pdch *pdch, const struct gprs_rlcmac_tbf *tbf, bitvec * dest, bool downlink, uint16_t ra, - uint32_t ref_fn, uint8_t ta, - uint8_t usf, bool polling, uint32_t fn, uint8_t alpha, + uint16_t ref_rfn, uint8_t ta, + uint8_t usf, bool polling, uint16_t rfn, uint8_t alpha, uint8_t gamma, int8_t ta_idx, enum ph_burst_type burst_type) { unsigned wp = 0; @@ -480,9 +480,9 @@ bitvec_write_field(dest, &wp, ra, 8); /* RACH value */ } - bitvec_write_field(dest, &wp, (ref_fn / (26 * 51)) % 32, 5); // T1' - bitvec_write_field(dest, &wp, ref_fn % 51, 6); // T3 - bitvec_write_field(dest, &wp, ref_fn % 26, 5); // T2 + bitvec_write_field(dest, &wp, (ref_rfn / (26 * 51)) % 32, 5); // T1' + bitvec_write_field(dest, &wp, ref_rfn % 51, 6); // T3 + bitvec_write_field(dest, &wp, ref_rfn % 26, 5); // T2 // 10.5.2.40 Timing Advance bitvec_write_field(dest, &wp, 0x0, 2); // spare @@ -508,7 +508,7 @@ if (downlink) { OSMO_ASSERT(tbf_as_dl_tbf_const(tbf) != NULL); - rc = write_ia_rest_downlink(tbf_as_dl_tbf_const(tbf), dest, polling, gsm48_ta_is_valid(ta), fn, alpha, gamma, + rc = write_ia_rest_downlink(tbf_as_dl_tbf_const(tbf), dest, polling, gsm48_ta_is_valid(ta), rfn, alpha, gamma, ta_idx); } else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { SET_L(dest); SET_H(dest); // "LH" @@ -521,7 +521,7 @@ if (tbf_as_ul_tbf_const(tbf) != NULL) rc = write_ia_rest_egprs_uplink_sba(tbf_as_ul_tbf_const(tbf), dest, usf, alpha, gamma, ta_idx); else - rc = write_ia_rest_egprs_uplink_mba(dest, fn, alpha, gamma); + rc = write_ia_rest_egprs_uplink_mba(dest, rfn, alpha, gamma); } else { OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled()); @@ -531,7 +531,7 @@ if (tbf_as_ul_tbf_const(tbf) != NULL) rc = write_ia_rest_uplink_mba(tbf_as_ul_tbf_const(tbf), dest, usf, alpha, gamma, ta_idx); else - rc = write_ia_rest_uplink_sba(dest, fn, alpha, gamma); + rc = write_ia_rest_uplink_sba(dest, rfn, alpha, gamma); } if (rc < 0) { diff --git a/src/encoding.h b/src/encoding.h index ae4d57f..89f6964 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -46,15 +46,15 @@ const struct gprs_rlcmac_pdch *pdch, const struct gprs_rlcmac_tbf *tbf, bitvec * dest, bool downlink, uint16_t ra, - uint32_t ref_fn, uint8_t ta, + uint16_t ref_rfn, uint8_t ta, uint8_t usf, bool polling, - uint32_t fn, uint8_t alpha, uint8_t gamma, + uint16_t rfn, uint8_t alpha, uint8_t gamma, int8_t ta_idx, enum ph_burst_type burst_type); static int write_immediate_assignment_reject( bitvec *dest, uint16_t ra, - uint32_t ref_fn, + uint16_t ref_rfn, enum ph_burst_type burst_type, uint8_t t3142 ); diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 871e0d1..c6a2fbf 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -753,7 +753,7 @@ struct msgb *m = msgb_alloc(80, "test"); bool poll = true; uint16_t ra = 13; - uint32_t ref_fn = 24, fn = 11; + uint32_t ref_rfn = 24, rfn = 11; int8_t ta_idx = 0; /* HACK: tbf can be NULL, so we cannot use tbf->trx here */ @@ -766,8 +766,8 @@ bitvec_unhex(immediate_assignment, DUMMY_VEC); plen = Encoding::write_immediate_assignment(&trx.pdch[5], tbf, immediate_assignment, - dl, ra, ref_fn, ta, usf, - poll, fn, alpha, gamma, ta_idx, bt); + dl, ra, ref_rfn, ta, usf, + poll, rfn, alpha, gamma, ta_idx, bt); printf("[%u] %s Immediate Assignment <%s>:\n\t%s\n", plen, dl ? "DL" : "UL", kind, osmo_hexdump(immediate_assignment->data, sz)); -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33123 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: If9b758434c00f2a3868534d5be84946809c989a9 Gerrit-Change-Number: 33123 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: Switch from pycryptodome to pycryptodomex
by laforge 31 May '23

31 May '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/33124 ) Change subject: Switch from pycryptodome to pycryptodomex ...................................................................... Switch from pycryptodome to pycryptodomex So for some weird historical reasons, the same python module is available as pycryptodome (Crypto.* namespace) and pycryptodomex (Cryptodome.* namespace). See the following information on the project homepage: https://www.pycryptodome.org/src/installation To make things extra-weird, Debian choose to package pycryptodomex as python3-pycryptodome (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886291) So in order to support both Debian-packaged and differently-installed packages, let's switch to pycryotodomex on all platforms/installers. Change-Id: I04daed01f51f9702595ef9f9e0d7fcdf1e4adb62 --- M README.md M pySim/ota.py M pySim/utils.py M requirements.txt M setup.py 5 files changed, 29 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/24/33124/1 diff --git a/README.md b/README.md index 025b518..db13a52 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ - termcolor - colorlog - packaging - - pycryptodome + - pycryptodomex Example for Debian: ```sh @@ -54,6 +54,7 @@ pcscd libpcsclite-dev \ python3 \ python3-setuptools \ + python3-pycryptodome \ python3-pyscard \ python3-pip pip3 install --user -r requirements.txt diff --git a/pySim/ota.py b/pySim/ota.py index 83303a6..5955a08 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -150,8 +150,8 @@ pass -from Crypto.Cipher import DES, DES3, AES -from Crypto.Hash import CMAC +from Cryptodome.Cipher import DES, DES3, AES +from Cryptodome.Hash import CMAC class OtaAlgo(abc.ABC): iv = property(lambda self: bytes([0] * self.blocksize)) diff --git a/pySim/utils.py b/pySim/utils.py index 6b8ee37..537014f 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -616,9 +616,9 @@ """ Run the milenage algorithm to calculate OPC from Ki and OP """ - from Crypto.Cipher import AES + from Cryptodome.Cipher import AES # pylint: disable=no-name-in-module - from Crypto.Util.strxor import strxor + from Cryptodome.Util.strxor import strxor from pySim.utils import b2h # We pass in hex string and now need to work on bytes diff --git a/requirements.txt b/requirements.txt index fb94472..b12cb4d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ pyyaml>=5.1 termcolor colorlog -pycryptodome +pycryptodomex packaging diff --git a/setup.py b/setup.py index d14ebc6..d4fb15f 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ "pyyaml >= 5.1", "termcolor", "colorlog", - "pycryptodome", + "pycryptodomex", "packaging", ], scripts=[ -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33124 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I04daed01f51f9702595ef9f9e0d7fcdf1e4adb62 Gerrit-Change-Number: 33124 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-pcu[master]: Derive FN from RFN once and cache it in struct rach_ind_params
by pespin 31 May '23

31 May '23
Attention is currently required from: pespin. pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33121 ) Change subject: Derive FN from RFN once and cache it in struct rach_ind_params ...................................................................... Derive FN from RFN once and cache it in struct rach_ind_params Change-Id: Iaefb9650dfc5083360a4a24b9c17fdbf3115e51f --- M src/bts.cpp M src/bts.h M src/pcu_l1_if.cpp M tests/tbf/TbfTest.cpp 4 files changed, 19 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/21/33121/1 diff --git a/src/bts.cpp b/src/bts.cpp index 6cac93f..28c8934 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -531,7 +531,7 @@ } bts_send_gsmtap_meas(bts, categ, true, rip->trx_nr, rip->ts_nr, channel, - bts_rfn_to_fn(bts, rip->rfn), ra_buf, + rip->fn, ra_buf, rip->is_11bit ? 2 : 1, &meas); } @@ -943,15 +943,13 @@ if (rip->is_11bit) bts_do_rate_ctr_inc(bts, CTR_RACH_REQUESTS_11BIT); - /* Determine full frame number */ - uint32_t Fn = bts_rfn_to_fn(bts, rip->rfn); uint8_t ta = qta2ta(rip->qta); bts_send_gsmtap_rach(bts, PCU_GSMTAP_C_UL_RACH, GSMTAP_CHANNEL_RACH, rip); LOGP(DRLCMAC, LOGL_DEBUG, "MS requests Uplink resource on CCCH/RACH: " "ra=0x%02x (%d bit) Fn=%u qta=%d\n", rip->ra, - rip->is_11bit ? 11 : 8, Fn, rip->qta); + rip->is_11bit ? 11 : 8, rip->fn, rip->qta); /* Parse [EGPRS Packet] Channel Request from RACH.ind */ rc = parse_rach_ind(rip, &chan_req); @@ -1022,7 +1020,7 @@ trx->trx_no, trx->arfcn & ~ARFCN_FLAG_MASK, pdch->ts_no, ta, pdch->tsc, tbf ? tbf->tfi() : -1, usf); plen = Encoding::write_immediate_assignment(pdch, tbf, bv, - false, rip->ra, Fn, ta, usf, false, sb_fn, + false, rip->ra, rip->fn, ta, usf, false, sb_fn, bts_get_ms_pwr_alpha(bts), bts->pcu->vty.gamma, -1, rip->burst_type); bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_UL_TBF); @@ -1038,7 +1036,7 @@ send_imm_ass_rej: LOGP(DRLCMAC, LOGL_DEBUG, "Tx Immediate Assignment Reject on AGCH\n"); plen = Encoding::write_immediate_assignment_reject( - bv, rip->ra, Fn, rip->burst_type, + bv, rip->ra, rip->fn, rip->burst_type, (uint8_t)osmo_tdef_get(bts->T_defs_bts, 3142, OSMO_TDEF_S, -1)); bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_REJ); if (plen >= 0) @@ -1058,7 +1056,7 @@ int bts_rcv_ptcch_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip) { - uint32_t fn416 = bts_rfn_to_fn(bts, rip->rfn) % 416; + uint32_t fn416 = rip->fn % 416; struct gprs_rlcmac_pdch *pdch; uint8_t ss; diff --git a/src/bts.h b/src/bts.h index 7dd8547..9a18cf3 100644 --- a/src/bts.h +++ b/src/bts.h @@ -196,7 +196,8 @@ uint16_t ra; uint8_t trx_nr; uint8_t ts_nr; - uint32_t rfn; + uint16_t rfn; + uint32_t fn; int16_t qta; }; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index cda7af7..e675d86 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -631,6 +631,7 @@ .trx_nr = trx_nr, .ts_nr = ts_nr, .rfn = fn2rfn(fn), + .fn = fn, .qta = qta, }; @@ -670,6 +671,7 @@ .trx_nr = rach_ind->trx_nr, .ts_nr = rach_ind->ts_nr, .rfn = rfn, + .fn = bts_rfn_to_fn(bts, rfn), .qta = rach_ind->qta, }; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index ae8b56f..bb36f9e 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -81,6 +81,7 @@ .trx_nr = 0, .ts_nr = 0, .rfn = fn2rfn(Fn), + .fn = Fn, .qta = qta, }; -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33121 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Iaefb9650dfc5083360a4a24b9c17fdbf3115e51f Gerrit-Change-Number: 33121 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-pcu[master]: Error trying to obtain FN from RFN if curr_fn not known
by pespin 31 May '23

31 May '23
Attention is currently required from: pespin. pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33120 ) Change subject: Error trying to obtain FN from RFN if curr_fn not known ...................................................................... Error trying to obtain FN from RFN if curr_fn not known This may happen if a RACH.ind is received before any DATA.ind has been received. With usual osmo-bts-trx or osmo-bts-sysmo, this shouldn't happen nowadays, but it is still a problem with osmo-bts-virtual, where lower layers don't submit NOPE.ind in the absence of data, and hence it won't sent DATA.ind to osmo-pcu all the time. This change helps in showcasing confusing scenarios where the RFN generated in the Imm Ass was wrong. Change-Id: I29b7ba828fe890f90e35686bbb04d4abfe56b955 --- M src/bts.cpp 1 file changed, 30 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/33120/1 diff --git a/src/bts.cpp b/src/bts.cpp index 8d6f156..6cac93f 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -740,20 +740,27 @@ /* Determine the full frame number from a relative frame number */ uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, uint32_t rfn) { - uint32_t m_cur_rfn; + uint32_t m_cur_fn, m_cur_rfn; uint32_t fn_rounded; /* Ensure that all following calculations are performed with the * relative frame number */ OSMO_ASSERT(rfn < RFN_MODULUS); + m_cur_fn = bts_current_frame_number(bts); + if (m_cur_fn == FN_UNSET) { + LOGP(DRLCMAC, LOGL_ERROR, "Unable to calculate full FN from RFN %u: Current FN not known!\n", + rfn); + return rfn; + } + /* Compute an internal relative frame number from the full internal frame number */ - m_cur_rfn = fn2rfn(bts->cur_fn); + m_cur_rfn = fn2rfn(m_cur_fn); /* Compute a "rounded" version of the internal frame number, which * exactly fits in the RFN_MODULUS raster */ - fn_rounded = GSM_TDMA_FN_SUB(bts->cur_fn, m_cur_rfn); + fn_rounded = GSM_TDMA_FN_SUB(m_cur_fn, m_cur_rfn); /* If the delta between the internal and the external relative frame * number exceeds a certain limit, we need to assume that the incoming @@ -762,7 +769,7 @@ if (GSM_TDMA_FN_DIFF(rfn, m_cur_rfn) > RFN_THRESHOLD) { LOGP(DRLCMAC, LOGL_DEBUG, "Race condition between rfn (%u) and m_cur_fn (%u) detected: rfn belongs to the previous modulus %u cycle, wrapping...\n", - rfn, bts->cur_fn, RFN_MODULUS); + rfn, m_cur_fn, RFN_MODULUS); if (fn_rounded < RFN_MODULUS) { LOGP(DRLCMAC, LOGL_DEBUG, "Cornercase detected: wrapping crosses %u border\n", -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I29b7ba828fe890f90e35686bbb04d4abfe56b955 Gerrit-Change-Number: 33120 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-pcu[master]: Use always RFN when handling RACH indications
by pespin 31 May '23

31 May '23
Attention is currently required from: laforge, pespin, dexter. pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33119 ) Change subject: Use always RFN when handling RACH indications ...................................................................... Use always RFN when handling RACH indications The previous code was really confusing, passing full FNs as RFNs under certain external conditions, and then assuming the RFN input of rfn_to_fn() function could actually be a FN. As a result, we had a lot of code behaving slightly different depending on whether the incomding FN from pcuif was filled in by a BSC or a BTS. Avoid this b ehavior differentiation and always assume the most restricted one, aka RFN. Change-Id: Ib3b5702168195b595711cd0ff32c211b9aba429d --- M src/bts.cpp M src/pcu_l1_if.cpp M src/pcu_utils.h M tests/tbf/TbfTest.cpp 4 files changed, 44 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/19/33119/1 diff --git a/src/bts.cpp b/src/bts.cpp index d4bb35f..8d6f156 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -52,7 +52,6 @@ #include <errno.h> #include <string.h> -#define RFN_MODULUS 42432 #define RFN_THRESHOLD RFN_MODULUS / 2 extern void *tall_pcu_ctx; @@ -744,25 +743,13 @@ uint32_t m_cur_rfn; uint32_t fn_rounded; - /* make sure RFN does not exceed the maximum possible value of a valid - * GSM frame number. */ - OSMO_ASSERT(rfn < GSM_MAX_FN); - - /* Note: If a BTS is sending in a rach request it will be fully aware - * of the frame number. If the PCU is used in a BSC-co-located setup. - * The BSC will forward the incoming RACH request. The RACH request - * only contains the relative frame number (Fn % 42432) in its request - * reference. This PCU implementation has to fit both scenarios, so - * we need to assume that Fn is a relative frame number. */ - /* Ensure that all following calculations are performed with the * relative frame number */ - if (rfn >= RFN_MODULUS) - return rfn; + OSMO_ASSERT(rfn < RFN_MODULUS); /* Compute an internal relative frame number from the full internal frame number */ - m_cur_rfn = bts->cur_fn % RFN_MODULUS; + m_cur_rfn = fn2rfn(bts->cur_fn); /* Compute a "rounded" version of the internal frame number, which * exactly fits in the RFN_MODULUS raster */ diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index aadc640..cda7af7 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -630,7 +630,7 @@ .ra = 0x00, .trx_nr = trx_nr, .ts_nr = ts_nr, - .rfn = fn, + .rfn = fn2rfn(fn), .qta = qta, }; @@ -640,11 +640,22 @@ static int pcu_rx_rach_ind(struct gprs_rlcmac_bts *bts, const struct gsm_pcu_if_rach_ind *rach_ind) { int rc = 0; - int current_fn = bts_current_frame_number(bts); + uint32_t current_fn = bts_current_frame_number(bts); + uint16_t rfn; - LOGP(DL1IF, LOGL_INFO, "RACH request received: sapi=%d " - "qta=%d, ra=0x%02x, fn=%u, cur_fn=%d, is_11bit=%d\n", rach_ind->sapi, rach_ind->qta, - rach_ind->ra, rach_ind->fn, current_fn, rach_ind->is_11bit); + /* Note: If a BSC is sending a RACH req to us, it is actually forwarding it to + * us from BTS as a result of receiving an RFN (Fn % 42432) over RSL + * (see 3GPP TS 48.058, section 9.3.19). + * If a BTS is sending a RACH req to us, it may contain a full FN + * (current osmo-bts does that) instead of an RFN. + * For consistency, and taking into account the BSC case limitations, + * work always with RFNs here: + */ + rfn = fn2rfn(rach_ind->fn); + + LOGP(DL1IF, LOGL_INFO, + "RACH request received: sapi=%d qta=%d, ra=0x%02x, fn=%u (rfn=%u), cur_fn=%d, is_11bit=%d\n", + rach_ind->sapi, rach_ind->qta, rach_ind->ra, rach_ind->fn, rfn, current_fn, rach_ind->is_11bit); if (OSMO_UNLIKELY(rach_ind->fn > GSM_TDMA_HYPERFRAME - 1)) { LOGP(DL1IF, LOGL_ERROR, "RACH request contains fn=%u that exceeds valid limits (0-%u) -- ignored!\n", @@ -658,7 +669,7 @@ .ra = rach_ind->ra, .trx_nr = rach_ind->trx_nr, .ts_nr = rach_ind->ts_nr, - .rfn = rach_ind->fn, + .rfn = rfn, .qta = rach_ind->qta, }; diff --git a/src/pcu_utils.h b/src/pcu_utils.h index 2dd86ac..0be37e9 100644 --- a/src/pcu_utils.h +++ b/src/pcu_utils.h @@ -77,6 +77,12 @@ return x & -x; } +#define RFN_MODULUS 42432 +static inline uint16_t fn2rfn(uint32_t fn) +{ + return fn % RFN_MODULUS; +} + /* Used to store a C++ class in a llist used by C code */ struct llist_item { struct llist_head list; /* item used by llist */ diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index bbd6821..ae8b56f 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -80,7 +80,7 @@ .ra = ra, .trx_nr = 0, .ts_nr = 0, - .rfn = Fn, + .rfn = fn2rfn(Fn), .qta = qta, }; -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33119 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Ib3b5702168195b595711cd0ff32c211b9aba429d Gerrit-Change-Number: 33119 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • ...
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.