Quellcode durchsuchen

qcacld-3.0: Add frequency in struct sSirMacChanInfo

As part of 6GHz regulatory update, channel numbers are
getting updated to corresponding frequencies, in this
update add frequency element in struct sSirMacChanInfo.

Change-Id: I1a18111a2b073164677b32fb6febc947df043bf2
CRs-Fixed: 2500361
Ashish Kumar Dhanotiya vor 5 Jahren
Ursprung
Commit
b0f0364ca5

+ 1 - 0
core/mac/inc/sir_mac_prot_def.h

@@ -981,6 +981,7 @@ typedef struct sSirMacCfParamSetIE {
 
 typedef struct sSirMacChanInfo {
 	tSirMacChanNum firstChanNum;
+	uint32_t first_freq;
 	uint8_t numChannels;
 	int8_t maxTxPower;
 } qdf_packed tSirMacChanInfo;

+ 8 - 0
core/sme/src/csr/csr_api_roam.c

@@ -2860,6 +2860,10 @@ static QDF_STATUS csr_init11d_info(struct mac_context *mac, tCsr11dinfo *ps11din
 		     index++) {
 			pChanInfo->firstChanNum =
 				ps11dinfo->ChnPower[index].firstChannel;
+			pChanInfo->first_freq =
+					wlan_reg_chan_to_freq(
+						mac->pdev,
+						pChanInfo->firstChanNum);
 			pChanInfo->numChannels =
 				ps11dinfo->ChnPower[index].numChannels;
 			pChanInfo->maxTxPower =
@@ -2923,6 +2927,10 @@ QDF_STATUS csr_init_channel_power_list(struct mac_context *mac,
 		     index++) {
 			pChanInfo->firstChanNum =
 				ps11dinfo->ChnPower[index].firstChannel;
+			pChanInfo->first_freq =
+					wlan_reg_chan_to_freq(
+						mac->pdev,
+						pChanInfo->firstChanNum);
 			pChanInfo->numChannels =
 				ps11dinfo->ChnPower[index].numChannels;
 			pChanInfo->maxTxPower =

+ 17 - 4
core/sme/src/csr/csr_api_scan.c

@@ -832,6 +832,9 @@ void csr_save_channel_power_for_band(struct mac_context *mac, bool fill_5f)
 
 		chan_info->firstChanNum =
 			mac->scan.defaultPowerTable[idx].chan_num;
+		chan_info->first_freq =
+			wlan_reg_chan_to_freq(mac->pdev,
+					      chan_info->firstChanNum);
 		chan_info->numChannels = 1;
 		chan_info->maxTxPower =
 			QDF_MIN(mac->scan.defaultPowerTable[idx].tx_power,
@@ -1535,9 +1538,14 @@ static void csr_save_tx_power_to_cfg(struct mac_context *mac,
 				ch_pwr_set->firstChanNum = (tSirMacChanNum)
 					(ch_set->firstChannel + (idx *
 						ch_set->interChannelOffset));
+				ch_pwr_set->first_freq =
+					wlan_reg_chan_to_freq(
+						mac->pdev,
+						ch_pwr_set->firstChanNum);
 				sme_debug(
-					"Setting Channel Number %d",
-					ch_pwr_set->firstChanNum);
+					"Setting Channel Num %d and freq %d",
+					ch_pwr_set->firstChanNum,
+					ch_pwr_set->first_freq);
 				ch_pwr_set->numChannels = 1;
 				ch_pwr_set->maxTxPower =
 					QDF_MIN(ch_set->txPower,
@@ -1560,8 +1568,13 @@ static void csr_save_tx_power_to_cfg(struct mac_context *mac,
 				break;
 			}
 			ch_pwr_set->firstChanNum = ch_set->firstChannel;
-			sme_debug("Setting Channel Number %d",
-				ch_pwr_set->firstChanNum);
+			ch_pwr_set->first_freq =
+					wlan_reg_chan_to_freq(
+						mac->pdev,
+						ch_pwr_set->firstChanNum);
+			sme_debug("Setting Channel Num %d and Freq %d",
+				  ch_pwr_set->firstChanNum,
+				  ch_pwr_set->first_freq);
 			ch_pwr_set->numChannels = ch_set->numChannels;
 			ch_pwr_set->maxTxPower = QDF_MIN(ch_set->txPower,
 					mac->mlme_cfg->power.max_tx_power);