Commit 45521245 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

mac80211: inform drivers about the off-channel status on channel changes

For some drivers it can be useful to know whether the channel they're
supposed to switch to is going to be used for short off-channel work or
scanning, or whether the hardware is expected to stay on it for a while
longer. This is important for various kinds of calibration work, which
takes longer to complete and should keep some persistent state, even if
the channel temporarily changes.
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a0daa0e7
...@@ -625,11 +625,14 @@ struct ieee80211_rx_status { ...@@ -625,11 +625,14 @@ struct ieee80211_rx_status {
* may turn the device off as much as possible. Typically, this flag will * may turn the device off as much as possible. Typically, this flag will
* be set when an interface is set UP but not associated or scanning, but * be set when an interface is set UP but not associated or scanning, but
* it can also be unset in that case when monitor interfaces are active. * it can also be unset in that case when monitor interfaces are active.
* @IEEE80211_CONF_OFFCHANNEL: The device is currently not on its main
* operating channel.
*/ */
enum ieee80211_conf_flags { enum ieee80211_conf_flags {
IEEE80211_CONF_MONITOR = (1<<0), IEEE80211_CONF_MONITOR = (1<<0),
IEEE80211_CONF_PS = (1<<1), IEEE80211_CONF_PS = (1<<1),
IEEE80211_CONF_IDLE = (1<<2), IEEE80211_CONF_IDLE = (1<<2),
IEEE80211_CONF_OFFCHANNEL = (1<<3),
}; };
......
...@@ -107,12 +107,15 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) ...@@ -107,12 +107,15 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
if (scan_chan) { if (scan_chan) {
chan = scan_chan; chan = scan_chan;
channel_type = NL80211_CHAN_NO_HT; channel_type = NL80211_CHAN_NO_HT;
local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL;
} else if (local->tmp_channel) { } else if (local->tmp_channel) {
chan = scan_chan = local->tmp_channel; chan = scan_chan = local->tmp_channel;
channel_type = local->tmp_channel_type; channel_type = local->tmp_channel_type;
local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL;
} else { } else {
chan = local->oper_channel; chan = local->oper_channel;
channel_type = local->_oper_channel_type; channel_type = local->_oper_channel_type;
local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL;
} }
if (chan != local->hw.conf.channel || if (chan != local->hw.conf.channel ||
......
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