浏览代码

qcacld-3.0: Add supported channels, 11r, ESE etc. to LIM

Add csr join req params in LIM and fill them
accordingly.

Change-Id: Iea26867168b4e211a42e501c2aa36bebec1808e6
CRs-Fixed: 2867376
gaurank kathpalia 4 年之前
父节点
当前提交
c29ed658d3

+ 10 - 14
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -3477,11 +3477,9 @@ cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
 }
 #endif
 
-#ifdef FEATURE_CM_ENABLE
-
-static bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
-				struct wlan_objmgr_vdev *vdev,
-				bool mdie_present)
+bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			 struct wlan_objmgr_vdev *vdev,
+			 bool mdie_present)
 {
 	int32_t akm, ucast_cipher;
 
@@ -3495,15 +3493,12 @@ static bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
 	      ucast_cipher))) {
 		if (mdie_present && mlme_obj->cfg.lfr.enable_ftopen)
 			return true;
-	} else if (QDF_HAS_PARAM(ucast_cipher,
-				 WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA384) ||
-		   QDF_HAS_PARAM(ucast_cipher,
-				 WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA256) ||
-		   QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_KEY_MGMT_FT_SAE) ||
-		   QDF_HAS_PARAM(ucast_cipher,
-				 WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X) ||
-		   QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_KEY_MGMT_FT_PSK) ||
-		   QDF_HAS_PARAM(ucast_cipher,
+	} else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA384) ||
+		   QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA256) ||
+		   QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_SAE) ||
+		   QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X) ||
+		   QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_PSK) ||
+		   QDF_HAS_PARAM(akm,
 				 WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384)) {
 		return true;
 	}
@@ -3511,6 +3506,7 @@ static bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
 	return false;
 }
 
+#ifdef FEATURE_CM_ENABLE
 static void cm_roam_start_init(struct wlan_objmgr_psoc *psoc,
 			       struct wlan_objmgr_pdev *pdev,
 			       struct wlan_objmgr_vdev *vdev)

+ 3 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h

@@ -122,4 +122,7 @@ QDF_STATUS
 cm_roam_send_disable_config(struct wlan_objmgr_psoc *psoc,
 			    uint8_t vdev_id, uint8_t cfg);
 
+bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			 struct wlan_objmgr_vdev *vdev,
+			 bool mdie_present);
 #endif /* _WLAN_CM_ROAM_OFFLOAD_H_ */

+ 2 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_api.h

@@ -37,6 +37,7 @@
  * struct cm_vdev_join_req - connect req from legacy CM to vdev manager
  * @vdev_id: vdev id
  * @cm_id: Connect manager id
+ * @force_24ghz_in_ht20: force 24ghz_in ht20
  * @force_rsne_override: force the arbitrary rsne received in connect req to be
  * used with out validation, used for the scenarios where the device is used
  * as a testbed device with special functionality and not recommended
@@ -48,6 +49,7 @@
 struct cm_vdev_join_req {
 	uint8_t vdev_id;
 	wlan_cm_id cm_id;
+	bool force_24ghz_in_ht20;
 	bool force_rsne_override;
 	struct element_info assoc_ie;
 	struct element_info scan_ie;

+ 20 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -30,6 +30,7 @@
 #include "wni_api.h"
 #include "wlan_crypto_global_api.h"
 #include "wlan_scan_api.h"
+#include "wlan_logging_sock_svc.h"
 
 #ifdef WLAN_FEATURE_FILS_SK
 void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
@@ -879,10 +880,22 @@ cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 	struct cm_vdev_join_req *join_req;
 	struct scheduler_msg msg;
 	QDF_STATUS status;
+	struct wlan_objmgr_psoc *psoc;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
 
 	if (!vdev || !req)
 		return QDF_STATUS_E_FAILURE;
 
+	psoc = wlan_vdev_get_psoc(vdev);
+	if (!psoc) {
+		mlme_err("vdev_id: %d psoc not found", req->vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_INVAL;
+
 	qdf_mem_zero(&msg, sizeof(msg));
 	join_req = qdf_mem_malloc(sizeof(*join_req));
 
@@ -905,6 +918,10 @@ cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 		cm_free_join_req(join_req);
 		return QDF_STATUS_E_FAILURE;
 	}
+	mlme_debug("HT cap %x", req->ht_caps);
+	if (mlme_obj->cfg.obss_ht40.is_override_ht20_40_24g &&
+	    !(req->ht_caps & WLAN_HTCAP_C_CHWIDTH40))
+		join_req->force_24ghz_in_ht20 = true;
 
 	msg.bodyptr = join_req;
 	msg.type = CM_CONNECT_REQ;
@@ -916,6 +933,9 @@ cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 	if (QDF_IS_STATUS_ERROR(status))
 		cm_free_join_req(join_req);
 
+	if (wlan_vdev_mlme_get_opmode(vdev) == QDF_STA_MODE)
+		wlan_register_txrx_packetdump(OL_TXRX_PDEV_ID);
+
 	return status;
 }
 

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

@@ -595,6 +595,14 @@ cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
 {}
 #endif
 
+static inline
+bool wlan_cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			      struct wlan_objmgr_vdev *vdev,
+			      bool mdie_present)
+{
+	return cm_is_auth_type_11r(mlme_obj, vdev, mdie_present);
+}
+
 #ifdef FEATURE_CM_ENABLE
 /**
  * cm_roam_start_init_on_connect() - init roaming

+ 0 - 5
core/mac/inc/sir_api.h

@@ -904,16 +904,11 @@ struct join_req {
 	tAniEdType UCEncryptionType;
 	enum ani_akm_type akm;
 
-	bool is11Rconnection;
-	bool is_adaptive_11r_connection;
 #ifdef FEATURE_WLAN_ESE
-	bool isESEFeatureIniEnabled;
-	bool isESEconnection;
 	tESETspecInfo eseTspecInfo;
 #endif
 	bool isOSENConnection;
 	struct supported_channels supportedChannels;
-	bool sae_pmk_cached;
 	/* Pls make this as last variable in struct */
 	bool force_24ghz_in_ht20;
 	bool force_rsne_override;

+ 1 - 1
core/mac/src/pe/lim/lim_process_fils.c

@@ -1025,7 +1025,7 @@ void lim_add_fils_data_to_auth_frame(struct pe_session *session,
 	 * MDIE to be sent in auth frame during initial
 	 * mobility domain association
 	 */
-	if (session->lim_join_req->is11Rconnection) {
+	if (session->is11Rconnection) {
 		struct bss_description *bss_desc;
 
 		bss_desc = &session->lim_join_req->bssDescription;

+ 280 - 120
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -234,6 +234,20 @@ fail:
 	return status;
 }
 
+#ifdef FEATURE_WLAN_ESE
+static inline bool
+lim_is_ese_enabled(struct mac_context *mac_ctx)
+{
+	return mac_ctx->mlme_cfg->lfr.ese_enabled;
+}
+#else
+static inline bool
+lim_is_ese_enabled(struct mac_context *mac_ctx)
+{
+	return false;
+}
+#endif
+
 /**
  * lim_process_set_antenna_mode_req() - Set antenna mode command
  * to WMA
@@ -1023,33 +1037,6 @@ void lim_get_random_bssid(struct mac_context *mac, uint8_t *data)
 	qdf_mem_copy(data, random, sizeof(tSirMacAddr));
 }
 
-#ifndef FEATURE_CM_ENABLE
-#ifdef WLAN_FEATURE_SAE
-
-/**
- * lim_update_sae_config()- This API update SAE session info to csr config
- * from join request.
- * @session: PE session
- * @sme_join_req: pointer to join request
- *
- * Return: None
- */
-static void lim_update_sae_config(struct pe_session *session,
-				  struct join_req *sme_join_req)
-{
-	session->sae_pmk_cached = sme_join_req->sae_pmk_cached;
-
-	pe_debug("pmk_cached %d for BSSID=" QDF_MAC_ADDR_FMT,
-		session->sae_pmk_cached,
-		QDF_MAC_ADDR_REF(sme_join_req->bssDescription.bssId));
-}
-#else
-static inline void lim_update_sae_config(struct pe_session *session,
-					 struct join_req *sme_join_req)
-{}
-#endif
-#endif
-
 /**
  * lim_send_join_req() - send vdev start request for assoc
  *@session: pe session
@@ -1272,18 +1259,6 @@ static bool lim_is_fast_roam_enabled(struct mac_context *mac_ctx,
 	return mac_ctx->mlme_cfg->lfr.lfr_enabled;
 }
 
-#ifdef FEATURE_WLAN_ESE
-static inline bool lim_is_ese_enabled(struct mac_context *mac_ctx)
-{
-	return mac_ctx->mlme_cfg->lfr.ese_enabled;
-}
-#else
-static inline bool lim_is_ese_enabled(struct mac_context *mac_ctx)
-{
-	return false;
-}
-#endif
-
 /**
  * lim_get_nss_supported_by_sta_and_ap() - finds out nss from session
  * and beacon from AP
@@ -2343,9 +2318,179 @@ static inline void lim_fill_rssi(struct pe_session *session,
 }
 #endif
 
+static QDF_STATUS lim_check_and_validate_6g_ap(struct mac_context *mac_ctx,
+					       struct bss_description *bss,
+					       tDot11fBeaconIEs *ie)
+{
+	tDot11fIEhe_op *he_op = &ie->he_op;
+
+	if (!wlan_reg_is_6ghz_chan_freq(bss->chan_freq))
+		return QDF_STATUS_SUCCESS;
+
+	if (!he_op->oper_info_6g_present) {
+		pe_err(QDF_MAC_ADDR_FMT" Invalid 6GHZ AP BSS description IE",
+			QDF_MAC_ADDR_REF(bss->bssId));
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+#if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
+/**
+ * lim_update_sae_single_pmk_ap_cap() - Function to update sae single pmk ap ie
+ * @mac: pointer to mac context
+ * @session: pe session
+ *
+ * Return: set sae single pmk feature
+ */
+static void
+lim_update_sae_single_pmk_ap_cap(struct mac_context *mac,
+				 struct pe_session *session)
+{
+	int32_t akm;
+
+	akm = wlan_crypto_get_param(session->vdev,
+				    WLAN_CRYPTO_PARAM_KEY_MGMT);
+
+	if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_SAE) &&
+	    mac->mlme_cfg->lfr.sae_single_pmk_feature_enabled)
+		wlan_mlme_set_sae_single_pmk_bss_cap(mac->psoc,
+			session->vdev_id,
+			session->lim_join_req->bssDescription.is_single_pmk);
+
+}
+#else
+static inline void
+lim_update_sae_single_pmk_ap_cap(struct mac_context *mac,
+				  struct pe_session *session)
+{
+}
+#endif
+
+#ifdef WLAN_FEATURE_SAE
+static void lim_update_sae_config(struct mac_context *mac,
+				  struct pe_session *session)
+{
+	struct wlan_crypto_pmksa *pmksa;
+	struct qdf_mac_addr bssid;
+
+	qdf_mem_copy(bssid.bytes, session->bssId,
+		     QDF_MAC_ADDR_SIZE);
+
+
+
+	pmksa = wlan_crypto_get_pmksa(session->vdev, &bssid);
+	if (!pmksa)
+		return;
+
+	session->sae_pmk_cached = true;
+	pe_debug("Found for BSSID=" QDF_MAC_ADDR_FMT,
+		 QDF_MAC_ADDR_REF(session->bssId));
+}
+#else
+static inline void lim_update_sae_config(struct mac_context *mac,
+					 struct pe_session *session)
+{ }
+#endif
+
+#ifdef FEATURE_WLAN_ESE
+static bool lim_is_open_mode(struct wlan_objmgr_vdev *vdev)
+{
+	int32_t ucast_cipher;
+
+	ucast_cipher = wlan_crypto_get_param(vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+	if (!ucast_cipher ||
+	    ((QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_NONE) ==
+	      ucast_cipher)))
+		return true;
+
+	return false;
+}
+
+static bool
+lim_ese_open_present(struct pe_session *session, bool ese_version_present)
+{
+	if (lim_is_open_mode(session->vdev) && ese_version_present &&
+	    session->mac_ctx->mlme_cfg->lfr.ese_enabled)
+		return true;
+
+	return false;
+}
+#else
+static bool
+lim_ese_open_present(struct pe_session *session, bool ese_version_present)
+{
+	return false;
+}
+#endif
+
+static void
+lim_fill_11r_params(struct mac_context *mac_ctx, struct pe_session *session,
+		    bool ese_version_present)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(mac_ctx->psoc);
+	if (!mlme_obj)
+		return;
+	if (wlan_cm_is_auth_type_11r(mlme_obj, session->vdev,
+	    session->lim_join_req->bssDescription.mdiePresent) &&
+	    !lim_ese_open_present(session, ese_version_present))
+		session->is11Rconnection = true;
+}
+
+#ifdef FEATURE_WLAN_ESE
+static bool
+lim_is_ese_profile(struct mac_context *mac_ctx, struct pe_session *session,
+		   bool ese_version_present)
+{
+	int32_t akm;
+	int32_t auth_mode;
+
+	akm = wlan_crypto_get_param(session->vdev,
+				    WLAN_CRYPTO_PARAM_KEY_MGMT);
+
+	auth_mode = wlan_crypto_get_param(session->vdev,
+					  WLAN_CRYPTO_PARAM_AUTH_MODE);
+
+	if (!mac_ctx->mlme_cfg->lfr.ese_enabled)
+		return false;
+
+	if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_CCKM))
+		return true;
+
+	/* A profile can not be both ESE and 11R. But an 802.11R AP
+	 * may be advertising support for ESE as well. So if we are
+	 * associating Open or explicitly ESE then we will get ESE.
+	 * If we are associating explicitly 11R only then we will get
+	 * 11R.
+	 */
+	return lim_ese_open_present(session, ese_version_present);
+}
+
+static void
+lim_fill_ese_params(struct mac_context *mac_ctx, struct pe_session *session,
+		    bool ese_version_present)
+{
+	if (lim_is_ese_profile(mac_ctx, session, ese_version_present))
+		session->isESEconnection = true;
+
+	wlan_cm_set_ese_assoc(mac_ctx->pdev, session->vdev_id,
+			      session->isESEconnection);
+}
+#else
+static inline void
+lim_fill_ese_params(struct mac_context *mac_ctx, struct pe_session *session,
+		    bool ese_version_present)
+{
+}
+#endif
+
 static QDF_STATUS
 lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
-		    struct bss_description *bss_desc, tSirResultCodes *ret_code)
+		    struct bss_description *bss_desc)
 {
 	uint8_t bss_chan_id;
 	tDot11fBeaconIEs *ie_struct;
@@ -2357,6 +2502,9 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 	struct lim_max_tx_pwr_attr tx_pwr_attr = {0};
 	tSirMacCapabilityInfo *ap_cap_info;
 	uint8_t wmm_mode, value;
+	struct wlan_mlme_lfr_cfg *lfr = &mac_ctx->mlme_cfg->lfr;
+	struct cm_roam_values_copy config;
+	bool ese_ver_present;
 
 	/*
 	 * Update the capability here itself as this is used in
@@ -2368,6 +2516,9 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 	bss_chan_id = wlan_reg_freq_to_chan(mac_ctx->pdev,
 					    bss_desc->chan_freq);
 
+	lim_update_sae_config(mac_ctx, session);
+	lim_update_sae_single_pmk_ap_cap(mac_ctx, session);
+
 	/* Update the beacon/probe filter in mac_ctx */
 	lim_set_bcn_probe_filter(mac_ctx, session,
 				 bss_chan_id);
@@ -2384,7 +2535,6 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 	if (QDF_IS_STATUS_ERROR(status)) {
 		pe_err("IE parsing failed vdev id %d",
 		       session->vdev_id);
-		*ret_code = eSIR_SME_RESOURCES_UNAVAILABLE;
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -2392,10 +2542,20 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 					lim_enable_twt(mac_ctx, ie_struct);
 
 	cb_mode = lim_get_cb_mode(mac_ctx, session, ie_struct);
+	if (WLAN_REG_IS_24GHZ_CH_FREQ(bss_desc->chan_freq) &&
+	    session->force_24ghz_in_ht20) {
+		cb_mode = PHY_SINGLE_CHANNEL_CENTERED;
+		pe_debug("force_24ghz_in_ht20 is set so set cbmode to 0");
+	}
 
 	status = lim_fill_dot11_mode(mac_ctx, session, ie_struct);
 	if (QDF_IS_STATUS_ERROR(status)) {
-		*ret_code = eSIR_SME_INVALID_PARAMETERS;
+		qdf_mem_free(ie_struct);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	status = lim_check_and_validate_6g_ap(mac_ctx, bss_desc, ie_struct);
+	if (QDF_IS_STATUS_ERROR(status)) {
 		qdf_mem_free(ie_struct);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -2404,9 +2564,15 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 					ie_struct);
 
 	lim_check_oui_and_update_session(mac_ctx, session, ie_struct);
+	ese_ver_present = ie_struct->ESEVersion.present;
 
 	qdf_mem_free(ie_struct);
 
+	wlan_add_supported_5Ghz_channels(mac_ctx->psoc, mac_ctx->pdev,
+			session->lim_join_req->supportedChannels.channelList,
+			&session->lim_join_req->supportedChannels.numChnl,
+			false);
+
 	/* Copying of bssId is already done, while creating session */
 	sir_copy_mac_addr(session->self_mac_addr,
 			  wlan_vdev_mlme_get_macaddr(session->vdev));
@@ -2423,6 +2589,26 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 	else
 		session->limQosEnabled = false;
 
+	if (session->lim_join_req->bssDescription.adaptive_11r_ap)
+		session->is_adaptive_11r_connection =
+				wlan_get_adaptive_11r_enabled(lfr);
+	config.bool_value = session->is_adaptive_11r_connection;
+	wlan_cm_roam_cfg_set_value(mac_ctx->psoc, session->vdev_id,
+				   ADAPTIVE_11R_CONNECTION,
+				   &config);
+	lim_fill_11r_params(mac_ctx, session , ese_ver_present);
+	lim_fill_ese_params(mac_ctx, session, ese_ver_present);
+
+
+	if (WLAN_REG_IS_5GHZ_CH_FREQ(bss_desc->chan_freq)) {
+		wlan_cm_set_disable_hi_rssi(mac_ctx->pdev, session->vdev_id,
+					    true);
+		pe_debug("Disabling HI_RSSI, AP freq=%d, rssi=%d",
+			  bss_desc->chan_freq, bss_desc->rssi);
+	} else {
+		wlan_cm_set_disable_hi_rssi(mac_ctx->pdev, session->vdev_id,
+					    false);
+	}
 	if (session->opmode == QDF_STA_MODE)
 		session->enable_bcast_probe_rsp =
 			mac_ctx->mlme_cfg->oce.enable_bcast_probe_rsp;
@@ -2618,6 +2804,40 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 	return QDF_STATUS_SUCCESS;
 }
 
+static QDF_STATUS
+lim_send_connect_req_to_mlm(struct pe_session *session)
+{
+	tLimMlmJoinReq *mlm_join_req;
+	uint32_t len;
+	QDF_STATUS status;
+
+	len = sizeof(tLimMlmJoinReq) +
+			session->lim_join_req->bssDescription.length + 2;
+	mlm_join_req = qdf_mem_malloc(len);
+	if (!mlm_join_req)
+		return QDF_STATUS_E_FAILURE;
+
+	/* PE SessionId is stored as a part of JoinReq */
+	mlm_join_req->sessionId = session->peSessionId;
+
+	mlm_join_req->bssDescription.length =
+		session->lim_join_req->bssDescription.length;
+
+	qdf_mem_copy((uint8_t *) &mlm_join_req->bssDescription.bssId,
+		(uint8_t *)
+		&session->lim_join_req->bssDescription.bssId,
+		session->lim_join_req->bssDescription.length + 2);
+
+	/* Issue LIM_MLM_JOIN_REQ to MLM */
+	status = lim_send_join_req(session, mlm_join_req);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		qdf_mem_free(mlm_join_req);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
 #ifdef FEATURE_CM_ENABLE
 static struct pe_session *
 lim_cm_create_session(struct mac_context *mac_ctx, struct cm_vdev_join_req *req)
@@ -2664,40 +2884,6 @@ lim_cm_create_session(struct mac_context *mac_ctx, struct cm_vdev_join_req *req)
 	return pe_session;
 }
 
-static QDF_STATUS
-lim_send_connect_req_to_mlm(struct pe_session *session)
-{
-	tLimMlmJoinReq *mlm_join_req;
-	uint32_t len;
-	QDF_STATUS status;
-
-	len = sizeof(tLimMlmJoinReq) +
-			session->lim_join_req->bssDescription.length + 2;
-	mlm_join_req = qdf_mem_malloc(len);
-	if (!mlm_join_req)
-		return QDF_STATUS_E_FAILURE;
-
-	/* PE SessionId is stored as a part of JoinReq */
-	mlm_join_req->sessionId = session->peSessionId;
-
-	mlm_join_req->bssDescription.length =
-		session->lim_join_req->bssDescription.length;
-
-	qdf_mem_copy((uint8_t *) &mlm_join_req->bssDescription.bssId,
-		(uint8_t *)
-		&session->lim_join_req->bssDescription.bssId,
-		session->lim_join_req->bssDescription.length + 2);
-
-	/* Issue LIM_MLM_JOIN_REQ to MLM */
-	status = lim_send_join_req(session, mlm_join_req);
-	if (QDF_IS_STATUS_ERROR(status)) {
-		qdf_mem_free(mlm_join_req);
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
 static bool
 lim_is_wpa_profile(struct pe_session *session)
 {
@@ -3201,7 +3387,6 @@ lim_fill_session_params(struct mac_context *mac_ctx,
 	struct bss_description *bss_desc;
 	uint32_t ie_len;
 	uint32_t bss_len;
-	tSirResultCodes ret_code = eSIR_SME_SUCCESS;
 	struct join_req *pe_join_req;
 	qdf_size_t op_rate_len, ext_rate_len;
 
@@ -3234,8 +3419,9 @@ lim_fill_session_params(struct mac_context *mac_ctx,
 	qdf_mem_copy(session->ssId.ssId, req->entry->ssid.ssid,
 		     session->ssId.length);
 
-	status = lim_fill_pe_session(mac_ctx, session, bss_desc,
-				     &ret_code);
+	session->force_24ghz_in_ht20 = req->force_24ghz_in_ht20;
+
+	status = lim_fill_pe_session(mac_ctx, session, bss_desc);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		pe_err("Failed to fill pe session vdev id %d",
 		       session->vdev_id);
@@ -3281,6 +3467,15 @@ lim_fill_session_params(struct mac_context *mac_ctx,
 		     req->scan_ie.ptr, req->scan_ie.len);
 	pe_join_req->addIEScan.length = req->scan_ie.len;
 
+	if (wlan_reg_is_6ghz_chan_freq(session->curr_op_freq)) {
+		if (!lim_is_session_he_capable(session)) {
+			pe_err("JOIN_REQ with invalid 6G security");
+			qdf_mem_free(session->lim_join_req);
+			session->lim_join_req = NULL;
+			return QDF_STATUS_E_FAILURE;
+		}
+	}
+
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -3560,9 +3755,7 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf)
 {
 	struct join_req *in_req = msg_buf;
 	struct join_req *sme_join_req = NULL;
-	tLimMlmJoinReq *mlm_join_req;
 	tSirResultCodes ret_code = eSIR_SME_SUCCESS;
-	uint32_t val = 0;
 	uint8_t session_id;
 	struct pe_session *session = NULL;
 	uint8_t vdev_id = 0;
@@ -3657,41 +3850,28 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf)
 
 		/* store the smejoin req handle in session table */
 		session->lim_join_req = sme_join_req;
+		session->force_24ghz_in_ht20 =
+			sme_join_req->force_24ghz_in_ht20;
 
-		status = lim_fill_pe_session(mac_ctx, session, bss_desc,
-					     &ret_code);
+		status = lim_fill_pe_session(mac_ctx, session, bss_desc);
 		if (QDF_IS_STATUS_ERROR(status)) {
 			pe_err("Failed to fill pe session vdev id %d",
 			       session->vdev_id);
+
+			ret_code = eSIR_SME_INVALID_PARAMETERS;
 			goto end;
 		}
 
 		session->wps_registration = sme_join_req->wps_registration;
 
-		session->force_24ghz_in_ht20 =
-			sme_join_req->force_24ghz_in_ht20;
-
 		/* Copy the SSID from smejoinreq to session entry  */
 		session->ssId.length = sme_join_req->ssId.length;
 		qdf_mem_copy(session->ssId.ssId, sme_join_req->ssId.ssId,
 			session->ssId.length);
 
-		/*
-		 * Determin 11r or ESE connection based on input from SME
-		 * which inturn is dependent on the profile the user wants
-		 * to connect to, So input is coming from supplicant
-		 */
-		session->is11Rconnection = sme_join_req->is11Rconnection;
 		session->connected_akm = sme_join_req->akm;
-		session->is_adaptive_11r_connection =
-				sme_join_req->is_adaptive_11r_connection;
-#ifdef FEATURE_WLAN_ESE
-		session->isESEconnection = sme_join_req->isESEconnection;
-#endif
 
 		lim_update_fils_config(mac_ctx, session, sme_join_req);
-		lim_update_sae_config(session, sme_join_req);
-
 		session->encryptType = sme_join_req->UCEncryptionType;
 		if (wlan_reg_is_6ghz_chan_freq(session->curr_op_freq)) {
 			if (!lim_is_session_he_capable(session)) {
@@ -3710,17 +3890,6 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf)
 				     &sme_join_req->addIEAssoc,
 				     sizeof(tSirAddie));
 
-		val = sizeof(tLimMlmJoinReq) +
-			session->lim_join_req->bssDescription.length + 2;
-		mlm_join_req = qdf_mem_malloc(val);
-		if (!mlm_join_req) {
-			ret_code = eSIR_SME_RESOURCES_UNAVAILABLE;
-			goto end;
-		}
-
-		/* PE SessionId is stored as a part of JoinReq */
-		mlm_join_req->sessionId = session->peSessionId;
-
 		/* copy operational rate from session */
 		qdf_mem_copy((void *)&session->rateSet,
 			(void *)&sme_join_req->operationalRateSet,
@@ -3729,14 +3898,6 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf)
 			(void *)&sme_join_req->extendedRateSet,
 			sizeof(tSirMacRateSet));
 
-		mlm_join_req->bssDescription.length =
-			session->lim_join_req->bssDescription.length;
-
-		qdf_mem_copy((uint8_t *) &mlm_join_req->bssDescription.bssId,
-			(uint8_t *)
-			&session->lim_join_req->bssDescription.bssId,
-			session->lim_join_req->bssDescription.length + 2);
-
 		session->isOSENConnection = sme_join_req->isOSENConnection;
 		pe_debug("Freq %d width %d freq0 %d freq1 %d, Smps %d: mode %d action %d, nss 1x1 %d vdev_nss %d nss %d cbMode %d dot11mode %d subfer %d subfee %d csn %d is_cisco %d",
 			 session->curr_op_freq, session->ch_width,
@@ -3753,9 +3914,8 @@ __lim_process_sme_join_req(struct mac_context *mac_ctx, void *msg_buf)
 			 session->isCiscoVendorAP);
 
 		/* Issue LIM_MLM_JOIN_REQ to MLM */
-		status = lim_send_join_req(session, mlm_join_req);
+		status = lim_send_connect_req_to_mlm(session);
 		if (QDF_IS_STATUS_ERROR(status)) {
-			qdf_mem_free(mlm_join_req);
 			ret_code = eSIR_SME_REFUSED;
 			goto end;
 		}

+ 1 - 1
core/mac/src/pe/lim/lim_send_frames_host_roam.c

@@ -232,7 +232,7 @@ void lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context *mac_ctx,
 		populate_dot11f_ese_version(&frm->ESEVersion);
 	/* For ESE Associations fill the ESE IEs */
 	if (pe_session->isESEconnection &&
-	    pe_session->pLimReAssocReq->isESEFeatureIniEnabled) {
+	    mac_ctx->mlme_cfg->lfr.ese_enabled) {
 #ifndef FEATURE_DISABLE_RM
 		populate_dot11f_ese_rad_mgmt_cap(&frm->ESERadMgmtCap);
 #endif

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

@@ -2299,7 +2299,7 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 					    &frm->he_6ghz_band_cap);
 	}
 
-	if (pe_session->lim_join_req->is11Rconnection) {
+	if (pe_session->is11Rconnection) {
 		struct bss_description *bssdescr;
 
 		bssdescr = &pe_session->lim_join_req->bssDescription;
@@ -2334,7 +2334,7 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 		populate_dot11f_ese_version(&frm->ESEVersion);
 	/* For ESE Associations fill the ESE IEs */
 	if (pe_session->isESEconnection &&
-	    pe_session->lim_join_req->isESEFeatureIniEnabled) {
+	    mac_ctx->mlme_cfg->lfr.ese_enabled) {
 #ifndef FEATURE_DISABLE_RM
 		populate_dot11f_ese_rad_mgmt_cap(&frm->ESERadMgmtCap);
 #endif
@@ -2921,7 +2921,7 @@ lim_send_auth_mgmt_frame(struct mac_context *mac_ctx,
 
 		/* include MDIE in FILS authentication frame */
 		if (session->lim_join_req &&
-		    session->lim_join_req->is11Rconnection &&
+		    session->is11Rconnection &&
 		    auth_frame->authAlgoNumber == SIR_FILS_SK_WITHOUT_PFS &&
 		    session->lim_join_req->bssDescription.mdiePresent)
 			frame_len += (2 + SIR_MDIE_SIZE);

+ 2 - 171
core/sme/src/csr/csr_api_roam.c

@@ -13387,29 +13387,6 @@ static void csr_fill_connected_info(struct mac_context *mac_ctx,
 	csr_copy_tspec_ie_len(session, frame_ptr, rsp);
 }
 
-#ifdef FEATURE_WLAN_ESE
-static inline void csr_set_ese_assoc(struct mac_context *mac_ctx,
-				     tDot11fBeaconIEs *bcn_ies,
-				     tCsrRoamConnectedProfile *conn_profile,
-				     uint8_t vdev_id)
-{
-	if ((conn_profile->AuthType == eCSR_AUTH_TYPE_CCKM_WPA &&
-	     conn_profile->AuthType == eCSR_AUTH_TYPE_CCKM_RSN) ||
-	    (bcn_ies->ESEVersion.present &&
-	     mac_ctx->mlme_cfg->lfr.ese_enabled &&
-	     conn_profile->AuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM))
-		wlan_cm_set_ese_assoc(mac_ctx->pdev, vdev_id, true);
-	else
-		wlan_cm_set_ese_assoc(mac_ctx->pdev, vdev_id, false);
-}
-#else
-static inline void csr_set_ese_assoc(struct mac_context *mac_ctx,
-				     tDot11fBeaconIEs *bcn_ies,
-				     tCsrRoamConnectedProfile *conn_profile,
-				     uint8_t vdev_id)
-{}
-#endif
-
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
 static inline void csr_qos_send_disconnect_ind(struct mac_context *mac_ctx,
 					       uint8_t vdev_id)
@@ -13552,7 +13529,6 @@ static void csr_fill_connected_profile(struct mac_context *mac_ctx,
 			  conn_profile->country_code[1],
 			  conn_profile->country_code[2]);
 	}
-	csr_set_ese_assoc(mac_ctx, bcn_ies, conn_profile, vdev_id);
 	assoc_info.bss_desc = bss_desc;
 	assoc_info.uapsd_mask = rsp->uapsd_mask;
 	csr_qos_send_assoc_ind(mac_ctx, vdev_id, &assoc_info);
@@ -13897,45 +13873,6 @@ csr_validate_and_update_fils_info(struct mac_context *mac,
 }
 #endif
 
-#ifdef WLAN_FEATURE_SAE
-/*
- * csr_update_sae_config() - Copy SAE info to join request
- * @csr_join_req: csr join request
- * @mac: mac context
- * @session: sme session
- *
- * Return: None
- */
-static void csr_update_sae_config(struct join_req *csr_join_req,
-	struct mac_context *mac, struct csr_roam_session *session)
-{
-	tPmkidCacheInfo *pmkid_cache;
-
-	pmkid_cache = qdf_mem_malloc(sizeof(*pmkid_cache));
-	if (!pmkid_cache)
-		return;
-
-	qdf_mem_copy(pmkid_cache->BSSID.bytes,
-		     csr_join_req->bssDescription.bssId,
-		     QDF_MAC_ADDR_SIZE);
-
-	csr_join_req->sae_pmk_cached =
-	       csr_lookup_pmkid_using_bssid(mac, session, pmkid_cache);
-
-	qdf_mem_free(pmkid_cache);
-
-	if (!csr_join_req->sae_pmk_cached)
-		return;
-
-	sme_debug("Found for BSSID=" QDF_MAC_ADDR_FMT,
-		  QDF_MAC_ADDR_REF(csr_join_req->bssDescription.bssId));
-}
-#else
-static inline void csr_update_sae_config(struct join_req *csr_join_req,
-	struct mac_context *mac, struct csr_roam_session *session)
-{ }
-#endif
-
 #if defined(WLAN_FEATURE_11AX) && defined(WLAN_SUPPORT_TWT)
 /**
  * csr_enable_twt() - Check if its allowed to enable twt for this session
@@ -13965,54 +13902,6 @@ static bool csr_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie)
 }
 #endif
 
-static QDF_STATUS csr_check_and_validate_6g_ap(struct mac_context *mac_ctx,
-					       struct bss_description *bss,
-					       struct join_req *csr_join_req,
-					       tDot11fBeaconIEs *ie)
-{
-	tDot11fIEhe_op *he_op = &ie->he_op;
-
-	if (!wlan_reg_is_6ghz_chan_freq(bss->chan_freq))
-		return QDF_STATUS_SUCCESS;
-
-	if (!he_op->oper_info_6g_present) {
-		sme_err(QDF_MAC_ADDR_FMT" Invalid 6GHZ AP BSS description IE",
-			QDF_MAC_ADDR_REF(bss->bssId));
-		return QDF_STATUS_E_INVAL;
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
-#if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
-/**
- * csr_update_sae_single_pmk_ap_cap() - Function to update sae single pmk ap ie
- * @mac: pointer to mac context
- * @bss_desc: BSS Descriptor
- * @vdev_id: Vdev id
- * @akm: Akm type
- *
- * Return: true if sae single pmk feature is enabled
- */
-static void
-csr_update_sae_single_pmk_ap_cap(struct mac_context *mac,
-				 struct bss_description *bss_desc,
-				 uint8_t vdev_id, enum csr_akm_type akm)
-{
-	if (akm == eCSR_AUTH_TYPE_SAE &&
-	    mac->mlme_cfg->lfr.sae_single_pmk_feature_enabled)
-		wlan_mlme_set_sae_single_pmk_bss_cap(mac->psoc, vdev_id,
-						     bss_desc->is_single_pmk);
-}
-#else
-static inline void
-csr_update_sae_single_pmk_ap_cap(struct mac_context *mac,
-				 struct bss_description *bss_desc,
-				 uint8_t vdev_id, enum csr_akm_type akm)
-{
-}
-#endif
-
 static void csr_get_basic_rates(tSirMacRateSet *b_rates, uint32_t chan_freq)
 {
 	/*
@@ -14123,13 +14012,10 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 	}
 	neigh_roam_info = &mac->roam.neighborRoamInfo[sessionId];
 	bss_freq = pBssDescription->chan_freq;
-	if ((eWNI_SME_REASSOC_REQ == messageType) ||
-	    WLAN_REG_IS_5GHZ_CH_FREQ(bss_freq)) {
+	if ((eWNI_SME_REASSOC_REQ == messageType)) {
 		wlan_cm_set_disable_hi_rssi(mac->pdev, sessionId, true);
 		sme_debug("Disabling HI_RSSI, AP freq=%d, rssi=%d",
 			  pBssDescription->chan_freq, pBssDescription->rssi);
-	} else {
-		wlan_cm_set_disable_hi_rssi(mac->pdev, sessionId, false);
 	}
 
 	do {
@@ -14171,11 +14057,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 		if (!QDF_IS_STATUS_SUCCESS(status))
 			break;
 
-		status = csr_check_and_validate_6g_ap(mac, pBssDescription,
-						      csr_join_req, pIes);
-		if (!QDF_IS_STATUS_SUCCESS(status))
-			break;
-
 		csr_join_req->messageType = messageType;
 		csr_join_req->length = msgLen;
 		csr_join_req->vdev_id = (uint8_t) sessionId;
@@ -14218,8 +14099,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 		akm = pProfile->negotiatedAuthType;
 		csr_join_req->akm = csr_convert_csr_to_ani_akm_type(akm);
 
-		csr_update_sae_single_pmk_ap_cap(mac, pBssDescription,
-						 sessionId, akm);
 		csr_join_req->dot11mode = (uint8_t)dot11mode;
 		csr_join_req->wps_registration = pProfile->bWPSAssociation;
 		csr_join_req->force_24ghz_in_ht20 =
@@ -14268,17 +14147,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 			csr_join_req->extendedRateSet.numRates = 0;
 		}
 
-		if (pBssDescription->adaptive_11r_ap)
-			src_config.bool_value =
-				wlan_get_adaptive_11r_enabled(&mac->mlme_cfg->lfr);
-		else
-			src_config.bool_value = false;
-
-		csr_join_req->is_adaptive_11r_connection =
-					src_config.bool_value;
-		wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
-					   ADAPTIVE_11R_CONNECTION,
-					   &src_config);
 		/* rsnIE */
 		if (csr_is_profile_wpa(pProfile)) {
 			/* Insert the Wpa IE into the join request */
@@ -14467,39 +14335,8 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 #ifdef FEATURE_WLAN_ESE
 		ese_config =  mac->mlme_cfg->lfr.ese_enabled;
 #endif
-		pProfile->mdid.mdie_present = pBssDescription->mdiePresent;
-		if (csr_is_profile11r(mac, pProfile)
-#ifdef FEATURE_WLAN_ESE
-		    &&
-		    !((pProfile->negotiatedAuthType ==
-		       eCSR_AUTH_TYPE_OPEN_SYSTEM) && (pIes->ESEVersion.present)
-		      && (ese_config))
-#endif
-			)
-			csr_join_req->is11Rconnection = true;
-		else
-			csr_join_req->is11Rconnection = false;
-#ifdef FEATURE_WLAN_ESE
-		if (true == ese_config)
-			csr_join_req->isESEFeatureIniEnabled = true;
-		else
-			csr_join_req->isESEFeatureIniEnabled = false;
-
-		/* A profile can not be both ESE and 11R. But an 802.11R AP
-		 * may be advertising support for ESE as well. So if we are
-		 * associating Open or explicitly ESE then we will get ESE.
-		 * If we are associating explicitly 11R only then we will get
-		 * 11R.
-		 */
-		if ((csr_is_profile_ese(pProfile) ||
-			((pIes->ESEVersion.present) &&
-			(pProfile->negotiatedAuthType ==
-				eCSR_AUTH_TYPE_OPEN_SYSTEM)))
-			&& (ese_config))
-			csr_join_req->isESEconnection = true;
-		else
-			csr_join_req->isESEconnection = false;
 
+#ifdef FEATURE_WLAN_ESE
 		if (eWNI_SME_JOIN_REQ == messageType) {
 			tESETspecInfo eseTspec;
 			/*
@@ -14552,11 +14389,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 		else
 			csr_join_req->isOSENConnection = false;
 
-		wlan_add_supported_5Ghz_channels(mac->psoc, mac->pdev,
-				csr_join_req->supportedChannels.channelList,
-				&csr_join_req->supportedChannels.numChnl,
-				false);
-
 		/* Move the entire BssDescription into the join request. */
 		qdf_mem_copy(&csr_join_req->bssDescription, pBssDescription,
 				pBssDescription->length +
@@ -14569,7 +14401,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 		if (QDF_IS_STATUS_ERROR(status))
 			return status;
 
-		csr_update_sae_config(csr_join_req, mac, pSession);
 		/*
 		 * conc_custom_rule1:
 		 * If SAP comes up first and STA comes up later then SAP