Ver código fonte

qcacld-3.0: Add host diag events for wlan disconnection state

Add new diag events for the wlan disconnection these
events will be used to inform the wlan disconnection scenario.

Change-Id: I6bdddb2d3f45deca2dc92a94e2abf59f46d7c38f
CRs-Fixed: 1108380
Sen, Devendra 8 anos atrás
pai
commit
154b3c4cc2

+ 25 - 0
core/hdd/src/wlan_hdd_driver_ops.c

@@ -425,6 +425,30 @@ static void wlan_hdd_remove(struct device *dev)
 	pr_info("%s: Driver De-initialized\n", WLAN_MODULE_NAME);
 }
 
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
+/**
+ * hdd_wlan_ssr_shutdown_event()- send ssr shutdown state
+ *
+ * This Function send send ssr shutdown state diag event
+ *
+ * Return: void.
+ */
+static void hdd_wlan_ssr_shutdown_event(void)
+{
+	WLAN_HOST_DIAG_EVENT_DEF(ssr_shutdown,
+					struct host_event_wlan_ssr_shutdown);
+	qdf_mem_zero(&ssr_shutdown, sizeof(ssr_shutdown));
+	ssr_shutdown.status = SSR_SUB_SYSTEM_SHUTDOWN;
+	WLAN_HOST_DIAG_EVENT_REPORT(&ssr_shutdown,
+					EVENT_WLAN_SSR_SHUTDOWN_SUBSYSTEM);
+}
+#else
+static inline void hdd_wlan_ssr_shutdown_event(void)
+{
+
+};
+#endif
+
 /**
  * wlan_hdd_shutdown() - wlan_hdd_shutdown
  *
@@ -443,6 +467,7 @@ static void wlan_hdd_shutdown(void)
 	}
 	/* this is for cases, where shutdown invoked from platform */
 	cds_set_recovery_in_progress(true);
+	hdd_wlan_ssr_shutdown_event();
 
 	if (!cds_wait_for_external_threads_completion(__func__))
 		hdd_err("Host is not ready for SSR, attempting anyway");

+ 24 - 0
core/hdd/src/wlan_hdd_power.c

@@ -1350,6 +1350,29 @@ QDF_STATUS hdd_wlan_shutdown(void)
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
+/**
+* hdd_wlan_ssr_reinit_event()- send ssr reinit state
+*
+* This Function send send ssr reinit state diag event
+*
+* Return: void.
+*/
+static void hdd_wlan_ssr_reinit_event(void)
+{
+	WLAN_HOST_DIAG_EVENT_DEF(ssr_reinit, struct host_event_wlan_ssr_reinit);
+	qdf_mem_zero(&ssr_reinit, sizeof(ssr_reinit));
+	ssr_reinit.status = SSR_SUB_SYSTEM_REINIT;
+	WLAN_HOST_DIAG_EVENT_REPORT(&ssr_reinit,
+					EVENT_WLAN_SSR_REINIT_SUBSYSTEM);
+}
+#else
+static inline void hdd_wlan_ssr_reinit_event(void)
+{
+
+}
+#endif
+
 /**
  * hdd_wlan_re_init() - HDD SSR re-init function
  *
@@ -1467,6 +1490,7 @@ success:
 	if (pHddCtx->config->sap_internal_restart)
 		hdd_ssr_restart_sap(pHddCtx);
 	hdd_ssr_timer_del();
+	hdd_wlan_ssr_reinit_event();
 	return QDF_STATUS_SUCCESS;
 }
 

+ 25 - 0
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -435,6 +435,30 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	return ret;
 }
 
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
+/**
+ * hdd_wlan_datastall_sap_event()- Send SAP datastall information
+ *
+ * This Function send send SAP datastall diag event
+ *
+ * Return: void.
+ */
+static void hdd_wlan_datastall_sap_event(void)
+{
+	WLAN_HOST_DIAG_EVENT_DEF(sap_data_stall,
+					struct host_event_wlan_datastall);
+	qdf_mem_zero(&sap_data_stall, sizeof(sap_data_stall));
+	sap_data_stall.reason = SOFTAP_TX_TIMEOUT;
+	WLAN_HOST_DIAG_EVENT_REPORT(&sap_data_stall,
+						EVENT_WLAN_SOFTAP_DATASTALL);
+}
+#else
+static inline void hdd_wlan_datastall_sap_event(void)
+{
+
+}
+#endif
+
 /**
  * __hdd_softap_tx_timeout() - TX timeout handler
  * @dev: pointer to network device
@@ -481,6 +505,7 @@ static void __hdd_softap_tx_timeout(struct net_device *dev)
 	cdp_dump_flow_pool_info(cds_get_context(QDF_MODULE_ID_SOC));
 	QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
 			"carrier state: %d", netif_carrier_ok(dev));
+	hdd_wlan_datastall_sap_event();
 }
 
 /**

+ 24 - 0
core/hdd/src/wlan_hdd_tx_rx.c

@@ -745,6 +745,29 @@ QDF_STATUS hdd_get_peer_sta_id(hdd_station_ctx_t *pHddStaCtx,
 	return QDF_STATUS_E_FAILURE;
 }
 
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
+/**
+* hdd_wlan_datastall_sta_event()- send sta datastall information
+*
+* This Function send send sta datastall status diag event
+*
+* Return: void.
+*/
+static void hdd_wlan_datastall_sta_event(void)
+{
+	WLAN_HOST_DIAG_EVENT_DEF(sta_data_stall,
+				struct host_event_wlan_datastall);
+	qdf_mem_zero(&sta_data_stall, sizeof(sta_data_stall));
+	sta_data_stall.reason = STA_TX_TIMEOUT;
+	WLAN_HOST_DIAG_EVENT_REPORT(&sta_data_stall, EVENT_WLAN_STA_DATASTALL);
+}
+#else
+static inline void hdd_wlan_datastall_sta_event(void)
+{
+
+}
+#endif
+
 /**
  * __hdd_tx_timeout() - TX timeout handler
  * @dev: pointer to network device
@@ -785,6 +808,7 @@ static void __hdd_tx_timeout(struct net_device *dev)
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	wlan_hdd_display_netif_queue_history(hdd_ctx);
 	cdp_dump_flow_pool_info(cds_get_context(QDF_MODULE_ID_SOC));
+	hdd_wlan_datastall_sta_event();
 }
 
 /**

+ 3 - 1
core/mac/src/pe/lim/lim_process_deauth_frame.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -181,6 +181,8 @@ lim_process_deauth_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
 			reasonCode, lim_dot11_reason_str(reasonCode),
 			MAC_ADDR_ARRAY(pHdr->sa));
 	       )
+	lim_diag_event_report(pMac, WLAN_PE_DIAG_DEAUTH_FRAME_EVENT,
+		psessionEntry, 0, reasonCode);
 
 	if (lim_check_disassoc_deauth_ack_pending(pMac, (uint8_t *) pHdr->sa)) {
 		PELOGE(lim_log(pMac, LOGE,

+ 2 - 1
core/mac/src/pe/lim/lim_process_disassoc_frame.c

@@ -175,7 +175,8 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
 		       psessionEntry->limSmeState, frame_rssi, reasonCode,
 		       lim_dot11_reason_str(reasonCode), MAC_ADDR_ARRAY(pHdr->sa));
 	       )
-
+	lim_diag_event_report(pMac, WLAN_PE_DIAG_DISASSOC_FRAME_EVENT,
+		psessionEntry, 0, reasonCode);
 	/**
 	 * Extract 'associated' context for STA, if any.
 	 * This is maintained by DPH and created by LIM.

+ 2 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -548,6 +548,8 @@ typedef enum {
 	WLAN_PE_DIAG_SCAN_RESULT_FOUND_EVENT,
 	WLAN_PE_DIAG_ASSOC_TIMEOUT,
 	WLAN_PE_DIAG_AUTH_TIMEOUT,
+	WLAN_PE_DIAG_DEAUTH_FRAME_EVENT,
+	WLAN_PE_DIAG_DISASSOC_FRAME_EVENT,
 } WLAN_PE_DIAG_EVENT_TYPE;
 
 void lim_diag_event_report(tpAniSirGlobal pMac, uint16_t eventType,

+ 22 - 0
core/wma/inc/wma_internal.h

@@ -1217,4 +1217,26 @@ void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id,
 				int32_t rssi);
 int wma_unified_power_debug_stats_event_handler(void *handle,
 			uint8_t *cmd_param_info, uint32_t len);
+
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
+/**
+ * wma_sta_kickout_event()- send sta kickout event
+ * @kickout_reason - reasoncode for kickout
+ * @macaddr[IEEE80211_ADDR_LEN]: Peer mac address
+ * @vdev_id: Unique id for identifying the VDEV
+ *
+ * This function sends sta kickout diag event
+ *
+ * Return: void.
+ */
+void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
+							uint8_t *macaddr);
+#else
+static inline void wma_sta_kickout_event(uint32_t kickout_reason,
+					uint8_t vdev_id, uint8_t *macaddr)
+{
+
+};
+#endif /* FEATURE_WLAN_DIAG_SUPPORT */
+
 #endif

+ 21 - 0
core/wma/src/wma_mgmt.c

@@ -276,6 +276,21 @@ int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len)
 	return 0;
 }
 
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
+void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id,
+							uint8_t *macaddr)
+{
+	WLAN_HOST_DIAG_EVENT_DEF(sta_kickout, struct host_event_wlan_kickout);
+	qdf_mem_zero(&sta_kickout, sizeof(sta_kickout));
+	sta_kickout.reasoncode = kickout_reason;
+	sta_kickout.vdev_id = vdev_id;
+	if (macaddr)
+		qdf_mem_copy(sta_kickout.peer_mac, macaddr,
+							IEEE80211_ADDR_LEN);
+	WLAN_HOST_DIAG_EVENT_REPORT(&sta_kickout, EVENT_WLAN_STA_KICKOUT);
+}
+#endif
+
 /**
  * wma_peer_sta_kickout_event_handler() - kickout event handler
  * @handle: wma handle
@@ -375,6 +390,8 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
 		     WMI_UNIFIED_VDEV_SUBTYPE_P2P_CLIENT) &&
 		    !qdf_mem_cmp(wma->interfaces[vdev_id].bssid,
 				    macaddr, IEEE80211_ADDR_LEN)) {
+			wma_sta_kickout_event(HOST_STA_KICKOUT_REASON_XRETRY,
+							vdev_id, macaddr);
 			/*
 			 * KICKOUT event is for current station-AP connection.
 			 * Treat it like final beacon miss. Station may not have
@@ -402,6 +419,8 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
 		     WMI_UNIFIED_VDEV_SUBTYPE_P2P_CLIENT) &&
 		    !qdf_mem_cmp(wma->interfaces[vdev_id].bssid,
 				    macaddr, IEEE80211_ADDR_LEN)) {
+			wma_sta_kickout_event(
+			HOST_STA_KICKOUT_REASON_UNSPECIFIED, vdev_id, macaddr);
 			/*
 			 * KICKOUT event is for current station-AP connection.
 			 * Treat it like final beacon miss. Station may not have
@@ -447,6 +466,8 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
 		     IEEE80211_ADDR_LEN);
 	del_sta_ctx->reasonCode = HAL_DEL_STA_REASON_CODE_KEEP_ALIVE;
 	del_sta_ctx->rssi = kickout_event->rssi + WMA_TGT_NOISE_FLOOR_DBM;
+	wma_sta_kickout_event(HOST_STA_KICKOUT_REASON_KEEP_ALIVE,
+							vdev_id, macaddr);
 	wma_send_msg(wma, SIR_LIM_DELETE_STA_CONTEXT_IND, (void *)del_sta_ctx,
 		     0);
 	wma_lost_link_info_handler(wma, vdev_id, kickout_event->rssi +

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

@@ -5841,6 +5841,8 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 		WMA_LOGD("Beacon Miss for vdevid %x", wmi_event->vdev_id);
 		wma_beacon_miss_handler(wma_handle, wmi_event->vdev_id,
 					wmi_event->rssi);
+		wma_sta_kickout_event(HOST_STA_KICKOUT_REASON_BMISS,
+						wmi_event->vdev_id, NULL);
 		break;
 	case WMI_ROAM_REASON_BETTER_AP:
 		WMA_LOGD("%s:Better AP found for vdevid %x, rssi %d", __func__,