浏览代码

qcacld-3.0: Extract channel info from EHT OP IE to fill PE session

After roaming to 11BE 320 MHz EHT AP, the channel width is wrongly
updated as 40 MHz in newly created pe_session. This causes wrong
channel info to be sent to kernel in the get sta channel request
and could result in disconnection. In lim_fill_ft_session(),
the chan_width is updated from VHT OP or Vendor VHT OP IE only
currently. But in 6 GHz EHT 320 mode, the VHT OP IE will not be
present and default 40 MHz is assigned.

So extract the channel info from EHT OP IE and use that to fill
the ft pe session created after roaming

Change-Id: I81b52391e69dfe87b103ca1ee90dd9658f02273a
CRs-Fixed: 3746276
Pragaspathi Thilagaraj 1 年之前
父节点
当前提交
86769c359e

+ 2 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_fw_sync.c

@@ -1163,6 +1163,7 @@ cm_fw_roam_sync_propagation(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 				     mlme_get_tdls_chan_switch_prohibited(vdev),
 				     mlme_get_tdls_prohibited(vdev), vdev);
 
+	wlan_cm_update_scan_mlme_info(vdev, connect_rsp);
 	cm_update_associated_ch_info(vdev, true);
 
 	status = cm_sm_deliver_event_sync(cm_ctx, WLAN_CM_SM_EV_ROAM_DONE,
@@ -1181,6 +1182,7 @@ cm_fw_roam_sync_propagation(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 
 	if (wlan_vdev_mlme_is_mlo_vdev(vdev))
 		mlo_roam_copy_reassoc_rsp(vdev, connect_rsp);
+
 	mlme_debug(CM_PREFIX_FMT, CM_PREFIX_REF(vdev_id, cm_id));
 	cm_remove_cmd(cm_ctx, &cm_id);
 

+ 7 - 7
core/mac/src/pe/lim/lim_ft.c

@@ -393,7 +393,7 @@ static uint8_t lim_convert_phymode_to_dot11mode(enum wlan_phymode phymode)
 
 /**
  * lim_calculate_dot11_mode() - calculate dot11 mode.
- * @mac_context: mac context
+ * @mac_ctx: mac context
  * @bcn: beacon structure
  * @band: reg_wifi_band
  *
@@ -515,7 +515,7 @@ static void lim_fill_dot11mode(struct mac_context *mac_ctx,
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 /**
  * lim_fill_session_power_info() - to fill power info in session
- * @mac_ctx: pointer to mac ctx
+ * @mac: pointer to mac ctx
  * @pbssDescription: Pointer to pbssDescription
  * @ft_session: Pointer to FT session
  * @pe_session: Pointer to PE session
@@ -727,7 +727,7 @@ lim_fill_ft_session(struct mac_context *mac,
 	if (ft_session->htRecommendedTxWidthSet) {
 		ft_session->ch_width = CH_WIDTH_40MHZ;
 		if (ft_session->vhtCapabilityPresentInBeacon &&
-				pBeaconStruct->VHTOperation.chanWidth) {
+		    pBeaconStruct->VHTOperation.chanWidth) {
 			ft_session->ch_width =
 				pBeaconStruct->VHTOperation.chanWidth + 1;
 			ft_session->ch_center_freq_seg0 =
@@ -735,13 +735,13 @@ lim_fill_ft_session(struct mac_context *mac,
 			ft_session->ch_center_freq_seg1 =
 			pBeaconStruct->VHTOperation.chan_center_freq_seg1;
 		} else if (ft_session->vhtCapabilityPresentInBeacon &&
-			   pBeaconStruct->vendor_vht_ie.VHTOperation.chanWidth){
+			   pBeaconStruct->vendor_vht_ie.VHTOperation.chanWidth) {
 			ft_session->ch_width =
-			pBeaconStruct->vendor_vht_ie.VHTOperation.chanWidth + 1;
+				pBeaconStruct->vendor_vht_ie.VHTOperation.chanWidth + 1;
 			ft_session->ch_center_freq_seg0 =
-		pBeaconStruct->vendor_vht_ie.VHTOperation.chan_center_freq_seg0;
+				pBeaconStruct->vendor_vht_ie.VHTOperation.chan_center_freq_seg0;
 			ft_session->ch_center_freq_seg1 =
-		pBeaconStruct->vendor_vht_ie.VHTOperation.chan_center_freq_seg1;
+				pBeaconStruct->vendor_vht_ie.VHTOperation.chan_center_freq_seg1;
 
 		} else {
 			if (pBeaconStruct->HTInfo.secondaryChannelOffset ==

+ 23 - 28
core/mac/src/pe/lim/lim_prop_exts_utils.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -339,8 +339,8 @@ void lim_update_he_mcs_12_13_map(struct wlan_objmgr_psoc *psoc,
 #endif
 
 #ifdef WLAN_FEATURE_11BE
-static void lim_extract_eht_op(struct pe_session *session,
-			       tSirProbeRespBeacon *beacon_struct)
+void lim_extract_eht_op(struct pe_session *session,
+			tSirProbeRespBeacon *beacon_struct)
 {
 	uint32_t max_eht_bw;
 
@@ -405,11 +405,6 @@ void lim_update_eht_bw_cap_mcs(struct pe_session *session,
 			session->eht_config.num_sounding_dim_320mhz = 0;
 	}
 }
-#else
-static void lim_extract_eht_op(struct pe_session *session,
-			       tSirProbeRespBeacon *beacon_struct)
-{
-}
 #endif
 
 #ifdef WLAN_FEATURE_11BE_MLO
@@ -598,6 +593,7 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 	uint8_t channel = 0;
 	uint8_t sta_prefer_80mhz_over_160mhz;
 	struct mlme_vht_capabilities_info *mlme_vht_cap;
+	QDF_STATUS status;
 
 	beacon_struct = qdf_mem_malloc(sizeof(tSirProbeRespBeacon));
 	if (!beacon_struct)
@@ -608,8 +604,9 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 	sta_prefer_80mhz_over_160mhz =
 		session->mac_ctx->mlme_cfg->sta.sta_prefer_80mhz_over_160mhz;
 
-	if (sir_parse_beacon_ie(mac_ctx, beacon_struct, p_ie,
-		(uint32_t) ie_len) != QDF_STATUS_SUCCESS) {
+	status = sir_parse_beacon_ie(mac_ctx, beacon_struct, p_ie,
+				     (uint32_t)ie_len);
+	if (QDF_IS_STATUS_ERROR(status)) {
 		pe_err("sir_parse_beacon_ie failed to parse beacon");
 		qdf_mem_free(beacon_struct);
 		return;
@@ -620,9 +617,10 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 	    beacon_struct->wmeEdcaPresent ||
 	    beacon_struct->HTCaps.present)
 		LIM_BSS_CAPS_SET(WME, *qos_cap);
-	if (LIM_BSS_CAPS_GET(WME, *qos_cap)
-			&& beacon_struct->wsmCapablePresent)
+
+	if (LIM_BSS_CAPS_GET(WME, *qos_cap) && beacon_struct->wsmCapablePresent)
 		LIM_BSS_CAPS_SET(WSM, *qos_cap);
+
 	if (beacon_struct->HTCaps.present)
 		mac_ctx->lim.htCapabilityPresentInBeacon = 1;
 	else
@@ -630,10 +628,10 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 
 	vht_op = &beacon_struct->VHTOperation;
 	vht_caps = &beacon_struct->VHTCaps;
-	if (IS_BSS_VHT_CAPABLE(beacon_struct->VHTCaps) &&
-			vht_op->present &&
-			session->vhtCapability) {
+	if (IS_BSS_VHT_CAPABLE(beacon_struct->VHTCaps) && vht_op->present &&
+	    session->vhtCapability) {
 		session->vhtCapabilityPresentInBeacon = 1;
+
 		if (((beacon_struct->Vendor1IEPresent &&
 		      beacon_struct->vendor_vht_ie.present &&
 		      beacon_struct->Vendor3IEPresent)) &&
@@ -647,7 +645,7 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 	}
 
 	if (session->vhtCapabilityPresentInBeacon == 1 &&
-			!session->htSupportedChannelWidthSet) {
+	    !session->htSupportedChannelWidthSet) {
 		if (!mac_ctx->mlme_cfg->vht_caps.vht_cap_info.enable_txbf_20mhz)
 			session->vht_config.su_beam_formee = 0;
 
@@ -658,8 +656,7 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 					mac_ctx, session,
 					beacon_struct->chan_freq);
 
-	} else if (session->vhtCapabilityPresentInBeacon &&
-			vht_op->chanWidth) {
+	} else if (session->vhtCapabilityPresentInBeacon && vht_op->chanWidth) {
 		/* If VHT is supported min 80 MHz support is must */
 		ap_bcon_ch_width = vht_op->chanWidth;
 		if (vht_caps->vht_extended_nss_bw_cap) {
@@ -707,8 +704,7 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 				vht_ch_wd =
 					WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ;
 			else
-				vht_ch_wd =
-					WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ;
+				vht_ch_wd = WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ;
 		}
 		/*
 		 * If the supported channel width is greater than 80MHz and
@@ -774,12 +770,11 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 		session->ap_ch_width = session->ch_width;
 	}
 
-	if (session->vhtCapability &&
-		session->vhtCapabilityPresentInBeacon &&
-		beacon_struct->ext_cap.present) {
+	if (session->vhtCapability && session->vhtCapabilityPresentInBeacon &&
+	    beacon_struct->ext_cap.present) {
 		ext_cap = (struct s_ext_cap *)beacon_struct->ext_cap.bytes;
 		session->gLimOperatingMode.present =
-			ext_cap->oper_mode_notification;
+					ext_cap->oper_mode_notification;
 		if (ext_cap->oper_mode_notification) {
 			uint8_t self_nss = 0;
 
@@ -798,13 +793,12 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 			 *  WFA CERT test scenario.
 			 */
 			if (ext_cap->beacon_protection_enable &&
-			    (session->opmode == QDF_STA_MODE) &&
-			    (!session->nss_forced_1x1) &&
+			    session->opmode == QDF_STA_MODE &&
+			    !session->nss_forced_1x1 &&
 			     lim_get_nss_supported_by_ap(
 					&beacon_struct->VHTCaps,
 					&beacon_struct->HTCaps,
-					&beacon_struct->he_cap) ==
-						 NSS_1x1_MODE)
+					&beacon_struct->he_cap) == NSS_1x1_MODE)
 				session->gLimOperatingMode.rxNSS = self_nss - 1;
 			else
 				session->gLimOperatingMode.rxNSS =
@@ -813,6 +807,7 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 			pe_err("AP does not support op_mode rx");
 		}
 	}
+
 	lim_check_is_he_mcs_valid(session, beacon_struct);
 	lim_check_peer_ldpc_and_update(session, beacon_struct);
 	lim_extract_he_op(session, beacon_struct);

+ 19 - 1
core/mac/src/pe/lim/lim_prop_exts_utils.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2014, 2016, 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -57,6 +57,24 @@ lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 			  int8_t *local_constraint, struct pe_session *session,
 			  bool *is_pwr_constraint);
 
+#ifdef WLAN_FEATURE_11BE
+/**
+ * lim_extract_eht_op() - Extract EHT operation IE into session
+ * @session: Pointer to pe_session
+ * @beacon_struct: Pointer to extracted beacon/probe response of the
+ * AP
+ *
+ * Return: None
+ */
+void lim_extract_eht_op(struct pe_session *session,
+			tSirProbeRespBeacon *beacon_struct);
+#else
+static inline void
+lim_extract_eht_op(struct pe_session *session,
+		   tSirProbeRespBeacon *beacon_struct)
+{}
+#endif
+
 ePhyChanBondState lim_get_htcb_state(ePhyChanBondState aniCBMode);
 
 /**