Commit 7acec26c authored by Jorge Ramirez-Ortiz's avatar Jorge Ramirez-Ortiz Committed by Johannes Berg

cfg80211: wext does not need to set monitor channel in managed mode

There is not a valid reason to attempt setting the monitor channel
while in managed mode. Since this code path only deals with this mode,
remove the code block.

Johannes: I'll note that the comment indicated it was for backward
compatibility, but the code wasn't functional since switching the
monitor channel isn't supported (any more?) when in managed mode, as
that mode owns the channel configuration. Additionally, since monitor
can't be done on a managed mode interface, this would only have had
any effect to start with if a separate monitor interface is present,
in which case it's better to change the channel through that anyway,
if even possible.
Signed-off-by: default avatarJorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent bd2522b1
...@@ -105,30 +105,7 @@ int cfg80211_mgd_wext_siwfreq(struct net_device *dev, ...@@ -105,30 +105,7 @@ int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
goto out; goto out;
} }
wdev->wext.connect.channel = chan; wdev->wext.connect.channel = chan;
/*
* SSID is not set, we just want to switch monitor channel,
* this is really just backward compatibility, if the SSID
* is set then we use the channel to select the BSS to use
* to connect to instead. If we were connected on another
* channel we disconnected above and reconnect below.
*/
if (chan && !wdev->wext.connect.ssid_len) {
struct cfg80211_chan_def chandef = {
.width = NL80211_CHAN_WIDTH_20_NOHT,
.center_freq1 = freq,
};
chandef.chan = ieee80211_get_channel(&rdev->wiphy, freq);
if (chandef.chan)
err = cfg80211_set_monitor_channel(rdev, &chandef);
else
err = -EINVAL;
goto out;
}
err = cfg80211_mgd_wext_connect(rdev, wdev); err = cfg80211_mgd_wext_connect(rdev, wdev);
out: out:
wdev_unlock(wdev); wdev_unlock(wdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment