This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgHello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/594 to look at the new patch set (#3). dyn TS: gsm_lchan2chan_nr(): decouple from ts->pchan For upcoming dynamic TS, the pchan choice for RSL De-/Activation is not trivial. So in order to pass the desired pchan to generate the RSL chan_nr, introduce gsm_lchan_as_pchan2chan_nr(). To avoid code dup, this requires decoupling the gsm_ts2chan_nr() pchan from the actual ts struct, so refactor gsm_ts2chan_nr() to gsm_pchan2chan_nr() with explicit pchan, ts_nr and lchan_nr arguments. Change-Id: I1a40e8452fe8120d350a27973e56be0b8c8c517f --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libcommon/gsm_data_shared.c 3 files changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/94/594/3 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index f4da7a7..b4ff0a4 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -825,8 +825,11 @@ /* reset the state of all MO in the BTS */ void gsm_bts_mo_reset(struct gsm_bts *bts); -uint8_t gsm_ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr); +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr); uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan); /* return the gsm_lchan for the CBCH (if it exists at all) */ struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 664b1a6..868375f 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -2048,7 +2048,7 @@ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; - dh->chan_nr = gsm_ts2chan_nr(ts, 0); + dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_PDCH, ts->nr, 0); DEBUGP(DRSL, "%s IPAC PDCH %sACT\n", gsm_ts_name(ts), act ? "" : "DE"); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 14c33d7..84c57c3 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -552,11 +552,12 @@ } /* See Table 10.5.25 of GSM04.08 */ -uint8_t gsm_ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr) +uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, + uint8_t ts_nr, uint8_t lchan_nr) { uint8_t cbits, chan_nr; - switch (ts->pchan) { + switch (pchan) { case GSM_PCHAN_TCH_F: case GSM_PCHAN_PDCH: case GSM_PCHAN_TCH_F_PDCH: @@ -596,14 +597,20 @@ break; } - chan_nr = (cbits << 3) | (ts->nr & 0x7); + chan_nr = (cbits << 3) | (ts_nr & 0x7); return chan_nr; } uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) { - return gsm_ts2chan_nr(lchan->ts, lchan->nr); + return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); +} + +uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, + enum gsm_phys_chan_config as_pchan) +{ + return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); } /* return the gsm_lchan for the CBCH (if it exists at all) */ -- To view, visit https://gerrit.osmocom.org/594 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1a40e8452fe8120d350a27973e56be0b8c8c517f Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de> Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels_test_account <neels at hofmeyr.de>