pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34295 )
Change subject: oml: ipacc: Use new packed struct abis_nm_ipacc_att_ns_cfg from libosmcore ......................................................................
oml: ipacc: Use new packed struct abis_nm_ipacc_att_ns_cfg from libosmcore
This way it becomes a lot clearer what kind of content is expected to be transmitted over the wire.
It is expected that in the future the bts_sm->gprs.nse.timer will disappear and the values feed into struct abis_nm_ipacc_att_ns_cfg come from osmo_tdef, etc.
Change-Id: I610ca34babc0b0ac9477622aa7b8360be8f3f59f Depends: libosmocore.git Change-Id Ie477b0e6d79e6d408e0004fd60307afc5feaa3b6 Related: OS#5335 --- M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c 1 file changed, 31 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/34295/1
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c index ce368fd..f6cdd0b 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c @@ -112,7 +112,8 @@ struct msgb *nanobts_gen_set_nse_attr(struct gsm_bts_sm *bts_sm) { struct msgb *msgb; - uint8_t buf[256]; + uint8_t buf[2]; + struct abis_nm_ipacc_att_ns_cfg ns_cfg; struct abis_nm_ipacc_att_bssgp_cfg bssgp_cfg; struct gsm_bts *bts = gsm_bts_sm_get_bts(bts_sm); msgb = msgb_alloc(1024, "nanobts_attr_bts"); @@ -124,10 +125,17 @@ buf[1] = bts_sm->gprs.nse.nsei & 0xff; msgb_tl16v_put(msgb, NM_ATT_IPACC_NSEI, 2, buf);
- /* all timers in seconds */ - OSMO_ASSERT(ARRAY_SIZE(bts_sm->gprs.nse.timer) < sizeof(buf)); - memcpy(buf, bts_sm->gprs.nse.timer, ARRAY_SIZE(bts_sm->gprs.nse.timer)); - msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_CFG, 7, buf); + osmo_static_assert(ARRAY_SIZE(bts_sm->gprs.nse.timer) == 7, nse_timer_array_wrong_size); + ns_cfg = (struct abis_nm_ipacc_att_ns_cfg){ + .un_blocking_timer = bts_sm->gprs.nse.timer[0], + .un_blocking_retries = bts_sm->gprs.nse.timer[1], + .reset_timer = bts_sm->gprs.nse.timer[2], + .reset_retries = bts_sm->gprs.nse.timer[3], + .test_timer = bts_sm->gprs.nse.timer[4], + .alive_timer = bts_sm->gprs.nse.timer[5], + .alive_retries = bts_sm->gprs.nse.timer[6], + }; + msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_CFG, sizeof(ns_cfg), (const uint8_t *)&ns_cfg);
osmo_static_assert(ARRAY_SIZE(bts->gprs.cell.timer) == 11, cell_timer_array_wrong_size); bssgp_cfg = (struct abis_nm_ipacc_att_bssgp_cfg){