Forráskód Böngészése

qcacld-3.0: Refactor connection manager connect code

Refactor connection manager connect code.

Change-Id: I34379170595637159ba13970fec8b9bff3620cc3
CRs-Fixed: 2880933
gaurank kathpalia 4 éve
szülő
commit
0e06319d7e

+ 6 - 21
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_api.h

@@ -156,27 +156,6 @@ static inline void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
 #endif
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
-/**
- * cm_get_diag_enc_type - get diag enc type
- * @cipherset: enc type to convert
- *
- * Return: diag enc type
- */
-enum mgmt_encrypt_type cm_get_diag_enc_type(uint32_t cipherset);
-
-/**
- * cm_diag_get_auth_type - get auth type
- * @auth_type: diag auth type to fill
- * @authmodeset: authmode to calculate diag auth type
- * @akm: akm  to calculate diag auth type
- * @ucastcipherset: cipher to calculate diag auth type
- *
- * Return: none
- */
-void cm_diag_get_auth_type(uint8_t *auth_type,
-			   uint32_t authmodeset, uint32_t akm,
-			   uint32_t ucastcipherset);
-
 /**
  * cm_connect_info - send connect info to diag
  * @vdev: vdev ptr
@@ -191,6 +170,12 @@ void cm_connect_info(struct wlan_objmgr_vdev *vdev, bool connect_success,
 		     struct qdf_mac_addr *bssid, struct wlan_ssid *ssid,
 		     qdf_freq_t freq);
 
+void cm_diag_get_auth_enc_type_vdev_id(struct wlan_objmgr_psoc *psoc,
+				       uint8_t *auth_type,
+				       uint8_t *ucast_cipher,
+				       uint8_t *mcast_cipher,
+				       uint8_t vdev_id);
+
 #ifdef WLAN_UNIT_TEST
 /**
  * cm_get_sta_cxn_info - fill sta context info in buffer

+ 41 - 4
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -402,7 +402,7 @@ static enum mgmt_bss_type cm_get_diag_persona(enum QDF_OPMODE persona)
 	}
 }
 
-enum mgmt_encrypt_type cm_get_diag_enc_type(uint32_t cipherset)
+static enum mgmt_encrypt_type cm_get_diag_enc_type(uint32_t cipherset)
 {
 	enum mgmt_encrypt_type n = ENC_MODE_OPEN;
 
@@ -467,9 +467,9 @@ static void cm_diag_fill_wapi_auth_type(uint8_t *auth_type, uint32_t akm)
 		*auth_type = AUTH_WAPI_PSK;
 }
 
-void cm_diag_get_auth_type(uint8_t *auth_type,
-			   uint32_t authmodeset, uint32_t akm,
-			   uint32_t ucastcipherset)
+static void cm_diag_get_auth_type(uint8_t *auth_type,
+				  uint32_t authmodeset, uint32_t akm,
+				  uint32_t ucastcipherset)
 {
 	if (!authmodeset) {
 		*auth_type = AUTH_OPEN;
@@ -692,6 +692,43 @@ void cm_connect_info(struct wlan_objmgr_vdev *vdev, bool connect_success,
 	cm_connect_success_diag(mlme_obj, &conn_stats);
 }
 
+void cm_diag_get_auth_enc_type_vdev_id(struct wlan_objmgr_psoc *psoc,
+				       uint8_t *auth_type,
+				       uint8_t *ucast_cipher,
+				       uint8_t *mcast_cipher,
+				       uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_crypto_params *crypto_params;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL for vdev %d", vdev_id);
+		return;
+	}
+
+	crypto_params = wlan_crypto_vdev_get_crypto_params(vdev);
+	if (!crypto_params) {
+		mlme_err("crypto params is null");
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+		return;
+	}
+	if (auth_type)
+		cm_diag_get_auth_type(auth_type,
+				      crypto_params->authmodeset,
+				      crypto_params->key_mgmt,
+				      crypto_params->ucastcipherset);
+	if (ucast_cipher)
+		*ucast_cipher =
+			cm_get_diag_enc_type(crypto_params->ucastcipherset);
+	if (mcast_cipher)
+		*mcast_cipher =
+			cm_get_diag_enc_type(crypto_params->ucastcipherset);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+
+}
+
 #ifdef WLAN_UNIT_TEST
 static const char *cm_diag_get_persona(enum mgmt_bss_type persona)
 {

+ 4 - 58
core/sme/src/csr/csr_api_roam.c

@@ -2585,43 +2585,6 @@ static void csr_roam_populate_channels(tDot11fBeaconIEs *beacon_ies,
 #endif
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
-void cm_diag_get_auth_enc_type_vdev_id(struct wlan_objmgr_psoc *psoc,
-				       uint8_t *auth_type,
-				       uint8_t *ucast_cipher,
-				       uint8_t *mcast_cipher,
-				       uint8_t vdev_id)
-{
-	struct wlan_objmgr_vdev *vdev;
-	struct wlan_crypto_params *crypto_params;
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
-						    WLAN_LEGACY_MAC_ID);
-	if (!vdev) {
-		mlme_err("vdev object is NULL for vdev %d", vdev_id);
-		return;
-	}
-	crypto_params = wlan_crypto_vdev_get_crypto_params(vdev);
-
-	if (!crypto_params) {
-		mlme_err("crypto params is null");
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
-		return;
-	}
-	if (auth_type)
-		cm_diag_get_auth_type(auth_type,
-				      crypto_params->authmodeset,
-				      crypto_params->key_mgmt,
-				      crypto_params->ucastcipherset);
-	if (ucast_cipher)
-		*ucast_cipher =
-			cm_get_diag_enc_type(crypto_params->ucastcipherset);
-	if (mcast_cipher)
-		*mcast_cipher =
-			cm_get_diag_enc_type(crypto_params->ucastcipherset);
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
-
-}
-
 #ifndef FEATURE_CM_ENABLE
 static void
 csr_cm_connect_info(struct mac_context *mac_ctx, uint8_t vdev_id,
@@ -13032,7 +12995,6 @@ QDF_STATUS cm_csr_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 	 * CSR is cleaned up fully. No new params should be added to CSR, use
 	 * vdev/pdev/psoc instead
 	 */
-
 	mac_ctx = cds_get_context(QDF_MODULE_ID_SME);
 	if (!mac_ctx)
 		return QDF_STATUS_E_INVAL;
@@ -13062,6 +13024,7 @@ QDF_STATUS cm_csr_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 	status = csr_cm_update_fils_info(vdev, bss_desc, req);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		sme_err("failed to update fils info vdev id %d", vdev_id);
+		qdf_mem_free(ie_struct);
 		qdf_mem_free(bss_desc);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -13076,22 +13039,17 @@ QDF_STATUS cm_csr_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 
 	status = csr_get_rate_set(mac_ctx, ie_struct, &op_rate_set,
 				  &ext_rate_set);
+	qdf_mem_free(ie_struct);
+	qdf_mem_free(bss_desc);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
 		sme_err("Rates parsing failed vdev id %d", vdev_id);
-		qdf_mem_free(ie_struct);
-		qdf_mem_free(bss_desc);
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	qdf_mem_free(ie_struct);
-	qdf_mem_free(bss_desc);
-
 	mlme_set_opr_rate(vdev, op_rate_set.rate, op_rate_set.numRates);
 	mlme_set_ext_opr_rate(vdev, ext_rate_set.rate, ext_rate_set.numRates);
 
-	/* Fill join_req from legacy */
-	mac_ctx->mlme_cfg->sta.current_rssi = join_req->entry->rssi_raw;
 	csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINING, vdev_id);
 
 	return QDF_STATUS_SUCCESS;
@@ -13231,6 +13189,7 @@ static void csr_fill_connected_profile(struct mac_context *mac_ctx,
 	struct wlan_channel *chan;
 
 	conn_profile = &session->connectedProfile;
+	qdf_mem_zero(conn_profile, sizeof(tCsrRoamConnectedProfile));
 	conn_profile->modifyProfileFields.uapsd_mask = rsp->uapsd_mask;
 	conn_profile->op_freq = rsp->connect_rsp.freq;
 	qdf_copy_macaddr(&conn_profile->bssid, &rsp->connect_rsp.bssid);
@@ -13383,11 +13342,6 @@ QDF_STATUS cm_csr_connect_rsp(struct wlan_objmgr_vdev *vdev,
 	return QDF_STATUS_SUCCESS;
 }
 
-static inline bool cm_is_fils_connection(struct wlan_cm_connect_resp *resp)
-{
-	return resp->is_fils_connection;
-}
-
 QDF_STATUS
 cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 			struct wlan_cm_connect_resp *rsp)
@@ -13405,7 +13359,6 @@ cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 	 * CSR is cleaned up fully. No new params should be added to CSR, use
 	 * vdev/pdev/psoc instead
 	 */
-
 	mac_ctx = cds_get_context(QDF_MODULE_ID_SME);
 	if (!mac_ctx)
 		return QDF_STATUS_E_INVAL;
@@ -13522,8 +13475,6 @@ QDF_STATUS cm_csr_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
 					 vdev_id);
 	}
 
-	/* Fill join_req from legacy */
-
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -13577,8 +13528,6 @@ QDF_STATUS cm_csr_handle_diconnect_req(struct wlan_objmgr_vdev *vdev,
 	wlan_roam_reset_roam_params(mac_ctx->psoc);
 	csr_roam_restore_default_config(mac_ctx, vdev_id);
 
-	/* Fill legacy struct */
-
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -13594,7 +13543,6 @@ cm_csr_diconnect_done_ind(struct wlan_objmgr_vdev *vdev,
 	 * CSR is cleaned up fully. No new params should be added to CSR, use
 	 * vdev/pdev/psoc instead
 	 */
-
 	mac_ctx = cds_get_context(QDF_MODULE_ID_SME);
 	if (!mac_ctx)
 		return QDF_STATUS_E_INVAL;
@@ -13605,8 +13553,6 @@ cm_csr_diconnect_done_ind(struct wlan_objmgr_vdev *vdev,
 	csr_set_default_dot11_mode(mac_ctx);
 	csr_free_connect_bss_desc(mac_ctx, vdev_id);
 
-	/* Fill legacy structures/ops from resp */
-
 	return QDF_STATUS_SUCCESS;
 }
 

+ 0 - 6
core/sme/src/csr/csr_inside_api.h

@@ -598,12 +598,6 @@ void csr_get_vdev_type_nss(enum QDF_OPMODE dev_mode, uint8_t *nss_2g,
 #define WLAN_80211D_DISABLED         0
 #define WLAN_80211D_SUPPORT_MULTI_DOMAIN     1
 #define WLAN_80211D_NOT_SUPPORT_MULTI_DOMAIN     2
-
-void cm_diag_get_auth_enc_type_vdev_id(struct wlan_objmgr_psoc *psoc,
-				       uint8_t *auth_type,
-				       uint8_t *ucast_cipher,
-				       uint8_t *mcast_cipher,
-				       uint8_t vdev_id);
 #endif /* #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR */
 /*
  * csr_scan_result_purge() -