From 383b3bf58b51807b12a8f032fa407a43b025fc18 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sun, 31 May 2020 16:03:30 +0700 Subject: 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 --- TODO-RELEASE | 1 + include/osmocom/gsm/bts_features.h | 6 ++++++ 2 files changed, 7 insertions(+) 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); -- cgit v1.2.3