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>
This commit is contained in:

committed by
Johannes Berg

parent
e9a21949b7
commit
6d027bcc8a
@@ -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);
|
||||
|
Reference in New Issue
Block a user