fixeria has uploaded this change for review.
oml: ipacc: fix sending hard-coded GPRS Cell attributes
Change-Id: I7d90ca3d6a660af8e953e890c7919194f5d297d2
Related: OS#4505
---
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
1 file changed, 37 insertions(+), 23 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/57/34357/1
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index 1f64c0e..ddbb05a 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -1,6 +1,6 @@
/* ip.access nanoBTS specific code, OML attribute table generator */
-/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
+/* (C) 2016-2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
* All Rights Reserved
*
* Author: Philipp Maier
@@ -226,6 +226,7 @@
struct msgb *nanobts_gen_set_cell_attr(struct gsm_bts *bts)
{
const struct gsm_gprs_cell *cell = &bts->gprs.cell;
+ const struct gprs_rlc_cfg *rlcc = &cell->rlc_cfg;
struct msgb *msgb;
uint8_t buf[2];
msgb = msgb_alloc(1024, "nanobts_attr_bts");
@@ -236,45 +237,48 @@
buf[0] = bts->gprs.rac;
msgb_tl16v_put(msgb, NM_ATT_IPACC_RAC, 1, buf);
- buf[0] = 5; /* repeat time (50ms) */
- buf[1] = 3; /* repeat count */
+ buf[0] = rlcc->paging.repeat_time / 50; /* units of 50ms */
+ buf[1] = rlcc->paging.repeat_count;
msgb_tl16v_put(msgb, NM_ATT_IPACC_GPRS_PAGING_CFG, 2, buf);
/* BVCI 925 */
- buf[0] = bts->gprs.cell.bvci >> 8;
- buf[1] = bts->gprs.cell.bvci & 0xff;
+ buf[0] = cell->bvci >> 8;
+ buf[1] = cell->bvci & 0xff;
msgb_tl16v_put(msgb, NM_ATT_IPACC_BVCI, 2, buf);
/* all timers in seconds, unless otherwise stated */
const struct abis_nm_ipacc_att_rlc_cfg rlc_cfg = {
- .t3142 = 20, /* T3142 */
- .t3169 = 5, /* T3169 */
- .t3191 = 5, /* T3191 */
- .t3193_10ms = 160, /* T3193 (units of 10ms) */
- .t3195 = 5, /* T3195 */
- .n3101 = 10, /* N3101 */
- .n3103 = 4, /* N3103 */
- .n3105 = 8, /* N3105 */
- .rlc_cv_countdown = 15, /* RLC CV countdown */
+ .t3142 = rlcc->parameter[RLC_T3142],
+ .t3169 = rlcc->parameter[RLC_T3169],
+ .t3191 = rlcc->parameter[RLC_T3191],
+ .t3193_10ms = rlcc->parameter[RLC_T3193] / 10,
+ .t3195 = rlcc->parameter[RLC_T3195],
+ .n3101 = rlcc->parameter[RLC_N3101],
+ .n3103 = rlcc->parameter[RLC_N3103],
+ .n3105 = rlcc->parameter[RLC_N3105],
+ .rlc_cv_countdown = rlcc->parameter[CV_COUNTDOWN],
};
msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG, sizeof(rlc_cfg), (const uint8_t *)&rlc_cfg);
if (is_osmobts(bts) || cell->mo.ipaccess.obj_version >= 4) {
+ /* CS1..CS4 flags encoded in the first octet */
+ buf[0] = rlcc->cs_mask & 0x0f;
+ /* MCS1..MSC8 flags encoded in the second octet */
+ buf[1] = 0x00;
if (bts->gprs.mode == BTS_GPRS_EGPRS) {
- buf[0] = 0x8f;
- buf[1] = 0xff;
- } else {
- buf[0] = 0x0f;
- buf[1] = 0x00;
+ /* MSC9 is special and also goes to the first octet */
+ if (rlcc->cs_mask & (1 << GPRS_MCS9))
+ buf[0] |= (1 << 7);
+ buf[1] = (rlcc->cs_mask >> 4) & 0xff;
}
msgb_tl16v_put(msgb, NM_ATT_IPACC_CODING_SCHEMES, 2, buf);
}
if (is_osmobts(bts) || cell->mo.ipaccess.obj_version >= 20) {
const struct abis_nm_ipacc_att_rlc_cfg_2 rlc_cfg_2 = {
- .t_dl_tbf_ext_10ms = htons(250), /* 0..500 */
- .t_ul_tbf_ext_10ms = htons(250), /* 0..500 */
- .initial_cs = 2, /* CS2 */
+ .t_dl_tbf_ext_10ms = htons(rlcc->parameter[T_DL_TBF_EXT] / 10),
+ .t_ul_tbf_ext_10ms = htons(rlcc->parameter[T_UL_TBF_EXT] / 10),
+ .initial_cs = rlcc->initial_cs,
};
msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_2,
sizeof(rlc_cfg_2), (const uint8_t *)&rlc_cfg_2);
@@ -282,7 +286,7 @@
if (is_osmobts(bts) || cell->mo.ipaccess.obj_version >= 30) {
const struct abis_nm_ipacc_att_rlc_cfg_3 rlc_cfg_3 = {
- .initial_mcs = 2, /* MCS2 */
+ .initial_mcs = rlcc->initial_mcs,
};
msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_3,
sizeof(rlc_cfg_3), (const uint8_t *)&rlc_cfg_3);
To view, visit change 34357. To unsubscribe, or for help writing mail filters, visit settings.