Sfoglia il codice sorgente

qcacld-3.0: Remove btm cap in SAE assoc req if SAE roaming disabled

Some legacy Helium firmware doesn't support SAE roaming, but btm cap is set
in associate request of DUT, then connected SAE AP thinks DUT supports btm,
AP will send btm request to DUT, DUT triggers roaming, but fails and
disconnects from current AP, users will complain this unexpected
disconnect.

Change-Id: Ife9860addef6898a518618f555158e7888ac74db
CRs-Fixed: 2884694
Jianmin Zhu 4 anni fa
parent
commit
a9e52b12a3

+ 73 - 53
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -2723,74 +2723,29 @@ cm_roam_offload_per_config(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
 	return status;
 }
 
-#ifdef FEATURE_CM_ENABLE
-#ifdef WLAN_ADAPTIVE_11R
-static bool
-cm_is_adaptive_11r_roam_supported(struct wlan_mlme_psoc_ext_obj *mlme_obj,
-				  struct rso_config *rso_cfg)
-{
-	if (rso_cfg->is_adaptive_11r_connection)
-		return mlme_obj->cfg.lfr.tgt_adaptive_11r_cap;
-
-	return true;
-}
-#else
-static bool
-cm_is_adaptive_11r_roam_supported(struct wlan_mlme_psoc_ext_obj *mlme_obj,
-				  struct rso_config *rso_cfg)
-
-{
-	return true;
-}
-#endif
-
-static QDF_STATUS
-cm_roam_cmd_allowed(struct wlan_objmgr_psoc *psoc,
-		    struct wlan_objmgr_vdev *vdev,
-		    uint8_t command, uint8_t reason)
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+QDF_STATUS
+cm_akm_roam_allowed(struct wlan_objmgr_psoc *psoc,
+		    struct wlan_objmgr_vdev *vdev)
 {
-	uint8_t vdev_id = wlan_vdev_get_id(vdev);
 	int32_t akm;
-	struct rso_config *rso_cfg;
 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
 	uint32_t fw_akm_bitmap;
-	bool p2p_disable_sta_roaming = 0, nan_disable_sta_roaming = 0;
-
-	mlme_obj = mlme_get_psoc_ext_obj(psoc);
-	if (!mlme_obj)
-		return QDF_STATUS_E_FAILURE;
-
-	rso_cfg = wlan_cm_get_rso_config(vdev);
-	if (!rso_cfg)
-		return QDF_STATUS_E_FAILURE;
 
 	akm = wlan_crypto_get_param(vdev,
 				    WLAN_CRYPTO_PARAM_KEY_MGMT);
+	mlme_debug("akm %x", akm);
 
-	mlme_debug("RSO Command %d, vdev %d, Reason %d AKM %x",
-		   command, vdev_id, reason, akm);
-
-	if (!cm_is_vdev_connected(vdev) &&
-	    (command == ROAM_SCAN_OFFLOAD_UPDATE_CFG ||
-	     command == ROAM_SCAN_OFFLOAD_START ||
-	     command == ROAM_SCAN_OFFLOAD_RESTART)) {
-		mlme_debug("vdev not in connected state and command %d ",
-			   command);
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
 		return QDF_STATUS_E_FAILURE;
-	}
 
 	if ((QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA384) ||
 	     QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA256)) &&
 	    !mlme_obj->cfg.lfr.rso_user_config.is_fils_roaming_supported) {
-		mlme_info("FILS Roaming not suppprted by fw, akm %x", akm);
-		return QDF_STATUS_E_NOSUPPORT;
-	}
-
-	if (!cm_is_adaptive_11r_roam_supported(mlme_obj, rso_cfg)) {
-		mlme_info("Adaptive 11r Roaming not suppprted by fw");
+		mlme_info("FILS Roaming not suppprted by fw");
 		return QDF_STATUS_E_NOSUPPORT;
 	}
-
 	fw_akm_bitmap = mlme_obj->cfg.lfr.fw_akm_bitmap;
 	/* Roaming is not supported currently for OWE akm */
 	if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_OWE) &&
@@ -2836,6 +2791,71 @@ cm_roam_cmd_allowed(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_NOSUPPORT;
 	}
 
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
+#ifdef FEATURE_CM_ENABLE
+#ifdef WLAN_ADAPTIVE_11R
+static bool
+cm_is_adaptive_11r_roam_supported(struct wlan_mlme_psoc_ext_obj *mlme_obj,
+				  struct rso_config *rso_cfg)
+{
+	if (rso_cfg->is_adaptive_11r_connection)
+		return mlme_obj->cfg.lfr.tgt_adaptive_11r_cap;
+
+	return true;
+}
+#else
+static bool
+cm_is_adaptive_11r_roam_supported(struct wlan_mlme_psoc_ext_obj *mlme_obj,
+				  struct rso_config *rso_cfg)
+
+{
+	return true;
+}
+#endif
+
+static QDF_STATUS
+cm_roam_cmd_allowed(struct wlan_objmgr_psoc *psoc,
+		    struct wlan_objmgr_vdev *vdev,
+		    uint8_t command, uint8_t reason)
+{
+	uint8_t vdev_id = wlan_vdev_get_id(vdev);
+	struct rso_config *rso_cfg;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+	bool p2p_disable_sta_roaming = 0, nan_disable_sta_roaming = 0;
+	QDF_STATUS  status;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_FAILURE;
+
+	rso_cfg = wlan_cm_get_rso_config(vdev);
+	if (!rso_cfg)
+		return QDF_STATUS_E_FAILURE;
+
+	mlme_debug("RSO Command %d, vdev %d, Reason %d",
+		   command, vdev_id, reason);
+
+	if (!cm_is_vdev_connected(vdev) &&
+	    (command == ROAM_SCAN_OFFLOAD_UPDATE_CFG ||
+	     command == ROAM_SCAN_OFFLOAD_START ||
+	     command == ROAM_SCAN_OFFLOAD_RESTART)) {
+		mlme_debug("vdev not in connected state and command %d ",
+			   command);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!cm_is_adaptive_11r_roam_supported(mlme_obj, rso_cfg)) {
+		mlme_info("Adaptive 11r Roaming not suppprted by fw");
+		return QDF_STATUS_E_NOSUPPORT;
+	}
+
+	status = cm_akm_roam_allowed(psoc, vdev);
+	if (QDF_IS_STATUS_ERROR(status))
+		return status;
+
 	p2p_disable_sta_roaming =
 		(cfg_p2p_is_roam_config_disabled(psoc) &&
 		(policy_mgr_mode_specific_connection_count(

+ 20 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h

@@ -862,6 +862,19 @@ void wlan_cm_set_psk_pmk(struct wlan_objmgr_pdev *pdev,
 void wlan_cm_get_psk_pmk(struct wlan_objmgr_pdev *pdev,
 			 uint8_t vdev_id, uint8_t *psk_pmk,
 			 uint8_t *pmk_len);
+
+/**
+ * cm_akm_roam_allowed() - check if  roam allowed for some akm type
+ * roaming using single pmk
+ * with same pmk or not
+ * @psoc: psoc
+ * @vdev: vdev pointer
+ *
+ * Return: QDF_STATUS: QDF_STATUS_SUCCESS is allowed
+ */
+QDF_STATUS
+cm_akm_roam_allowed(struct wlan_objmgr_psoc *psoc,
+		    struct wlan_objmgr_vdev *vdev);
 #else
 static inline
 void wlan_cm_roam_activate_pcl_per_vdev(struct wlan_objmgr_psoc *psoc,
@@ -971,5 +984,12 @@ static inline void wlan_cm_set_psk_pmk(struct wlan_objmgr_pdev *pdev,
 				       uint8_t vdev_id, uint8_t *psk_pmk,
 				       uint8_t pmk_len)
 {}
+
+static inline QDF_STATUS
+cm_akm_roam_allowed(struct wlan_objmgr_psoc *psoc,
+		    struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
 #endif  /* FEATURE_ROAM_OFFLOAD */
 #endif  /* WLAN_CM_ROAM_API_H__ */

+ 14 - 0
core/mac/src/include/parser_api.h

@@ -1249,6 +1249,20 @@ QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx,
 }
 #endif
 
+/**
+ * populate_dot11f_btm_extended_caps() - populate btm extended capabilities
+ * @mac_ctx: Global MAC context.
+ * @pe_session: Pointer to the PE session.
+ * @dot11f: Pointer to the extended capabilities of the session.
+ *
+ * Disable btm for SAE types for Helium firmware limit
+ *
+ * Return: QDF_STATUS Success or Failure
+ */
+QDF_STATUS populate_dot11f_btm_extended_caps(struct mac_context *mac_ctx,
+					     struct pe_session *pe_session,
+					     struct sDot11fIEExtCap *dot11f);
+
 /**
  * lim_truncate_ppet: truncates ppet of trailling zeros
  * @ppet: ppet to truncate

+ 3 - 0
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -2375,6 +2375,9 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 			lim_merge_extcap_struct(&frm->ExtCap, &bcn_ext_cap,
 							false);
 		}
+
+		populate_dot11f_btm_extended_caps(mac_ctx, pe_session,
+						  &frm->ExtCap);
 		/*
 		 * TWT extended capabilities should be populated after the
 		 * intersection of beacon caps and self caps is done because

+ 23 - 0
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -46,6 +46,7 @@
 #include "wlan_mlme_ucfg_api.h"
 #include "wlan_mlme_api.h"
 #include "wlan_reg_services_api.h"
+#include "wlan_cm_roam_api.h"
 
 #define RSN_OUI_SIZE 4
 /* ////////////////////////////////////////////////////////////////////// */
@@ -7276,4 +7277,26 @@ wlan_get_ielen_from_bss_description(struct bss_description *bss_desc)
 	return ielen;
 }
 
+QDF_STATUS populate_dot11f_btm_extended_caps(struct mac_context *mac_ctx,
+					     struct pe_session *pe_session,
+					     struct sDot11fIEExtCap *dot11f)
+{
+	struct s_ext_cap *p_ext_cap;
+	QDF_STATUS  status;
+
+	pe_debug("enter");
+	dot11f->num_bytes = DOT11F_IE_EXTCAP_MAX_LEN;
+	p_ext_cap = (struct s_ext_cap *)dot11f->bytes;
+
+	status = cm_akm_roam_allowed(mac_ctx->psoc, pe_session->vdev);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		p_ext_cap->bss_transition = 0;
+		pe_debug("Disable btm for roaming not suppprted");
+	}
+
+	dot11f->num_bytes = lim_compute_ext_cap_ie_length(dot11f);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 /* parser_api.c ends here. */