This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
fixeria gerrit-no-reply at lists.osmocom.orgfixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/18773 ) Change subject: gsm_data_shared: use bitvec API to allocate the feature vector ...................................................................... gsm_data_shared: use bitvec API to allocate the feature vector Change-Id: I19ecfc619c0dc2bfd14f054d17e222c4e16f6238 --- M include/osmo-bts/gsm_data_shared.h M src/common/gsm_data_shared.c M src/common/oml.c 3 files changed, 6 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index dc7d39f..f3855f7 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -523,8 +523,7 @@ char sub_model[MAX_VERSION_LENGTH]; /* features of a given BTS set/reported via OML */ - struct bitvec features; - uint8_t _features_data[MAX_BTS_FEATURES/8]; + struct bitvec *features; /* Connected PCU version (if any) */ char pcu_version[MAX_VERSION_LENGTH]; @@ -744,13 +743,13 @@ static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat) { OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&bts->features, feat, 1); + return bitvec_set_bit_pos(bts->features, feat, 1); } static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat) { OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&bts->features, feat); + return bitvec_get_bit_pos(bts->features, feat); } void gsm_abis_mo_reset(struct gsm_abis_mo *mo); diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c index c05f59d..e23b04b 100644 --- a/src/common/gsm_data_shared.c +++ b/src/common/gsm_data_shared.c @@ -322,8 +322,8 @@ } bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; - bts->features.data = &bts->_features_data[0]; - bts->features.data_len = sizeof(bts->_features_data); + bts->features = bitvec_alloc(MAX_BTS_FEATURES / 8, bts); + OSMO_ASSERT(bts->features != NULL); return bts; } diff --git a/src/common/oml.c b/src/common/oml.c index 587a808..5610ab1 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -174,7 +174,7 @@ static inline void add_bts_feat(struct msgb *msg, const struct gsm_bts *bts) { unsigned int len = OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT); - msgb_tl16v_put(msg, NM_ATT_MANUF_ID, len, bts->_features_data); + msgb_tl16v_put(msg, NM_ATT_MANUF_ID, len, bts->features->data); } static inline void add_trx_attr(struct msgb *msg, const struct gsm_bts_trx *trx) -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/18773 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I19ecfc619c0dc2bfd14f054d17e222c4e16f6238 Gerrit-Change-Number: 18773 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de> Gerrit-CC: neels <nhofmeyr at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200610/802e3aa2/attachment.htm>