pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/34295?usp=email )

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 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
---
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
1 file changed, 31 insertions(+), 5 deletions(-)

Approvals:
  osmith: Looks good to me, approved
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve




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){

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34295?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I610ca34babc0b0ac9477622aa7b8360be8f3f59f
Gerrit-Change-Number: 34295
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to