diff options
author | Luciano Coelho <luciano.coelho@intel.com> | 2014-10-08 09:48:37 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-10-09 11:30:08 +0200 |
commit | 6d027bcc8a4e2518ae825b0ff3dd069ab1abfe96 (patch) | |
tree | 798d3bfaf90f5f653905da6cb3be864f2a7a0443 /net/mac80211/cfg.c | |
parent | e9a21949b79414dda42a017855b288901c07e613 (diff) | |
download | lwn-6d027bcc8a4e2518ae825b0ff3dd069ab1abfe96.tar.gz lwn-6d027bcc8a4e2518ae825b0ff3dd069ab1abfe96.zip |
mac80211: add pre_channel_switch driver operation
Some drivers may need to prepare for a channel switch also when it is
initiated from the remote side (eg. station, P2P client). To make
this possible, add a generic callback that can be called for all
interface types.
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 3a04f2edd3c3..647a2f6eb7dc 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3104,6 +3104,7 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = sdata->local; + struct ieee80211_channel_switch ch_switch; struct ieee80211_chanctx_conf *conf; struct ieee80211_chanctx *chanctx; int err, changed = 0; @@ -3139,6 +3140,10 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, goto out; } + err = drv_pre_channel_switch(sdata, &ch_switch); + if (err) + goto out; + err = ieee80211_vif_reserve_chanctx(sdata, ¶ms->chandef, chanctx->mode, params->radar_required); @@ -3152,6 +3157,12 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, goto out; } + ch_switch.timestamp = 0; + ch_switch.device_timestamp = 0; + ch_switch.block_tx = params->block_tx; + ch_switch.chandef = params->chandef; + ch_switch.count = params->count; + err = ieee80211_set_csa_beacon(sdata, params, &changed); if (err) { ieee80211_vif_unreserve_chanctx(sdata); |