From 17b4c508664c05647857a98da173bcdf612859c7 Mon Sep 17 00:00:00 2001 From: Sergei Makarenkov Date: Sat, 17 Dec 2016 16:44:09 +0300 Subject: [PATCH] Unmask all available channels --- os_dep/linux/wifi_regd.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index a2be906..4bd84a8 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -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); } } }