From 63f64ddbaf4be80d75c612527cb3320b75242f93 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Thu, 28 Apr 2016 15:13:35 -0700 Subject: [PATCH] qcacld-3.0: Skip DSRC channels in TDLS operation qcacld-2.0 to qcacld-3.0 propagation We do not support TDLS on DSRC AND DFS channels so skip these channels in the TDLS frames. Change-Id: I3ad523ab21d1383df189d3856f6e0759b1a2bb6a CRs-Fixed: 975657 --- core/cds/src/cds_reg_service.c | 33 -------------------------- core/mac/src/pe/lim/lim_process_tdls.c | 24 ++++++++++--------- core/sme/src/common/sme_api.c | 23 ++++++++---------- 3 files changed, 23 insertions(+), 57 deletions(-) diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c index b2bba993b058..b15f99fef296 100644 --- a/core/cds/src/cds_reg_service.c +++ b/core/cds/src/cds_reg_service.c @@ -645,39 +645,6 @@ bool cds_is_dsrc_channel(uint16_t center_freq) return false; } -/** - * cds_skip_dfs_and_2g() - skip dfs and 2g band channels - * @rf_channel: input channel enum to know, whether to skip or add the channel - * - * Return: true or false - */ -uint8_t cds_skip_dfs_and_2g(uint32_t rf_channel) -{ - uint32_t channel_loop; - enum channel_enum channel = INVALID_CHANNEL; - uint8_t ret = false; - - for (channel_loop = CHAN_ENUM_36; - channel_loop <= CHAN_ENUM_184; channel_loop++) { - if (CDS_CHANNEL_NUM(channel_loop) == rf_channel) { - channel = (enum channel_enum)channel_loop; - break; - } - } - - if (INVALID_CHANNEL == channel) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "Invalid channel %d", rf_channel); - ret = true; - goto exit_ok; - } - - if (CHANNEL_STATE_DFS == CDS_CHANNEL_STATE(channel)) - ret = true; -exit_ok: - return ret; -} - /** * cds_set_reg_domain() - set regulatory domain * @client_ctxt: client context diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index f39b1fa0f409..5eece14d2aad 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -76,6 +76,7 @@ #include "dph_hash_table.h" #include "wma_types.h" #include "cds_regdomain.h" +#include "cds_utils.h" /* define NO_PAD_TDLS_MIN_8023_SIZE to NOT padding: See CR#447630 There was IOT issue with cisco 1252 open mode, where it pads @@ -2674,21 +2675,22 @@ void populate_dot11f_tdls_offchannel_params(tpAniSirGlobal pMac, /* validating the channel list for DFS and 2G channels */ for (i = 0U; i < numChans; i++) { - if (band == eCSR_BAND_24) { - if (CHANNEL_STATE_DFS == - cds_get_channel_state(validChan[i])) { - lim_log(pMac, LOG1, - FL("skipping DFS channel %d from the valid channel list"), - validChan[i]); - continue; - } - } else if ((NSS_2x2_MODE == nss_5g) && - (NSS_1x1_MODE == nss_2g) && - (true == cds_skip_dfs_and_2g(validChan[i]))) { + if ((band == eCSR_BAND_5G) && + (NSS_2x2_MODE == nss_5g) && + (NSS_1x1_MODE == nss_2g) && + (true == CDS_IS_DFS_CH(validChan[i]))) { lim_log(pMac, LOG1, FL("skipping channel %d, nss_5g: %d, nss_2g: %d"), validChan[i], nss_5g, nss_2g); continue; + } else { + if (true == cds_is_dsrc_channel( + cds_chan_to_freq(validChan[i]))) { + lim_log(pMac, LOG1, + FL("skipping channel %d from the valid channel list"), + validChan[i]); + continue; + } } if (valid_count >= ARRAY_SIZE(suppChannels->bands)) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 4495067bd178..362cccf7ce02 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -10126,19 +10126,16 @@ QDF_STATUS sme_update_tdls_peer_state(tHalHandle hHal, num = 0; for (i = 0; i < peerStateParams->peerCap.peerChanLen; i++) { chanId = peerStateParams->peerCap.peerChan[i]; - if (!csr_roam_is_channel_valid(pMac, chanId)) - continue; - peer_cap->peerChan[num].chanId = chanId; - peer_cap->peerChan[num].pwr = - csr_get_cfg_max_tx_power(pMac, chanId); - - if (cds_get_channel_state(chanId) == CHANNEL_STATE_DFS) - peer_cap->peerChan[num].dfsSet = - true; - else - peer_cap->peerChan[num].dfsSet = - false; - num++; + if (csr_roam_is_channel_valid(pMac, chanId) && + !(cds_get_channel_state(chanId) == + CHANNEL_STATE_DFS) && + !cds_is_dsrc_channel(cds_chan_to_freq(chanId))) { + peer_cap->peerChan[num].chanId = chanId; + peer_cap->peerChan[num].pwr = + csr_get_cfg_max_tx_power(pMac, chanId); + peer_cap->peerChan[num].dfsSet = false; + num++; + } } peer_cap->peerChanLen = num; peer_cap->peerOperClassLen =