浏览代码

cfg80211/mac80211: allow any interface to send channel switch notifications

For multi-vif channel switches, we want to send
NL80211_CMD_CH_SWITCH_NOTIFY to the userspace to let it decide whether
other interfaces need to be moved as well.  This is needed when we
want a P2P GO interface to follow the channel of a station, for
example.

Modify the code so that all interfaces can send CSA notifications.
Additionally, send notifications for STA CSA as well.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Luciano Coelho 10 年之前
父节点
当前提交
d04b5ac9e7
共有 3 个文件被更改,包括 5 次插入7 次删除
  1. 3 1
      include/uapi/linux/nl80211.h
  2. 2 0
      net/mac80211/mlme.c
  3. 0 6
      net/wireless/nl80211.c

+ 3 - 1
include/uapi/linux/nl80211.h

@@ -643,7 +643,9 @@
  * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
  * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
  *	independently of the userspace SME, send this event indicating
  *	independently of the userspace SME, send this event indicating
  *	%NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
  *	%NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
- *	attributes determining channel width.
+ *	attributes determining channel width.  This indication may also be
+ *	sent when a remotely-initiated switch (e.g., when a STA receives a CSA
+ *	from the remote AP) is completed;
  *
  *
  * @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch
  * @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch
  *	has been started on an interface, regardless of the initiator
  *	has been started on an interface, regardless of the initiator

+ 2 - 0
net/mac80211/mlme.c

@@ -1049,6 +1049,8 @@ static void ieee80211_chswitch_post_beacon(struct ieee80211_sub_if_data *sdata)
 		sdata->csa_block_tx = false;
 		sdata->csa_block_tx = false;
 	}
 	}
 
 
+	cfg80211_ch_switch_notify(sdata->dev, &sdata->reserved_chandef);
+
 	sdata->vif.csa_active = false;
 	sdata->vif.csa_active = false;
 	ifmgd->csa_waiting_bcn = false;
 	ifmgd->csa_waiting_bcn = false;
 
 

+ 0 - 6
net/wireless/nl80211.c

@@ -11702,12 +11702,6 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
 
 
 	trace_cfg80211_ch_switch_notify(dev, chandef);
 	trace_cfg80211_ch_switch_notify(dev, chandef);
 
 
-	if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP &&
-		    wdev->iftype != NL80211_IFTYPE_P2P_GO &&
-		    wdev->iftype != NL80211_IFTYPE_ADHOC &&
-		    wdev->iftype != NL80211_IFTYPE_MESH_POINT))
-		return;
-
 	wdev->chandef = *chandef;
 	wdev->chandef = *chandef;
 	wdev->preset_chandef = *chandef;
 	wdev->preset_chandef = *chandef;
 	nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL,
 	nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL,