diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-05-31 16:03:30 +0700 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-05-31 18:40:20 +0000 |
commit | 383b3bf58b51807b12a8f032fa407a43b025fc18 (patch) | |
tree | 7e48450b9820ac7f90d2724e65a8050d16080923 | |
parent | f8e153d815ead9bd11665d0270c439ab5c5f568b (diff) |
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
-rw-r--r-- | TODO-RELEASE | 1 | ||||
-rw-r--r-- | include/osmocom/gsm/bts_features.h | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE index bc95b914..a6ed7309 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,4 @@ gsm API/ABI change l1sap.h, added struct members to ph_data_param and ph_tch_param sim API/ABI change new osim_file_desc_find_aid() sim API/ABI change all over the place +gsm new API new osmo_bts_unset_feature() diff --git a/include/osmocom/gsm/bts_features.h b/include/osmocom/gsm/bts_features.h index 6ab8f622..27a3983a 100644 --- a/include/osmocom/gsm/bts_features.h +++ b/include/osmocom/gsm/bts_features.h @@ -37,6 +37,12 @@ static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_fe 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); |