aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-10-08 02:48:37 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-09 05:30:08 -0400
commit6d027bcc8a4e2518ae825b0ff3dd069ab1abfe96 (patch)
tree798d3bfaf90f5f653905da6cb3be864f2a7a0443 /net/mac80211/cfg.c
parente9a21949b79414dda42a017855b288901c07e613 (diff)
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.c11
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,
3104{ 3104{
3105 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 3105 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
3106 struct ieee80211_local *local = sdata->local; 3106 struct ieee80211_local *local = sdata->local;
3107 struct ieee80211_channel_switch ch_switch;
3107 struct ieee80211_chanctx_conf *conf; 3108 struct ieee80211_chanctx_conf *conf;
3108 struct ieee80211_chanctx *chanctx; 3109 struct ieee80211_chanctx *chanctx;
3109 int err, changed = 0; 3110 int err, changed = 0;
@@ -3139,6 +3140,10 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
3139 goto out; 3140 goto out;
3140 } 3141 }
3141 3142
3143 err = drv_pre_channel_switch(sdata, &ch_switch);
3144 if (err)
3145 goto out;
3146
3142 err = ieee80211_vif_reserve_chanctx(sdata, &params->chandef, 3147 err = ieee80211_vif_reserve_chanctx(sdata, &params->chandef,
3143 chanctx->mode, 3148 chanctx->mode,
3144 params->radar_required); 3149 params->radar_required);
@@ -3152,6 +3157,12 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
3152 goto out; 3157 goto out;
3153 } 3158 }
3154 3159
3160 ch_switch.timestamp = 0;
3161 ch_switch.device_timestamp = 0;
3162 ch_switch.block_tx = params->block_tx;
3163 ch_switch.chandef = params->chandef;
3164 ch_switch.count = params->count;
3165
3155 err = ieee80211_set_csa_beacon(sdata, params, &changed); 3166 err = ieee80211_set_csa_beacon(sdata, params, &changed);
3156 if (err) { 3167 if (err) {
3157 ieee80211_vif_unreserve_chanctx(sdata); 3168 ieee80211_vif_unreserve_chanctx(sdata);