qcacld-3.0: Replace channel ID with channel frequency
Replace channel ID(channelId) with channel frequency(
chan_freq) in struct bss_description.
Add code for chan_freq's value population in the same
struct wherever channelId's value population occures.
Remove a few camel cases detected by checkpatch.
Change-Id: I84d193b67f642df310997865ec6e1b62e3518f98
CRs-Fixed: 2488826
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index ec5980a..18a0118 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -660,6 +660,7 @@
int8_t sinr;
/* channelId what peer sent in beacon/probersp. */
uint8_t channelId;
+ uint32_t chan_freq;
/* channelId on which we are parked at. */
/* used only in scan case. */
uint8_t channelIdSelf;
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index 7d615c7..8d51326 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -2170,8 +2170,15 @@
bss_desc_ptr->scansystimensec = qdf_get_monotonic_boottime_ns();
if (parsed_frm_ptr->dsParamsPresent) {
bss_desc_ptr->channelId = parsed_frm_ptr->channelNumber;
+ bss_desc_ptr->chan_freq =
+ wlan_reg_chan_to_freq(mac->pdev,
+ parsed_frm_ptr->channelNumber);
} else if (parsed_frm_ptr->HTInfo.present) {
bss_desc_ptr->channelId = parsed_frm_ptr->HTInfo.primaryChannel;
+ bss_desc_ptr->chan_freq =
+ wlan_reg_chan_to_freq(mac->pdev,
+ parsed_frm_ptr->HTInfo.
+ primaryChannel);
} else {
/*
* If DS Params or HTIE is not present in the probe resp or
@@ -2179,6 +2186,7 @@
* to fill the channel in the BSS descriptor.*/
bss_desc_ptr->channelId =
cds_freq_to_chan(roam_synch_ind_ptr->chan_freq);
+ bss_desc_ptr->chan_freq = roam_synch_ind_ptr->chan_freq;
}
bss_desc_ptr->channelIdSelf = bss_desc_ptr->channelId;
diff --git a/core/mac/src/pe/lim/lim_scan_result_utils.c b/core/mac/src/pe/lim/lim_scan_result_utils.c
index 8b6480c..ac7e768 100644
--- a/core/mac/src/pe/lim/lim_scan_result_utils.c
+++ b/core/mac/src/pe/lim/lim_scan_result_utils.c
@@ -69,7 +69,7 @@
uint8_t *pBody;
uint32_t ieLen = 0;
tpSirMacMgmtHdr pHdr;
- uint8_t channelNum;
+ uint8_t channel_num;
uint8_t rxChannel;
uint8_t rfBand = 0;
@@ -132,15 +132,16 @@
* This fix will work for 5Ghz 11n devices, but for 11a devices, we have to rely on RXP routing flag to get the correct channel.
* So The problem of incorrect channel reporting in 5Ghz will still remain for 11a devices.
*/
- pBssDescr->channelId = lim_get_channel_from_beacon(mac, pBPR);
+ channel_num = lim_get_channel_from_beacon(mac, pBPR);
+ pBssDescr->channelId = channel_num;
+ pBssDescr->chan_freq = wlan_reg_chan_to_freq(mac->pdev, channel_num);
pBssDescr->channelIdSelf = pBssDescr->channelId;
pBssDescr->rx_channel = rxChannel;
/* set the network type in bss description */
- channelNum = pBssDescr->channelId;
pBssDescr->nwType =
- lim_get_nw_type(mac, channelNum, SIR_MAC_MGMT_FRAME, pBPR);
+ lim_get_nw_type(mac, channel_num, SIR_MAC_MGMT_FRAME, pBPR);
/* Copy RSSI & SINR from BD */
pBssDescr->rssi = (int8_t) WMA_GET_RX_RSSI_NORMALIZED(pRxPacketInfo);
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index 453e539..ef9167f 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -549,6 +549,10 @@
pSirSmeRsp->bssDescription.channelId =
pe_session->currentOperChannel;
+ pSirSmeRsp->bssDescription.chan_freq =
+ wlan_reg_chan_to_freq(mac->pdev,
+ pe_session->
+ currentOperChannel);
if (!LIM_IS_NDI_ROLE(pe_session)) {
curLen = pe_session->schBeaconOffsetBegin - ieOffset;