summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@codeaurora.org>2016-04-27 12:21:24 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2016-05-04 21:18:03 -0700
commit4ef5fe00a42d3e2526a2bab2d671aa395c6dfb6e (patch)
tree16dbbbd197058f91a7bc1d177d4755ad009d0eea
parenteca12f2624e6b189a8afabb2b0723477d04c7087 (diff)
qcacld-3.0: Add diag event for TDLS teardown
qcacld-2.0 to qcacld-3.0 propagation Add diag event for TDLS teardown. Event contains reason for teardown and peer mac address. Change-Id: Ib04deac6cf7d61fae1a7bb0d0fb8f4dc652b3217 CRs-Fixed: 934448
-rw-r--r--core/hdd/inc/wlan_hdd_tdls.h33
-rw-r--r--core/hdd/src/wlan_hdd_assoc.c8
-rw-r--r--core/hdd/src/wlan_hdd_tdls.c33
-rw-r--r--core/utils/host_diag_log/inc/host_diag_core_event.h12
-rw-r--r--core/utils/host_diag_log/inc/host_diag_event_defs.h3
5 files changed, 88 insertions, 1 deletions
diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h
index 8a4cd45e7f89..4e12836d3189 100644
--- a/core/hdd/inc/wlan_hdd_tdls.h
+++ b/core/hdd/inc/wlan_hdd_tdls.h
@@ -161,6 +161,30 @@ typedef enum eTDLSLinkStatus {
} tTDLSLinkStatus;
/**
+ * enum tdls_teardown_reason - Reason for TDLS teardown
+ * @eTDLS_TEARDOWN_EXT_CTRL: Reason ext ctrl.
+ * @eTDLS_TEARDOWN_CONCURRENCY: Reason concurrency.
+ * @eTDLS_TEARDOWN_RSSI_THRESHOLD: Reason rssi threshold.
+ * @eTDLS_TEARDOWN_TXRX_THRESHOLD: Reason txrx threshold.
+ * @eTDLS_TEARDOWN_BTCOEX: Reason BTCOEX.
+ * @eTDLS_TEARDOWN_SCAN: Reason scan.
+ * @eTDLS_TEARDOWN_BSS_DISCONNECT: Reason bss disconnected.
+ * @eTDLS_TEARDOWN_ANTENNA_SWITCH: Disconnected due to antenna switch
+ *
+ * Reason to indicate in diag event of tdls teardown.
+ */
+enum tdls_teardown_reason {
+ eTDLS_TEARDOWN_EXT_CTRL,
+ eTDLS_TEARDOWN_CONCURRENCY,
+ eTDLS_TEARDOWN_RSSI_THRESHOLD,
+ eTDLS_TEARDOWN_TXRX_THRESHOLD,
+ eTDLS_TEARDOWN_BTCOEX,
+ eTDLS_TEARDOWN_SCAN,
+ eTDLS_TEARDOWN_BSS_DISCONNECT,
+ eTDLS_TEARDOWN_ANTENNA_SWITCH,
+};
+
+/**
* enum tTDLSLinkReason - tdls link reason
*
* @eTDLS_LINK_SUCCESS: Success
@@ -625,4 +649,13 @@ static inline void wlan_hdd_tdls_exit(hdd_adapter_t *adapter)
static inline void hdd_tdls_pre_init(hdd_context_t *hdd_ctx) { }
#endif /* End of FEATURE_WLAN_TDLS */
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
+void hdd_send_wlan_tdls_teardown_event(uint32_t reason,
+ uint8_t *peer_mac);
+#else
+static inline
+void hdd_send_wlan_tdls_teardown_event(uint32_t reason,
+ uint8_t *peer_mac) {}
+#endif /* FEATURE_WLAN_DIAG_SUPPORT */
+
#endif /* __HDD_TDLS_H */
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index ac874632c7bd..ecca88729eaa 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -3209,6 +3209,8 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter,
pRoamInfo->peerMac.bytes, true);
wlan_hdd_tdls_indicate_teardown(pAdapter, curr_peer,
pRoamInfo->reasonCode);
+ hdd_send_wlan_tdls_teardown_event(eTDLS_TEARDOWN_BSS_DISCONNECT,
+ curr_peer->peerMac);
status = QDF_STATUS_SUCCESS;
break;
}
@@ -3388,6 +3390,9 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter,
wlan_hdd_tdls_indicate_teardown
(pHddTdlsCtx->pAdapter, curr_peer,
reason);
+ hdd_send_wlan_tdls_teardown_event(
+ eTDLS_TEARDOWN_BSS_DISCONNECT,
+ curr_peer->peerMac);
} else {
hddLog(LOGE,
FL
@@ -3436,6 +3441,9 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter,
wlan_hdd_tdls_indicate_teardown
(pHddTdlsCtx->pAdapter, curr_peer,
reason);
+ hdd_send_wlan_tdls_teardown_event(
+ eTDLS_TEARDOWN_BSS_DISCONNECT,
+ curr_peer->peerMac);
} else {
hddLog(LOGE,
FL
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index e0978c31b2e1..de431b9a7f1a 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -85,6 +85,31 @@ static void wlan_hdd_tdls_determine_channel_opclass(hdd_context_t *hddctx,
}
}
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
+/**
+ * hdd_send_wlan_tdls_teardown_event()- send TDLS teardown event
+ * @reason: reason for tear down.
+ * @peer_mac: peer mac
+ *
+ * This Function sends TDLS teardown diag event
+ *
+ * Return: void.
+ */
+void hdd_send_wlan_tdls_teardown_event(uint32_t reason,
+ uint8_t *peer_mac)
+{
+ WLAN_HOST_DIAG_EVENT_DEF(tdls_tear_down,
+ struct host_event_tdls_teardown);
+ qdf_mem_zero(&tdls_tear_down,
+ sizeof(tdls_tear_down));
+
+ tdls_tear_down.reason = reason;
+ qdf_mem_copy(tdls_tear_down.peer_mac, peer_mac, MAC_ADDR_LEN);
+ WLAN_HOST_DIAG_EVENT_REPORT(&tdls_tear_down,
+ EVENT_WLAN_TDLS_TEARDOWN);
+}
+#endif
+
/**
* wlan_hdd_tdls_hash_key() - calculate tdls hash key given mac address
* @mac: mac address
@@ -168,6 +193,8 @@ void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx)
curr_peer->pHddTdlsCtx->pAdapter,
curr_peer,
eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON);
+ hdd_send_wlan_tdls_teardown_event(eTDLS_TEARDOWN_CONCURRENCY,
+ curr_peer->peerMac);
}
}
@@ -2764,6 +2791,9 @@ int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
(connectedPeerList[i]->pHddTdlsCtx->
pAdapter, connectedPeerList[i],
eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON);
+ hdd_send_wlan_tdls_teardown_event(
+ eTDLS_TEARDOWN_SCAN,
+ connectedPeerList[i]->peerMac);
}
}
/* schedule scan */
@@ -4117,6 +4147,9 @@ int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter,
} else {
wlan_hdd_tdls_indicate_teardown(pAdapter, pTdlsPeer,
eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON);
+ hdd_send_wlan_tdls_teardown_event(
+ eTDLS_TEARDOWN_EXT_CTRL,
+ pTdlsPeer->peerMac);
}
if (0 != wlan_hdd_tdls_set_force_peer(pAdapter, peer, false)) {
QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
diff --git a/core/utils/host_diag_log/inc/host_diag_core_event.h b/core/utils/host_diag_log/inc/host_diag_core_event.h
index 0c8d963e7389..135ded970a9b 100644
--- a/core/utils/host_diag_log/inc/host_diag_core_event.h
+++ b/core/utils/host_diag_log/inc/host_diag_core_event.h
@@ -299,6 +299,18 @@ struct host_event_wlan_log_complete {
uint32_t reserved;
};
+/**
+ * struct host_event_tdls_teardown - tdls teardown diag event
+ * @reason: reason for tear down
+ * @peer_mac: peer mac
+ *
+ * This structure contains tdls teardown diag event info
+ */
+struct host_event_tdls_teardown {
+ uint32_t reason;
+ uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
+};
+
/*-------------------------------------------------------------------------
Function declarations and documenation
------------------------------------------------------------------------*/
diff --git a/core/utils/host_diag_log/inc/host_diag_event_defs.h b/core/utils/host_diag_log/inc/host_diag_event_defs.h
index ca250c592db2..6027f88dabd5 100644
--- a/core/utils/host_diag_log/inc/host_diag_event_defs.h
+++ b/core/utils/host_diag_log/inc/host_diag_event_defs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -54,6 +54,7 @@ typedef enum {
EVENT_WLAN_WAKE_LOCK = 0xAA2, /* 96 bytes payload */
EVENT_WLAN_BEACON_RECEIVED = 0xAA6, /* FW event: 2726 */
EVENT_WLAN_LOG_COMPLETE = 0xAA7, /* 16 bytes payload */
+ EVENT_WLAN_TDLS_TEARDOWN = 0xAB5,
EVENT_MAX_ID = 0x0FFF
} event_id_enum_type;