diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-09-01 20:32:04 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-09-01 20:45:13 +0200 |
commit | a473c260ff260c2c990f92269e50e4c1881282bb (patch) | |
tree | 02fdb08d4ebb35bbf7d0d2dffbd676d40e0e2017 /src | |
parent | 9e5b3ad687c6fe8dc4d9bf94f1400660ebcfe7e8 (diff) |
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 fed 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
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c index ce368fdd4..f6cdd0b39 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_bts_attr(struct gsm_bts *bts) 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 @@ struct msgb *nanobts_gen_set_nse_attr(struct gsm_bts_sm *bts_sm) 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){ |