From: Karl Beldan <karl.beldan@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Karl Beldan <karl.beldan@rivierawaves.com>,
Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: [PATCH v2] mac80211_hwsim: claim CSA support for AP
Date: Fri, 22 Nov 2013 09:56:47 +0100 [thread overview]
Message-ID: <1385110607-17962-1-git-send-email-karl.beldan@gmail.com> (raw)
From: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
drivers/net/wireless/mac80211_hwsim.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index a11dc7c..3fa63bd 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -168,6 +168,7 @@ struct hwsim_vif_priv {
u8 bssid[ETH_ALEN];
bool assoc;
bool bcn_en;
+ int csa_bcn_cnt;
u16 aid;
};
@@ -1058,6 +1059,18 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
mac80211_hwsim_tx_frame(hw, skb,
rcu_dereference(vif->chanctx_conf)->def.chan);
+
+ if (vif->csa_active) {
+ struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
+
+ vp->csa_bcn_cnt++;
+ if (ieee80211_csa_is_complete(vif)) {
+ wiphy_debug(hw->wiphy,
+ "%s CSA complete after %d beacons\n",
+ __func__, vp->csa_bcn_cnt);
+ ieee80211_csa_finish(vif);
+ }
+ }
}
static enum hrtimer_restart
@@ -1692,6 +1705,18 @@ static void mac80211_hwsim_unassign_vif_chanctx(struct ieee80211_hw *hw,
hwsim_check_chanctx_magic(ctx);
}
+static void mac80211_hwsim_channel_switch_beacon(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ struct cfg80211_chan_def *chandef)
+{
+ struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
+
+ vp->csa_bcn_cnt = 0;
+ wiphy_debug(hw->wiphy, "%s (freq=%d(%d - %d)/%s)\n", __func__,
+ chandef->chan->center_freq, chandef->center_freq1,
+ chandef->center_freq2, hwsim_chanwidths[chandef->width]);
+}
+
static struct ieee80211_ops mac80211_hwsim_ops =
{
.tx = mac80211_hwsim_tx,
@@ -1716,6 +1741,7 @@ static struct ieee80211_ops mac80211_hwsim_ops =
.flush = mac80211_hwsim_flush,
.get_tsf = mac80211_hwsim_get_tsf,
.set_tsf = mac80211_hwsim_set_tsf,
+ .channel_switch_beacon = mac80211_hwsim_channel_switch_beacon,
};
@@ -2359,7 +2385,9 @@ static int __init init_mac80211_hwsim(void)
hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
- WIPHY_FLAG_AP_UAPSD;
+ WIPHY_FLAG_AP_UAPSD |
+ WIPHY_FLAG_HAS_CHANNEL_SWITCH;
+
hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR;
/* ask mac80211 to reserve space for magic */
--
1.8.2
reply other threads:[~2013-11-22 8:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1385110607-17962-1-git-send-email-karl.beldan@gmail.com \
--to=karl.beldan@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=karl.beldan@rivierawaves.com \
--cc=linux-wireless@vger.kernel.org \
--cc=siwu@hrz.tu-chemnitz.de \
/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;
as well as URLs for NNTP newsgroup(s).