From 6842e8f33ac4ef082acdbf5bca3591db0cac4062 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Tue, 23 Feb 2016 16:30:32 -0800 Subject: [PATCH] qcacld-3.0: Fix set-band operation Currently, in regulatory callback, we do not update channels that are out-of-band. For example, if the current band is set to 2.4 GHz, we do not update channels of 5 GHZ band. Now, if the band gets changed, the channel list goes wrong. Fix this issue by updating all the channels and then calling wlan_hdd_cfg80211_update_band to update wiphy for the current in-band channels. Change-Id: If6d6fee01c7a7d6b2aa0f7d3acb862decce0819e CRs-Fixed: 978660 --- core/hdd/src/wlan_hdd_cfg80211.c | 12 +----------- core/hdd/src/wlan_hdd_cfg80211.h | 2 ++ core/hdd/src/wlan_hdd_regulatory.c | 13 ++----------- core/hdd/src/wlan_hdd_wext.c | 1 - 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2d6ef17ac33b..d6002c55bda6 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -5441,19 +5441,9 @@ int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand) continue; } - if (CHANNEL_STATE_DISABLE == channelEnabledState || - CHANNEL_STATE_INVALID == channelEnabledState) { - band->channels[j].flags |= - IEEE80211_CHAN_DISABLED; - } else if (CHANNEL_STATE_DFS == channelEnabledState) { + if (CHANNEL_STATE_DISABLE != channelEnabledState) band->channels[j].flags &= ~IEEE80211_CHAN_DISABLED; - band->channels[j].flags |= IEEE80211_CHAN_RADAR; - } else { - band->channels[j].flags &= - ~(IEEE80211_CHAN_DISABLED | - IEEE80211_CHAN_RADAR); - } } } return 0; diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 3b0cdbf2855e..9ba52bb31790 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -2433,4 +2433,6 @@ int wlan_hdd_disable_dfs_chan_scan(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, uint32_t no_dfs_flag); +int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, + eCsrBand eBand); #endif diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 5ddb11b40e8a..67ecde1c18f3 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -360,14 +360,6 @@ static void hdd_process_regulatory_data(hdd_context_t *hdd_ctx, for (band_num = 0; band_num < IEEE80211_NUM_BANDS; band_num++) { - if (band_num == IEEE80211_BAND_2GHZ && - band_capability == eCSR_BAND_5G) - continue; - - else if (band_num == IEEE80211_BAND_5GHZ && - band_capability == eCSR_BAND_24) - continue; - if (wiphy->bands[band_num] == NULL) continue; @@ -415,6 +407,8 @@ static void hdd_process_regulatory_data(hdd_context_t *hdd_ctx, cds_chan = &(reg_channels[CHAN_ENUM_144]); cds_chan->state = CHANNEL_STATE_DISABLE; } + + wlan_hdd_cfg80211_update_band(wiphy, band_capability); } @@ -589,7 +583,6 @@ void hdd_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) { hdd_context_t *hdd_ctx = wiphy_priv(wiphy); - eCsrBand band_capability = eCSR_BAND_ALL; bool vht80_allowed; bool reset = false; uint8_t dfs_reg; @@ -611,8 +604,6 @@ void hdd_reg_notifier(struct wiphy *wiphy, return; } - sme_get_freq_band(hdd_ctx->hHal, &band_capability); - /* first check if this callback is in response to the driver callback */ switch (request->initiator) { diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 0caea59c2a0e..4215f68cc27a 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -92,7 +92,6 @@ #define HDD_SET_MCBC_FILTERS_TO_FW 1 #define HDD_DELETE_MCBC_FILTERS_FROM_FW 0 -extern int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand); static int ioctl_debug; module_param(ioctl_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);