Search Linux Wireless

[RFC 4/4] wifi: mac80211: Handle RU Puncturing information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Handle RU Puncturing information received from user space.
RU Puncturing bitmap is initially received during
ieee80211_change_iface() and stored. During AP chanwidth setting,
the bitmap is validated. In addition driver is notified of new bitmap
value.

Signed-off-by: Muna Sinada <quic_msinada@xxxxxxxxxxx>
---
 net/mac80211/cfg.c  |  8 ++++++++
 net/mac80211/chan.c | 14 ++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c848fe04dd44..d82060d8fd4e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -213,6 +213,12 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
 	struct sta_info *sta;
 	int ret;
 
+	sdata->vif.bss_conf.ru_punct_bitmap = params->ru_punct_bitmap;
+	sdata->vif.bss_conf.ru_punct_bitmap_supp_he = params->ru_punct_bitmap_supp_he;
+
+	if (!sdata->vif.bss_conf.ru_punct_bitmap)
+		sdata_dbg(sdata, "RU Puncturing Bitmap was not set by user\n");
+
 	ret = ieee80211_if_change_type(sdata, type);
 	if (ret)
 		return ret;
@@ -1251,6 +1257,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	prev_beacon_int = link_conf->beacon_int;
 	link_conf->beacon_int = params->beacon_interval;
 
+	sdata->vif.bss_conf.ru_punct_bitmap = dev->ieee80211_ptr->ru_punct_bitmap;
+
 	if (params->he_cap && params->he_oper) {
 		link_conf->he_support = true;
 		link_conf->htc_trig_based_pkt_ext =
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index e72cf0749d49..55a1f8bb309c 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -838,6 +838,7 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_chanctx_conf *conf;
 	struct ieee80211_chanctx *curr_ctx = NULL;
+	u64 changed;
 	int ret = 0;
 
 	if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_NAN))
@@ -882,8 +883,10 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
 	}
 
 	if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
-	    sdata->vif.type != NL80211_IFTYPE_MONITOR)
-		ieee80211_vif_cfg_change_notify(sdata, BSS_CHANGED_IDLE);
+	    sdata->vif.type != NL80211_IFTYPE_MONITOR) {
+		changed |= BSS_CHANGED_IDLE | BSS_CHANGED_EHT_PUNCTURING;
+		ieee80211_vif_cfg_change_notify(sdata, changed);
+	}
 
 	ieee80211_check_fast_xmit_iface(sdata);
 
@@ -1942,6 +1945,13 @@ int ieee80211_link_change_bandwidth(struct ieee80211_link_data *link,
 		goto out;
 	}
 
+	if (!ieee80211_valid_disable_subchannel_bitmap(
+					   &sdata->vif.bss_conf.ru_punct_bitmap,
+					   chandef->width)) {
+		ret = -EINVAL;
+		goto out;
+	}
+
 	conf = rcu_dereference_protected(link_conf->chanctx_conf,
 					 lockdep_is_held(&local->chanctx_mtx));
 	if (!conf) {
-- 
2.7.4




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux