Ver Fonte

qcacld-3.0: Convert channel to freq in tpAddBssParams structure

Topic: 6ghz_chan_to_freq

Convert channel to freq in tpAddBssParams and wma_vdev_start_req
structure to avoid duplicate channel numbers in 6ghz, and 2.4ghz
operation.

Change-Id: I8f657a566d1555efa07bf9155b84c37431c57f86
Crs-Fixed: 2511312
Abhinav Kumar há 5 anos atrás
pai
commit
4f959589b8

+ 27 - 30
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -3489,11 +3489,13 @@ static void lim_update_vht_oper_assoc_resp(struct mac_context *mac_ctx,
 			pe_session->ch_width) {
 		pAddBssParams->ch_width = vht_oper->chanWidth + 1;
 
-		pAddBssParams->ch_center_freq_seg0 =
-			vht_oper->chanCenterFreqSeg1;
+		pAddBssParams->chan_freq_seg0 =
+			wlan_reg_chan_to_freq(mac_ctx->pdev,
+					      vht_oper->chanCenterFreqSeg1);
 
-		pAddBssParams->ch_center_freq_seg1 =
-			vht_oper->chanCenterFreqSeg2;
+		pAddBssParams->chan_freq_seg1 =
+			wlan_reg_chan_to_freq(mac_ctx->pdev,
+					      vht_oper->chanCenterFreqSeg2);
 	}
 	pe_debug("Updating VHT Operation in assoc Response");
 }
@@ -3518,7 +3520,7 @@ static inline void lim_set_sta_ctx_twt(tAddStaParams *sta_ctx,
 }
 #endif
 
-void lim_sta_add_bss_update_ht_parameter(uint8_t bss_chan_id,
+void lim_sta_add_bss_update_ht_parameter(uint32_t bss_chan_freq,
 					 tDot11fIEHTCaps* ht_cap,
 					 tDot11fIEHTInfo* ht_inf,
 					 bool chan_width_support,
@@ -3539,13 +3541,13 @@ void lim_sta_add_bss_update_ht_parameter(uint8_t bss_chan_id,
 		add_bss->ch_width = ht_inf->recommendedTxWidthSet;
 		if (ht_inf->secondaryChannelOffset ==
 		    PHY_DOUBLE_CHANNEL_LOW_PRIMARY)
-			add_bss->ch_center_freq_seg0 = bss_chan_id + 2;
+			add_bss->chan_freq_seg0 = bss_chan_freq + 10;
 		else if (ht_inf->secondaryChannelOffset ==
 			 PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)
-			add_bss->ch_center_freq_seg0 = bss_chan_id - 2;
+			add_bss->chan_freq_seg0 = bss_chan_freq - 10;
 	} else {
 		add_bss->ch_width = CH_WIDTH_20MHZ;
-		add_bss->ch_center_freq_seg0 = 0;
+		add_bss->chan_freq_seg0 = 0;
 	}
 	add_bss->llnNonGFCoexist = ht_inf->nonGFDevicesPresent;
 	add_bss->fLsigTXOPProtectionFullSupport =
@@ -3556,7 +3558,7 @@ void lim_sta_add_bss_update_ht_parameter(uint8_t bss_chan_id,
 		 add_bss->dualCTSProtection,
 		 add_bss->ch_width);
 	pe_debug("center_freq_0: %d llnNonGFCoexist: %d",
-		 add_bss->ch_center_freq_seg0,
+		 add_bss->chan_freq_seg0,
 		 add_bss->llnNonGFCoexist);
 	pe_debug("fLsigTXOPProtectionFullSupport: %d fRIFSMode: %d",
 		 add_bss->fLsigTXOPProtectionFullSupport,
@@ -3600,7 +3602,6 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 	uint32_t retCode;
 	tpDphHashNode sta = NULL;
 	bool chan_width_support = false;
-	uint8_t bss_chan_id;
 	bool is_vht_cap_in_vendor_ie = false;
 	tDot11fIEVHTCaps *vht_caps = NULL;
 	tDot11fIEVHTOperation *vht_oper = NULL;
@@ -3694,23 +3695,21 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 	pAddBssParams->dot11_mode = pe_session->dot11mode;
 	pe_debug("dot11_mode: %d", pAddBssParams->dot11_mode);
 
-	bss_chan_id = wlan_reg_freq_to_chan(mac->pdev,
-					    bssDescription->chan_freq);
 	/* Use the advertised capabilities from the received beacon/PR */
 	if (IS_DOT11_MODE_HT(pe_session->dot11mode)) {
 		chan_width_support =
 			lim_get_ht_capability(mac,
 					      eHT_SUPPORTED_CHANNEL_WIDTH_SET,
 					      pe_session);
-		lim_sta_add_bss_update_ht_parameter(bss_chan_id,
+		lim_sta_add_bss_update_ht_parameter(bssDescription->chan_freq,
 						    &pAssocRsp->HTCaps,
 						    &pAssocRsp->HTInfo,
 						    chan_width_support,
 						    pAddBssParams);
 	}
 
-	pAddBssParams->currentOperChannel = bss_chan_id;
-	pe_debug("currentOperChannel %d", pAddBssParams->currentOperChannel);
+	pAddBssParams->op_chan_freq = bssDescription->chan_freq;
+	pe_debug("current op frequency %d", pAddBssParams->op_chan_freq);
 	if (pe_session->vhtCapability && (pAssocRsp->VHTCaps.present)) {
 		pAddBssParams->vhtCapable = pAssocRsp->VHTCaps.present;
 		vht_caps =  &pAssocRsp->VHTCaps;
@@ -3736,8 +3735,8 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp
 
 	pe_debug("vhtCapable %d TxChannelWidth %d center_freq_0 %d center_freq_1 %d",
 			pAddBssParams->vhtCapable, pAddBssParams->ch_width,
-			pAddBssParams->ch_center_freq_seg0,
-			pAddBssParams->ch_center_freq_seg1);
+			pAddBssParams->chan_freq_seg0,
+			pAddBssParams->chan_freq_seg1);
 
 	if (lim_is_session_he_capable(pe_session) &&
 			(pAssocRsp->he_cap.present)) {
@@ -4100,7 +4099,6 @@ QDF_STATUS lim_sta_send_add_bss_pre_assoc(struct mac_context *mac, uint8_t updat
 	uint32_t retCode;
 	tSchBeaconStruct *pBeaconStruct;
 	bool chan_width_support = false;
-	uint8_t bss_chan_id;
 	tDot11fIEVHTOperation *vht_oper = NULL;
 	tDot11fIEVHTCaps *vht_caps = NULL;
 	uint32_t listen_interval = MLME_CFG_LISTEN_INTERVAL;
@@ -4198,24 +4196,21 @@ QDF_STATUS lim_sta_send_add_bss_pre_assoc(struct mac_context *mac, uint8_t updat
 		pAddBssParams->llaCoexist, pAddBssParams->llbCoexist,
 		pAddBssParams->llgCoexist, pAddBssParams->ht20Coexist);
 
-	bss_chan_id = wlan_reg_freq_to_chan(mac->pdev,
-					    bssDescription->chan_freq);
 	/* Use the advertised capabilities from the received beacon/PR */
 	if (IS_DOT11_MODE_HT(pe_session->dot11mode)) {
 		chan_width_support =
 			lim_get_ht_capability(mac,
 					      eHT_SUPPORTED_CHANNEL_WIDTH_SET,
 					      pe_session);
-		lim_sta_add_bss_update_ht_parameter(bss_chan_id,
+		lim_sta_add_bss_update_ht_parameter(bssDescription->chan_freq,
 						    &pBeaconStruct->HTCaps,
 						    &pBeaconStruct->HTInfo,
 						    chan_width_support,
 						    pAddBssParams);
 	}
 
-	pAddBssParams->currentOperChannel = bss_chan_id;
-	pe_debug("currentOperChannel %d",
-		pAddBssParams->currentOperChannel);
+	pAddBssParams->op_chan_freq = bssDescription->chan_freq;
+	pe_debug("current Oper freq %d", pAddBssParams->op_chan_freq);
 
 	if (pe_session->vhtCapability &&
 		(IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) ||
@@ -4231,10 +4226,12 @@ QDF_STATUS lim_sta_send_add_bss_pre_assoc(struct mac_context *mac, uint8_t updat
 
 
 		if (vht_oper && vht_oper->chanWidth && chan_width_support) {
-			pAddBssParams->ch_center_freq_seg0 =
-				vht_oper->chanCenterFreqSeg1;
-			pAddBssParams->ch_center_freq_seg1 =
-				vht_oper->chanCenterFreqSeg2;
+			pAddBssParams->chan_freq_seg0 =
+				wlan_reg_chan_to_freq(mac->pdev,
+						vht_oper->chanCenterFreqSeg1);
+			pAddBssParams->chan_freq_seg1 =
+				wlan_reg_chan_to_freq(mac->pdev,
+						vht_oper->chanCenterFreqSeg2);
 		}
 		/*
 		 * in limExtractApCapability function intersection of FW
@@ -4258,8 +4255,8 @@ QDF_STATUS lim_sta_send_add_bss_pre_assoc(struct mac_context *mac, uint8_t updat
 	}
 	pe_debug("vhtCapable %d vhtTxChannelWidthSet %d center_freq_seg0 - %d, center_freq_seg1 - %d",
 		pAddBssParams->vhtCapable, pAddBssParams->ch_width,
-		pAddBssParams->ch_center_freq_seg0,
-		pAddBssParams->ch_center_freq_seg1);
+		pAddBssParams->chan_freq_seg0,
+		pAddBssParams->chan_freq_seg1);
 	/*
 	 * Populate the STA-related parameters here
 	 * Note that the STA here refers to the AP

+ 2 - 2
core/mac/src/pe/lim/lim_assoc_utils.h

@@ -188,7 +188,7 @@ void lim_update_assoc_sta_datas(struct mac_context *mac,
 /**
  * lim_sta_add_bss_update_ht_parameter() - function to update ht related
  *                                         parameters when add bss request
- * @bss_chan_id: channel number of bss
+ * @bss_chan_freq: operating frequency of bss
  * @ht_cap: ht capability extract from beacon/assoc response
  * @ht_inf: ht information extract from beacon/assoc response
  * @chan_width_support: local wide bandwith support capability
@@ -196,7 +196,7 @@ void lim_update_assoc_sta_datas(struct mac_context *mac,
  *
  * Return: none
  */
-void lim_sta_add_bss_update_ht_parameter(uint8_t bss_chan_id,
+void lim_sta_add_bss_update_ht_parameter(uint32_t bss_chan_freq,
 					 tDot11fIEHTCaps* ht_cap,
 					 tDot11fIEHTInfo* ht_inf,
 					 bool chan_width_support,

+ 10 - 12
core/mac/src/pe/lim/lim_ft.c

@@ -119,7 +119,6 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac,
 	struct bss_params *pAddBssParams = NULL;
 	tAddStaParams *sta_ctx;
 	bool chan_width_support = false;
-	uint8_t bss_chan_id;
 	tSchBeaconStruct *pBeaconStruct;
 
 	/* Nothing to be done if the session is not in STA mode */
@@ -194,9 +193,6 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac,
 #ifdef WLAN_FEATURE_11W
 	pAddBssParams->rmfEnabled = ft_session->limRmfEnabled;
 #endif
-
-	bss_chan_id = wlan_reg_freq_to_chan(mac->pdev,
-					    bssDescription->chan_freq);
 	/* Use the advertised capabilities from the received beacon/PR */
 	if (IS_DOT11_MODE_HT(ft_session->dot11mode) &&
 	    (pBeaconStruct->HTCaps.present)) {
@@ -204,7 +200,7 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac,
 			lim_get_ht_capability(mac,
 					      eHT_SUPPORTED_CHANNEL_WIDTH_SET,
 					      ft_session);
-		lim_sta_add_bss_update_ht_parameter(bss_chan_id,
+		lim_sta_add_bss_update_ht_parameter(bssDescription->chan_freq,
 						    &pBeaconStruct->HTCaps,
 						    &pBeaconStruct->HTInfo,
 						    chan_width_support,
@@ -218,7 +214,7 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac,
 			     sizeof(pAddBssParams->staContext.ht_caps));
 	}
 
-	pAddBssParams->currentOperChannel = bss_chan_id;
+	pAddBssParams->op_chan_freq = bssDescription->chan_freq;
 	ft_session->htSecondaryChannelOffset =
 		pBeaconStruct->HTInfo.secondaryChannelOffset;
 	sta_ctx = &pAddBssParams->staContext;
@@ -230,10 +226,12 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac,
 		    chan_width_support) {
 			pAddBssParams->ch_width =
 				pBeaconStruct->VHTOperation.chanWidth + 1;
-			pAddBssParams->ch_center_freq_seg0 =
-				pBeaconStruct->VHTOperation.chanCenterFreqSeg1;
-			pAddBssParams->ch_center_freq_seg1 =
-				pBeaconStruct->VHTOperation.chanCenterFreqSeg2;
+			pAddBssParams->chan_freq_seg0 =
+			    wlan_reg_chan_to_freq(mac->pdev,
+				pBeaconStruct->VHTOperation.chanCenterFreqSeg1);
+			pAddBssParams->chan_freq_seg1 =
+			    wlan_reg_chan_to_freq(mac->pdev,
+				pBeaconStruct->VHTOperation.chanCenterFreqSeg2);
 		}
 		pAddBssParams->staContext.vht_caps =
 			((pBeaconStruct->VHTCaps.maxMPDULen <<
@@ -280,8 +278,8 @@ void lim_ft_prepare_add_bss_req(struct mac_context *mac,
 		pAddBssParams->vhtCapable = 0;
 	}
 
-	pe_debug("SIR_HAL_ADD_BSS_REQ with channel: %d",
-		pAddBssParams->currentOperChannel);
+	pe_debug("SIR_HAL_ADD_BSS_REQ with frequency: %d",
+		bssDescription->chan_freq);
 
 	/* Populate the STA-related parameters here */
 	/* Note that the STA here refers to the AP */

+ 1 - 2
core/mac/src/pe/lim/lim_ibss_peer_mgmt.c

@@ -1249,8 +1249,7 @@ void lim_ibss_add_bss_rsp_when_coalescing(struct mac_context *mac,
 
 	qdf_mem_zero((void *)&newBssInfo, sizeof(newBssInfo));
 	qdf_mem_copy(newBssInfo.bssId.bytes, pHdr->bssId, QDF_MAC_ADDR_SIZE);
-	newBssInfo.freq = wlan_reg_chan_to_freq(mac->pdev,
-						bss_param->currentOperChannel);
+	newBssInfo.freq = bss_param->op_chan_freq;
 	qdf_mem_copy((uint8_t *) &newBssInfo.ssId,
 		     (uint8_t *) &pBeacon->ssId, pBeacon->ssId.length + 1);
 

+ 9 - 5
core/mac/src/pe/lim/lim_process_mlm_req_messages.c

@@ -357,15 +357,19 @@ lim_mlm_add_bss(struct mac_context *mac_ctx,
 	}
 
 	addbss_param->ch_width = session->ch_width;
-	addbss_param->ch_center_freq_seg0 =
-		session->ch_center_freq_seg0;
-	addbss_param->ch_center_freq_seg1 =
-		session->ch_center_freq_seg1;
+	addbss_param->chan_freq_seg0 =
+		wlan_reg_chan_to_freq(mac_ctx->pdev,
+				      session->ch_center_freq_seg0);
+	addbss_param->chan_freq_seg1 =
+		wlan_reg_chan_to_freq(mac_ctx->pdev,
+				      session->ch_center_freq_seg1);
 	addbss_param->htOperMode = mlm_start_req->htOperMode;
 	addbss_param->dualCTSProtection = mlm_start_req->dualCTSProtection;
 	addbss_param->txChannelWidthSet = mlm_start_req->txChannelWidthSet;
 
-	addbss_param->currentOperChannel = mlm_start_req->channelNumber;
+	addbss_param->op_chan_freq =
+		wlan_reg_chan_to_freq(mac_ctx->pdev,
+				      mlm_start_req->channelNumber);
 #ifdef WLAN_FEATURE_11W
 	addbss_param->rmfEnabled = session->limRmfEnabled;
 #endif

+ 6 - 4
core/wma/inc/wma.h

@@ -1253,12 +1253,14 @@ struct wma_target_req {
  * @chan_offset: channel offset
  * @is_dfs: is dfs supported or not
  * @vdev_id: vdev id
- * @op_freq: operating frequency
+ * @op_chan_freq: operating frequency
  * @oper_mode: operating mode
  * @ssid: ssid
  * @hidden_ssid: hidden ssid
  * @pmf_enabled: is pmf enabled or not
  * @vht_capable: VHT capabality
+ * @chan_freq_seg0: center freq seq 0
+ * @chan_freq_seg1: center freq seq 1
  * @ht_capable: HT capabality
  * @dot11_mode: 802.11 mode
  * @is_half_rate: is the channel operating at 10MHz
@@ -1280,14 +1282,14 @@ struct wma_vdev_start_req {
 	enum phy_ch_width chan_width;
 	bool is_dfs;
 	uint8_t vdev_id;
-	uint32_t op_freq;
+	uint32_t op_chan_freq;
 	uint8_t oper_mode;
 	tSirMacSSid ssid;
 	uint8_t hidden_ssid;
 	uint8_t pmf_enabled;
 	uint8_t vht_capable;
-	uint8_t ch_center_freq_seg0;
-	uint8_t ch_center_freq_seg1;
+	uint32_t chan_freq_seg0;
+	uint32_t chan_freq_seg1;
 	uint8_t ht_capable;
 	uint8_t dot11_mode;
 	bool is_half_rate;

+ 6 - 5
core/wma/inc/wma_if.h

@@ -390,8 +390,7 @@ typedef struct sLimMlmSetKeysReq {
  * @htOperMode: HT Operating Mode
  * @HT Operating Mode: Dual CTS Protection: 0 - Unused, 1 - Used
  * @txChannelWidthSet: TX Width Set: 0 - 20 MHz only, 1 - 20/40 MHz
- * @currentOperChannel: Current Operating Channel
- * @currentExtChannel: Current Extension Channel, if applicable
+ * @op_chan_freq: Current Operating frequency
  * @staContext: sta context
  * @status: status
  * @bss_idx: BSS index allocated by HAL
@@ -409,6 +408,8 @@ typedef struct sLimMlmSetKeysReq {
  * @bSpectrumMgtEnabled: Spectrum Management Capability, 1:Enabled, 0:Disabled.
  * @vhtCapable: VHT capablity
  * @vhtTxChannelWidthSet: VHT tx channel width
+ * @chan_freq_seg0: center freq seq 0
+ * @chan_freq_seg1: center freq seq 1
  * @reassocReq: Set only during roaming reassociation
  * @chainMask: chain mask
  * @smpsMode: SMPS mode
@@ -442,7 +443,7 @@ struct bss_params {
 	tSirMacHTOperatingMode htOperMode;
 	uint8_t dualCTSProtection;
 	uint8_t txChannelWidthSet;
-	uint8_t currentOperChannel;
+	uint32_t op_chan_freq;
 	tAddStaParams staContext;
 	QDF_STATUS status;
 	uint16_t bss_idx;
@@ -466,8 +467,8 @@ struct bss_params {
 	uint8_t bSpectrumMgtEnabled;
 	uint8_t vhtCapable;
 	enum phy_ch_width ch_width;
-	uint8_t ch_center_freq_seg0;
-	uint8_t ch_center_freq_seg1;
+	uint32_t chan_freq_seg0;
+	uint32_t chan_freq_seg1;
 	uint8_t reassocReq;     /* Set only during roaming reassociation */
 	uint16_t chainMask;
 	uint16_t smpsMode;

+ 24 - 28
core/wma/src/wma_dev_if.c

@@ -2948,31 +2948,30 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (req->op_freq == 0) {
-		WMA_LOGE("invalid operating frequency");
+	if (req->op_chan_freq == 0) {
+		WMA_LOGE("%s: Invalid operating frequency: %d", __func__,
+			 req->op_chan_freq);
 		QDF_ASSERT(0);
 		return QDF_STATUS_E_INVAL;
 	}
 
-	params.channel.cfreq1 = req->op_freq;
+	params.channel.cfreq1 = req->op_chan_freq;
 	ch_width = req->chan_width;
 	bw_val = wlan_reg_get_bw_value(req->chan_width);
 	if (bw_val > 20) {
-		if (req->ch_center_freq_seg0) {
-			params.channel.cfreq1 =
-				cds_chan_to_freq(req->ch_center_freq_seg0);
+		if (req->chan_freq_seg0) {
+			params.channel.cfreq1 = req->chan_freq_seg0;
 		} else {
 			WMA_LOGE("%s: invalid cntr_freq for bw %d, drop to 20",
 					__func__, bw_val);
-			params.channel.cfreq1 = req->op_freq;
+			params.channel.cfreq1 = req->op_chan_freq;
 			ch_width = CH_WIDTH_20MHZ;
 			bw_val = 20;
 		}
 	}
 	if (bw_val > 80) {
-		if (req->ch_center_freq_seg1) {
-			params.channel.cfreq2 =
-				cds_chan_to_freq(req->ch_center_freq_seg1);
+		if (req->chan_freq_seg1) {
+			params.channel.cfreq2 = req->chan_freq_seg1;
 		} else {
 			WMA_LOGE("%s: invalid cntr_freq for bw %d, drop to 80",
 					__func__, bw_val);
@@ -2982,7 +2981,8 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 	} else {
 		params.channel.cfreq2 = 0;
 	}
-	chan_mode = wma_chan_phy_mode(req->op_freq, ch_width, req->dot11_mode);
+	chan_mode = wma_chan_phy_mode(req->op_chan_freq, ch_width,
+				      req->dot11_mode);
 
 	if (chan_mode == MODE_UNKNOWN) {
 		WMA_LOGE("%s: invalid phy mode!", __func__);
@@ -3000,7 +3000,7 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 		return QDF_STATUS_E_FAILURE;
 	}
 	/* Fill channel info */
-	params.channel.mhz = req->op_freq;
+	params.channel.mhz = req->op_chan_freq;
 	params.channel.phy_mode = chan_mode;
 
 	/* For Rome, only supports LFR2, not LFR3, for reassoc, need send vdev
@@ -3046,7 +3046,7 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 	intr[params.vdev_id].mhz = params.channel.mhz;
 	intr[params.vdev_id].chan_width = ch_width;
 	intr[params.vdev_id].channel = wlan_reg_freq_to_chan(wma->pdev,
-							     req->op_freq);
+							     req->op_chan_freq);
 
 	temp_chan_info &= 0xffffffc0;
 	temp_chan_info |= params.channel.phy_mode;
@@ -4059,8 +4059,7 @@ static void wma_add_bss_ap_mode(tp_wma_handle wma, struct bss_params *add_bss)
 
 	qdf_mem_zero(&req, sizeof(req));
 	req.vdev_id = vdev_id;
-	req.op_freq = wlan_reg_chan_to_freq(wma->pdev,
-					    add_bss->currentOperChannel);
+	req.op_chan_freq = add_bss->op_chan_freq;
 	req.chan_width = add_bss->ch_width;
 	req.dot11_mode = add_bss->dot11_mode;
 
@@ -4069,8 +4068,8 @@ static void wma_add_bss_ap_mode(tp_wma_handle wma, struct bss_params *add_bss)
 	else if (add_bss->ch_width == CH_WIDTH_5MHZ)
 		req.is_quarter_rate = 1;
 
-	req.ch_center_freq_seg0 = add_bss->ch_center_freq_seg0;
-	req.ch_center_freq_seg1 = add_bss->ch_center_freq_seg1;
+	req.chan_freq_seg0 = add_bss->chan_freq_seg0;
+	req.chan_freq_seg1 = add_bss->chan_freq_seg1;
 	req.vht_capable = add_bss->vhtCapable;
 	wma_update_vdev_he_ops(&req, add_bss);
 
@@ -4218,11 +4217,10 @@ static void wma_add_bss_ibss_mode(tp_wma_handle wma, struct bss_params *add_bss)
 
 	qdf_mem_zero(&req, sizeof(req));
 	req.vdev_id = vdev_id;
-	req.op_freq = wlan_reg_chan_to_freq(wma->pdev,
-					    add_bss->currentOperChannel);
+	req.op_chan_freq = add_bss->op_chan_freq;
 	req.chan_width = add_bss->ch_width;
-	req.ch_center_freq_seg0 = add_bss->ch_center_freq_seg0;
-	req.ch_center_freq_seg1 = add_bss->ch_center_freq_seg1;
+	req.chan_freq_seg0 = add_bss->chan_freq_seg0;
+	req.chan_freq_seg1 = add_bss->chan_freq_seg1;
 	req.vht_capable = add_bss->vhtCapable;
 #if defined WLAN_FEATURE_VOWIF
 	req.max_txpow = add_bss->maxTxPower;
@@ -4247,8 +4245,8 @@ static void wma_add_bss_ibss_mode(tp_wma_handle wma, struct bss_params *add_bss)
 		req.preferred_tx_streams = 1;
 	}
 
-	WMA_LOGD("%s: op_freq %d chan_width %d", __func__, req.op_freq,
-		 req.chan_width);
+	WMA_LOGD("%s: op_chan_freq %d chan_width %d", __func__,
+		 req.op_chan_freq, req.chan_width);
 	WMA_LOGD("%s: ssid = %s", __func__, req.ssid.ssId);
 
 	status = wma_vdev_start(wma, &req, false);
@@ -4395,9 +4393,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, struct bss_params *add_bss)
 
 			qdf_mem_zero(&req, sizeof(req));
 			req.vdev_id = vdev_id;
-			req.op_freq =
-			  wlan_reg_chan_to_freq(wma->pdev,
-						add_bss->currentOperChannel);
+			req.op_chan_freq = add_bss->op_chan_freq;
 			req.chan_width = add_bss->ch_width;
 
 			if (add_bss->ch_width == CH_WIDTH_10MHZ)
@@ -4405,8 +4401,8 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, struct bss_params *add_bss)
 			else if (add_bss->ch_width == CH_WIDTH_5MHZ)
 				req.is_quarter_rate = 1;
 
-			req.ch_center_freq_seg0 = add_bss->ch_center_freq_seg0;
-			req.ch_center_freq_seg1 = add_bss->ch_center_freq_seg1;
+			req.chan_freq_seg0 = add_bss->chan_freq_seg0;
+			req.chan_freq_seg1 = add_bss->chan_freq_seg1;
 			req.max_txpow = add_bss->maxTxPower;
 			req.beacon_intval = add_bss->beaconInterval;
 			req.dtim_period = add_bss->dtimPeriod;

+ 3 - 4
core/wma/src/wma_nan_datapath.c

@@ -101,10 +101,9 @@ void wma_add_bss_ndi_mode(tp_wma_handle wma, struct bss_params *add_bss)
 	 */
 	qdf_mem_zero(&req, sizeof(req));
 	req.vdev_id = vdev_id;
-	req.op_freq = wlan_reg_chan_to_freq(wma->pdev,
-					    add_bss->currentOperChannel);
-	req.ch_center_freq_seg0 = add_bss->ch_center_freq_seg0;
-	req.ch_center_freq_seg1 = add_bss->ch_center_freq_seg1;
+	req.op_chan_freq = add_bss->op_chan_freq;
+	req.chan_freq_seg0 = add_bss->chan_freq_seg0;
+	req.chan_freq_seg1 = add_bss->chan_freq_seg1;
 	req.vht_capable = add_bss->vhtCapable;
 	req.max_txpow = add_bss->maxTxPower;
 	req.oper_mode = add_bss->operMode;

+ 2 - 2
core/wma/src/wma_ocb.c

@@ -50,9 +50,9 @@ static QDF_STATUS wma_start_ocb_vdev(struct ocb_config *config)
 
 		return QDF_STATUS_E_NOMEM;
 	}
-	req.op_freq = config->channels[0].chan_freq;
+	req.op_chan_freq = config->channels[0].chan_freq;
 	req.vdev_id = msg->vdev_id;
-	if (wlan_reg_is_24ghz_ch_freq(req.op_freq))
+	if (wlan_reg_is_24ghz_ch_freq(req.op_chan_freq))
 		req.dot11_mode = MLME_DOT11_MODE_11G;
 	else
 		req.dot11_mode = MLME_DOT11_MODE_11A;

+ 11 - 7
core/wma/src/wma_scan_roam.c

@@ -3513,6 +3513,7 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 	struct wma_txrx_node *intr = wma->interfaces;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	uint16_t beacon_interval_ori;
+	uint8_t chan;
 
 	WMA_LOGD("%s: Enter", __func__);
 	if (!wma_find_vdev_by_addr(wma, params->selfStaMacAddr, &vdev_id)) {
@@ -3534,7 +3535,8 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 
 	qdf_mem_zero(&req, sizeof(req));
 	req.vdev_id = vdev_id;
-	req.op_freq = wlan_reg_chan_to_freq(wma->pdev, params->channelNumber);
+	req.op_chan_freq = wlan_reg_chan_to_freq(wma->pdev,
+						 params->channelNumber);
 	req.chan_width = params->ch_width;
 
 	if (params->ch_width == CH_WIDTH_10MHZ)
@@ -3543,8 +3545,10 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 		req.is_quarter_rate = 1;
 
 	req.vht_capable = params->vhtCapable;
-	req.ch_center_freq_seg0 = params->ch_center_freq_seg0;
-	req.ch_center_freq_seg1 = params->ch_center_freq_seg1;
+	req.chan_freq_seg0 = wlan_reg_chan_to_freq(wma->pdev,
+						   params->ch_center_freq_seg0);
+	req.chan_freq_seg1 = wlan_reg_chan_to_freq(wma->pdev,
+						   params->ch_center_freq_seg1);
 	req.dot11_mode = params->dot11_mode;
 	wma_update_vdev_he_capable(&req, params);
 
@@ -3632,10 +3636,10 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 	 * Record monitor mode channel here in case HW
 	 * indicate RX PPDU TLV with invalid channel number.
 	 */
-	if (intr[vdev_id].type == WMI_VDEV_TYPE_MONITOR)
-		cdp_record_monitor_chan_num(soc, pdev,
-					    wlan_reg_freq_to_chan(wma->pdev,
-								  req.op_freq));
+	if (intr[vdev_id].type == WMI_VDEV_TYPE_MONITOR) {
+		chan = wlan_reg_freq_to_chan(wma->pdev, req.op_chan_freq);
+		cdp_record_monitor_chan_num(soc, pdev, chan);
+	}
 
 	return;
 send_resp: