Explorar el Código

qcacld-3.0: Fix enum mismatch while calculating regulatory class

Fix the enum value used while calculating the regulatory class
from the operating channel. Currently, the channel width is of
type 'enum ch_width' whereas the expected enum is of type
'offset_t'. Fixing the same by performing the enum conversion
before calculating the regulatory class to avoid incorrect
value of regulatory class.

Change-Id: I6aabb8ae78836e3c640f41b27e10830adc91a57e
CRs-Fixed: 986246
Chandrasekaran Manishekar hace 9 años
padre
commit
4fcb7f5feb

+ 2 - 0
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -5623,6 +5623,8 @@ static void lim_process_sme_dfs_csa_ie_request(tpAniSirGlobal mac_ctx,
 	session_entry->gLimChannelSwitch.switchCount = LIM_MAX_CSA_IE_UPDATES;
 	session_entry->gLimChannelSwitch.ch_width =
 				 dfs_csa_ie_req->ch_params.ch_width;
+	session_entry->gLimChannelSwitch.sec_ch_offset =
+				 dfs_csa_ie_req->ch_params.sec_ch_offset;
 	if (mac_ctx->sap.SapDfsInfo.disable_dfs_ch_switch == false)
 		session_entry->gLimChannelSwitch.switchMode = 1;
 

+ 16 - 1
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -248,16 +248,31 @@ void populate_dot_11_f_ext_chann_switch_ann(tpAniSirGlobal mac_ptr,
 		tDot11fIEext_chan_switch_ann *dot_11_ptr,
 		tpPESession session_entry)
 {
+	uint8_t ch_offset;
+
+	if (session_entry->gLimChannelSwitch.ch_width == CH_WIDTH_80MHZ)
+		ch_offset = BW80;
+	else
+		ch_offset = session_entry->gLimChannelSwitch.sec_ch_offset;
+
 	dot_11_ptr->switch_mode = session_entry->gLimChannelSwitch.switchMode;
 	dot_11_ptr->new_reg_class = cds_regdm_get_opclass_from_channel(
 			mac_ptr->scan.countryCodeCurrent,
 			session_entry->gLimChannelSwitch.primaryChannel,
-			session_entry->gLimChannelSwitch.ch_width);
+			ch_offset);
 	dot_11_ptr->new_channel =
 		session_entry->gLimChannelSwitch.primaryChannel;
 	dot_11_ptr->switch_count =
 		session_entry->gLimChannelSwitch.switchCount;
 	dot_11_ptr->present = 1;
+
+	dot11f_log(mac_ptr, LOG1,
+			FL("country:%s chan:%d width:%d reg:%d off:%d"),
+			mac_ptr->scan.countryCodeCurrent,
+			session_entry->gLimChannelSwitch.primaryChannel,
+			session_entry->gLimChannelSwitch.ch_width,
+			dot_11_ptr->new_reg_class,
+			session_entry->gLimChannelSwitch.sec_ch_offset);
 }
 
 void

+ 7 - 0
core/sap/src/sap_module.c

@@ -2437,6 +2437,13 @@ QDF_STATUS wlansap_dfs_send_csa_ie_request(void *pSapCtx)
 				pMac->sap.SapDfsInfo.target_channel, 0,
 				&pMac->sap.SapDfsInfo.new_ch_params);
 
+	QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
+			"%s: chan:%d req:%d width:%d off:%d",
+			__func__, pMac->sap.SapDfsInfo.target_channel,
+			pMac->sap.SapDfsInfo.csaIERequired,
+			pMac->sap.SapDfsInfo.new_ch_params.ch_width,
+			pMac->sap.SapDfsInfo.new_ch_params.sec_ch_offset);
+
 	qdf_ret_status = sme_roam_csa_ie_request(hHal,
 				sapContext->bssid,
 				pMac->sap.SapDfsInfo.target_channel,