aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index aeec1d9..c8ff7a0 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1380,10 +1380,26 @@ static int hostapd_config_vht_capab(struct hostapd_config *conf,
#ifdef CONFIG_IEEE80211AX
+
+static u8 find_bit_offset(u8 val)
+{
+ u8 res = 0;
+
+ for (; val; val >>= 1) {
+ if (val & 1)
+ break;
+ res++;
+ }
+
+ return res;
+}
+
+
static u8 set_he_cap(int val, u8 mask)
{
- return (u8) (mask & (val << ffs(mask)));
+ return (u8) (mask & (val << find_bit_offset(mask)));
}
+
#endif /* CONFIG_IEEE80211AX */