Prechádzať zdrojové kódy

qcacld-3.0: Update Datastall callbacks definition

Update definitions for datastall callback which posts
DataStall Events.

Change-Id: I1aadb438afeafe1f13114b1472b2280f0f713db4
CRs-Fixed: 2563194
Alok Kumar 5 rokov pred
rodič
commit
939ca50cf2

+ 16 - 23
core/dp/txrx/ol_txrx.c

@@ -5318,9 +5318,7 @@ static void ol_txrx_post_data_stall_event(
 				enum data_stall_log_recovery_type recovery_type)
 {
 	struct ol_txrx_soc_t *soc = cdp_soc_t_to_ol_txrx_soc_t(soc_hdl);
-	struct scheduler_msg msg = {0};
-	QDF_STATUS status;
-	struct data_stall_event_info *data_stall_info;
+	struct data_stall_event_info data_stall_info;
 	ol_txrx_pdev_handle pdev;
 
 	if (qdf_unlikely(!soc)) {
@@ -5335,32 +5333,27 @@ static void ol_txrx_post_data_stall_event(
 		return;
 	}
 
-	data_stall_info = qdf_mem_malloc(sizeof(*data_stall_info));
-	if (!data_stall_info)
+	if (!pdev->data_stall_detect_callback) {
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			  "%s: data stall cb not registered", __func__);
 		return;
+	}
 
-	data_stall_info->indicator = indicator;
-	data_stall_info->data_stall_type = data_stall_type;
-	data_stall_info->vdev_id_bitmap = vdev_id_bitmap;
-	data_stall_info->pdev_id = pdev_id;
-	data_stall_info->recovery_type = recovery_type;
+	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
+		  "%s: data_stall_type: %x pdev_id: %d",
+		  __func__, data_stall_type, pdev_id);
 
-	if (data_stall_info->data_stall_type ==
+	data_stall_info.indicator = indicator;
+	data_stall_info.data_stall_type = data_stall_type;
+	data_stall_info.vdev_id_bitmap = vdev_id_bitmap;
+	data_stall_info.pdev_id = pdev_id;
+	data_stall_info.recovery_type = recovery_type;
+
+	if (data_stall_info.data_stall_type ==
 				DATA_STALL_LOG_FW_RX_REFILL_FAILED)
 		htt_log_rx_ring_info(pdev->htt_pdev);
 
-	sys_build_message_header(SYS_MSG_ID_DATA_STALL_MSG, &msg);
-	/* Save callback and data */
-	msg.callback = pdev->data_stall_detect_callback;
-	msg.bodyptr = data_stall_info;
-	msg.bodyval = 0;
-
-	status = scheduler_post_message(QDF_MODULE_ID_TXRX,
-					QDF_MODULE_ID_HDD,
-					QDF_MODULE_ID_SYS, &msg);
-
-	if (status != QDF_STATUS_SUCCESS)
-		qdf_mem_free(data_stall_info);
+	pdev->data_stall_detect_callback(&data_stall_info);
 }
 
 void

+ 4 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -13275,12 +13275,15 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
 
 	/* send NUD failure event only when ARP tracking is enabled. */
 	if (cdp_cfg_get(soc, cfg_dp_enable_data_stall) &&
-	    (pkt_type_bitmap & CONNECTIVITY_CHECK_SET_ARP))
+	    (pkt_type_bitmap & CONNECTIVITY_CHECK_SET_ARP)) {
+		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
+			  "Data stall due to NUD failure");
 		cdp_post_data_stall_event(soc,
 				      DATA_STALL_LOG_INDICATOR_FRAMEWORK,
 				      DATA_STALL_LOG_NUD_FAILURE,
 				      OL_TXRX_PDEV_ID, 0XFF,
 				      DATA_STALL_LOG_RECOVERY_TRIGGER_PDR);
+	}
 
 	mac_handle = hdd_ctx->mac_handle;
 	if (sme_set_nud_debug_stats_cb(mac_handle, hdd_get_nud_stats_cb,

+ 47 - 2
core/hdd/src/wlan_hdd_data_stall_detection.c

@@ -22,7 +22,10 @@
  * WLAN Host Device Driver Data Stall detection API implementation
  */
 
+#include <wlan_qct_sys.h>
+#include <scheduler_api.h>
 #include "wlan_hdd_data_stall_detection.h"
+#include "wlan_hdd_main.h"
 #include "cdp_txrx_cmn.h"
 #include "cdp_txrx_misc.h"
 #include "ol_txrx_types.h"
@@ -47,6 +50,7 @@ static void hdd_data_stall_send_event(uint32_t reason)
 				struct host_event_wlan_datastall);
 	qdf_mem_zero(&sta_data_stall, sizeof(sta_data_stall));
 	sta_data_stall.reason = reason;
+	hdd_debug("Posting data stall event %x", reason);
 	WLAN_HOST_DIAG_EVENT_REPORT(&sta_data_stall, EVENT_WLAN_STA_DATASTALL);
 }
 #else
@@ -56,25 +60,65 @@ static inline void hdd_data_stall_send_event(uint32_t reason)
 #endif
 
 /**
- * hdd_data_stall_process_cb() - Process data stall message
+ * hdd_data_stall_process_event() - Process data stall event
  * @message: data stall message
  *
  * Process data stall message
  *
  * Return: void
  */
-static void hdd_data_stall_process_cb(
+static void hdd_data_stall_process_event(
 			struct data_stall_event_info *data_stall_info)
 {
 	hdd_data_stall_send_event(data_stall_info->data_stall_type);
 }
 
+/**
+ * hdd_data_stall_process_cb() - Process data stall message
+ * @message: data stall message
+ *
+ * Process data stall message
+ *
+ * Return: void
+ */
+static void hdd_data_stall_process_cb(
+			struct data_stall_event_info *info)
+{
+	struct scheduler_msg msg = {0};
+	struct data_stall_event_info *data_stall_event_info;
+	QDF_STATUS status;
+
+	data_stall_event_info = qdf_mem_malloc(sizeof(*data_stall_event_info));
+	if (!data_stall_event_info)
+		return;
+
+	data_stall_event_info->data_stall_type = info->data_stall_type;
+	data_stall_event_info->indicator = info->indicator;
+	data_stall_event_info->pdev_id = info->pdev_id;
+	data_stall_event_info->recovery_type = info->recovery_type;
+	data_stall_event_info->vdev_id_bitmap = info->vdev_id_bitmap;
+
+	sys_build_message_header(SYS_MSG_ID_DATA_STALL_MSG, &msg);
+	/* Save callback and data */
+	msg.callback = hdd_data_stall_process_event;
+	msg.bodyptr = data_stall_event_info;
+	msg.bodyval = 0;
+
+	status = scheduler_post_message(QDF_MODULE_ID_HDD,
+					QDF_MODULE_ID_HDD,
+					QDF_MODULE_ID_SYS, &msg);
+
+	if (status != QDF_STATUS_SUCCESS)
+		qdf_mem_free(data_stall_event_info);
+}
+
 int hdd_register_data_stall_detect_cb(void)
 {
 	QDF_STATUS status;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	/* Register the data stall callback */
+	hdd_debug("Register data stall detect callback");
 	status = cdp_data_stall_cb_register(soc, OL_TXRX_PDEV_ID,
 					    hdd_data_stall_process_cb);
 	return qdf_status_to_os_return(status);
@@ -86,6 +130,7 @@ int hdd_deregister_data_stall_detect_cb(void)
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	/* De-Register the data stall callback */
+	hdd_debug("De-Register data stall detect callback");
 	status = cdp_data_stall_cb_deregister(soc, OL_TXRX_PDEV_ID,
 					      hdd_data_stall_process_cb);
 	return qdf_status_to_os_return(status);