1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-29 08:27:41 +00:00

Unmask all available channels

This commit is contained in:
Sergei Makarenkov 2016-12-17 16:44:09 +03:00
parent 4db8fd36a4
commit 17b4c50866

View File

@ -305,16 +305,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
{
#if 1 // by channel plan
_adapter *padapter = wiphy_to_adapter(wiphy);
u8 channel_plan = padapter->mlmepriv.ChannelPlan;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
RT_CHANNEL_INFO *channel_set = pmlmeext->channel_set;
u8 max_chan_nums = pmlmeext->max_chan_nums;
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
unsigned int i, j;
u16 channel;
u32 freq;
// all channels disable
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
@ -325,29 +320,7 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
ch = &sband->channels[j];
if (ch)
ch->flags = IEEE80211_CHAN_DISABLED;
}
}
}
// channels apply by channel plans.
for (i = 0; i < max_chan_nums; i++) {
channel = channel_set[i].ChannelNum;
freq = rtw_ch2freq(channel);
ch = ieee80211_get_channel(wiphy, freq);
if (ch) {
if (channel_set[i].ScanType == SCAN_PASSIVE) {
#if defined(CONFIG_DFS_MASTER) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
ch->flags = 0;
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
ch->flags = (IEEE80211_CHAN_NO_IBSS|IEEE80211_CHAN_PASSIVE_SCAN);
#else
ch->flags = IEEE80211_CHAN_NO_IR;
#endif
}
else {
ch->flags = 0;
ch->flags &= ~(IEEE80211_CHAN_DISABLED|IEEE80211_CHAN_NO_HT40PLUS|IEEE80211_CHAN_NO_HT40MINUS);
}
}
}