mostly revert commit r22396
[openwrt/staging/chunkeey.git] / package / mac80211 / patches / 520-mac80211_offchannel_conf.patch
1 --- a/include/net/mac80211.h
2 +++ b/include/net/mac80211.h
3 @@ -625,11 +625,14 @@ struct ieee80211_rx_status {
4 * may turn the device off as much as possible. Typically, this flag will
5 * be set when an interface is set UP but not associated or scanning, but
6 * it can also be unset in that case when monitor interfaces are active.
7 + * @IEEE80211_CONF_OFFCHANNEL: The device is currently not on its main
8 + * operating channel.
9 */
10 enum ieee80211_conf_flags {
11 IEEE80211_CONF_MONITOR = (1<<0),
12 IEEE80211_CONF_PS = (1<<1),
13 IEEE80211_CONF_IDLE = (1<<2),
14 + IEEE80211_CONF_OFFCHANNEL = (1<<3),
15 };
16
17
18 --- a/net/mac80211/main.c
19 +++ b/net/mac80211/main.c
20 @@ -111,12 +111,15 @@ int ieee80211_hw_config(struct ieee80211
21 if (scan_chan) {
22 chan = scan_chan;
23 channel_type = NL80211_CHAN_NO_HT;
24 + local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL;
25 } else if (local->tmp_channel) {
26 chan = scan_chan = local->tmp_channel;
27 channel_type = local->tmp_channel_type;
28 + local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL;
29 } else {
30 chan = local->oper_channel;
31 channel_type = local->_oper_channel_type;
32 + local->hw.conf.flags &= ~IEEE80211_CONF_OFFCHANNEL;
33 }
34
35 if (chan != local->hw.conf.channel ||