Browse Source

qcacld-3.0: Implement LFR2 and reassoc for new vdev SM

LFR2 uses ft reassoc, whose process is different from general
connect.

1.ft reassoc, normal reassoc and assoc, all of 3 need deliver
event WLAN_VDEV_SM_EV_START to SM,  but need different handler.

2.ft reassoc send vdev start when add bss, not switch channel.

Change-Id: Ieefbcf0a28867be3c8a86d9a912143857c54fe06
CRs-Fixed: 2334194
Jianmin Zhu 6 years ago
parent
commit
0923660ec1

+ 33 - 0
components/mlme/core/inc/wlan_mlme_vdev_mgr_interface.h

@@ -26,6 +26,18 @@
 #include <wlan_objmgr_vdev_obj.h>
 #include "include/wlan_vdev_mlme.h"
 
+/**
+ * enum vdev_assoc_type - VDEV associate/reassociate type
+ * @VDEV_ASSOC: associate
+ * @VDEV_REASSOC: reassociate
+ * @VDEV_FT_REASSOC: fast reassociate
+ */
+enum vdev_assoc_type {
+	VDEV_ASSOC,
+	VDEV_REASSOC,
+	VDEV_FT_REASSOC
+};
+
 /**
  * struct mlme_legacy_priv - VDEV MLME legacy priv object
  * @chan_switch_in_progress: flag to indicate that channel switch is in progress
@@ -33,12 +45,14 @@
  *                                   in progress
  * @vdev_start_failed: flag to indicate that vdev start failed.
  * @connection_fail: flag to indicate connection failed
+ * @assoc_type: vdev associate/reassociate type
  */
 struct mlme_legacy_priv {
 	bool chan_switch_in_progress;
 	bool hidden_ssid_restart_in_progress;
 	bool vdev_start_failed;
 	bool connection_fail;
+	enum vdev_assoc_type assoc_type;
 };
 
 /**
@@ -144,5 +158,24 @@ bool mlme_get_vdev_start_failed(struct wlan_objmgr_vdev *vdev);
  * Return: true or false
  */
 bool mlme_is_vdev_in_beaconning_mode(enum QDF_OPMODE vdev_opmode);
+
+/**
+ * mlme_set_assoc_type() - set associate type
+ * @vdev: vdev pointer
+ * @assoc_type: type to be set
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS mlme_set_assoc_type(struct wlan_objmgr_vdev *vdev,
+			       enum vdev_assoc_type assoc_type);
+
+/**
+ * mlme_get_assoc_type() - get associate type
+ * @vdev: vdev pointer
+ *
+ * Return: associate type
+ */
+enum vdev_assoc_type  mlme_get_assoc_type(struct wlan_objmgr_vdev *vdev);
+
 #endif
 #endif

+ 35 - 0
components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c

@@ -541,6 +541,41 @@ bool mlme_is_connection_fail(struct wlan_objmgr_vdev *vdev)
 	return mlme_priv->connection_fail;
 }
 
+QDF_STATUS mlme_set_assoc_type(struct wlan_objmgr_vdev *vdev,
+			       enum vdev_assoc_type assoc_type)
+{
+	struct vdev_mlme_obj *vdev_mlme;
+	struct mlme_legacy_priv *mlme_priv;
+
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
+	if (!vdev_mlme) {
+		mlme_err("vdev component object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mlme_priv = (struct mlme_legacy_priv *)vdev_mlme->legacy_vdev_ptr;
+
+	mlme_priv->assoc_type = assoc_type;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+enum vdev_assoc_type  mlme_get_assoc_type(struct wlan_objmgr_vdev *vdev)
+{
+	struct vdev_mlme_obj *vdev_mlme;
+	struct mlme_legacy_priv *mlme_priv;
+
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
+	if (!vdev_mlme) {
+		mlme_err("vdev component object is NULL");
+		return false;
+	}
+
+	mlme_priv = (struct mlme_legacy_priv *)vdev_mlme->legacy_vdev_ptr;
+
+	return mlme_priv->assoc_type;
+}
+
 QDF_STATUS
 mlme_set_vdev_start_failed(struct wlan_objmgr_vdev *vdev, bool val)
 {

+ 6 - 5
core/mac/src/pe/include/lim_ft.h

@@ -41,8 +41,8 @@ void lim_ft_cleanup_pre_auth_info(tpAniSirGlobal pMac,
 int lim_process_ft_pre_auth_req(tpAniSirGlobal pMac,
 				struct scheduler_msg *pMsg);
 void lim_process_ft_preauth_rsp_timeout(tpAniSirGlobal pMac);
-void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac, uint32_t *pMsgBuf,
-		tpPESession psessionEntry);
+void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac,
+				    tpPESession psessionEntry);
 void lim_perform_ft_pre_auth(tpAniSirGlobal pMac, QDF_STATUS status,
 		uint32_t *data, tpPESession psessionEntry);
 void lim_post_ft_pre_auth_rsp(tpAniSirGlobal pMac, QDF_STATUS status,
@@ -56,7 +56,8 @@ QDF_STATUS lim_ft_setup_auth_session(tpAniSirGlobal pMac,
 void lim_process_mlm_reassoc_cnf(tpAniSirGlobal mac_ctx, uint32_t *msg);
 void lim_process_sta_mlm_add_bss_rsp_ft(tpAniSirGlobal pMac,
 		struct scheduler_msg *limMsgQ, tpPESession psessionEntry);
-void lim_process_mlm_reassoc_req(tpAniSirGlobal mac_ctx, uint32_t *msg);
+void lim_process_mlm_reassoc_req(tpAniSirGlobal mac_ctx,
+				 tLimMlmReassocReq *reassoc_req);
 void lim_preauth_scan_event_handler(tpAniSirGlobal mac_ctx,
 				enum sir_scan_event_type event,
 				uint8_t session_id,
@@ -70,7 +71,7 @@ static inline void lim_ft_cleanup_pre_auth_info(tpAniSirGlobal pMac,
 static inline void lim_process_ft_preauth_rsp_timeout(tpAniSirGlobal pMac)
 {}
 static inline void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac,
-		uint32_t *pMsgBuf, tpPESession psessionEntry)
+						  tpPESession psessionEntry)
 {}
 static inline void lim_handle_ft_pre_auth_rsp(tpAniSirGlobal pMac,
 		QDF_STATUS status, uint8_t *auth_rsp,
@@ -83,7 +84,7 @@ static inline void lim_process_sta_mlm_add_bss_rsp_ft(tpAniSirGlobal pMac,
 		struct scheduler_msg *limMsgQ, tpPESession psessionEntry)
 {}
 static inline void lim_process_mlm_reassoc_req(tpAniSirGlobal mac_ctx,
-		uint32_t *msg)
+					       tLimMlmReassocReq *reassoc_req)
 {}
 static inline void lim_preauth_scan_event_handler(tpAniSirGlobal mac_ctx,
 		enum sir_scan_event_type event,

+ 3 - 16
core/mac/src/pe/lim/lim_process_mlm_host_roam.c

@@ -56,20 +56,14 @@ static void lim_handle_sme_reaasoc_result(tpAniSirGlobal, tSirResultCodes,
  *
  * Return: None
  */
-void lim_process_mlm_reassoc_req(tpAniSirGlobal mac_ctx, uint32_t *msg)
+void lim_process_mlm_reassoc_req(tpAniSirGlobal mac_ctx,
+				 tLimMlmReassocReq *reassoc_req)
 {
 	uint8_t channel, sec_ch_offset;
 	struct tLimPreAuthNode *auth_node;
-	tLimMlmReassocReq *reassoc_req;
 	tLimMlmReassocCnf reassoc_cnf;
 	tpPESession session;
 
-	if (msg == NULL) {
-		pe_err("Buffer is Pointing to NULL");
-		return;
-	}
-
-	reassoc_req = (tLimMlmReassocReq *) msg;
 	session = pe_find_session_by_session_id(mac_ctx,
 			reassoc_req->sessionId);
 	if (NULL == session) {
@@ -572,18 +566,15 @@ end:
 /**
  * lim_process_mlm_ft_reassoc_req() - Handle the Reassoc request
  * @pMac: Global MAC context
- * @pMsgBuf: Buffer which holds the data
  * @psessionEntry: PE Session
  *
  *  This function handles the Reassoc Req from SME
  *
  *  Return: None
  */
-void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac, uint32_t *pMsgBuf,
+void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac,
 				    tpPESession psessionEntry)
 {
-	uint8_t smeSessionId = 0;
-	uint16_t transactionId = 0;
 	uint8_t chanNum = 0;
 	tLimMlmReassocReq *pMlmReassocReq;
 	uint16_t caps;
@@ -593,10 +584,6 @@ void lim_process_mlm_ft_reassoc_req(tpAniSirGlobal pMac, uint32_t *pMsgBuf,
 	uint32_t teleBcnEn = 0;
 
 	chanNum = psessionEntry->currentOperChannel;
-	lim_get_session_info(pMac, (uint8_t *) pMsgBuf, &smeSessionId,
-			     &transactionId);
-	psessionEntry->smeSessionId = smeSessionId;
-	psessionEntry->transactionId = transactionId;
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM    /* FEATURE_WLAN_DIAG_SUPPORT */
 	lim_diag_event_report(pMac, WLAN_PE_DIAG_REASSOCIATING,

+ 62 - 7
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -1177,7 +1177,7 @@ static inline void lim_update_sae_config(tpPESession session,
 #endif
 
 /**
- * lim_send_join_req() - send vdev start request
+ * lim_send_join_req() - send vdev start request for assoc
  *@session: pe session
  *@mlm_join_req: join req
  *
@@ -1188,6 +1188,7 @@ static inline void lim_update_sae_config(tpPESession session,
 static QDF_STATUS lim_send_join_req(tpPESession session,
 				    tLimMlmJoinReq *mlm_join_req)
 {
+	mlme_set_assoc_type(session->vdev, VDEV_ASSOC);
 	return wlan_vdev_mlme_sm_deliver_evt(session->vdev,
 					     WLAN_VDEV_SM_EV_START,
 					     sizeof(*mlm_join_req),
@@ -1203,6 +1204,59 @@ static QDF_STATUS lim_send_join_req(tpPESession session,
 }
 #endif
 
+/**
+ * lim_send_reassoc_req() - send vdev start request for reassoc
+ *@session: pe session
+ *@mlm_join_req: join req
+ *
+ * Return: QDF_STATUS
+ */
+
+#ifdef CONFIG_VDEV_SM
+static QDF_STATUS lim_send_reassoc_req(tpPESession session,
+				       tLimMlmReassocReq *reassoc_req)
+{
+	mlme_set_assoc_type(session->vdev, VDEV_REASSOC);
+	return wlan_vdev_mlme_sm_deliver_evt(session->vdev,
+					     WLAN_VDEV_SM_EV_START,
+					     sizeof(*reassoc_req),
+					     reassoc_req);
+}
+#else
+static QDF_STATUS lim_send_reassoc_req(tpPESession session,
+				       tLimMlmReassocReq *reassoc_req)
+{
+	lim_process_mlm_reassoc_req(session->mac_ctx, reassoc_req);
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
+/**
+ * lim_send_ft_reassoc_req() - send vdev start request for ft_reassoc
+ *@session: pe session
+ *@mlm_join_req: join req
+ *
+ * Return: QDF_STATUS
+ */
+
+#ifdef CONFIG_VDEV_SM
+static QDF_STATUS lim_send_ft_reassoc_req(tpPESession session)
+{
+	mlme_set_assoc_type(session->vdev, VDEV_FT_REASSOC);
+	return wlan_vdev_mlme_sm_deliver_evt(session->vdev,
+					     WLAN_VDEV_SM_EV_START,
+					     sizeof(*session),
+					     session);
+}
+#else
+static QDF_STATUS lim_send_ft_reassoc_req(tpPESession session)
+{
+	lim_process_mlm_ft_reassoc_req(session->mac_ctx, session);
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif
 
 /**
  * __lim_process_sme_join_req() - process SME_JOIN_REQ message
@@ -1772,6 +1826,8 @@ static void __lim_process_sme_reassoc_req(tpAniSirGlobal mac_ctx,
 		ret_code = eSIR_SME_INVALID_PARAMETERS;
 		goto end;
 	}
+	lim_get_session_info(mac_ctx, (uint8_t *)msg_buf,
+			     &sme_session_id, &transaction_id);
 
 	session_entry = pe_find_session_by_bssid(mac_ctx,
 			reassoc_req->bssDescription.bssId,
@@ -1781,8 +1837,6 @@ static void __lim_process_sme_reassoc_req(tpAniSirGlobal mac_ctx,
 		lim_print_mac_addr(mac_ctx, reassoc_req->bssDescription.bssId,
 				LOGE);
 		ret_code = eSIR_SME_INVALID_PARAMETERS;
-		lim_get_session_info(mac_ctx, (uint8_t *)msg_buf,
-				&sme_session_id, &transaction_id);
 		session_entry =
 			pe_find_session_by_sme_session_id(mac_ctx,
 					sme_session_id);
@@ -1865,8 +1919,9 @@ static void __lim_process_sme_reassoc_req(tpAniSirGlobal mac_ctx,
 				goto end;
 			}
 
-			lim_process_mlm_ft_reassoc_req(mac_ctx, msg_buf,
-					session_entry);
+			session_entry->smeSessionId = sme_session_id;
+			session_entry->transactionId = transaction_id;
+			lim_send_ft_reassoc_req(session_entry);
 			return;
 		}
 		/*
@@ -1975,8 +2030,8 @@ static void __lim_process_sme_reassoc_req(tpAniSirGlobal mac_ctx,
 				session_entry->peSessionId,
 				session_entry->limSmeState));
 
-	lim_post_mlm_message(mac_ctx,
-			     LIM_MLM_REASSOC_REQ, (uint32_t *)mlm_reassoc_req);
+	lim_send_reassoc_req(session_entry, mlm_reassoc_req);
+
 	return;
 end:
 	if (reassoc_req) {

+ 16 - 2
core/mac/src/pe/lim/lim_utils.c

@@ -63,6 +63,7 @@
 #endif
 #include "cfg_mlme_obss_ht40.h"
 #include "cfg_ucfg_api.h"
+#include "lim_ft.h"
 
 #define ASCII_SPACE_CHARACTER 0x20
 
@@ -8392,6 +8393,7 @@ QDF_STATUS lim_sta_mlme_vdev_start_send(struct vdev_mlme_obj *vdev_mlme,
 					uint16_t data_len, void *data)
 {
 	tpAniSirGlobal mac_ctx;
+	enum vdev_assoc_type assoc_type;
 
 	mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
 	if (!mac_ctx) {
@@ -8401,8 +8403,20 @@ QDF_STATUS lim_sta_mlme_vdev_start_send(struct vdev_mlme_obj *vdev_mlme,
 		return QDF_STATUS_E_INVAL;
 	}
 
-	lim_process_mlm_join_req(mac_ctx, (tLimMlmJoinReq *)data);
-
+	assoc_type = mlme_get_assoc_type(vdev_mlme->vdev);
+	switch (assoc_type) {
+	case VDEV_ASSOC:
+		lim_process_mlm_join_req(mac_ctx, (tLimMlmJoinReq *)data);
+		break;
+	case VDEV_REASSOC:
+		lim_process_mlm_reassoc_req(mac_ctx, (tLimMlmReassocReq *)data);
+		break;
+	case VDEV_FT_REASSOC:
+		lim_process_mlm_ft_reassoc_req(mac_ctx, (tPESession *)data);
+		break;
+	default:
+		pe_err("assoc_type %d is invalid", assoc_type);
+	}
 	return QDF_STATUS_SUCCESS;
 }
 

+ 15 - 2
core/wma/src/wma_utils.c

@@ -4807,9 +4807,22 @@ QDF_STATUS wma_sta_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
 					    uint16_t data_len, void *data)
 {
 	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+	enum vdev_assoc_type assoc_type;
 
-	wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
-				   data, 0);
+	assoc_type = mlme_get_assoc_type(vdev_mlme->vdev);
+	switch (assoc_type) {
+	case VDEV_ASSOC:
+	case VDEV_REASSOC:
+		wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
+					   data, 0);
+		break;
+	case VDEV_FT_REASSOC:
+		wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP,
+					   data, 0);
+		break;
+	default:
+		WMA_LOGE(FL("assoc_type %d is invalid"), assoc_type);
+	}
 
 	return QDF_STATUS_SUCCESS;
 }