laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34298?usp=email )
Change subject: oml: ipacc: send GPRS Cell attributes based on IPA Object Version ......................................................................
oml: ipacc: send GPRS Cell attributes based on IPA Object Version
Change-Id: Ie0fb3eaf76e1f70e5a19bb088e1674b7e553d32a Related: OS#4505 --- M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c M tests/nanobts_omlattr/nanobts_omlattr_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.ok 3 files changed, 70 insertions(+), 28 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c index 83c5a30..96c4d50 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c @@ -227,9 +227,8 @@
struct msgb *nanobts_gen_set_cell_attr(struct gsm_bts *bts) { + const struct gsm_gprs_cell *cell = &bts->gprs.cell; struct msgb *msgb; - struct abis_nm_ipacc_att_rlc_cfg rlc_cfg; - struct abis_nm_ipacc_att_rlc_cfg_2 rlc_cfg_2; uint8_t buf[2];
msgb = msgb_alloc(1024, __func__); @@ -250,7 +249,7 @@ msgb_tl16v_put(msgb, NM_ATT_IPACC_BVCI, 2, buf);
/* all timers in seconds, unless otherwise stated */ - rlc_cfg = (struct abis_nm_ipacc_att_rlc_cfg){ + const struct abis_nm_ipacc_att_rlc_cfg rlc_cfg = { .t3142 = 20, /* T3142 */ .t3169 = 5, /* T3169 */ .t3191 = 5, /* T3191 */ @@ -263,31 +262,62 @@ }; msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG, sizeof(rlc_cfg), (const uint8_t *)&rlc_cfg);
- if (bts->gprs.mode == BTS_GPRS_EGPRS) { - buf[0] = 0x8f; - buf[1] = 0xff; - } else { - buf[0] = 0x0f; - buf[1] = 0x00; + switch (bts->type) { + case GSM_BTS_TYPE_NANOBTS: + if (cell->mo.ipaccess.obj_version < 4) + break; + /* fall-through */ + case GSM_BTS_TYPE_OSMOBTS: + if (bts->gprs.mode == BTS_GPRS_EGPRS) { + buf[0] = 0x8f; + buf[1] = 0xff; + } else { + buf[0] = 0x0f; + buf[1] = 0x00; + } + msgb_tl16v_put(msgb, NM_ATT_IPACC_CODING_SCHEMES, 2, buf); + break; + default: + break; } - msgb_tl16v_put(msgb, NM_ATT_IPACC_CODING_SCHEMES, 2, buf);
- rlc_cfg_2 = (struct abis_nm_ipacc_att_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 */ - }; - msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_2, sizeof(rlc_cfg_2), (const uint8_t *)&rlc_cfg_2); + switch (bts->type) { + case GSM_BTS_TYPE_NANOBTS: + if (cell->mo.ipaccess.obj_version < 20) + break; + /* fall-through */ + case GSM_BTS_TYPE_OSMOBTS: + { + 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 */ + }; + msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_2, + sizeof(rlc_cfg_2), (const uint8_t *)&rlc_cfg_2); + break; + } + default: + break; + }
-#if 0 - /* EDGE model only, breaks older models. - * Should inquire the BTS capabilities */ - struct abis_nm_ipacc_att_rlc_cfg_3 rlc_cfg_3; - rlc_cfg_3 = (struct abis_nm_ipacc_att_rlc_cfg_3){ - .initial_mcs = 2, /* MCS2 */ - }; - msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_3, sizeof(rlc_cfg_3), (const uint8_t *)&rlc_cfg_3); -#endif + switch (bts->type) { + case GSM_BTS_TYPE_NANOBTS: + if (cell->mo.ipaccess.obj_version < 30) + break; + /* fall-through */ + case GSM_BTS_TYPE_OSMOBTS: + { + const struct abis_nm_ipacc_att_rlc_cfg_3 rlc_cfg_3 = { + .initial_mcs = 2, /* MCS2 */ + }; + msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_3, + sizeof(rlc_cfg_3), (const uint8_t *)&rlc_cfg_3); + break; + } + default: + break; + }
return msgb; } diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index ba58e45..6a09d27 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -73,6 +73,8 @@
printf("Testing nanobts_gen_set_cell_attr()...\n");
+ bts->gprs.cell.mo.ipaccess.obj_version = 30; + msgb = nanobts_gen_set_cell_attr(bts); printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); @@ -211,7 +213,7 @@ 0x02, 0x00, 0x02, 0xa3, 0x00, 0x09, 0x14, 0x05, 0x05, 0xa0, 0x05, 0x0a, 0x04, 0x08, 0x0f, 0xa8, 0x00, 0x02, 0x0f, 0x00, 0xa9, 0x00, 0x05, 0x00, - 0xfa, 0x00, 0xfa, 0x02 + 0xfa, 0x00, 0xfa, 0x02, 0xac, 0x00, 0x01, 0x02, };
/* Parameters needed to test nanobts_gen_set_nsvc_attr() */ diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok index 5f90769..7e7ba69 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.ok +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.ok @@ -9,8 +9,8 @@ ok.
Testing nanobts_gen_set_cell_attr()... -result= 9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02 -expected=9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02 +result= 9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02ac000102 +expected=9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02ac000102 ok.
Testing nanobts_gen_set_nsvc_attr()...