qcacld-3.0: Change INDOOR channel check to PASSIVE channels

INDOOR channels may or may not be enabled for SAP. If
INDOOR channels are not enabled for SAP, they are converted
to PASSIVE channels. So remove PASSIVE channels from SAP
channel list. Also remove any function not getting called
any more.

CRs-Fixed: 1058893
Change-Id: I45da966ee8c4c0005a5ca185cb121bdbc8989f48
This commit is contained in:
Amar Singhal 2016-08-23 15:31:45 -07:00 committed by Prakash Dhavali
parent 7c1a62f23f
commit ea10a872ae
2 changed files with 12 additions and 15 deletions

View File

@ -34,10 +34,13 @@
* HDD Regulatory prototype implementation
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
#define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR
#define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR
#endif
void hdd_reset_global_reg_params(void);
int hdd_regulatory_init(hdd_context_t *hdd_ctx, struct wiphy *wiphy);
void hdd_program_country_code(hdd_context_t *hdd_ctx);
#endif

View File

@ -32,6 +32,7 @@
#define HDD_DISALLOW_LEGACY_HDDLOG 1
#include "wlan_hdd_ext_scan.h"
#include "wlan_hdd_regulatory.h"
#include "cds_utils.h"
#include "cds_sched.h"
@ -2440,16 +2441,15 @@ static void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list,
}
/**
* hdd_remove_indoor_channels () - remove indoor channels
* hdd_remove_passive_channels () - remove passive channels
* @wiphy: Pointer to wireless phy
* @chan_list: channel list
* @num_channels: number of channels
*
* Return: none
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list,
uint8_t *num_channels)
void hdd_remove_passive_channels(struct wiphy *wiphy, uint32_t *chan_list,
uint8_t *num_channels)
{
uint8_t num_chan_temp = 0;
int i, j, k;
@ -2462,7 +2462,7 @@ static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list,
if ((chan_list[i] ==
wiphy->bands[j]->channels[k].center_freq)
&& (!(wiphy->bands[j]->channels[k].flags &
IEEE80211_CHAN_INDOOR_ONLY))
IEEE80211_CHAN_PASSIVE_SCAN))
) {
chan_list[num_chan_temp] = chan_list[i];
num_chan_temp++;
@ -2472,13 +2472,6 @@ static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list,
*num_channels = num_chan_temp;
}
#else
static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list,
uint8_t *num_channels)
{
*num_channels = 0;
}
#endif
/**
* __wlan_hdd_cfg80211_extscan_get_valid_channels () - get valid channels
@ -2573,7 +2566,8 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy,
if ((QDF_SAP_MODE == pAdapter->device_mode) ||
!strncmp(hdd_get_fwpath(), "ap", 2))
hdd_remove_indoor_channels(wiphy, chan_list, &num_channels);
hdd_remove_passive_channels(wiphy, chan_list,
&num_channels);
hdd_notice("Number of channels: %d", num_channels);
for (i = 0; i < num_channels; i++)