qcacld-3.0: Update bss count based on channel offset only for same band
In sap_update_rssi_bsscount, bss count for channels is incremented based on offset only and does not consider if channel on which scan result is received and the offset channel belong to same band. This could result in incorrect increment of bss count for some channels when channels from both bands are present. Fix is to increment bss count based on channel offset only if both channels belong to same band and also choose channel with lower bss count among the channels having least weight. Change-Id: Icee978fc40047782c79fe36cba29e3feed3c90aa CRs-Fixed: 2191324
This commit is contained in:

committed by
snandini

parent
a842b94f04
commit
273889e7cc
@@ -1035,6 +1035,24 @@ uint32_t sap_weight_channel_status(struct sap_context *sap_ctx,
|
|||||||
sap_weight_channel_txpwr_tput(sap_ctx, channel_stat);
|
sap_weight_channel_txpwr_tput(sap_ctx, channel_stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sap_check_channels_same_band() - Check if two channels belong to same band
|
||||||
|
* @ch_num1: channel number
|
||||||
|
* @ch_num2: channel number
|
||||||
|
*
|
||||||
|
* Return: true if both channels belong to same band else false
|
||||||
|
*/
|
||||||
|
static bool sap_check_channels_same_band(uint16_t ch_num1, uint16_t ch_num2)
|
||||||
|
{
|
||||||
|
if ((ch_num1 <= SIR_11B_CHANNEL_END &&
|
||||||
|
ch_num2 <= SIR_11B_CHANNEL_END) ||
|
||||||
|
(ch_num1 >= SIR_11A_CHANNEL_BEGIN &&
|
||||||
|
ch_num2 >= SIR_11A_CHANNEL_BEGIN))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sap_update_rssi_bsscount() - updates bss count and rssi effect.
|
* sap_update_rssi_bsscount() - updates bss count and rssi effect.
|
||||||
*
|
*
|
||||||
@@ -1061,6 +1079,9 @@ static void sap_update_rssi_bsscount(tSapSpectChInfo *pSpectCh, int32_t offset,
|
|||||||
if (pExtSpectCh != NULL &&
|
if (pExtSpectCh != NULL &&
|
||||||
pExtSpectCh >= spectch_start &&
|
pExtSpectCh >= spectch_start &&
|
||||||
pExtSpectCh < spectch_end) {
|
pExtSpectCh < spectch_end) {
|
||||||
|
if (!sap_check_channels_same_band(pSpectCh->chNum,
|
||||||
|
pExtSpectCh->chNum))
|
||||||
|
return;
|
||||||
++pExtSpectCh->bssCount;
|
++pExtSpectCh->bssCount;
|
||||||
switch (offset) {
|
switch (offset) {
|
||||||
case -1:
|
case -1:
|
||||||
@@ -1749,6 +1770,11 @@ static void sap_sort_chl_weight(tSapChSelSpectInfo *pSpectInfoParams)
|
|||||||
if (pSpectCh[j].weight <
|
if (pSpectCh[j].weight <
|
||||||
pSpectCh[minWeightIndex].weight) {
|
pSpectCh[minWeightIndex].weight) {
|
||||||
minWeightIndex = j;
|
minWeightIndex = j;
|
||||||
|
} else if (pSpectCh[j].weight ==
|
||||||
|
pSpectCh[minWeightIndex].weight) {
|
||||||
|
if (pSpectCh[j].bssCount <
|
||||||
|
pSpectCh[minWeightIndex].bssCount)
|
||||||
|
minWeightIndex = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (minWeightIndex != i) {
|
if (minWeightIndex != i) {
|
||||||
|
Reference in New Issue
Block a user