Browse Source

qcacld-3.0: Use wlan_cm_is_vdev_roaming() API in wma

Use wlan_cm_is_vdev_roaming() API in wma, instead of
wma->interfaces[vdev_id].roaming_in_progress.

Change-Id: Icb88246b2c45c052a1d42dece4983b1e534fe608
CRs-Fixed: 2993180
Utkarsh Bhatnagar 3 years ago
parent
commit
91d6eaf0fd

+ 2 - 1
components/mlme/core/src/wlan_mlme_main.c

@@ -2956,13 +2956,14 @@ bool wlan_vdev_id_is_11n_allowed(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
 					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
 
 	if (ucast_cipher == -1)
-		return is_11n_allowed;
+		goto err;
 	if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_TKIP) ||
 	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP) ||
 	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_40) ||
 	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_104))
 		is_11n_allowed = false;
 
+err:
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
 
 	return is_11n_allowed;

+ 0 - 2
core/wma/inc/wma.h

@@ -670,7 +670,6 @@ struct wma_invalid_peer_params {
  * @nwType: network type (802.11a/b/g/n/ac)
  * @ps_enabled: is powersave enable/disable
  * @peer_count: peer count
- * @roam_synch_in_progress: flag is in progress or not
  * @plink_status_req: link status request
  * @psnr_req: snr request
  * @tx_streams: number of tx streams can be used by the vdev
@@ -722,7 +721,6 @@ struct wma_txrx_node {
 #endif
 	uint32_t tx_streams;
 	uint32_t mac_id;
-	bool roaming_in_progress;
 	int32_t roam_synch_delay;
 	struct sme_rcpi_req *rcpi_req;
 	bool in_bmps;

+ 3 - 2
core/wma/src/wma_data.c

@@ -79,6 +79,7 @@
 #include <wlan_cp_stats_mc_ucfg_api.h>
 #include <wlan_crypto_global_api.h>
 #include <wlan_mlme_main.h>
+#include <wlan_cm_api.h>
 #include "wlan_pkt_capture_ucfg_api.h"
 
 struct wma_search_rate {
@@ -3166,8 +3167,8 @@ bool wma_is_roam_in_progress(uint32_t vdev_id)
 {
 	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
 
-	if (!wma)
+	if (!wma || !wma->interfaces[vdev_id].vdev)
 		return false;
 
-	return wma->interfaces[vdev_id].roaming_in_progress;
+	return wlan_cm_is_vdev_roaming(wma->interfaces[vdev_id].vdev);
 }

+ 4 - 3
core/wma/src/wma_dev_if.c

@@ -4191,15 +4191,16 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 	bool peer_assoc_cnf = false;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	uint8_t pdev_id = OL_TXRX_PDEV_ID;
+	struct wma_txrx_node *iface = &wma->interfaces[add_sta->smesessionId];
 
 	wma_debug("staType: %d, updateSta: %d, bssId: "QDF_MAC_ADDR_FMT", staMac: "QDF_MAC_ADDR_FMT,
 		 add_sta->staType,
 		 add_sta->updateSta, QDF_MAC_ADDR_REF(add_sta->bssId),
 		 QDF_MAC_ADDR_REF(add_sta->staMac));
 
-	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, add_sta->smesessionId) ||
-	    wma_is_roam_in_progress(add_sta->smesessionId)) {
-		wma_err("roaming in progress, reject add sta!");
+	if (iface->vdev && wlan_cm_is_vdev_roaming(iface->vdev)) {
+		wma_err("Vdev %d roaming in progress, reject add sta!",
+			add_sta->smesessionId);
 		add_sta->status = QDF_STATUS_E_PERM;
 		goto send_rsp;
 	}

+ 3 - 2
core/wma/src/wma_features.c

@@ -68,6 +68,7 @@
 #include "target_if_nan.h"
 #endif
 #include "wlan_scan_api.h"
+#include "wlan_cm_api.h"
 #include <wlan_crypto_global_api.h>
 #include "cdp_txrx_host_stats.h"
 
@@ -1233,8 +1234,8 @@ int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len)
 	if (!csa_offload_event)
 		return -EINVAL;
 
-	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(wma->psoc, vdev_id) ||
-	    wma->interfaces[vdev_id].roaming_in_progress) {
+	if (intr[vdev_id].vdev &&
+	    wlan_cm_is_vdev_roaming(intr[vdev_id].vdev)) {
 		wma_err("Roaming in progress for vdev %d, ignore csa event",
 			 vdev_id);
 		qdf_mem_free(csa_offload_event);

+ 5 - 3
core/wma/src/wma_mgmt.c

@@ -86,6 +86,7 @@
 #include <wlan_logging_sock_svc.h>
 #endif
 #include "wlan_cm_roam_api.h"
+#include "wlan_cm_api.h"
 
 /**
  * wma_send_bcn_buf_ll() - prepare and send beacon buffer to fw for LL
@@ -354,11 +355,12 @@ int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
 		      QDF_MAC_ADDR_REF(macaddr), QDF_MAC_ADDR_REF(addr),
 		      vdev_id, kickout_event->reason);
 
-	if (wma->interfaces[vdev_id].roaming_in_progress) {
-		wma_err("Ignore STA kick out since roaming is in progress");
+	if (wlan_cm_is_vdev_roaming(vdev)) {
+		wma_err("vdev_id %d: Ignore STA kick out since roaming is in progress",
+			vdev_id);
 		return -EINVAL;
 	}
-	bssid = wma_get_vdev_bssid(wma->interfaces[vdev_id].vdev);
+	bssid = wma_get_vdev_bssid(vdev);
 	if (!bssid) {
 		wma_err("Failed to get bssid for vdev_%d", vdev_id);
 		return -ENOMEM;

+ 0 - 11
core/wma/src/wma_scan_roam.c

@@ -996,14 +996,6 @@ int wma_mlme_roam_synch_event_handler_cb(void *handle, uint8_t *event,
 		return status;
 	}
 
-	/*
-	 * This flag is set during ROAM_START and once this event is being
-	 * executed which is a run to completion, no other event can interrupt
-	 * this in MC thread context. So, it is OK to reset the flag here as
-	 * soon as we receive this event.
-	 */
-	wma->interfaces[synch_event->vdev_id].roaming_in_progress = false;
-
 	if (synch_event->bcn_probe_rsp_len >
 	    param_buf->num_bcn_probe_rsp_frame ||
 	    synch_event->reassoc_req_len >
@@ -4008,7 +4000,6 @@ void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id)
 	if (!ind)
 		return;
 
-	wma->interfaces[vdev_id].roaming_in_progress = true;
 	ind->pdev = wma->pdev;
 	ind->vdev_id = vdev_id;
 	msg.bodyptr = ind;
@@ -4082,10 +4073,8 @@ static void wma_invalid_roam_reason_handler(tp_wma_handle wma_handle,
 	enum sir_roam_op_code op_code;
 
 	if (notif == WMI_ROAM_NOTIF_ROAM_START) {
-		wma_handle->interfaces[vdev_id].roaming_in_progress = true;
 		op_code = SIR_ROAMING_START;
 	} else if (notif == WMI_ROAM_NOTIF_ROAM_ABORT) {
-		wma_handle->interfaces[vdev_id].roaming_in_progress = false;
 		op_code = SIR_ROAMING_ABORT;
 		lim_sae_auth_cleanup_retry(wma_handle->mac_context, vdev_id);
 	} else {

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

@@ -3961,8 +3961,6 @@ QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id)
 		return status;
 	}
 
-	wma->interfaces[vdev_id].roaming_in_progress = false;
-
 	status = vdev_mgr_down_send(vdev_mlme);
 
 	return status;