Prechádzať zdrojové kódy

qcacld-3.0: Delete all PASN peers before vdev delete

Delete all PASN peers before vdev delete

Change-Id: I125c62680179ae9ba466c8e26573d82680f6e9d3
CRs-Fixed: 3170778
Pragaspathi Thilagaraj 3 rokov pred
rodič
commit
da71bc9d01

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

@@ -37,6 +37,7 @@
 #include <cm_utf.h>
 #include "target_if_cm_roam_event.h"
 #include "wlan_cm_roam_api.h"
+#include "wifi_pos_api.h"
 #ifdef WLAN_FEATURE_11BE_MLO
 #include <wlan_mlo_mgr_public_structs.h>
 #include <wlan_mlo_mgr_cmn.h>
@@ -1687,11 +1688,31 @@ static QDF_STATUS
 vdevmgr_vdev_peer_delete_all_rsp_handle(struct vdev_mlme_obj *vdev_mlme,
 					struct peer_delete_all_response *rsp)
 {
+	struct wlan_objmgr_psoc *psoc;
+	struct wlan_lmac_if_wifi_pos_rx_ops *rx_ops;
 	QDF_STATUS status;
 
+	psoc = wlan_vdev_get_psoc(vdev_mlme->vdev);
+	if (!psoc)
+		return -QDF_STATUS_E_INVAL;
+
+	if (rsp->peer_type_bitmap == BIT(WLAN_PEER_RTT_PASN)) {
+		rx_ops = wifi_pos_get_rx_ops(psoc);
+		if (!rx_ops ||
+		    !rx_ops->wifi_pos_vdev_delete_all_ranging_peers_rsp_cb) {
+			mlme_err("rx_ops is NULL");
+			return QDF_STATUS_E_FAILURE;
+		}
+
+		status = rx_ops->wifi_pos_vdev_delete_all_ranging_peers_rsp_cb(
+							psoc, rsp->vdev_id);
+		return status;
+	}
+
 	status = lim_process_mlm_del_all_sta_rsp(vdev_mlme, rsp);
 	if (QDF_IS_STATUS_ERROR(status))
 		mlme_err("Failed to call lim_process_mlm_del_all_sta_rsp");
+
 	return status;
 }
 

+ 14 - 0
components/wifi_pos/core/src/wlan_wifi_pos_interface.c

@@ -54,9 +54,23 @@ static QDF_STATUS wlan_wifi_pos_pasn_peer_delete(struct wlan_objmgr_psoc *psoc,
 				    no_fw_peer_delete);
 }
 
+/**
+ * wlan_wifi_pos_vdev_delete_resume() - Resume vdev delete operation
+ * after deleting all pasn peers
+ * @vdev: Pointer to objmgr vdev
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS
+wlan_wifi_pos_vdev_delete_resume(struct wlan_objmgr_vdev *vdev)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
 static struct wifi_pos_legacy_ops wifi_pos_ops = {
 	.pasn_peer_create_cb = wlan_wifi_pos_pasn_peer_create,
 	.pasn_peer_delete_cb = wlan_wifi_pos_pasn_peer_delete,
+	.pasn_vdev_delete_resume_cb = wlan_wifi_pos_vdev_delete_resume,
 };
 
 QDF_STATUS

+ 7 - 0
core/sme/src/common/sme_api.c

@@ -80,6 +80,7 @@
 #include <wlan_mlo_mgr_sta.h>
 #include <wlan_mlo_mgr_main.h>
 #include "wlan_policy_mgr_ucfg.h"
+#include "wma_pasn_peer_api.h"
 
 static QDF_STATUS init_sme_cmd_list(struct mac_context *mac);
 
@@ -4776,6 +4777,7 @@ QDF_STATUS sme_vdev_delete(mac_handle_t mac_handle,
 {
 	QDF_STATUS status;
 	struct mac_context *mac = MAC_CONTEXT(mac_handle);
+	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
 	uint8_t *self_peer_macaddr, vdev_id = wlan_vdev_get_id(vdev);
 	struct scheduler_msg self_peer_delete_msg = {0};
 	struct del_vdev_params *del_self_peer;
@@ -4784,6 +4786,11 @@ QDF_STATUS sme_vdev_delete(mac_handle_t mac_handle,
 			 TRACE_CODE_SME_RX_HDD_CLOSE_SESSION, vdev_id, 0));
 
 	status = sme_acquire_global_lock(&mac->sme);
+
+	if (vdev->vdev_mlme.vdev_opmode == QDF_STA_MODE ||
+	    vdev->vdev_mlme.vdev_opmode == QDF_SAP_MODE)
+		wma_delete_all_pasn_peers(wma, vdev);
+
 	if (QDF_IS_STATUS_SUCCESS(status)) {
 		status = csr_prepare_vdev_delete(mac, vdev_id, false);
 		sme_release_global_lock(&mac->sme);

+ 16 - 0
core/wma/inc/wma_pasn_peer_api.h

@@ -67,6 +67,16 @@ QDF_STATUS
 wma_pasn_handle_peer_create_conf(tp_wma_handle wma,
 				 struct qdf_mac_addr *peer_mac,
 				 QDF_STATUS status, uint8_t vdev_id);
+
+/**
+ * wma_delete_all_pasn_peers() - Delete all PASN peers
+ * @wma: WMA handle
+ * @vdev: Vdev object pointer
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wma_delete_all_pasn_peers(tp_wma_handle wma, struct wlan_objmgr_vdev *vdev);
 #else
 static inline QDF_STATUS
 wma_pasn_peer_create(struct wlan_objmgr_psoc *psoc,
@@ -91,5 +101,11 @@ wma_pasn_handle_peer_create_conf(tp_wma_handle wma,
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline QDF_STATUS
+wma_delete_all_pasn_peers(tp_wma_handle wma, struct wlan_objmgr_vdev *vdev)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 #endif

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

@@ -65,6 +65,7 @@
 
 #include "wlan_policy_mgr_api.h"
 #include "wma_nan_datapath.h"
+#include "wifi_pos_pasn_api.h"
 #if defined(CONFIG_HL_SUPPORT)
 #include "wlan_tgt_def_config_hl.h"
 #else
@@ -97,6 +98,7 @@
 #include "wlan_nan_api.h"
 #include "wlan_mlo_mgr_peer.h"
 #include "wifi_pos_api.h"
+#include "wifi_pos_pasn_api.h"
 #ifdef DCS_INTERFERENCE_DETECTION
 #include <wlan_dcs_ucfg_api.h>
 #endif
@@ -675,9 +677,9 @@ static QDF_STATUS wma_check_for_deffered_peer_delete(tp_wma_handle wma_handle,
 	return status;
 }
 
-static QDF_STATUS wma_vdev_self_peer_delete(tp_wma_handle wma_handle,
-					    struct del_vdev_params
-					    *pdel_vdev_req_param)
+static QDF_STATUS
+wma_vdev_self_peer_delete(tp_wma_handle wma_handle,
+			  struct del_vdev_params *pdel_vdev_req_param)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint8_t vdev_id = pdel_vdev_req_param->vdev_id;

+ 22 - 0
core/wma/src/wma_pasn_peer_api.c

@@ -223,3 +223,25 @@ wma_pasn_handle_peer_create_conf(tp_wma_handle wma,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS
+wma_delete_all_pasn_peers(tp_wma_handle wma, struct wlan_objmgr_vdev *vdev)
+{
+	struct wlan_lmac_if_wifi_pos_tx_ops *tx_ops;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	tx_ops = wifi_pos_get_tx_ops(wma->psoc);
+	if (!tx_ops || !tx_ops->wifi_pos_vdev_delete_all_ranging_peers_cb) {
+		wma_err("rx_ops is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	status = tx_ops->wifi_pos_vdev_delete_all_ranging_peers_cb(vdev);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("Delete all ranging peers failed");
+		return status;
+	}
+
+	return status;
+}
+#endif