diff options
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r-- | src/osmo-bsc/nm_bb_transc_fsm.c | 17 | ||||
-rw-r--r-- | src/osmo-bsc/nm_bts_fsm.c | 17 |
2 files changed, 22 insertions, 12 deletions
diff --git a/src/osmo-bsc/nm_bb_transc_fsm.c b/src/osmo-bsc/nm_bb_transc_fsm.c index c70904ba1..4b5e2b24d 100644 --- a/src/osmo-bsc/nm_bb_transc_fsm.c +++ b/src/osmo-bsc/nm_bb_transc_fsm.c @@ -111,13 +111,18 @@ static void configure_loop(struct gsm_bts_bb_trx *bb_transc, const struct gsm_nm /* Request TRX-level attributes */ if (!bb_transc->mo.get_attr_sent && !bb_transc->mo.get_attr_rep_received) { - bb_transc->mo.get_attr_sent = true; - /* N. B: we rely on attribute order when parsing response in abis_nm_rx_get_attr_resp() */ - const uint8_t trx_attr[] = { NM_ATT_MANUF_STATE, NM_ATT_SW_CONFIG, NM_ATT_IPACC_SUPP_FEATURES }; - /* we should not request more attributes than we're ready to handle */ - OSMO_ASSERT(sizeof(trx_attr) < MAX_BTS_ATTR); + uint8_t attr_buf[MAX_BTS_ATTR]; + uint8_t *ptr = &attr_buf[0]; + + *(ptr++) = NM_ATT_MANUF_STATE; + *(ptr++) = NM_ATT_SW_CONFIG; + if (is_ipa_abisip_bts(trx->bts)) + *(ptr++) = NM_ATT_IPACC_SUPP_FEATURES; + + OSMO_ASSERT((ptr - attr_buf) <= sizeof(attr_buf)); abis_nm_get_attr(trx->bts, NM_OC_BASEB_TRANSC, 0, trx->nr, 0xff, - trx_attr, sizeof(trx_attr)); + &attr_buf[0], (ptr - attr_buf)); + bb_transc->mo.get_attr_sent = true; } if (bb_transc->mo.get_attr_rep_received && diff --git a/src/osmo-bsc/nm_bts_fsm.c b/src/osmo-bsc/nm_bts_fsm.c index e601e1841..a9b6604b5 100644 --- a/src/osmo-bsc/nm_bts_fsm.c +++ b/src/osmo-bsc/nm_bts_fsm.c @@ -98,13 +98,18 @@ static void configure_loop(struct gsm_bts *bts, const struct gsm_nm_state *state /* Request generic BTS-level attributes */ if (!bts->mo.get_attr_sent && !bts->mo.get_attr_rep_received) { - bts->mo.get_attr_sent = true; - /* N. B: we rely on attribute order when parsing response in abis_nm_rx_get_attr_resp() */ - const uint8_t bts_attr[] = { NM_ATT_MANUF_ID, NM_ATT_SW_CONFIG, NM_ATT_IPACC_SUPP_FEATURES}; - /* we should not request more attributes than we're ready to handle */ - OSMO_ASSERT(sizeof(bts_attr) < MAX_BTS_ATTR); + uint8_t attr_buf[MAX_BTS_ATTR]; + uint8_t *ptr = &attr_buf[0]; + + *(ptr++) = NM_ATT_MANUF_ID; + *(ptr++) = NM_ATT_SW_CONFIG; + if (is_ipa_abisip_bts(bts)) + *(ptr++) = NM_ATT_IPACC_SUPP_FEATURES; + + OSMO_ASSERT((ptr - attr_buf) <= sizeof(attr_buf)); abis_nm_get_attr(bts, NM_OC_BTS, 0, 0xff, 0xff, - bts_attr, sizeof(bts_attr)); + &attr_buf[0], (ptr - attr_buf)); + bts->mo.get_attr_sent = true; } if (bts->mo.get_attr_rep_received && |