Change in osmo-bts[master]: gsm_data_shared: use bitvec API to allocate the feature vector

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.org
Wed Jun 10 16:59:43 UTC 2020


fixeria has uploaded this change for review. ( 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, 4 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/73/18773/1

diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index dc7d39f..ab7ee72 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];
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: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200610/b003aed4/attachment.htm>


More information about the gerrit-log mailing list