xref: /OK3568_Linux_fs/external/rkwifibt/drivers/infineon/include/event_trace.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Trace log blocks sent over HBUS
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Portions of this code are copyright (c) 2021 Cypress Semiconductor Corporation
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Copyright (C) 1999-2017, Broadcom Corporation
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  *      Unless you and Broadcom execute a separate written software license
9*4882a593Smuzhiyun  * agreement governing use of this software, this software is licensed to you
10*4882a593Smuzhiyun  * under the terms of the GNU General Public License version 2 (the "GPL"),
11*4882a593Smuzhiyun  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
12*4882a593Smuzhiyun  * following added to such license:
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  *      As a special exception, the copyright holders of this software give you
15*4882a593Smuzhiyun  * permission to link this software with independent modules, and to copy and
16*4882a593Smuzhiyun  * distribute the resulting executable under terms of your choice, provided that
17*4882a593Smuzhiyun  * you also meet, for each linked independent module, the terms and conditions of
18*4882a593Smuzhiyun  * the license of that module.  An independent module is a module which is not
19*4882a593Smuzhiyun  * derived from this software.  The special exception does not apply to any
20*4882a593Smuzhiyun  * modifications of the software.
21*4882a593Smuzhiyun  *
22*4882a593Smuzhiyun  *      Notwithstanding the above, under no circumstances may you combine this
23*4882a593Smuzhiyun  * software in any way with any other Broadcom software provided under a license
24*4882a593Smuzhiyun  * other than the GPL, without Broadcom's express prior written consent.
25*4882a593Smuzhiyun  *
26*4882a593Smuzhiyun  *
27*4882a593Smuzhiyun  * <<Broadcom-WL-IPTag/Open:>>
28*4882a593Smuzhiyun  *
29*4882a593Smuzhiyun  * $Id: event_trace.h 693870 2017-04-05 09:03:17Z $
30*4882a593Smuzhiyun  */
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun /**
33*4882a593Smuzhiyun  * @file
34*4882a593Smuzhiyun  * @brief
35*4882a593Smuzhiyun  * Define the trace event ID and tag ID
36*4882a593Smuzhiyun  */
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #ifndef	_WL_DIAG_H
39*4882a593Smuzhiyun #define	_WL_DIAG_H
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun #define DIAG_MAJOR_VERSION      1	/* 4 bits */
42*4882a593Smuzhiyun #define DIAG_MINOR_VERSION      0	/* 4 bits */
43*4882a593Smuzhiyun #define DIAG_MICRO_VERSION      0	/* 4 bits */
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun #define DIAG_VERSION		\
46*4882a593Smuzhiyun 	((DIAG_MICRO_VERSION&0xF) | (DIAG_MINOR_VERSION&0xF)<<4 | \
47*4882a593Smuzhiyun 	(DIAG_MAJOR_VERSION&0xF)<<8)
48*4882a593Smuzhiyun 					/* bit[11:8] major ver */
49*4882a593Smuzhiyun 					/* bit[7:4] minor ver */
50*4882a593Smuzhiyun 					/* bit[3:0] micro ver */
51*4882a593Smuzhiyun 
52*4882a593Smuzhiyun /* event ID for trace purpose only, to avoid the conflict with future new
53*4882a593Smuzhiyun * WLC_E_ , starting from 0x8000
54*4882a593Smuzhiyun */
55*4882a593Smuzhiyun #define TRACE_FW_AUTH_STARTED			0x8000
56*4882a593Smuzhiyun #define TRACE_FW_ASSOC_STARTED			0x8001
57*4882a593Smuzhiyun #define TRACE_FW_RE_ASSOC_STARTED		0x8002
58*4882a593Smuzhiyun #define TRACE_G_SCAN_STARTED			0x8003
59*4882a593Smuzhiyun #define TRACE_ROAM_SCAN_STARTED			0x8004
60*4882a593Smuzhiyun #define TRACE_ROAM_SCAN_COMPLETE		0x8005
61*4882a593Smuzhiyun #define TRACE_FW_EAPOL_FRAME_TRANSMIT_START	0x8006
62*4882a593Smuzhiyun #define TRACE_FW_EAPOL_FRAME_TRANSMIT_STOP	0x8007
63*4882a593Smuzhiyun #define TRACE_BLOCK_ACK_NEGOTIATION_COMPLETE	0x8008	/* protocol status */
64*4882a593Smuzhiyun #define TRACE_BT_COEX_BT_SCO_START		0x8009
65*4882a593Smuzhiyun #define TRACE_BT_COEX_BT_SCO_STOP		0x800a
66*4882a593Smuzhiyun #define TRACE_BT_COEX_BT_SCAN_START		0x800b
67*4882a593Smuzhiyun #define TRACE_BT_COEX_BT_SCAN_STOP		0x800c
68*4882a593Smuzhiyun #define TRACE_BT_COEX_BT_HID_START		0x800d
69*4882a593Smuzhiyun #define TRACE_BT_COEX_BT_HID_STOP		0x800e
70*4882a593Smuzhiyun #define TRACE_ROAM_AUTH_STARTED			0x800f
71*4882a593Smuzhiyun /* Event ID for NAN, start from 0x9000 */
72*4882a593Smuzhiyun #define TRACE_NAN_CLUSTER_STARTED               0x9000
73*4882a593Smuzhiyun #define TRACE_NAN_CLUSTER_JOINED                0x9001
74*4882a593Smuzhiyun #define TRACE_NAN_CLUSTER_MERGED                0x9002
75*4882a593Smuzhiyun #define TRACE_NAN_ROLE_CHANGED                  0x9003
76*4882a593Smuzhiyun #define TRACE_NAN_SCAN_COMPLETE                 0x9004
77*4882a593Smuzhiyun #define TRACE_NAN_STATUS_CHNG                   0x9005
78*4882a593Smuzhiyun 
79*4882a593Smuzhiyun /* Parameters of wifi logger events are TLVs */
80*4882a593Smuzhiyun /* Event parameters tags are defined as: */
81*4882a593Smuzhiyun #define TRACE_TAG_VENDOR_SPECIFIC	0 /* take a byte stream as parameter */
82*4882a593Smuzhiyun #define TRACE_TAG_BSSID			1 /* takes a 6 bytes MAC address as parameter */
83*4882a593Smuzhiyun #define TRACE_TAG_ADDR			2 /* takes a 6 bytes MAC address as parameter */
84*4882a593Smuzhiyun #define TRACE_TAG_SSID			3 /* takes a 32 bytes SSID address as parameter */
85*4882a593Smuzhiyun #define TRACE_TAG_STATUS		4 /* takes an integer as parameter */
86*4882a593Smuzhiyun #define TRACE_TAG_CHANNEL_SPEC		5 /* takes one or more wifi_channel_spec as */
87*4882a593Smuzhiyun 					  /* parameter */
88*4882a593Smuzhiyun #define TRACE_TAG_WAKE_LOCK_EVENT	6 /* takes a wake_lock_event struct as parameter */
89*4882a593Smuzhiyun #define TRACE_TAG_ADDR1			7 /* takes a 6 bytes MAC address as parameter */
90*4882a593Smuzhiyun #define TRACE_TAG_ADDR2			8 /* takes a 6 bytes MAC address as parameter */
91*4882a593Smuzhiyun #define TRACE_TAG_ADDR3			9 /* takes a 6 bytes MAC address as parameter */
92*4882a593Smuzhiyun #define TRACE_TAG_ADDR4			10 /* takes a 6 bytes MAC address as parameter */
93*4882a593Smuzhiyun #define TRACE_TAG_TSF			11 /* take a 64 bits TSF value as parameter */
94*4882a593Smuzhiyun #define TRACE_TAG_IE			12 /* take one or more specific 802.11 IEs */
95*4882a593Smuzhiyun 					   /* parameter, IEs are in turn indicated in */
96*4882a593Smuzhiyun 					   /* TLV format as per 802.11 spec */
97*4882a593Smuzhiyun #define TRACE_TAG_INTERFACE		13 /* take interface name as parameter */
98*4882a593Smuzhiyun #define TRACE_TAG_REASON_CODE		14 /* take a reason code as per 802.11 */
99*4882a593Smuzhiyun 					   /* as parameter */
100*4882a593Smuzhiyun #define TRACE_TAG_RATE_MBPS		15 /* take a wifi rate in 0.5 mbps */
101*4882a593Smuzhiyun #define TRACE_TAG_REQUEST_ID		16 /* take an integer as parameter */
102*4882a593Smuzhiyun #define TRACE_TAG_BUCKET_ID		17 /* take an integer as parameter */
103*4882a593Smuzhiyun #define TRACE_TAG_GSCAN_PARAMS		18 /* takes a wifi_scan_cmd_params struct as parameter */
104*4882a593Smuzhiyun #define TRACE_TAG_GSCAN_CAPABILITIES	19 /* takes a wifi_gscan_capabilities struct as parameter */
105*4882a593Smuzhiyun #define TRACE_TAG_SCAN_ID		20 /* take an integer as parameter */
106*4882a593Smuzhiyun #define TRACE_TAG_RSSI			21 /* take an integer as parameter */
107*4882a593Smuzhiyun #define TRACE_TAG_CHANNEL		22 /* take an integer as parameter */
108*4882a593Smuzhiyun #define TRACE_TAG_LINK_ID		23 /* take an integer as parameter */
109*4882a593Smuzhiyun #define TRACE_TAG_LINK_ROLE		24 /* take an integer as parameter */
110*4882a593Smuzhiyun #define TRACE_TAG_LINK_STATE		25 /* take an integer as parameter */
111*4882a593Smuzhiyun #define TRACE_TAG_LINK_TYPE		26 /* take an integer as parameter */
112*4882a593Smuzhiyun #define TRACE_TAG_TSCO			27 /* take an integer as parameter */
113*4882a593Smuzhiyun #define TRACE_TAG_RSCO			28 /* take an integer as parameter */
114*4882a593Smuzhiyun #define TRACE_TAG_EAPOL_MESSAGE_TYPE	29 /* take an integer as parameter */
115*4882a593Smuzhiyun 					   /* M1-1, M2-2, M3-3, M4-4 */
116*4882a593Smuzhiyun 
117*4882a593Smuzhiyun typedef union {
118*4882a593Smuzhiyun 	struct {
119*4882a593Smuzhiyun 		uint16 event:	16;
120*4882a593Smuzhiyun 		uint16 version:	16;
121*4882a593Smuzhiyun 	};
122*4882a593Smuzhiyun 	uint32 t;
123*4882a593Smuzhiyun } wl_event_log_id_ver_t;
124*4882a593Smuzhiyun 
125*4882a593Smuzhiyun #endif	/* _WL_DIAG_H */
126