From: Luca Coelho <luca@coelho.fi>
To: linux-wireless@vger.kernel.org, johannes@sipsolutions.net
Cc: michal.kazior@tieto.com
Subject: [PATCH 4/4] cfg80211/nl80211: allow any interface to send channel switch notifications
Date: Fri, 2 May 2014 16:40:31 +0300 [thread overview]
Message-ID: <1399038031-23206-4-git-send-email-luca@coelho.fi> (raw)
In-Reply-To: <1399038031-23206-1-git-send-email-luca@coelho.fi>
From: Luciano Coelho <luciano.coelho@intel.com>
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 run
out of available channels or 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>
---
include/uapi/linux/nl80211.h | 4 +++-
net/mac80211/mlme.c | 1 +
net/wireless/nl80211.c | 6 ------
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index d7c5b61..635267d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -636,7 +636,9 @@
* @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
* independently of the userspace SME, send this event indicating
* %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 (eg. when a STA receives a CSA
+ * from the remote AP) is completed;
*
* @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch
* has been started on an interface, regardless of the initiator
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index beff8c8..59c59da 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -984,6 +984,7 @@ static void ieee80211_chswitch_work(struct work_struct *work)
ieee80211_bss_info_change_notify(sdata, changed);
+ cfg80211_ch_switch_notify(sdata->dev, &sdata->reserved_chandef);
out:
sdata->vif.csa_active = false;
ifmgd->flags &= ~IEEE80211_STA_CSA_RECEIVED;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 804c3c9..aea60bb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -11252,12 +11252,6 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
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->preset_chandef = *chandef;
nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL,
--
1.9.2
next prev parent reply other threads:[~2014-05-02 13:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-02 13:40 [PATCH 1/4] cfg80211/nl80211: add channel switch started and failed notifications Luca Coelho
2014-05-02 13:40 ` [PATCH 2/4] mac80211: send channel switch started notifications Luca Coelho
2014-05-02 13:40 ` [PATCH 3/4] mac80211: send channel switch failed notifications Luca Coelho
2014-05-02 13:40 ` Luca Coelho [this message]
2014-05-06 10:47 ` [PATCH 1/4] cfg80211/nl80211: add channel switch started and " Johannes Berg
2014-05-06 12:49 ` Michal Kazior
2014-05-06 13:08 ` Johannes Berg
2014-05-07 6:08 ` Peer, Ilan
2014-05-07 6:39 ` Johannes Berg
2014-05-07 10:27 ` Peer, Ilan
2014-05-07 11:19 ` Johannes Berg
2014-05-07 11:45 ` Michal Kazior
2014-05-07 11:55 ` Peer, Ilan
2014-05-13 10:31 ` Luca Coelho
2014-05-06 10:48 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399038031-23206-4-git-send-email-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox