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

December 2022

  • 1 participants
  • 1979 discussions
Change in osmo-pcu[master]: Move control_ts explicit checks out of the scheduler implementation
by laforge 13 Dec '22

13 Dec '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30564 ) Change subject: Move control_ts explicit checks out of the scheduler implementation ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30564 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Ifaf7dde651d56942779d84aa9135fc8c974b6f26 Gerrit-Change-Number: 30564 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 13 Dec 2022 18:11:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-pcu[master]: tbf_dl_fsm_ctx: Properly define tbf backptr as dl_tbf
by laforge 13 Dec '22

13 Dec '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30562 ) Change subject: tbf_dl_fsm_ctx: Properly define tbf backptr as dl_tbf ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30562 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Id2571e55e1fea2918207175f2030ec026e880bc1 Gerrit-Change-Number: 30562 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 13 Dec 2022 18:11:15 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-pcu[master]: tbf_ul_fsm_ctx: Properly define tbf backptr as ul_tbf
by laforge 13 Dec '22

13 Dec '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30541 ) Change subject: tbf_ul_fsm_ctx: Properly define tbf backptr as ul_tbf ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30541 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I7741d524a14437caf4c92b9c09e19762eb272e30 Gerrit-Change-Number: 30541 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 13 Dec 2022 18:10:54 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-trx[master]: vita demod by piotr krysik, modified
by laforge 13 Dec '22

13 Dec '22
Attention is currently required from: Hoernchen, pespin, fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/30415 ) Change subject: vita demod by piotr krysik, modified ...................................................................... Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/30415 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I5466c522cf4de984a4810ec46df43a10b52ed78f Gerrit-Change-Number: 30415 Gerrit-PatchSet: 10 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 13 Dec 2022 18:09:51 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-pcu[master]: Convert ms_first_common_ts to struct gprs_rlcmac_pdch
by pespin 13 Dec '22

13 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30575 ) Change subject: Convert ms_first_common_ts to struct gprs_rlcmac_pdch ...................................................................... Convert ms_first_common_ts to struct gprs_rlcmac_pdch This way it contains full information about the TS, not only the TN. Change-Id: I19373939ec104d371e3e91422f018a8175cb0f89 --- M src/gprs_ms.c M src/gprs_ms.h M src/gprs_rlcmac_ts_alloc.cpp M src/pcu_vty_functions.cpp M src/tbf.cpp M src/tbf_ul.cpp M tests/alloc/AllocTest.cpp M tests/ulc/PdchUlcTest.cpp 8 files changed, 39 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/75/30575/1 diff --git a/src/gprs_ms.c b/src/gprs_ms.c index 073dd4a..29d226f 100644 --- a/src/gprs_ms.c +++ b/src/gprs_ms.c @@ -120,7 +120,6 @@ ms->current_cs_ul = UNKNOWN; ms->current_cs_dl = UNKNOWN; ms->is_idle = true; - ms->first_common_ts = TBF_TS_UNSET; INIT_LLIST_HEAD(&ms->list); INIT_LLIST_HEAD(&ms->old_tbfs); @@ -384,7 +383,7 @@ if (!ms->dl_tbf && !ms->ul_tbf) { ms_set_reserved_slots(ms, NULL, 0, 0); - ms->first_common_ts = TBF_TS_UNSET; + ms->first_common_ts = NULL; if (ms_tlli(ms) != 0) ms_release_timer_start(ms); @@ -920,15 +919,15 @@ return cs; } -int8_t ms_first_common_ts(const struct GprsMs *ms) +struct gprs_rlcmac_pdch *ms_first_common_ts(const struct GprsMs *ms) { return ms->first_common_ts; } -void ms_set_first_common_ts(struct GprsMs *ms, uint8_t first_common_ts) +void ms_set_first_common_ts(struct GprsMs *ms, struct gprs_rlcmac_pdch *pdch) { - OSMO_ASSERT(first_common_ts < 8); - ms->first_common_ts = first_common_ts; + OSMO_ASSERT(pdch); + ms->first_common_ts = pdch; } uint8_t ms_dl_slots(const struct GprsMs *ms) diff --git a/src/gprs_ms.h b/src/gprs_ms.h index 8a324fb..9298804 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -65,7 +65,7 @@ struct gprs_rlcmac_dl_tbf *dl_tbf; struct llist_head old_tbfs; /* list of gprs_rlcmac_tbf */ /* first TS where the phone can send and receive simultaniously, 0..7 or TBF_TS_UNSET (-1): */ - int8_t first_common_ts; + struct gprs_rlcmac_pdch *first_common_ts; uint32_t tlli; uint32_t new_ul_tlli; @@ -103,8 +103,8 @@ struct GprsMs *ms_alloc(struct gprs_rlcmac_bts *bts, uint32_t tlli); -int8_t ms_first_common_ts(const struct GprsMs *ms); -void ms_set_first_common_ts(struct GprsMs *ms, uint8_t first_common_ts); +struct gprs_rlcmac_pdch *ms_first_common_ts(const struct GprsMs *ms); +void ms_set_first_common_ts(struct GprsMs *ms, struct gprs_rlcmac_pdch *pdch); void ms_set_reserved_slots(struct GprsMs *ms, struct gprs_rlcmac_trx *trx, uint8_t ul_slots, uint8_t dl_slots); struct GprsMs *ms_ref(struct GprsMs *ms); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 96098a9..704b696 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -350,6 +350,7 @@ const char *mask_reason = NULL; struct GprsMs *ms = tbf->ms(); gprs_rlcmac_trx *trx = ms_current_trx(ms); + struct gprs_rlcmac_pdch *first_common_ts = ms_first_common_ts(ms); LOGPAL(tbf, "A", single, use_trx, LOGL_DEBUG, "Alloc start\n"); @@ -365,11 +366,9 @@ dl_slots = ms_reserved_dl_slots(ms); ul_slots = ms_reserved_ul_slots(ms); - ts = ms_first_common_ts(ms); - - if (ts >= 0) { + if (first_common_ts) { mask_reason = "need to reuse TS"; - mask = 1 << ts; + mask = 1 << first_common_ts->ts_no; } else if (dl_slots || ul_slots) { mask_reason = "need to use a reserved common TS"; mask = dl_slots & ul_slots; @@ -412,7 +411,7 @@ tbf->trx = trx; /* the only one TS is the common TS */ ms_set_reserved_slots(ms, trx, 1 << ts, 1 << ts); - ms_set_first_common_ts(ms, ts); + ms_set_first_common_ts(ms, pdch); tbf->upgrade_to_multislot = false; bts_do_rate_ctr_inc(bts, CTR_TBF_ALLOC_ALGO_A); @@ -861,7 +860,7 @@ uint8_t ul_slots; uint8_t reserved_dl_slots; uint8_t reserved_ul_slots; - int8_t first_common_ts; + int8_t first_common_tn; uint8_t slotcount = 0; uint8_t reserve_count = 0, trx_no; int first_ts; @@ -870,6 +869,7 @@ int tfi; struct GprsMs *ms = tbf->ms(); gprs_rlcmac_trx *trx; + struct gprs_rlcmac_pdch *first_common_ts = ms_first_common_ts(ms); LOGPAL(tbf, "B", single, use_trx, LOGL_DEBUG, "Alloc start\n"); @@ -877,7 +877,7 @@ reserved_dl_slots = ms_reserved_dl_slots(ms); reserved_ul_slots = ms_reserved_ul_slots(ms); - first_common_ts = ms_first_common_ts(ms); + first_common_tn = first_common_ts ? first_common_ts->ts_no : -1; /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts, ms, tbf->direction, use_trx, &trx_no); @@ -899,7 +899,7 @@ /* Step 3a: Derive the slot set for the current TBF */ rc = tbf_select_slot_set(tbf, trx, single, ul_slots, dl_slots, reserved_ul_slots, reserved_dl_slots, - first_common_ts); + first_common_tn); if (rc < 0) return -EINVAL; @@ -924,11 +924,12 @@ return -EINVAL; } - first_common_ts = ffs(dl_slots & ul_slots) - 1; - if (first_common_ts < 0) { + first_common_tn = ffs(dl_slots & ul_slots) - 1; + if (first_common_tn < 0) { LOGPAL(tbf, "B", single, use_trx, LOGL_NOTICE, "first common slot unavailable\n"); return -EINVAL; } + first_common_ts = &trx->pdch[first_common_tn]; if (single && slotcount) { tbf->upgrade_to_multislot = (reserve_count > slotcount); diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 17aa203..facc34c 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -55,6 +55,7 @@ gprs_rlcmac_dl_tbf *dl_tbf = tbf_as_dl_tbf(tbf); uint32_t state_flags = tbf_state_flags(tbf); struct GprsMs *ms = tbf_ms(tbf); + const struct gprs_rlcmac_pdch *first_common_ts = ms_first_common_ts(ms); vty_out(vty, "TBF: TFI=%d TLLI=0x%08x (%s) TA=%u DIR=%s IMSI=%s%s", tbf->tfi(), tbf->tlli(), tbf->is_tlli_valid() ? "valid" : "invalid", @@ -66,7 +67,8 @@ state_flags, state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH), state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH), - ms_first_common_ts(ms), tbf->control_ts, + first_common_ts ? first_common_ts->ts_no : -1, + tbf->control_ts, tbf->ms_class(), ms_egprs_ms_class(ms), VTY_NEWLINE); diff --git a/src/tbf.cpp b/src/tbf.cpp index 0dfab32..caff660 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -279,14 +279,15 @@ void tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf) { - int8_t first_common_ts = ms_first_common_ts(tbf_ms(tbf)); + struct gprs_rlcmac_pdch *first_common = ms_first_common_ts(tbf_ms(tbf)); + OSMO_ASSERT(first_common); if (tbf->control_ts == TBF_TS_UNSET) LOGPTBF(tbf, LOGL_INFO, "Setting Control TS %d\n", - first_common_ts); - else if (tbf->control_ts != first_common_ts) + first_common->ts_no); + else if (tbf->control_ts != first_common->ts_no) LOGPTBF(tbf, LOGL_INFO, "Changing Control TS %d -> %d\n", - tbf->control_ts, first_common_ts); - tbf->control_ts = first_common_ts; + tbf->control_ts, first_common->ts_no); + tbf->control_ts = first_common->ts_no; } void gprs_rlcmac_tbf::n_reset(enum tbf_counters n) @@ -706,13 +707,14 @@ { uint8_t slots = 0; size_t i; + struct gprs_rlcmac_pdch *first_common; if (direction == GPRS_RLCMAC_DL_TBF) { if (control_ts < 8) slots |= 1 << control_ts; - int8_t first_common_ts = ms_first_common_ts(tbf_ms(this)); - if (first_common_ts != TBF_TS_UNSET) - slots |= 1 << first_common_ts; + first_common = ms_first_common_ts(tbf_ms(this)); + if (first_common) + slots |= 1 << first_common->ts_no; return slots; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index b04c511..a0e0398 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -166,7 +166,7 @@ ul_tbf->trx = trx; /* The only one TS is the common, control TS */ - ms_set_first_common_ts(ms, pdch->ts_no); + ms_set_first_common_ts(ms, pdch); tbf_assign_control_ts(ul_tbf); ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, next_tbf_ctr_group_id++); ul_tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(ul_tbf, diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 215a7ae..4b4fbd5 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -177,12 +177,13 @@ if (!verbose) return; const struct GprsMs *ms = tbf_ms(tbf); + const struct gprs_rlcmac_pdch *first_common = ms_first_common_ts(ms); for (size_t i = 0; i < ARRAY_SIZE(tbf->pdch); ++i) if (tbf->pdch[i]) printf("PDCH[%zu] is used for %s\n", i, dir); printf("PDCH[%d] is control_ts for %s\n", tbf->control_ts, dir); - printf("PDCH[%d] is first common for %s\n", ms_first_common_ts(ms), dir); + printf("PDCH[%d] is first common for %s\n", first_common ? first_common->ts_no : -1, dir); } #define ENABLE_PDCH(ts_no, enable_flag, trx) \ @@ -569,13 +570,13 @@ trx = ms_current_trx(ms); OSMO_ASSERT(ul_tbf || dl_tbf); - OSMO_ASSERT(ms_first_common_ts(ms) != TBF_TS_UNSET); + OSMO_ASSERT(ms_first_common_ts(ms) != NULL); if (ul_tbf) { - ul_slots = 1 << (uint8_t)ms_first_common_ts(ms); + ul_slots = 1 << (uint8_t)ms_first_common_ts(ms)->ts_no; tfi = ul_tbf->tfi(); dir = GPRS_RLCMAC_UL_TBF; } else { - ul_slots = 1 << (uint8_t)ms_first_common_ts(ms); + ul_slots = 1 << (uint8_t)ms_first_common_ts(ms)->ts_no; tfi = dl_tbf->tfi(); dir = GPRS_RLCMAC_DL_TBF; } diff --git a/tests/ulc/PdchUlcTest.cpp b/tests/ulc/PdchUlcTest.cpp index 2501f60..a199311 100644 --- a/tests/ulc/PdchUlcTest.cpp +++ b/tests/ulc/PdchUlcTest.cpp @@ -169,6 +169,7 @@ bool single, int8_t use_tbf) { tbf->trx = &bts->trx[0]; + ms_set_first_common_ts(tbf_ms(tbf), &tbf->trx->pdch[0]); return 0; } -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I19373939ec104d371e3e91422f018a8175cb0f89 Gerrit-Change-Number: 30575 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: abis_rsl: when doing packet access, log t1,t3,t2 and fn
by neels 13 Dec '22

13 Dec '22
Attention is currently required from: pespin, lynxis lazus, dexter. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/29704 ) Change subject: abis_rsl: when doing packet access, log t1,t3,t2 and fn ...................................................................... Patch Set 7: (2 comments) Commit Message: https://gerrit.osmocom.org/c/osmo-bsc/+/29704/comment/66076f67_e4989521 PS7, Line 9: the . File src/osmo-bsc/abis_rsl.c: https://gerrit.osmocom.org/c/osmo-bsc/+/29704/comment/e011c545_c8a983bd PS7, Line 1822: LOG_BTS(rqd->bts, DRSL, LOGL_INFO, "CHAN RQD: fn(t1=%u,t3=%u,t2=%u) = %u\n", t1, t3, t2, fn); re: why not in the order t1, t2, t3? you hint at a comment, i assume you mean this one: " The order T1, T2, T3 is intentional. That is the order in which the numbers are stored and also the order in which wireshark will display the values. When debuging it is easier when one does not have to convert between different display variants. The fn is displayed at later log lines as well, no need to display it here once more. (it is important to see T1, T2, T3 since wireshark won't always do the conversion.) " The confusion is not gone, your comment says 1,2,3 while the code says 1,3,2. Is wireshark showing 1,3,2? -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/29704 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I83d20ba9e0ce6488d458ccf4a85c8445c30e3a89 Gerrit-Change-Number: 29704 Gerrit-PatchSet: 7 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 13 Dec 2022 17:29:10 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in libosmocore[master]: [WIP] gsm0808: add gsm0808_enc_speech_codec[_list]2()
by fixeria 13 Dec '22

13 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/30574 ) Change subject: [WIP] gsm0808: add gsm0808_enc_speech_codec[_list]2() ...................................................................... [WIP] gsm0808: add gsm0808_enc_speech_codec[_list]2() Change-Id: I199ffa0ba4a64813238519178155dfc767aa3975 --- M include/osmocom/gsm/gsm0808_utils.h M src/gsm/gsm0808_utils.c 2 files changed, 61 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/30574/1 diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 6abfeec..269ffe3 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -112,11 +112,16 @@ uint8_t gsm0808_enc_speech_codec(struct msgb *msg, const struct gsm0808_speech_codec *sc); + OSMO_DEPRECATED("use gsm0808_enc_speech_codec2() instead") +int gsm0808_enc_speech_codec2(struct msgb *msg, + const struct gsm0808_speech_codec *sc); int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, const uint8_t *elem, uint8_t len); uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, - const struct gsm0808_speech_codec_list - *scl); + const struct gsm0808_speech_codec_list *scl) + OSMO_DEPRECATED("use gsm0808_enc_speech_codec_list2() instead"); +int gsm0808_enc_speech_codec_list2(struct msgb *msg, + const struct gsm0808_speech_codec_list *scl); int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl, const uint8_t *elem, uint8_t len); uint8_t gsm0808_enc_channel_type(struct msgb *msg, diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index f1569c9..96a97dc 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -213,10 +213,10 @@ gsm48_decode_lai2(&lai, decoded); } -/* Helper function for gsm0808_enc_speech_codec() - * and gsm0808_enc_speech_codec_list() */ -static uint8_t enc_speech_codec(struct msgb *msg, - const struct gsm0808_speech_codec *sc) +/* Helper function for gsm0808_enc_speech_codec[_list](). + * Returns number of bytes appended; negative on error. */ +static int enc_speech_codec(struct msgb *msg, + const struct gsm0808_speech_codec *sc) { /* See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t header = 0; @@ -244,8 +244,7 @@ break; default: /* Invalid codec type specified */ - OSMO_ASSERT(false); - break; + return -EINVAL; } old_tail = msg->tail; @@ -264,7 +263,6 @@ msgb_put_u8(msg, header); msgb_put_u8(msg, sc->type); } else { - OSMO_ASSERT(sc->type < 0x0f); header |= sc->type; msgb_put_u8(msg, header); } @@ -282,11 +280,13 @@ case GSM0808_SCT_FR5: case GSM0808_SCT_HR4: case GSM0808_SCT_CSD: - OSMO_ASSERT((sc->cfg & 0xff00) == 0); + if (sc->cfg >> 8) + return -EINVAL; msgb_put_u8(msg, (uint8_t) sc->cfg & 0xff); break; default: - OSMO_ASSERT(sc->cfg == 0); + if (sc->cfg != 0) + return -EINVAL; break; } @@ -296,27 +296,41 @@ /*! Encode TS 08.08 Speech Codec IE * \param[out] msg Message Buffer to which IE will be appended * \param[in] sc Speech Codec to be encoded into IE - * \returns number of bytes appended to \a msg */ -uint8_t gsm0808_enc_speech_codec(struct msgb *msg, - const struct gsm0808_speech_codec *sc) + * \returns number of bytes appended to \a msg; negative on error */ +int gsm0808_enc_speech_codec2(struct msgb *msg, + const struct gsm0808_speech_codec *sc) { /*! See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ - uint8_t *old_tail; uint8_t *tlv_len; + int rc; - OSMO_ASSERT(msg); - OSMO_ASSERT(sc); + if (OSMO_UNLIKELY(msg == NULL || sc == NULL)) + return -EINVAL; msgb_put_u8(msg, GSM0808_IE_SPEECH_CODEC); tlv_len = msgb_put(msg, 1); - old_tail = msg->tail; - enc_speech_codec(msg, sc); + rc = enc_speech_codec(msg, sc); + if (rc < 0) + return rc; - *tlv_len = (uint8_t) (msg->tail - old_tail); + *tlv_len = rc; return *tlv_len + 2; } +/*! Deprecated: gsm0808_enc_speech_codec2() wrapper for backwards compatibility. + * Mimics the old behavior: crash on missing and/or invalid input. */ +uint8_t gsm0808_enc_speech_codec(struct msgb *msg, + const struct gsm0808_speech_codec *sc) +{ + int rc; + + rc = gsm0808_enc_speech_codec2(msg, sc); + OSMO_ASSERT(rc > 0); + + return rc; +} + /*! Decode TS 08.08 Speech Codec IE * \param[out] sc Caller-allocated memory for Speech Codec * \param[in] elem IE value to be decoded @@ -401,9 +415,9 @@ /*! Encode TS 08.08 Speech Codec list * \param[out] msg Message Buffer to which IE is to be appended * \param[in] scl Speech Codec List to be encoded into IE - * \returns number of bytes added to \a msg */ -uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, - const struct gsm0808_speech_codec_list *scl) + * \returns number of bytes added to \a msg; negative on error */ +int gsm0808_enc_speech_codec_list2(struct msgb *msg, + const struct gsm0808_speech_codec_list *scl) { /*! See also 3GPP TS 48.008 3.2.2.103 Speech Codec List */ uint8_t *old_tail; @@ -412,8 +426,8 @@ uint8_t rc; unsigned int bytes_used = 0; - OSMO_ASSERT(msg); - OSMO_ASSERT(scl); + if (OSMO_UNLIKELY(msg == NULL || scl == NULL)) + return -EINVAL; msgb_put_u8(msg, GSM0808_IE_SPEECH_CODEC_LIST); tlv_len = msgb_put(msg, 1); @@ -421,15 +435,30 @@ for (i = 0; i < scl->len; i++) { rc = enc_speech_codec(msg, &scl->codec[i]); - OSMO_ASSERT(rc >= 1); + if (rc < 1) + return rc; bytes_used += rc; - OSMO_ASSERT(bytes_used <= 255); + if (bytes_used > 0xff) + return -EOVERFLOW; } *tlv_len = (uint8_t) (msg->tail - old_tail); return *tlv_len + 2; } +/*! Deprecated: gsm0808_enc_speech_codec_list2() wrapper for backwards compatibility. + * Mimics the old behavior: crash on missing and/or invalid input. */ +uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg, + const struct gsm0808_speech_codec_list *scl) +{ + int rc; + + rc = gsm0808_enc_speech_codec_list2(msg, scl); + OSMO_ASSERT(rc > 0); + + return rc; +} + /*! Decode TS 08.08 Speech Codec list IE * \param[out] scl Caller-provided memory to store codec list * \param[in] elem IE value to be decoded -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30574 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I199ffa0ba4a64813238519178155dfc767aa3975 Gerrit-Change-Number: 30574 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-pcu[master]: tbf_ul: Fix wrong struct type in field
by pespin 13 Dec '22

13 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30571 ) Change subject: tbf_ul: Fix wrong struct type in field ...................................................................... tbf_ul: Fix wrong struct type in field This typo was harmless so far because both old and new structures have the exact same content. Change-Id: If2e20128a589a25b9dc3fd08340cdb92aad158c3 --- M src/tbf_ul.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/71/30571/1 diff --git a/src/tbf_ul.h b/src/tbf_ul.h index 38784f8..c5c55f7 100644 --- a/src/tbf_ul.h +++ b/src/tbf_ul.h @@ -105,7 +105,7 @@ struct rate_ctr_group *m_ul_egprs_ctrs; struct tbf_ul_fsm_ctx state_fsm; - struct tbf_ul_ass_fsm_ctx ul_ack_fsm; + struct tbf_ul_ack_fsm_ctx ul_ack_fsm; protected: void maybe_schedule_uplink_acknack(const gprs_rlc_data_info *rlc, bool countdown_finished); -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30571 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: If2e20128a589a25b9dc3fd08340cdb92aad158c3 Gerrit-Change-Number: 30571 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-pcu[master]: bts: Adapt slot_mask to trx defined array size
by pespin 13 Dec '22

13 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30573 ) Change subject: bts: Adapt slot_mask to trx defined array size ...................................................................... bts: Adapt slot_mask to trx defined array size struct gprs_rlcmac_bts still hardcodes it to 8, but using ARRAY_SIZE there should aim at seeing the relation between those, and avoid having one updated without the other. Related: OS#5827 Change-Id: I165588ba10d8528a9a496175d8dfe9d902c89e55 --- M src/bts.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/73/30573/1 diff --git a/src/bts.cpp b/src/bts.cpp index 5ae0714..06ac5a7 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -424,7 +424,7 @@ struct gprs_rlcmac_tbf *tbf; struct llist_head *tmp; const struct osmo_mobile_identity *mi; - uint8_t slot_mask[8]; + uint8_t slot_mask[ARRAY_SIZE(bts->trx)]; int8_t first_ts; /* must be signed */ /* First, build the MI used to page on PDCH from available subscriber info: */ -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30573 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I165588ba10d8528a9a496175d8dfe9d902c89e55 Gerrit-Change-Number: 30573 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-pcu[master]: Refactor code rejecting UL-TBF upon rx of PktResourceReq
by pespin 13 Dec '22

13 Dec '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/30572 ) Change subject: Refactor code rejecting UL-TBF upon rx of PktResourceReq ...................................................................... Refactor code rejecting UL-TBF upon rx of PktResourceReq * Make it similar to the already existing TBF allocation procedures * Pass pdch pointer instead of trx and ts numbers Change-Id: I04b3b65942732cc652adeaa507529b849292ff61 --- M src/gprs_ms.c M src/gprs_ms.h M src/pdch.cpp M src/tbf_ul.cpp M src/tbf_ul.h M tests/tbf/TbfTest.cpp 6 files changed, 27 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/30572/1 diff --git a/src/gprs_ms.c b/src/gprs_ms.c index c9eaf97..073dd4a 100644 --- a/src/gprs_ms.c +++ b/src/gprs_ms.c @@ -1160,6 +1160,22 @@ return ul_tbf; } +/* Create a temporary dummy TBF to Tx a ImmAssReject if allocating a new one during + * packet resource Request failed. This is similar as ul_tbf_alloc() but without + * calling tbf->setup() (in charge of TFI/USF allocation), and reusing resources + * from Packet Resource Request we received. See TS 44.060 sec 7.1.3.2.1 */ +struct gprs_rlcmac_ul_tbf *ms_new_ul_tbf_rejected_pacch(struct GprsMs *ms, struct gprs_rlcmac_pdch *pdch) +{ + struct gprs_rlcmac_ul_tbf *ul_tbf; + ul_tbf = ul_tbf_alloc_rejected(ms->bts, ms, pdch); + if (!ul_tbf) + return NULL; + osmo_fsm_inst_dispatch(tbf_state_fi(ul_tbf_as_tbf(ul_tbf)), TBF_EV_ASSIGN_ADD_PACCH, NULL); + osmo_fsm_inst_dispatch(tbf_ul_ass_fi(ul_tbf_as_tbf(ul_tbf)), TBF_UL_ASS_EV_SCHED_ASS_REJ, NULL); + + return ul_tbf; +} + /* A new DL-TBF is allocated and assigned through PACCH using "tbf". * "tbf" may be either a UL-TBF or a DL-TBF. * Note: This should be called only when MS is reachable, see ms_is_reachable_for_dl_ass(). diff --git a/src/gprs_ms.h b/src/gprs_ms.h index 00baffa..8a324fb 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -151,6 +151,7 @@ struct gprs_rlcmac_ul_tbf *ms_new_ul_tbf_assigned_pacch(struct GprsMs *ms, int8_t use_trx); struct gprs_rlcmac_ul_tbf *ms_new_ul_tbf_assigned_agch(struct GprsMs *ms); +struct gprs_rlcmac_ul_tbf *ms_new_ul_tbf_rejected_pacch(struct GprsMs *ms, struct gprs_rlcmac_pdch *pdch); int ms_new_dl_tbf_assigned_on_pacch(struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf); int ms_new_dl_tbf_assigned_on_pch(struct GprsMs *ms); int ms_append_llc_dl_data(struct GprsMs *ms, uint16_t pdu_delay_csec, const uint8_t *data, uint16_t len); diff --git a/src/pdch.cpp b/src/pdch.cpp index 75afc88..5a683ff 100644 --- a/src/pdch.cpp +++ b/src/pdch.cpp @@ -825,7 +825,7 @@ new_ul_tbf = ms_new_ul_tbf_assigned_pacch(ms, trx_no()); if (!new_ul_tbf) { - handle_tbf_reject(bts, ms, trx_no(), ts_no); + ms_new_ul_tbf_rejected_pacch(ms, this); goto return_unref; } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 8333a2f..b04c511 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -151,11 +151,11 @@ * packet resource Request failed. This is similar as tbf_alloc_ul() but without * calling tbf->setup() (in charge of TFI/USF allocation), and reusing resources * from Packet Resource Request we received. See TS 44.060 sec 7.1.3.2.1 */ -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint8_t trx_no, uint8_t ts) +struct gprs_rlcmac_ul_tbf *ul_tbf_alloc_rejected(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, + struct gprs_rlcmac_pdch *pdch) { struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + struct gprs_rlcmac_trx *trx = pdch->trx; OSMO_ASSERT(ms); ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); @@ -166,7 +166,7 @@ ul_tbf->trx = trx; /* The only one TS is the common, control TS */ - ms_set_first_common_ts(ms, ts); + ms_set_first_common_ts(ms, pdch->ts_no); tbf_assign_control_ts(ul_tbf); ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, next_tbf_ctr_group_id++); ul_tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(ul_tbf, @@ -176,17 +176,15 @@ &tbf_ul_gprs_ctrg_desc, ul_tbf->m_ctrs->idx); if (!ul_tbf->m_ctrs || !ul_tbf->m_ul_egprs_ctrs || !ul_tbf->m_ul_gprs_ctrs) { - LOGPTBF(ul_tbf, LOGL_ERROR, "Cound not allocate TBF UL rate counters\n"); + LOGPTBF(ul_tbf, LOGL_ERROR, "Could not allocate TBF UL rate counters\n"); talloc_free(ul_tbf); return NULL; } tbf_update_state_fsm_name(ul_tbf); ms_attach_tbf(ms, ul_tbf); - llist_add(tbf_trx_list((struct gprs_rlcmac_tbf *)ul_tbf), &trx->ul_tbfs); + llist_add(tbf_trx_list(ul_tbf), &trx->ul_tbfs); bts_do_rate_ctr_inc(ul_tbf->bts, CTR_TBF_UL_ALLOCATED); - osmo_fsm_inst_dispatch(ul_tbf->state_fi, TBF_EV_ASSIGN_ADD_PACCH, NULL); - osmo_fsm_inst_dispatch(ul_tbf->ul_ass_fsm.fi, TBF_UL_ASS_EV_SCHED_ASS_REJ, NULL); return ul_tbf; } diff --git a/src/tbf_ul.h b/src/tbf_ul.h index c5c55f7..aa54c8f 100644 --- a/src/tbf_ul.h +++ b/src/tbf_ul.h @@ -123,8 +123,6 @@ return m_window.ws(); } -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint8_t trx_no, uint8_t ts_no); #else /* ifdef __cplusplus */ struct gprs_rlcmac_ul_tbf; @@ -135,6 +133,8 @@ extern "C" { #endif struct gprs_rlcmac_ul_tbf *ul_tbf_alloc(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, int8_t use_trx, bool single_slot); +struct gprs_rlcmac_ul_tbf *ul_tbf_alloc_rejected(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, + struct gprs_rlcmac_pdch *pdch); void update_tbf_ta(struct gprs_rlcmac_ul_tbf *tbf, int8_t ta_delta); void set_tbf_ta(struct gprs_rlcmac_ul_tbf *tbf, uint8_t ta); struct gprs_rlcmac_ul_tbf *tbf_as_ul_tbf(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 314d2d9..80dfc2f 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -3240,7 +3240,7 @@ ms = bts_alloc_ms(bts, 0, 0); ms_set_tlli(ms, tlli); - ul_tbf = handle_tbf_reject(bts, ms, trx_no, ts_no); + ul_tbf = ms_new_ul_tbf_rejected_pacch(ms, &bts->trx[trx_no].pdch[ts_no]); OSMO_ASSERT(ul_tbf != 0); -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/30572 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I04b3b65942732cc652adeaa507529b849292ff61 Gerrit-Change-Number: 30572 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • ...
  • 198
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.