Ver código fonte

qcacld-3.0: Add WMA callbacks to send peer unmap conf cmd to FW

Add supports to register WMA callbacks to send peer unmap conf
command to FW.

Change-Id: Ia709f5163d5e0a4b9f7141989c4e59183767f00e
CRs-Fixed: 2358129
Alok Kumar 6 anos atrás
pai
commit
0230129d11
3 arquivos alterados com 76 adições e 6 exclusões
  1. 4 0
      core/wma/inc/wma.h
  2. 61 6
      core/wma/src/wma_dev_if.c
  3. 11 0
      core/wma/src/wma_main.c

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

@@ -1918,6 +1918,10 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
 			   u_int32_t peer_type, u_int8_t vdev_id,
 			   bool roam_synch_in_progress);
 
+QDF_STATUS wma_peer_unmap_conf_cb(uint8_t vdev_id,
+				  uint32_t peer_id_cnt,
+				  uint16_t *peer_id_list);
+
 /**
  * wma_get_cca_stats() - send request to fw to get CCA
  * @wmi_hdl: wma handle

+ 61 - 6
core/wma/src/wma_dev_if.c

@@ -1683,6 +1683,32 @@ QDF_STATUS wma_set_peer_param(void *wma_ctx, uint8_t *peer_addr,
 	return err;
 }
 
+/**
+ * wma_peer_unmap_conf_cb - send peer unmap conf cmnd to fw
+ * @vdev_id: vdev id
+ * @peer_id_cnt: no of peer id
+ * @peer_id_list: list of peer ids
+ *
+ * Return: QDF_STATUS
+ */
+
+QDF_STATUS wma_peer_unmap_conf_cb(uint8_t vdev_id,
+				  uint32_t peer_id_cnt,
+				  uint16_t *peer_id_list)
+{
+	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+
+	if (!wma) {
+		WMA_LOGD("%s: peer_id_cnt: %d, null wma_handle",
+			 __func__, peer_id_cnt);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return wmi_unified_peer_unmap_conf_send(wma->wmi_handle,
+						vdev_id, peer_id_cnt,
+						peer_id_list);
+}
+
 /**
  * wma_remove_peer() - remove peer information from host driver and fw
  * @wma: wma handle
@@ -1708,6 +1734,7 @@ QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
 	void *vdev;
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 	uint32_t bitmap = 1 << CDP_PEER_DELETE_NO_SPECIAL;
+	bool peer_unmap_conf_support_enabled;
 
 	if (!wma->interfaces[vdev_id].peer_count) {
 		WMA_LOGE("%s: Can't remove peer with peer_addr %pM vdevid %d peer_count %d",
@@ -1728,6 +1755,9 @@ QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
 		QDF_BUG(0);
 		return QDF_STATUS_E_INVAL;
 	}
+	peer_unmap_conf_support_enabled =
+				cdp_cfg_get_peer_unmap_conf_support(soc);
+
 	peer_mac_addr = cdp_peer_get_peer_mac_addr(soc, peer);
 	if (peer_mac_addr == NULL) {
 		WMA_LOGE("%s: peer mac addr is NULL, Can't remove peer with peer_addr %pM vdevid %d peer_count %d",
@@ -1786,15 +1816,26 @@ peer_detach:
 	qdf_mem_copy(peer_mac, peer_mac_addr, QDF_MAC_ADDR_SIZE);
 	if (roam_synch_in_progress &&
 	    is_cdp_peer_detach_force_delete_supported(soc)) {
-		WMA_LOGD("%s: LFR3: trigger force delete for peer %pM",
-			 __func__, peer_mac_addr);
-		cdp_peer_detach_force_delete(soc, peer);
+		if (!peer_unmap_conf_support_enabled) {
+			WMA_LOGD("%s: LFR3: trigger force delete for peer %pM",
+				 __func__, peer_mac_addr);
+			cdp_peer_detach_force_delete(soc, peer);
+		} else {
+			cdp_peer_delete_sync(soc, peer,
+					     wma_peer_unmap_conf_cb,
+					     bitmap);
+		}
 	} else {
 		if (roam_synch_in_progress) {
 			WMA_LOGD("%s: LFR3: normal peer delete for peer %pM",
 				 __func__, peer_mac_addr);
 		}
-		cdp_peer_delete(soc, peer, bitmap);
+		if (peer_unmap_conf_support_enabled)
+			cdp_peer_delete_sync(soc, peer,
+					     wma_peer_unmap_conf_cb,
+					     bitmap);
+		else
+			cdp_peer_delete(soc, peer, bitmap);
 	}
 
 	wma_remove_objmgr_peer(wma, vdev_id, peer_mac);
@@ -2033,7 +2074,14 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
 	if (wmi_unified_peer_create_send(wma->wmi_handle,
 					 &param) != QDF_STATUS_SUCCESS) {
 		WMA_LOGE("%s : Unable to create peer in Target", __func__);
-		cdp_peer_delete(dp_soc, peer,
+		if (cdp_cfg_get_peer_unmap_conf_support(dp_soc))
+			cdp_peer_delete_sync(
+				dp_soc, peer,
+				wma_peer_unmap_conf_cb,
+				1 << CDP_PEER_DO_NOT_START_UNMAP_TIMER);
+		else
+			cdp_peer_delete(
+				dp_soc, peer,
 				1 << CDP_PEER_DO_NOT_START_UNMAP_TIMER);
 		wlan_objmgr_peer_obj_delete(obj_peer);
 		goto err;
@@ -6105,7 +6153,14 @@ void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params)
 		WMA_LOGD("%s: vdev %pK is detaching peer:%pK peer_addr %pM to vdev_id %d, peer_count - %d",
 			 __func__, txrx_vdev, peer, params->bssid,
 			 params->smesessionId, iface->peer_count);
-		cdp_peer_delete(soc, peer, 1 << CDP_PEER_DELETE_NO_SPECIAL);
+		if (cdp_cfg_get_peer_unmap_conf_support(soc))
+			cdp_peer_delete_sync(
+				soc, peer,
+				wma_peer_unmap_conf_cb,
+				1 << CDP_PEER_DELETE_NO_SPECIAL);
+		else
+			cdp_peer_delete(soc, peer,
+					1 << CDP_PEER_DELETE_NO_SPECIAL);
 		wma_remove_objmgr_peer(wma, params->smesessionId,
 							params->bssid);
 	}

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

@@ -92,6 +92,7 @@
 #include "cfg_nan_api.h"
 #include "wlan_mlme_api.h"
 #include "wlan_mlme_ucfg_api.h"
+#include "cfg_ucfg_api.h"
 
 #define WMA_LOG_COMPLETION_TIMER 3000 /* 3 seconds */
 #define WMI_TLV_HEADROOM 128
@@ -6730,6 +6731,16 @@ int wma_rx_service_ready_ext_event(void *handle, uint8_t *event,
 		wlan_res_cfg->new_htt_msg_format = false;
 	}
 
+	if (cfg_get(wma_handle->psoc, CFG_DP_ENABLE_PEER_UMAP_CONF_SUPPORT) &&
+	    wmi_service_enabled(wmi_handle,
+				wmi_service_peer_unmap_cnf_support)) {
+		wlan_res_cfg->peer_unmap_conf_support = true;
+		cdp_cfg_set_peer_unmap_conf_support(soc, true);
+	} else {
+		wlan_res_cfg->peer_unmap_conf_support = false;
+		cdp_cfg_set_peer_unmap_conf_support(soc, false);
+	}
+
 	return 0;
 }