bts_features: introduce osmo_bts_unset_feature()
This function may be useful in a case when most of the BTS models
do support some feature, but just a couple models do not. It's
much easier to unset that feature 2/10 times than set it 8/10
times individually for each BTS model.
Change-Id: Ib5fa27287be7f1ecf2f82249b1e8c848465cbac0
Related: I431c8ab9478cbc40179903edc21043623d805da1
diff --git a/include/osmocom/gsm/bts_features.h b/include/osmocom/gsm/bts_features.h
index 6ab8f62..27a3983 100644
--- a/include/osmocom/gsm/bts_features.h
+++ b/include/osmocom/gsm/bts_features.h
@@ -37,6 +37,12 @@
return bitvec_set_bit_pos(features, feature, 1);
}
+static inline int osmo_bts_unset_feature(struct bitvec *features, enum osmo_bts_features feature)
+{
+ OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
+ return bitvec_set_bit_pos(features, feature, 0);
+}
+
static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
{
OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);