diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-09-12 04:23:58 +0700 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-09-15 01:39:06 +0700 |
commit | e8518ae375049ad887fbf26e7c1852830e579e46 (patch) | |
tree | 419cd093c75ec11315a434691dc3d2f14041d692 | |
parent | fd4654e1b8ccf364e604c93d2fdbd21a076dc6ea (diff) |
oml: oml_tx_attr_resp(): pass *mo to handle_attrs_{bts,trx}()
Change-Id: I78555d7226afd0c25efc100d95642634323a7b95
-rw-r--r-- | src/common/oml.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/common/oml.c b/src/common/oml.c index 43802583..d1b7e5dd 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -217,18 +217,15 @@ static inline void add_trx_attr(struct msgb *msg, const struct gsm_bts_trx *trx) /* Handle a list of attributes requested by the BSC, compose * TRX-specific Get Attribute Response IE as per 9.4.64. */ -static inline int handle_attrs_trx(struct msgb *out_msg, const struct gsm_bts_trx *trx, +static inline int handle_attrs_trx(struct msgb *out_msg, + const struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) { + const struct gsm_bts_trx *trx = container_of(mo, struct gsm_bts_trx, bb_transc.mo); uint8_t num_unsupported = 0; uint8_t *buf; int i; - if (!trx) { - LOGP(DOML, LOGL_ERROR, "%s: O&M Get Attributes for unknown TRX\n", gsm_trx_name(trx)); - return -NM_NACK_TRXNR_UNKN; - } - for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: @@ -253,18 +250,15 @@ static inline int handle_attrs_trx(struct msgb *out_msg, const struct gsm_bts_tr /* Handle a list of attributes requested by the BSC, compose * BTS-specific Get Attribute Response IE as per 9.4.64. */ -static inline int handle_attrs_bts(struct msgb *out_msg, const struct gsm_bts *bts, +static inline int handle_attrs_bts(struct msgb *out_msg, + const struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) { + const struct gsm_bts *bts = container_of(mo, struct gsm_bts, mo); uint8_t num_unsupported = 0; uint8_t *buf; int i; - if (!bts) { - LOGP(DOML, LOGL_ERROR, "O&M Get Attributes for unknown BTS\n"); - return -NM_NACK_BTSNR_UNKN; - } - for (i = 0; i < attr_len; i++) { switch (attr[i]) { case NM_ATT_SW_CONFIG: @@ -303,10 +297,10 @@ static int oml_tx_attr_resp(const struct gsm_abis_mo *mo, switch (mo->obj_class) { case NM_OC_BTS: - rc = handle_attrs_bts(nmsg, mo->bts, attr, attr_len); + rc = handle_attrs_bts(nmsg, mo, attr, attr_len); break; case NM_OC_BASEB_TRANSC: - rc = handle_attrs_trx(nmsg, gsm_bts_trx_num(mo->bts, mo->obj_inst.trx_nr), attr, attr_len); + rc = handle_attrs_trx(nmsg, mo, attr, attr_len); break; default: LOGP(DOML, LOGL_ERROR, "%s: Unsupported MO class in Get Attribute Response\n", |