qcacld-2.0: Skip DSRC channels in TDLS operation

We do not support TDLS on DSRC so do not encode DSRC channels
in TDLS frames.

Change-Id: I3ad523ab21d1383df189d3856f6e0759b1a2bb6a
CRs-Fixed: 975657
This commit is contained in:
Kabilan Kannan 2016-02-24 02:33:44 -08:00 committed by syphyr
parent e4b1f200c6
commit 5fa1d7ee51
5 changed files with 42 additions and 19 deletions

View File

@ -2652,19 +2652,22 @@ void PopulateDot11fTdlsOffchannelParams(tpAniSirGlobal pMac,
/* validating the channel list for DFS and 2G channels */
for (i = 0U; i < numChans; i++) {
if (band == eCSR_BAND_24) {
if (NV_CHANNEL_DFS == vos_nv_getChannelEnabledState(validChan[i])) {
if ((band == eCSR_BAND_5G) && (NSS_2x2_MODE == nss_5g) &&
(NSS_1x1_MODE == nss_2g) &&
(true == vos_nv_skip_dsrc_dfs_2g(validChan[i],
NV_CHANNEL_SKIP_2G))) {
limLog(pMac, LOG1,
FL("skipping DFS channel %d from the valid channel list"),
FL("skipping channel %d, nss_5g: %d, nss_2g: %d"),
validChan[i], nss_5g, nss_2g);
continue;
} else {
if (true == vos_nv_skip_dsrc_dfs_2g(validChan[i],
NV_CHANNEL_SKIP_DSRC)) {
limLog(pMac, LOG1,
FL("skipping channel %d from the valid channel list"),
validChan[i]);
continue;
}
} else if ((NSS_2x2_MODE == nss_5g) && (NSS_1x1_MODE == nss_2g) &&
(true == vos_nv_skip_dfs_and_2g(validChan[i]))){
limLog(pMac, LOG1,
FL("skipping channel %d, nss_5g: %d, nss_2g: %d"),
validChan[i], nss_5g, nss_2g);
continue;
}
if (valid_count >=

View File

@ -12015,15 +12015,16 @@ eHalStatus sme_UpdateTdlsPeerState(tHalHandle hHal,
csrGetCfgMaxTxPower(pMac, chanId);
if (vos_nv_getChannelEnabledState(chanId) == NV_CHANNEL_DFS)
{
pTdlsPeerStateParams->peerCap.peerChan[num].dfsSet =
VOS_TRUE;
}
continue;
else
{
pTdlsPeerStateParams->peerCap.peerChan[num].dfsSet =
VOS_FALSE;
}
if (vos_nv_skip_dsrc_dfs_2g(chanId, NV_CHANNEL_SKIP_DSRC))
continue;
num++;
}
}

View File

@ -255,7 +255,7 @@ VOS_STATUS vos_nv_setRegDomain(void * clientCtxt, v_REGDOMAIN_t regId,
-------------------------------------------------------------------------*/
eNVChannelEnabledType vos_nv_getChannelEnabledState(v_U32_t rfChannel);
uint8_t vos_nv_skip_dfs_and_2g(uint32_t rf_channel);
uint8_t vos_nv_skip_dsrc_dfs_2g(uint32_t rf_channel, int32_t skip_group);
VOS_STATUS vos_nv_get_dfs_region(uint8_t *dfs_region);
VOS_STATUS vos_nv_set_dfs_region(uint8_t dfs_region);

View File

@ -905,19 +905,36 @@ VOS_STATUS vos_nv_readDefaultCountryTable( uNvTables *tableData )
}
/**
* vos_nv_skip_dfs_and_2g() - skip dfs and 2g band channels
* vos_nv_skip_dsrc_dfs_2g() - skip dsrc, dfs and 2g band channels
* @rf_channel: input channel enum to know, whether to skip or add the channel
* @skip_group: group to skip
*
* Return: true or false
*/
uint8_t vos_nv_skip_dfs_and_2g(uint32_t rf_channel)
uint8_t vos_nv_skip_dsrc_dfs_2g(uint32_t rf_channel, int32_t skip_group)
{
uint32_t channel_loop;
eRfChannels channel_enum = INVALID_RF_CHANNEL;
uint8_t ret = false;
int32_t start_channel, end_channel;
for (channel_loop = RF_CHAN_36;
channel_loop <= RF_CHAN_184; channel_loop++) {
switch (skip_group){
case NV_CHANNEL_SKIP_DSRC:
start_channel = RF_CHAN_1;
end_channel = RF_CHAN_165;
break;
case NV_CHANNEL_SKIP_2G:
start_channel = RF_CHAN_36;
end_channel = RF_CHAN_165;
break;
default:
start_channel = RF_CHAN_1;
end_channel = RF_CHAN_184;
break;
}
for (channel_loop = start_channel;
channel_loop <= end_channel; channel_loop++) {
if (rfChannels[channel_loop].channelNum == rf_channel) {
channel_enum = (eRfChannels)channel_loop;
break;

View File

@ -398,7 +398,9 @@ enum
NV_CHANNEL_DISABLE,
NV_CHANNEL_ENABLE,
NV_CHANNEL_DFS,
NV_CHANNEL_INVALID
NV_CHANNEL_INVALID,
NV_CHANNEL_SKIP_DSRC,
NV_CHANNEL_SKIP_2G
};
typedef uint8 eNVChannelEnabledType;