From 0abd3e6f6353d6cc2fec8a3d6bab6c895db5c678 Mon Sep 17 00:00:00 2001 From: Muna Sinada Date: Wed, 2 Mar 2022 15:47:45 -0800 Subject: [PATCH 6/6] ru_puncturing: send bitmap to kernel Send the user configured bitmap to the kernel. Signed-off-by: Muna Sinada Signed-off-by: Aloka Dixit --- src/drivers/driver_nl80211.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5036,6 +5036,14 @@ static int nl80211_put_freq_params(struc nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ2, freq->center_freq2))) return -ENOBUFS; + if (freq->ru_punct_bitmap) { + if (freq->ru_punct_ofdma && + nla_put_flag(msg, NL80211_ATTR_RU_PUNCT_SUPP_HE)) + return -ENOBUFS; + if (nla_put_u16(msg, NL80211_ATTR_RU_PUNCT_BITMAP, + freq->ru_punct_bitmap)) + return -ENOBUFS; + } } else if (freq->ht_enabled || (freq->he_enabled && is_24ghz)) { enum nl80211_channel_type ct; @@ -5084,10 +5092,10 @@ static int nl80211_set_channel(struct i8 int ret; wpa_printf(MSG_DEBUG, - "nl80211: Set freq %d (ht_enabled=%d, vht_enabled=%d, he_enabled=%d, eht_enabled=%d, bandwidth=%d MHz, cf1=%d MHz, cf2=%d MHz)", + "nl80211: Set freq %d (ht_enabled=%d, vht_enabled=%d, he_enabled=%d, eht_enabled=%d, bandwidth=%d MHz, cf1=%d MHz, cf2=%d MHz, puncturing bitmap=0x%04x)", freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled, freq->eht_enabled, freq->bandwidth, freq->center_freq1, - freq->center_freq2); + freq->center_freq2, freq->ru_punct_bitmap); msg = nl80211_bss_msg(bss, 0, set_chan ? NL80211_CMD_SET_CHANNEL : NL80211_CMD_SET_WIPHY);