From 832d026d31d3f40fb914c69a75e1403f95a7d63d Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Thu, 3 Sep 2015 12:08:28 -0700 Subject: qcacld-2.0: Remove the DSRC channels from channel list Remove the DSRC channels returned to userspace for channel list queried. The query is typically for scan or SAP candidate channels; DSRC channels are not required in them. Change-Id: Ia22dee7e165cd20d78c8d888be91132a0e4ddf9b CRs-Fixed: 902018 --- CORE/HDD/src/wlan_hdd_cfg80211.c | 11 ++++++++++- CORE/VOSS/inc/vos_nvitem.h | 1 + CORE/VOSS/src/vos_nvitem.c | 16 ++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 1d6dd45cfca8..f3a6014fce26 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -3334,7 +3334,16 @@ static int __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, num_channels = VOS_MIN(num_channels, maxChannels); - num_chan_new = num_channels; + /* remove the DSRC channels from the list */ + num_chan_new = 0; + for (i = 0; i < num_channels; i++) { + if (!vos_is_dsrc_channel(chan_list[i])) { + chan_list[num_chan_new] = chan_list[i]; + num_chan_new++; + } + } + + num_channels = num_chan_new; /* remove the indoor only channels if iface is SAP */ if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) || diff --git a/CORE/VOSS/inc/vos_nvitem.h b/CORE/VOSS/inc/vos_nvitem.h index cbb202b8b08c..6febbff521cb 100644 --- a/CORE/VOSS/inc/vos_nvitem.h +++ b/CORE/VOSS/inc/vos_nvitem.h @@ -253,4 +253,5 @@ VOS_STATUS vos_nv_set_dfs_region(uint8_t dfs_region); VOS_STATUS vos_init_wiphy_from_nv_bin(void); const char * voss_DomainIdtoString(const v_U8_t domainIdCurrent); VOS_STATUS vos_init_wiphy_from_eeprom(void); +bool vos_is_dsrc_channel(uint16_t); #endif // __VOS_NVITEM_H diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c index 2e06852cef14..d158884eda98 100644 --- a/CORE/VOSS/src/vos_nvitem.c +++ b/CORE/VOSS/src/vos_nvitem.c @@ -1160,8 +1160,16 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain, #ifdef FEATURE_STATICALLY_ADD_11P_CHANNELS #define DEFAULT_11P_POWER (30) -// Returns whether a channel is valid for DSRC. -static int is_dsrc_channel(v_U16_t center_freq) +#endif + +/* vos_is_dsrc_channel() - is the channel DSRC + * + * @center_freq: center freq of the channel + * + * Return: true if dsrc channel + * false otherwise + */ +bool vos_is_dsrc_channel(uint16_t center_freq) { switch (center_freq) { case 5852: @@ -1178,7 +1186,7 @@ static int is_dsrc_channel(v_U16_t center_freq) } return 0; } -#endif + /* create_linux_regulatory_entry to populate internal structures from wiphy */ static int create_linux_regulatory_entry(struct wiphy *wiphy, @@ -1319,7 +1327,7 @@ static int create_linux_regulatory_entry(struct wiphy *wiphy, } #ifdef FEATURE_STATICALLY_ADD_11P_CHANNELS - if (is_dsrc_channel(wiphy->bands[i]->channels[j].center_freq)) + if (vos_is_dsrc_channel(wiphy->bands[i]->channels[j].center_freq)) { pnvEFSTable->halnv.tables.regDomains[temp_reg_domain]. channels[k].enabled = NV_CHANNEL_ENABLE; -- cgit v1.2.3