xref: /OK3568_Linux_fs/external/rkwifibt/drivers/bcmdhd/include/bcmevent.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Broadcom Event  protocol definitions
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Dependencies: bcmeth.h
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Copyright (C) 2020, Broadcom.
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  *
23*4882a593Smuzhiyun  * <<Broadcom-WL-IPTag/Dual:>>
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  */
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun /*
28*4882a593Smuzhiyun  * Broadcom Ethernet Events protocol defines
29*4882a593Smuzhiyun  *
30*4882a593Smuzhiyun  */
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #ifndef _BCMEVENT_H_
33*4882a593Smuzhiyun #define _BCMEVENT_H_
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun #include <typedefs.h>
36*4882a593Smuzhiyun /* #include <ethernet.h> -- TODO: req., excluded to overwhelming coupling (break up ethernet.h) */
37*4882a593Smuzhiyun #include <bcmeth.h>
38*4882a593Smuzhiyun #if defined(HEALTH_CHECK) || defined(DNGL_EVENT_SUPPORT)
39*4882a593Smuzhiyun #include <dnglevent.h>
40*4882a593Smuzhiyun #endif /* HEALTH_CHECK || DNGL_EVENT_SUPPORT */
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun /* This marks the start of a packed structure section. */
43*4882a593Smuzhiyun #include <packed_section_start.h>
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun #define BCM_EVENT_MSG_VERSION		2	/* wl_event_msg_t struct version */
46*4882a593Smuzhiyun #define BCM_MSG_IFNAME_MAX		16	/* max length of interface name */
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun /* flags */
49*4882a593Smuzhiyun #define WLC_EVENT_MSG_LINK		0x01	/* link is up */
50*4882a593Smuzhiyun #define WLC_EVENT_MSG_FLUSHTXQ		0x02	/* flush tx queue on MIC error */
51*4882a593Smuzhiyun #define WLC_EVENT_MSG_GROUP		0x04	/* group MIC error */
52*4882a593Smuzhiyun #define WLC_EVENT_MSG_UNKBSS		0x08	/* unknown source bsscfg */
53*4882a593Smuzhiyun #define WLC_EVENT_MSG_UNKIF		0x10	/* unknown source OS i/f */
54*4882a593Smuzhiyun 
55*4882a593Smuzhiyun /* these fields are stored in network order */
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun /* version 1 */
58*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct
59*4882a593Smuzhiyun {
60*4882a593Smuzhiyun 	uint16	version;
61*4882a593Smuzhiyun 	uint16	flags;			/* see flags below */
62*4882a593Smuzhiyun 	uint32	event_type;		/* Message (see below) */
63*4882a593Smuzhiyun 	uint32	status;			/* Status code (see below) */
64*4882a593Smuzhiyun 	uint32	reason;			/* Reason code (if applicable) */
65*4882a593Smuzhiyun 	uint32	auth_type;		/* WLC_E_AUTH */
66*4882a593Smuzhiyun 	uint32	datalen;		/* data buf */
67*4882a593Smuzhiyun 	struct ether_addr	addr;	/* Station address (if applicable) */
68*4882a593Smuzhiyun 	char	ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
69*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_event_msg_v1_t;
70*4882a593Smuzhiyun 
71*4882a593Smuzhiyun /* the current version */
72*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct
73*4882a593Smuzhiyun {
74*4882a593Smuzhiyun 	uint16	version;
75*4882a593Smuzhiyun 	uint16	flags;			/* see flags below */
76*4882a593Smuzhiyun 	uint32	event_type;		/* Message (see below) */
77*4882a593Smuzhiyun 	uint32	status;			/* Status code (see below) */
78*4882a593Smuzhiyun 	uint32	reason;			/* Reason code (if applicable) */
79*4882a593Smuzhiyun 	uint32	auth_type;		/* WLC_E_AUTH */
80*4882a593Smuzhiyun 	uint32	datalen;		/* data buf */
81*4882a593Smuzhiyun 	struct ether_addr	addr;	/* Station address (if applicable) */
82*4882a593Smuzhiyun 	char	ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
83*4882a593Smuzhiyun 	uint8	ifidx;			/* destination OS i/f index */
84*4882a593Smuzhiyun 	uint8	bsscfgidx;		/* source bsscfg index */
85*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_event_msg_t;
86*4882a593Smuzhiyun 
87*4882a593Smuzhiyun /* used by driver msgs */
88*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
89*4882a593Smuzhiyun 	struct ether_header eth;
90*4882a593Smuzhiyun 	bcmeth_hdr_t		bcm_hdr;
91*4882a593Smuzhiyun 	wl_event_msg_t		event;
92*4882a593Smuzhiyun 	/* data portion follows */
93*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT bcm_event_t;
94*4882a593Smuzhiyun 
95*4882a593Smuzhiyun /*
96*4882a593Smuzhiyun  * used by host event
97*4882a593Smuzhiyun  * note: if additional event types are added, it should go with is_wlc_event_frame() as well.
98*4882a593Smuzhiyun  */
99*4882a593Smuzhiyun typedef union bcm_event_msg_u {
100*4882a593Smuzhiyun 	wl_event_msg_t		event;
101*4882a593Smuzhiyun #if defined(HEALTH_CHECK) || defined(DNGL_EVENT_SUPPORT)
102*4882a593Smuzhiyun 	bcm_dngl_event_msg_t	dngl_event;
103*4882a593Smuzhiyun #endif /* HEALTH_CHECK || DNGL_EVENT_SUPPORT */
104*4882a593Smuzhiyun 
105*4882a593Smuzhiyun 	/* add new event here */
106*4882a593Smuzhiyun } bcm_event_msg_u_t;
107*4882a593Smuzhiyun 
108*4882a593Smuzhiyun #define BCM_MSG_LEN	(sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
109*4882a593Smuzhiyun 
110*4882a593Smuzhiyun /* Event messages */
111*4882a593Smuzhiyun #define WLC_E_SET_SSID		0	/* indicates status of set SSID */
112*4882a593Smuzhiyun #define WLC_E_JOIN		1	/* differentiates join IBSS from found (WLC_E_START) IBSS */
113*4882a593Smuzhiyun #define WLC_E_START		2	/* STA founded an IBSS or AP started a BSS */
114*4882a593Smuzhiyun #define WLC_E_AUTH		3	/* 802.11 AUTH request */
115*4882a593Smuzhiyun #define WLC_E_AUTH_IND		4	/* 802.11 AUTH indication */
116*4882a593Smuzhiyun #define WLC_E_DEAUTH		5	/* 802.11 DEAUTH request */
117*4882a593Smuzhiyun #define WLC_E_DEAUTH_IND	6	/* 802.11 DEAUTH indication */
118*4882a593Smuzhiyun #define WLC_E_ASSOC		7	/* 802.11 ASSOC request */
119*4882a593Smuzhiyun #define WLC_E_ASSOC_IND		8	/* 802.11 ASSOC indication */
120*4882a593Smuzhiyun #define WLC_E_REASSOC		9	/* 802.11 REASSOC request */
121*4882a593Smuzhiyun #define WLC_E_REASSOC_IND	10	/* 802.11 REASSOC indication */
122*4882a593Smuzhiyun #define WLC_E_DISASSOC		11	/* 802.11 DISASSOC request */
123*4882a593Smuzhiyun #define WLC_E_DISASSOC_IND	12	/* 802.11 DISASSOC indication */
124*4882a593Smuzhiyun #define WLC_E_QUIET_START	13	/* 802.11h Quiet period started */
125*4882a593Smuzhiyun #define WLC_E_QUIET_END		14	/* 802.11h Quiet period ended */
126*4882a593Smuzhiyun #define WLC_E_BEACON_RX		15	/* BEACONS received/lost indication */
127*4882a593Smuzhiyun #define WLC_E_LINK		16	/* generic link indication */
128*4882a593Smuzhiyun #define WLC_E_MIC_ERROR		17	/* TKIP MIC error occurred */
129*4882a593Smuzhiyun #define WLC_E_NDIS_LINK		18	/* NDIS style link indication */
130*4882a593Smuzhiyun #define WLC_E_ROAM		19	/* roam complete: indicate status & reason */
131*4882a593Smuzhiyun #define WLC_E_TXFAIL		20	/* change in dot11FailedCount (txfail) */
132*4882a593Smuzhiyun #define WLC_E_PMKID_CACHE	21	/* WPA2 pmkid cache indication */
133*4882a593Smuzhiyun #define WLC_E_RETROGRADE_TSF	22	/* current AP's TSF value went backward */
134*4882a593Smuzhiyun #define WLC_E_PRUNE		23	/* AP was pruned from join list for reason */
135*4882a593Smuzhiyun #define WLC_E_AUTOAUTH		24	/* report AutoAuth table entry match for join attempt */
136*4882a593Smuzhiyun #define WLC_E_EAPOL_MSG		25	/* Event encapsulating an EAPOL message */
137*4882a593Smuzhiyun #define WLC_E_SCAN_COMPLETE	26	/* Scan results are ready or scan was aborted */
138*4882a593Smuzhiyun #define WLC_E_ADDTS_IND		27	/* indicate to host addts fail/success */
139*4882a593Smuzhiyun #define WLC_E_DELTS_IND		28	/* indicate to host delts fail/success */
140*4882a593Smuzhiyun #define WLC_E_BCNSENT_IND	29	/* indicate to host of beacon transmit */
141*4882a593Smuzhiyun #define WLC_E_BCNRX_MSG		30	/* Send the received beacon up to the host */
142*4882a593Smuzhiyun #define WLC_E_BCNLOST_MSG	31	/* indicate to host loss of beacon */
143*4882a593Smuzhiyun #define WLC_E_ROAM_PREP		32	/* before attempting to roam association */
144*4882a593Smuzhiyun #define WLC_E_PFN_NET_FOUND	33	/* PFN network found event */
145*4882a593Smuzhiyun #define WLC_E_PFN_NET_LOST	34	/* PFN network lost event */
146*4882a593Smuzhiyun #define WLC_E_RESET_COMPLETE	35
147*4882a593Smuzhiyun #define WLC_E_JOIN_START	36
148*4882a593Smuzhiyun #define WLC_E_ROAM_START	37	/* roam attempt started: indicate reason */
149*4882a593Smuzhiyun #define WLC_E_ASSOC_START	38
150*4882a593Smuzhiyun #define WLC_E_IBSS_ASSOC	39
151*4882a593Smuzhiyun #define WLC_E_RADIO		40
152*4882a593Smuzhiyun #define WLC_E_PSM_WATCHDOG	41	/* PSM microcode watchdog fired */
153*4882a593Smuzhiyun 
154*4882a593Smuzhiyun #define WLC_E_PROBREQ_MSG       44      /* probe request received */
155*4882a593Smuzhiyun #define WLC_E_SCAN_CONFIRM_IND  45
156*4882a593Smuzhiyun #define WLC_E_PSK_SUP		46	/* WPA Handshake fail */
157*4882a593Smuzhiyun #define WLC_E_COUNTRY_CODE_CHANGED	47
158*4882a593Smuzhiyun #define	WLC_E_EXCEEDED_MEDIUM_TIME	48	/* WMMAC excedded medium time */
159*4882a593Smuzhiyun #define WLC_E_ICV_ERROR		49	/* WEP ICV error occurred */
160*4882a593Smuzhiyun #define WLC_E_UNICAST_DECODE_ERROR	50	/* Unsupported unicast encrypted frame */
161*4882a593Smuzhiyun #define WLC_E_MULTICAST_DECODE_ERROR	51	/* Unsupported multicast encrypted frame */
162*4882a593Smuzhiyun #define WLC_E_TRACE		52
163*4882a593Smuzhiyun #define WLC_E_IF		54	/* I/F change (for dongle host notification) */
164*4882a593Smuzhiyun #define WLC_E_P2P_DISC_LISTEN_COMPLETE	55	/* listen state expires */
165*4882a593Smuzhiyun #define WLC_E_RSSI		56	/* indicate RSSI change based on configured levels */
166*4882a593Smuzhiyun #define WLC_E_PFN_BEST_BATCHING	57	/* PFN best network batching event */
167*4882a593Smuzhiyun #define WLC_E_EXTLOG_MSG	58
168*4882a593Smuzhiyun #define WLC_E_ACTION_FRAME      59	/* Action frame Rx */
169*4882a593Smuzhiyun #define WLC_E_ACTION_FRAME_COMPLETE	60	/* Action frame Tx complete */
170*4882a593Smuzhiyun #define WLC_E_PRE_ASSOC_IND	61	/* assoc request received */
171*4882a593Smuzhiyun #define WLC_E_PRE_REASSOC_IND	62	/* re-assoc request received */
172*4882a593Smuzhiyun #ifdef CSI_SUPPORT
173*4882a593Smuzhiyun #define WLC_E_CSI		63
174*4882a593Smuzhiyun #else
175*4882a593Smuzhiyun #define WLC_E_CHANNEL_ADOPTED	63	/* channel adopted (obsoleted) */
176*4882a593Smuzhiyun #endif /* CSI_SUPPORT */
177*4882a593Smuzhiyun #define WLC_E_AP_STARTED	64	/* AP started */
178*4882a593Smuzhiyun #define WLC_E_DFS_AP_STOP	65	/* AP stopped due to DFS */
179*4882a593Smuzhiyun #define WLC_E_DFS_AP_RESUME	66	/* AP resumed due to DFS */
180*4882a593Smuzhiyun #define WLC_E_WAI_STA_EVENT	67	/* WAI stations event */
181*4882a593Smuzhiyun #define WLC_E_WAI_MSG		68	/* event encapsulating an WAI message */
182*4882a593Smuzhiyun #define WLC_E_ESCAN_RESULT	69	/* escan result event */
183*4882a593Smuzhiyun #define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE	70	/* action frame off channel complete */
184*4882a593Smuzhiyun #define WLC_E_PROBRESP_MSG	71	/* probe response received */
185*4882a593Smuzhiyun #define WLC_E_P2P_PROBREQ_MSG	72	/* P2P Probe request received */
186*4882a593Smuzhiyun #define WLC_E_DCS_REQUEST	73
187*4882a593Smuzhiyun /* will enable this after proptxstatus code is merged back to ToT */
188*4882a593Smuzhiyun #define WLC_E_FIFO_CREDIT_MAP	74	/* credits for D11 FIFOs. [AC0,AC1,AC2,AC3,BC_MC,ATIM] */
189*4882a593Smuzhiyun #define WLC_E_ACTION_FRAME_RX	75	/* Received action frame event WITH
190*4882a593Smuzhiyun 					 * wl_event_rx_frame_data_t header
191*4882a593Smuzhiyun 					 */
192*4882a593Smuzhiyun #define WLC_E_WAKE_EVENT	76	/* Wake Event timer fired, used for wake WLAN test mode */
193*4882a593Smuzhiyun #define WLC_E_RM_COMPLETE	77	/* Radio measurement complete */
194*4882a593Smuzhiyun #define WLC_E_HTSFSYNC		78	/* Synchronize TSF with the host */
195*4882a593Smuzhiyun #define WLC_E_OVERLAY_REQ	79	/* request an overlay IOCTL/iovar from the host */
196*4882a593Smuzhiyun #define WLC_E_CSA_COMPLETE_IND		80	/* 802.11 CHANNEL SWITCH ACTION completed */
197*4882a593Smuzhiyun #define WLC_E_EXCESS_PM_WAKE_EVENT	81	/* excess PM Wake Event to inform host  */
198*4882a593Smuzhiyun #define WLC_E_PFN_SCAN_NONE		82	/* no PFN networks around */
199*4882a593Smuzhiyun /* PFN BSSID network found event, conflict/share with  WLC_E_PFN_SCAN_NONE */
200*4882a593Smuzhiyun #define WLC_E_PFN_BSSID_NET_FOUND	82
201*4882a593Smuzhiyun #define WLC_E_PFN_SCAN_ALLGONE		83	/* last found PFN network gets lost */
202*4882a593Smuzhiyun /* PFN BSSID network lost event, conflict/share with WLC_E_PFN_SCAN_ALLGONE */
203*4882a593Smuzhiyun #define WLC_E_PFN_BSSID_NET_LOST	83
204*4882a593Smuzhiyun #define WLC_E_GTK_PLUMBED		84
205*4882a593Smuzhiyun #define WLC_E_ASSOC_IND_NDIS		85	/* 802.11 ASSOC indication for NDIS only */
206*4882a593Smuzhiyun #define WLC_E_REASSOC_IND_NDIS		86	/* 802.11 REASSOC indication for NDIS only */
207*4882a593Smuzhiyun #define WLC_E_ASSOC_REQ_IE		87
208*4882a593Smuzhiyun #define WLC_E_ASSOC_RESP_IE		88
209*4882a593Smuzhiyun #define WLC_E_ASSOC_RECREATED		89	/* association recreated on resume */
210*4882a593Smuzhiyun #define WLC_E_ACTION_FRAME_RX_NDIS	90	/* rx action frame event for NDIS only */
211*4882a593Smuzhiyun #define WLC_E_AUTH_REQ			91	/* authentication request received */
212*4882a593Smuzhiyun #define WLC_E_TDLS_PEER_EVENT		92	/* discovered peer, connected/disconnected peer */
213*4882a593Smuzhiyun #define WLC_E_SPEEDY_RECREATE_FAIL	93	/* fast assoc recreation failed */
214*4882a593Smuzhiyun #define WLC_E_NATIVE			94	/* port-specific event and payload (e.g. NDIS) */
215*4882a593Smuzhiyun #define WLC_E_PKTDELAY_IND		95	/* event for tx pkt delay suddently jump */
216*4882a593Smuzhiyun 
217*4882a593Smuzhiyun #ifdef WLAWDL
218*4882a593Smuzhiyun #define WLC_E_AWDL_AW			96	/* AWDL AW period starts */
219*4882a593Smuzhiyun #define WLC_E_AWDL_ROLE			97	/* AWDL Master/Slave/NE master role event */
220*4882a593Smuzhiyun #define WLC_E_AWDL_EVENT		98	/* Generic AWDL event */
221*4882a593Smuzhiyun #endif /* WLAWDL */
222*4882a593Smuzhiyun 
223*4882a593Smuzhiyun #define WLC_E_PSTA_PRIMARY_INTF_IND	99	/* psta primary interface indication */
224*4882a593Smuzhiyun #define WLC_E_NAN			100     /* NAN event - Reserved for future */
225*4882a593Smuzhiyun #define WLC_E_BEACON_FRAME_RX		101
226*4882a593Smuzhiyun #define WLC_E_SERVICE_FOUND		102	/* desired service found */
227*4882a593Smuzhiyun #define WLC_E_GAS_FRAGMENT_RX		103	/* GAS fragment received */
228*4882a593Smuzhiyun #define WLC_E_GAS_COMPLETE		104	/* GAS sessions all complete */
229*4882a593Smuzhiyun #define WLC_E_P2PO_ADD_DEVICE		105	/* New device found by p2p offload */
230*4882a593Smuzhiyun #define WLC_E_P2PO_DEL_DEVICE		106	/* device has been removed by p2p offload */
231*4882a593Smuzhiyun #define WLC_E_WNM_STA_SLEEP		107	/* WNM event to notify STA enter sleep mode */
232*4882a593Smuzhiyun #define WLC_E_TXFAIL_THRESH		108	/* Indication of MAC tx failures (exhaustion of
233*4882a593Smuzhiyun 						 * 802.11 retries) exceeding threshold(s)
234*4882a593Smuzhiyun 						 */
235*4882a593Smuzhiyun #define WLC_E_PROXD			109	/* Proximity Detection event */
236*4882a593Smuzhiyun #define WLC_E_IBSS_COALESCE		110	/* IBSS Coalescing */
237*4882a593Smuzhiyun #define WLC_E_AIBSS_TXFAIL		110	/* TXFAIL event for AIBSS, re using event 110 */
238*4882a593Smuzhiyun #define WLC_E_BSS_LOAD			114	/* Inform host of beacon bss load */
239*4882a593Smuzhiyun #define WLC_E_MIMO_PWR_SAVE		115	/* Inform host MIMO PWR SAVE learning events */
240*4882a593Smuzhiyun #define WLC_E_LEAKY_AP_STATS	116 /* Inform host leaky Ap stats events */
241*4882a593Smuzhiyun #define WLC_E_ALLOW_CREDIT_BORROW 117	/* Allow or disallow wlfc credit borrowing in DHD */
242*4882a593Smuzhiyun #define WLC_E_MSCH			120	/* Multiple channel scheduler event */
243*4882a593Smuzhiyun #define WLC_E_CSA_START_IND		121
244*4882a593Smuzhiyun #define WLC_E_CSA_DONE_IND		122
245*4882a593Smuzhiyun #define WLC_E_CSA_FAILURE_IND		123
246*4882a593Smuzhiyun #define WLC_E_CCA_CHAN_QUAL		124	/* CCA based channel quality report */
247*4882a593Smuzhiyun #define WLC_E_BSSID		125	/* to report change in BSSID while roaming */
248*4882a593Smuzhiyun #define WLC_E_TX_STAT_ERROR		126	/* tx error indication */
249*4882a593Smuzhiyun #define WLC_E_BCMC_CREDIT_SUPPORT	127	/* credit check for BCMC supported */
250*4882a593Smuzhiyun #define WLC_E_PEER_TIMEOUT	128 /* silently drop a STA because of inactivity */
251*4882a593Smuzhiyun #define WLC_E_BT_WIFI_HANDOVER_REQ	130	/* Handover Request Initiated */
252*4882a593Smuzhiyun #define WLC_E_SPW_TXINHIBIT		131     /* Southpaw TxInhibit notification */
253*4882a593Smuzhiyun #define WLC_E_FBT_AUTH_REQ_IND		132	/* FBT Authentication Request Indication */
254*4882a593Smuzhiyun #define WLC_E_RSSI_LQM			133	/* Enhancement addition for WLC_E_RSSI */
255*4882a593Smuzhiyun #define WLC_E_PFN_GSCAN_FULL_RESULT		134 /* Full probe/beacon (IEs etc) results */
256*4882a593Smuzhiyun #define WLC_E_PFN_SWC		135 /* Significant change in rssi of bssids being tracked */
257*4882a593Smuzhiyun #define WLC_E_AUTHORIZED	136	/* a STA been authroized for traffic */
258*4882a593Smuzhiyun #define WLC_E_PROBREQ_MSG_RX	137 /* probe req with wl_event_rx_frame_data_t header */
259*4882a593Smuzhiyun #define WLC_E_PFN_SCAN_COMPLETE	138	/* PFN completed scan of network list */
260*4882a593Smuzhiyun #define WLC_E_RMC_EVENT		139	/* RMC Event */
261*4882a593Smuzhiyun #define WLC_E_DPSTA_INTF_IND	140	/* DPSTA interface indication */
262*4882a593Smuzhiyun #define WLC_E_RRM		141	/* RRM Event */
263*4882a593Smuzhiyun #define WLC_E_PFN_SSID_EXT	142	/* SSID EXT event */
264*4882a593Smuzhiyun #define WLC_E_ROAM_EXP_EVENT	143	/* Expanded roam event */
265*4882a593Smuzhiyun #define WLC_E_ULP			146	/* ULP entered indication */
266*4882a593Smuzhiyun #define WLC_E_MACDBG			147	/* Ucode debugging event */
267*4882a593Smuzhiyun #define WLC_E_RESERVED			148	/* reserved */
268*4882a593Smuzhiyun #define WLC_E_PRE_ASSOC_RSEP_IND	149	/* assoc resp received */
269*4882a593Smuzhiyun #define WLC_E_PSK_AUTH			150	/* PSK AUTH WPA2-PSK 4 WAY Handshake failure */
270*4882a593Smuzhiyun #define WLC_E_TKO			151     /* TCP keepalive offload */
271*4882a593Smuzhiyun #define WLC_E_SDB_TRANSITION            152     /* SDB mode-switch event */
272*4882a593Smuzhiyun #define WLC_E_NATOE_NFCT		153     /* natoe event */
273*4882a593Smuzhiyun #define WLC_E_TEMP_THROTTLE		154	/* Temperature throttling control event */
274*4882a593Smuzhiyun #define WLC_E_LINK_QUALITY		155     /* Link quality measurement complete */
275*4882a593Smuzhiyun #define WLC_E_BSSTRANS_RESP		156	/* BSS Transition Response received */
276*4882a593Smuzhiyun #define WLC_E_TWT_SETUP			157	/* TWT Setup Complete event */
277*4882a593Smuzhiyun #define WLC_E_HE_TWT_SETUP		157	/* TODO:Remove after merging TWT changes to trunk */
278*4882a593Smuzhiyun #define WLC_E_NAN_CRITICAL		158	/* NAN Critical Event */
279*4882a593Smuzhiyun #define WLC_E_NAN_NON_CRITICAL		159	/* NAN Non-Critical Event */
280*4882a593Smuzhiyun #define WLC_E_RADAR_DETECTED		160	/* Radar Detected event */
281*4882a593Smuzhiyun #define WLC_E_RANGING_EVENT		161	/* Ranging event */
282*4882a593Smuzhiyun #define WLC_E_INVALID_IE		162	/* Received invalid IE */
283*4882a593Smuzhiyun #define WLC_E_MODE_SWITCH		163	/* Mode switch event */
284*4882a593Smuzhiyun #define WLC_E_PKT_FILTER		164	/* Packet filter event */
285*4882a593Smuzhiyun #define WLC_E_DMA_TXFLUSH_COMPLETE	165	/* TxFlush done before changing tx/rxchain */
286*4882a593Smuzhiyun #define WLC_E_FBT			166	/* FBT event */
287*4882a593Smuzhiyun #define WLC_E_PFN_SCAN_BACKOFF		167	/* PFN SCAN Backoff event */
288*4882a593Smuzhiyun #define WLC_E_PFN_BSSID_SCAN_BACKOFF	168	/* PFN BSSID SCAN BAckoff event */
289*4882a593Smuzhiyun #define WLC_E_AGGR_EVENT		169	/* Aggregated event */
290*4882a593Smuzhiyun #define WLC_E_TVPM_MITIGATION		171	/* Change in mitigation applied by TVPM */
291*4882a593Smuzhiyun #define WLC_E_SCAN_START		172	/* Deprecated */
292*4882a593Smuzhiyun #define WLC_E_SCAN			172	/* Scan event */
293*4882a593Smuzhiyun #define WLC_E_MBO			173	/* MBO event */
294*4882a593Smuzhiyun #define WLC_E_PHY_CAL			174	/* Phy calibration start indication to host */
295*4882a593Smuzhiyun #define WLC_E_RPSNOA			175	/* Radio power save start/end indication to host */
296*4882a593Smuzhiyun #define WLC_E_ADPS			176	/* ADPS event */
297*4882a593Smuzhiyun #define WLC_E_SLOTTED_BSS_PEER_OP	177	/* Per peer SCB delete */
298*4882a593Smuzhiyun #define WLC_E_GTK_KEYROT_NO_CHANSW	179	/* Avoid Chanswitch while GTK key rotation */
299*4882a593Smuzhiyun #define WLC_E_ONBODY_STATUS_CHANGE	180	/* Indication of onbody status change */
300*4882a593Smuzhiyun #define WLC_E_BCNRECV_ABORTED		181	/* Fake AP bcnrecv aborted roam event */
301*4882a593Smuzhiyun #define WLC_E_PMK_INFO			182	/* PMK,PMKID information event */
302*4882a593Smuzhiyun #define WLC_E_BSSTRANS			183	/* BSS Transition request / Response */
303*4882a593Smuzhiyun #define WLC_E_WA_LQM			184	/* link quality monitoring */
304*4882a593Smuzhiyun #define WLC_E_ACTION_FRAME_OFF_CHAN_DWELL_COMPLETE  185 /* action frame off channel
305*4882a593Smuzhiyun 						 *  dwell time complete
306*4882a593Smuzhiyun 						 */
307*4882a593Smuzhiyun #define WLC_E_WSEC			186	/* wsec keymgmt event */
308*4882a593Smuzhiyun #define WLC_E_OBSS_DETECTION		187	/* OBSS HW event */
309*4882a593Smuzhiyun #define WLC_E_AP_BCN_MUTE		188	/* Beacon mute mitigation event */
310*4882a593Smuzhiyun #define WLC_E_SC_CHAN_QUAL		189	/* Event to indicate the SC chanel quality */
311*4882a593Smuzhiyun #define WLC_E_DYNSAR			190	/* Dynamic SAR indicate optimize on/off */
312*4882a593Smuzhiyun #define WLC_E_ROAM_CACHE_UPDATE		191	/* Roam cache update indication */
313*4882a593Smuzhiyun #define WLC_E_AP_BCN_DRIFT		192	/* Beacon Drift event */
314*4882a593Smuzhiyun #define WLC_E_PFN_SCAN_ALLGONE_EXT	193	/* last found PFN network gets lost. */
315*4882a593Smuzhiyun #define WLC_E_AUTH_START		194	/* notify upper layer to start auth */
316*4882a593Smuzhiyun #define WLC_E_TWT			195	/* TWT event */
317*4882a593Smuzhiyun #define WLC_E_LAST			196	/* highest val + 1 for range checking */
318*4882a593Smuzhiyun #if (WLC_E_LAST > 196)
319*4882a593Smuzhiyun #error "WLC_E_LAST: Invalid value for last event; must be <= 196."
320*4882a593Smuzhiyun #endif /* WLC_E_LAST */
321*4882a593Smuzhiyun 
322*4882a593Smuzhiyun /* define an API for getting the string name of an event */
323*4882a593Smuzhiyun extern const char *bcmevent_get_name(uint event_type);
324*4882a593Smuzhiyun extern void wl_event_to_host_order(wl_event_msg_t * evt);
325*4882a593Smuzhiyun extern void wl_event_to_network_order(wl_event_msg_t * evt);
326*4882a593Smuzhiyun 
327*4882a593Smuzhiyun /* validate if the event is proper and if valid copy event header to event */
328*4882a593Smuzhiyun extern int is_wlc_event_frame(void *pktdata, uint pktlen, uint16 exp_usr_subtype,
329*4882a593Smuzhiyun 	bcm_event_msg_u_t *out_event);
330*4882a593Smuzhiyun 
331*4882a593Smuzhiyun /* conversion between host and network order for events */
332*4882a593Smuzhiyun void wl_event_to_host_order(wl_event_msg_t * evt);
333*4882a593Smuzhiyun void wl_event_to_network_order(wl_event_msg_t * evt);
334*4882a593Smuzhiyun 
335*4882a593Smuzhiyun #define WLC_ROAM_EVENT_V1 0x1u
336*4882a593Smuzhiyun 
337*4882a593Smuzhiyun /* tlv ids for roam event */
338*4882a593Smuzhiyun #define WLC_ROAM_NO_NETWORKS_TLV_ID 1
339*4882a593Smuzhiyun 
340*4882a593Smuzhiyun /* No Networks reasons */
341*4882a593Smuzhiyun #define WLC_E_REASON_NO_NETWORKS		0x0u /* value 0 means no networks found */
342*4882a593Smuzhiyun #define WLC_E_REASON_NO_NETWORKS_BY_SCORE	0x01u /* bit 1 indicates filtered by score */
343*4882a593Smuzhiyun 
344*4882a593Smuzhiyun /* bit mask field indicating fail reason */
345*4882a593Smuzhiyun typedef uint32 wlc_roam_fail_reason_t;
346*4882a593Smuzhiyun 
347*4882a593Smuzhiyun typedef struct wlc_roam_event_header {
348*4882a593Smuzhiyun 	uint16 version;		/* version */
349*4882a593Smuzhiyun 	uint16 length;		/* total length */
350*4882a593Smuzhiyun } wlc_roam_event_header_t;
351*4882a593Smuzhiyun 
352*4882a593Smuzhiyun typedef struct wlc_roam_event {
353*4882a593Smuzhiyun 	wlc_roam_event_header_t header;
354*4882a593Smuzhiyun 	uint8 xtlvs[];		/* data */
355*4882a593Smuzhiyun } wl_roam_event_t;
356*4882a593Smuzhiyun 
357*4882a593Smuzhiyun #define WLC_ROAM_PREP_EVENT_V1 0x1u
358*4882a593Smuzhiyun #define WLC_ROAM_START_EVENT_V1 0x1u
359*4882a593Smuzhiyun 
360*4882a593Smuzhiyun typedef struct wlc_roam_start_event {
361*4882a593Smuzhiyun 	uint16 version;		/* version */
362*4882a593Smuzhiyun 	uint16 length;		/* total length */
363*4882a593Smuzhiyun 	int16 rssi;		/* current bss rssi */
364*4882a593Smuzhiyun 	int8 pad[2];		/* padding */
365*4882a593Smuzhiyun 	uint8 xtlvs[];		/* optional xtlvs */
366*4882a593Smuzhiyun } wlc_roam_start_event_t;
367*4882a593Smuzhiyun 
368*4882a593Smuzhiyun typedef struct wlc_roam_prep_event {
369*4882a593Smuzhiyun 	uint16 version;		/* version */
370*4882a593Smuzhiyun 	uint16 length;		/* total length */
371*4882a593Smuzhiyun 	int16 rssi;		/* target bss rssi */
372*4882a593Smuzhiyun 	int8 pad[2];		/* padding */
373*4882a593Smuzhiyun 	uint8 xtlvs[];		/* optional xtlvs */
374*4882a593Smuzhiyun } wlc_roam_prep_event_t;
375*4882a593Smuzhiyun 
376*4882a593Smuzhiyun #define WLC_ROAM_CACHE_UPDATE_EVENT_V1	0x1u
377*4882a593Smuzhiyun 
378*4882a593Smuzhiyun /* WLC_E_ROAM_CACHE_UPDATE event data prototype */
379*4882a593Smuzhiyun typedef struct wlc_roam_cache_update_event {
380*4882a593Smuzhiyun 	uint16 version;		/* version */
381*4882a593Smuzhiyun 	uint16 length;		/* total length */
382*4882a593Smuzhiyun 	uint8 xtlvs[];		/* optional xtlvs */
383*4882a593Smuzhiyun } wlc_roam_cache_update_event_t;
384*4882a593Smuzhiyun 
385*4882a593Smuzhiyun typedef enum wlc_roam_cache_update_reason {
386*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_NEW_ROAM_CACHE = 1,	/* new roam cache */
387*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_JOIN = 2,			/* join bss */
388*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_RSSI_DELTA = 3,		/* rssi delta */
389*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_MOTION_RSSI_DELTA = 4,	/* motion rssi delta */
390*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_CHANNEL_MISS = 5,		/* channel missed */
391*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_START_SPLIT_SCAN = 6,	/* start split scan */
392*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_START_FULL_SCAN = 7,	/* start full scan */
393*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_INIT_ASSOC = 8,		/* init before assoc */
394*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_FULL_SCAN_FAILED = 9,	/* full scan failed */
395*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_NO_AP_FOUND = 10,		/* no ap found */
396*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_MISSING_AP = 11,		/* cached ap not found */
397*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_START_PART_SCAN = 12,	/* RCC */
398*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_RCC_MODE = 13,		/* RCC */
399*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_RCC_CHANNELS = 14,	/* RCC */
400*4882a593Smuzhiyun 	WLC_ROAM_CACHE_UPDATE_START_LP_FULL_SCAN = 15	/* start low power full scan */
401*4882a593Smuzhiyun } wlc_roam_cache_update_reason_t;
402*4882a593Smuzhiyun 
403*4882a593Smuzhiyun /*
404*4882a593Smuzhiyun  * Please do not insert/delete events in the middle causing renumbering.
405*4882a593Smuzhiyun  * It is a problem for host-device compatibility, especially with ROMmed chips.
406*4882a593Smuzhiyun  */
407*4882a593Smuzhiyun 
408*4882a593Smuzhiyun /* Translate between internal and exported status codes */
409*4882a593Smuzhiyun /* Event status codes */
410*4882a593Smuzhiyun #define WLC_E_STATUS_SUCCESS		0	/* operation was successful */
411*4882a593Smuzhiyun #define WLC_E_STATUS_FAIL		1	/* operation failed */
412*4882a593Smuzhiyun #define WLC_E_STATUS_TIMEOUT		2	/* operation timed out */
413*4882a593Smuzhiyun #define WLC_E_STATUS_NO_NETWORKS	3	/* failed due to no matching network found */
414*4882a593Smuzhiyun #define WLC_E_STATUS_ABORT		4	/* operation was aborted */
415*4882a593Smuzhiyun #define WLC_E_STATUS_NO_ACK		5	/* protocol failure: packet not ack'd */
416*4882a593Smuzhiyun #define WLC_E_STATUS_UNSOLICITED	6	/* AUTH or ASSOC packet was unsolicited */
417*4882a593Smuzhiyun #define WLC_E_STATUS_ATTEMPT		7	/* attempt to assoc to an auto auth configuration */
418*4882a593Smuzhiyun #define WLC_E_STATUS_PARTIAL		8	/* scan results are incomplete */
419*4882a593Smuzhiyun #define WLC_E_STATUS_NEWSCAN		9	/* scan aborted by another scan */
420*4882a593Smuzhiyun #define WLC_E_STATUS_NEWASSOC		10	/* scan aborted due to assoc in progress */
421*4882a593Smuzhiyun #define WLC_E_STATUS_11HQUIET		11	/* 802.11h quiet period started */
422*4882a593Smuzhiyun #define WLC_E_STATUS_SUPPRESS		12	/* user disabled scanning (WLC_SET_SCANSUPPRESS) */
423*4882a593Smuzhiyun #define WLC_E_STATUS_NOCHANS		13	/* no allowable channels to scan */
424*4882a593Smuzhiyun #ifdef BCMCCX
425*4882a593Smuzhiyun #define WLC_E_STATUS_CCXFASTRM		14	/* scan aborted due to CCX fast roam */
426*4882a593Smuzhiyun #endif /* BCMCCX */
427*4882a593Smuzhiyun #define WLC_E_STATUS_CS_ABORT		15	/* abort channel select */
428*4882a593Smuzhiyun #define WLC_E_STATUS_ERROR		16	/* request failed due to error */
429*4882a593Smuzhiyun #define WLC_E_STATUS_SLOTTED_PEER_ADD	17	/* Slotted scb for peer addition status */
430*4882a593Smuzhiyun #define WLC_E_STATUS_SLOTTED_PEER_DEL	18	/* Slotted scb for peer deletion status */
431*4882a593Smuzhiyun #define WLC_E_STATUS_RXBCN		19	/* Rx Beacon event for FAKEAP feature	*/
432*4882a593Smuzhiyun #define WLC_E_STATUS_RXBCN_ABORT	20	/* Rx Beacon abort event for FAKEAP feature */
433*4882a593Smuzhiyun #define WLC_E_STATUS_LOWPOWER_ON_LOWSPAN	21	/* LOWPOWER scan request during LOWSPAN */
434*4882a593Smuzhiyun #define WLC_E_STATUS_INVALID 0xff  /* Invalid status code to init variables. */
435*4882a593Smuzhiyun 
436*4882a593Smuzhiyun /* 4-way handshake event type */
437*4882a593Smuzhiyun #define WLC_E_PSK_AUTH_SUB_EAPOL_START		1	/* EAPOL start */
438*4882a593Smuzhiyun #define WLC_E_PSK_AUTH_SUB_EAPOL_DONE		2	/* EAPOL end */
439*4882a593Smuzhiyun /* GTK event type */
440*4882a593Smuzhiyun #define	WLC_E_PSK_AUTH_SUB_GTK_DONE		3	/* GTK end */
441*4882a593Smuzhiyun 
442*4882a593Smuzhiyun /* 4-way handshake event status code */
443*4882a593Smuzhiyun #define WLC_E_STATUS_PSK_AUTH_WPA_TIMOUT	1	/* operation timed out */
444*4882a593Smuzhiyun #define WLC_E_STATUS_PSK_AUTH_MIC_WPA_ERR		2	/* MIC error */
445*4882a593Smuzhiyun #define WLC_E_STATUS_PSK_AUTH_IE_MISMATCH_ERR		3	/* IE Missmatch error */
446*4882a593Smuzhiyun #define WLC_E_STATUS_PSK_AUTH_REPLAY_COUNT_ERR		4
447*4882a593Smuzhiyun #define WLC_E_STATUS_PSK_AUTH_PEER_BLACKISTED	5	/* Blaclisted peer */
448*4882a593Smuzhiyun #define WLC_E_STATUS_PSK_AUTH_GTK_REKEY_FAIL	6	/* GTK event status code */
449*4882a593Smuzhiyun 
450*4882a593Smuzhiyun /* SDB transition status code */
451*4882a593Smuzhiyun #define WLC_E_STATUS_SDB_START			1
452*4882a593Smuzhiyun #define WLC_E_STATUS_SDB_COMPLETE		2
453*4882a593Smuzhiyun /* Slice-swap status code */
454*4882a593Smuzhiyun #define WLC_E_STATUS_SLICE_SWAP_START		3
455*4882a593Smuzhiyun #define WLC_E_STATUS_SLICE_SWAP_COMPLETE	4
456*4882a593Smuzhiyun 
457*4882a593Smuzhiyun /* SDB transition reason code */
458*4882a593Smuzhiyun #define WLC_E_REASON_HOST_DIRECT	0
459*4882a593Smuzhiyun #define WLC_E_REASON_INFRA_ASSOC	1
460*4882a593Smuzhiyun #define WLC_E_REASON_INFRA_ROAM		2
461*4882a593Smuzhiyun #define WLC_E_REASON_INFRA_DISASSOC	3
462*4882a593Smuzhiyun #define WLC_E_REASON_NO_MODE_CHANGE_NEEDED	4
463*4882a593Smuzhiyun 
464*4882a593Smuzhiyun #ifdef WLAWDL
465*4882a593Smuzhiyun #define WLC_E_REASON_AWDL_ENABLE	5
466*4882a593Smuzhiyun #define WLC_E_REASON_AWDL_DISABLE	6
467*4882a593Smuzhiyun #endif /* WLAWDL */
468*4882a593Smuzhiyun 
469*4882a593Smuzhiyun /* TX STAT ERROR REASON CODE */
470*4882a593Smuzhiyun #define WLC_E_REASON_TXBACKOFF_NOT_DECREMENTED 0x1
471*4882a593Smuzhiyun 
472*4882a593Smuzhiyun /* WLC_E_SDB_TRANSITION event data */
473*4882a593Smuzhiyun #define WL_MAX_BSSCFG     4
474*4882a593Smuzhiyun #define WL_EVENT_SDB_TRANSITION_VER     1
475*4882a593Smuzhiyun typedef struct wl_event_sdb_data {
476*4882a593Smuzhiyun 	uint8 wlunit;           /* Core index */
477*4882a593Smuzhiyun 	uint8 is_iftype;        /* Interface Type(Station, SoftAP, P2P_GO, P2P_GC */
478*4882a593Smuzhiyun 	uint16 chanspec;        /* Interface Channel/Chanspec */
479*4882a593Smuzhiyun 	char ssidbuf[(4 * 32) + 1];	/* SSID_FMT_BUF_LEN: ((4 * DOT11_MAX_SSID_LEN) + 1) */
480*4882a593Smuzhiyun } wl_event_sdb_data_t;
481*4882a593Smuzhiyun 
482*4882a593Smuzhiyun typedef struct wl_event_sdb_trans {
483*4882a593Smuzhiyun 	uint8 version;          /* Event Data Version */
484*4882a593Smuzhiyun 	uint8 rsdb_mode;
485*4882a593Smuzhiyun 	uint8 enable_bsscfg;
486*4882a593Smuzhiyun 	uint8 reserved;
487*4882a593Smuzhiyun 	struct wl_event_sdb_data values[WL_MAX_BSSCFG];
488*4882a593Smuzhiyun } wl_event_sdb_trans_t;
489*4882a593Smuzhiyun 
490*4882a593Smuzhiyun /* reason codes for WLC_E_GTK_KEYROT_NO_CHANSW event */
491*4882a593Smuzhiyun #define WLC_E_GTKKEYROT_SCANDELAY       0       /* Delay scan while gtk in progress */
492*4882a593Smuzhiyun 
493*4882a593Smuzhiyun #ifdef WLAWDL
494*4882a593Smuzhiyun #define WLC_E_GTKKEYROT_SKIPCHANSW_AWDL 1       /* Avoid chansw by awdl while gtk in progress */
495*4882a593Smuzhiyun #endif /* WLAWDL */
496*4882a593Smuzhiyun 
497*4882a593Smuzhiyun #define WLC_E_GTKKEYROT_SKIPCHANSW_P2P  2       /* Avoid chansw by p2p while gtk in progress */
498*4882a593Smuzhiyun 
499*4882a593Smuzhiyun /* roam reason codes */
500*4882a593Smuzhiyun #define WLC_E_REASON_INITIAL_ASSOC	0	/* initial assoc */
501*4882a593Smuzhiyun #define WLC_E_REASON_LOW_RSSI		1	/* roamed due to low RSSI */
502*4882a593Smuzhiyun #define WLC_E_REASON_DEAUTH		2	/* roamed due to DEAUTH indication */
503*4882a593Smuzhiyun #define WLC_E_REASON_DISASSOC		3	/* roamed due to DISASSOC indication */
504*4882a593Smuzhiyun #define WLC_E_REASON_BCNS_LOST		4	/* roamed due to lost beacons */
505*4882a593Smuzhiyun 
506*4882a593Smuzhiyun /* Roam codes (5-7) used primarily by CCX */
507*4882a593Smuzhiyun #define WLC_E_REASON_FAST_ROAM_FAILED	5	/* roamed due to fast roam failure */
508*4882a593Smuzhiyun #define WLC_E_REASON_DIRECTED_ROAM	6	/* roamed due to request by AP */
509*4882a593Smuzhiyun #define WLC_E_REASON_TSPEC_REJECTED	7	/* roamed due to TSPEC rejection */
510*4882a593Smuzhiyun #define WLC_E_REASON_BETTER_AP		8	/* roamed due to finding better AP */
511*4882a593Smuzhiyun #define WLC_E_REASON_MINTXRATE		9	/* roamed because at mintxrate for too long */
512*4882a593Smuzhiyun #define WLC_E_REASON_TXFAIL		10	/* We can hear AP, but AP can't hear us */
513*4882a593Smuzhiyun #define WLC_E_REASON_BSSTRANS_REQ	11	/* roamed due to BSS Transition request by AP */
514*4882a593Smuzhiyun #define WLC_E_REASON_LOW_RSSI_CU	12	/* roamed due to low RSSI and Channel Usage */
515*4882a593Smuzhiyun #define WLC_E_REASON_RADAR_DETECTED	13	/* roamed due to radar detection by STA */
516*4882a593Smuzhiyun #define WLC_E_REASON_CSA		14	/* roamed due to CSA from AP */
517*4882a593Smuzhiyun #define WLC_E_REASON_ESTM_LOW		15	/* roamed due to ESTM low tput */
518*4882a593Smuzhiyun #define WLC_E_REASON_SILENT_ROAM	16	/* roamed due to Silent roam */
519*4882a593Smuzhiyun #define WLC_E_REASON_INACTIVITY		17	/* full roam scan due to inactivity */
520*4882a593Smuzhiyun #define WLC_E_REASON_ROAM_SCAN_TIMEOUT		18	/* roam scan timer timeout */
521*4882a593Smuzhiyun #define WLC_E_REASON_REASSOC		19	/* roamed due to reassoc iovar */
522*4882a593Smuzhiyun #define WLC_E_REASON_LAST		20	/* NOTE: increment this as you add reasons above */
523*4882a593Smuzhiyun 
524*4882a593Smuzhiyun /* prune reason codes */
525*4882a593Smuzhiyun #define WLC_E_PRUNE_ENCR_MISMATCH	1	/* encryption mismatch */
526*4882a593Smuzhiyun #define WLC_E_PRUNE_BCAST_BSSID		2	/* AP uses a broadcast BSSID */
527*4882a593Smuzhiyun #define WLC_E_PRUNE_MAC_DENY		3	/* STA's MAC addr is in AP's MAC deny list */
528*4882a593Smuzhiyun #define WLC_E_PRUNE_MAC_NA		4	/* STA's MAC addr is not in AP's MAC allow list */
529*4882a593Smuzhiyun #define WLC_E_PRUNE_REG_PASSV		5	/* AP not allowed due to regulatory restriction */
530*4882a593Smuzhiyun #define WLC_E_PRUNE_SPCT_MGMT		6	/* AP does not support STA locale spectrum mgmt */
531*4882a593Smuzhiyun #define WLC_E_PRUNE_RADAR		7	/* AP is on a radar channel of STA locale */
532*4882a593Smuzhiyun #define WLC_E_RSN_MISMATCH		8	/* STA does not support AP's RSN */
533*4882a593Smuzhiyun #define WLC_E_PRUNE_NO_COMMON_RATES	9	/* No rates in common with AP */
534*4882a593Smuzhiyun #define WLC_E_PRUNE_BASIC_RATES		10	/* STA does not support all basic rates of BSS */
535*4882a593Smuzhiyun #ifdef BCMCCX
536*4882a593Smuzhiyun #define WLC_E_PRUNE_CCXFAST_PREVAP	11	/* CCX FAST ROAM: prune previous AP */
537*4882a593Smuzhiyun #endif /* def BCMCCX */
538*4882a593Smuzhiyun #define WLC_E_PRUNE_CIPHER_NA		12	/* BSS's cipher not supported */
539*4882a593Smuzhiyun #define WLC_E_PRUNE_KNOWN_STA		13	/* AP is already known to us as a STA */
540*4882a593Smuzhiyun #ifdef BCMCCX
541*4882a593Smuzhiyun #define WLC_E_PRUNE_CCXFAST_DROAM	14	/* CCX FAST ROAM: prune unqualified AP */
542*4882a593Smuzhiyun #endif /* def BCMCCX */
543*4882a593Smuzhiyun #define WLC_E_PRUNE_WDS_PEER		15	/* AP is already known to us as a WDS peer */
544*4882a593Smuzhiyun #define WLC_E_PRUNE_QBSS_LOAD		16	/* QBSS LOAD - AAC is too low */
545*4882a593Smuzhiyun #define WLC_E_PRUNE_HOME_AP		17	/* prune home AP */
546*4882a593Smuzhiyun #ifdef BCMCCX
547*4882a593Smuzhiyun #define WLC_E_PRUNE_AP_BLOCKED		18	/* prune blocked AP */
548*4882a593Smuzhiyun #define WLC_E_PRUNE_NO_DIAG_SUPPORT	19	/* prune due to diagnostic mode not supported */
549*4882a593Smuzhiyun #endif /* BCMCCX */
550*4882a593Smuzhiyun #define WLC_E_PRUNE_AUTH_RESP_MAC	20	/* suppress auth resp by MAC filter */
551*4882a593Smuzhiyun #define WLC_E_PRUNE_ASSOC_RETRY_DELAY	21	/* MBO assoc retry delay */
552*4882a593Smuzhiyun #define WLC_E_PRUNE_RSSI_ASSOC_REJ	22	/* OCE RSSI-based assoc rejection */
553*4882a593Smuzhiyun #define WLC_E_PRUNE_MAC_AVOID		23	/* AP's MAC addr is in STA's MAC avoid list */
554*4882a593Smuzhiyun #define WLC_E_PRUNE_TRANSITION_DISABLE	24	/* AP's Transition Disable Policy */
555*4882a593Smuzhiyun 
556*4882a593Smuzhiyun /* WPA failure reason codes carried in the WLC_E_PSK_SUP event */
557*4882a593Smuzhiyun #define WLC_E_SUP_OTHER			0	/* Other reason */
558*4882a593Smuzhiyun #define WLC_E_SUP_DECRYPT_KEY_DATA	1	/* Decryption of key data failed */
559*4882a593Smuzhiyun #define WLC_E_SUP_BAD_UCAST_WEP128	2	/* Illegal use of ucast WEP128 */
560*4882a593Smuzhiyun #define WLC_E_SUP_BAD_UCAST_WEP40	3	/* Illegal use of ucast WEP40 */
561*4882a593Smuzhiyun #define WLC_E_SUP_UNSUP_KEY_LEN		4	/* Unsupported key length */
562*4882a593Smuzhiyun #define WLC_E_SUP_PW_KEY_CIPHER		5	/* Unicast cipher mismatch in pairwise key */
563*4882a593Smuzhiyun #define WLC_E_SUP_MSG3_TOO_MANY_IE	6	/* WPA IE contains > 1 RSN IE in key msg 3 */
564*4882a593Smuzhiyun #define WLC_E_SUP_MSG3_IE_MISMATCH	7	/* WPA IE mismatch in key message 3 */
565*4882a593Smuzhiyun #define WLC_E_SUP_NO_INSTALL_FLAG	8	/* INSTALL flag unset in 4-way msg */
566*4882a593Smuzhiyun #define WLC_E_SUP_MSG3_NO_GTK		9	/* encapsulated GTK missing from msg 3 */
567*4882a593Smuzhiyun #define WLC_E_SUP_GRP_KEY_CIPHER	10	/* Multicast cipher mismatch in group key */
568*4882a593Smuzhiyun #define WLC_E_SUP_GRP_MSG1_NO_GTK	11	/* encapsulated GTK missing from group msg 1 */
569*4882a593Smuzhiyun #define WLC_E_SUP_GTK_DECRYPT_FAIL	12	/* GTK decrypt failure */
570*4882a593Smuzhiyun #define WLC_E_SUP_SEND_FAIL		13	/* message send failure */
571*4882a593Smuzhiyun #define WLC_E_SUP_DEAUTH		14	/* received FC_DEAUTH */
572*4882a593Smuzhiyun #define WLC_E_SUP_WPA_PSK_TMO		15	/* WPA PSK 4-way handshake timeout */
573*4882a593Smuzhiyun #define WLC_E_SUP_WPA_PSK_M1_TMO	16	/* WPA PSK 4-way handshake M1 timeout */
574*4882a593Smuzhiyun #define WLC_E_SUP_WPA_PSK_M3_TMO	17	/* WPA PSK 4-way handshake M3 timeout */
575*4882a593Smuzhiyun #define WLC_E_SUP_GTK_UPDATE_FAIL	18  /* GTK update failure */
576*4882a593Smuzhiyun #define WLC_E_SUP_TK_UPDATE_FAIL	19  /* TK update failure */
577*4882a593Smuzhiyun #define WLC_E_SUP_KEY_INSTALL_FAIL	20  /* Buffered key install failure */
578*4882a593Smuzhiyun #define WLC_E_SUP_PTK_UPDATE		21	/* PTK update */
579*4882a593Smuzhiyun #define WLC_E_SUP_MSG1_PMKID_MISMATCH	22	/* MSG1 PMKID not matched to PMKSA cache list */
580*4882a593Smuzhiyun 
581*4882a593Smuzhiyun /* event msg for WLC_E_SUP_PTK_UPDATE */
582*4882a593Smuzhiyun typedef struct wlc_sup_ptk_update {
583*4882a593Smuzhiyun 	uint16 version;		/* 0x0001 */
584*4882a593Smuzhiyun 	uint16 length;		/* length of data that follows */
585*4882a593Smuzhiyun 	uint32 tsf_low;		/* tsf at which ptk updated by internal supplicant */
586*4882a593Smuzhiyun 	uint32 tsf_high;
587*4882a593Smuzhiyun 	uint8 key_id;		/* always 0 for PTK update */
588*4882a593Smuzhiyun 	uint8 tid;		/* tid for the PN below - PTK refresh is per key */
589*4882a593Smuzhiyun 	uint16 pn_low;
590*4882a593Smuzhiyun 	uint32 pn_high;		/* local highest PN of any tid of the key when M4 was sent */
591*4882a593Smuzhiyun } wlc_sup_ptk_update_t;
592*4882a593Smuzhiyun 
593*4882a593Smuzhiyun /* sub event of WLC_E_WSEC */
594*4882a593Smuzhiyun typedef enum {
595*4882a593Smuzhiyun 	WLC_WSEC_EVENT_PTK_PN_SYNC_ERROR = 0x01
596*4882a593Smuzhiyun } wl_wsec_event_type_t;
597*4882a593Smuzhiyun 
598*4882a593Smuzhiyun /* sub event msg - WLC_WSEC_EVENT_PTK_PN_SYNC_ERROR */
599*4882a593Smuzhiyun struct wlc_wsec_ptk_pn_sync_error_v1 {
600*4882a593Smuzhiyun 	uint32 tsf_low;		/* tsf at which PN sync error happened */
601*4882a593Smuzhiyun 	uint32 tsf_high;
602*4882a593Smuzhiyun 	uint8 key_id;		/* always 0 for PTK update */
603*4882a593Smuzhiyun 	uint8 tid;		/* tid for the PN below - PTK refresh is per key */
604*4882a593Smuzhiyun 	uint16 PAD1;
605*4882a593Smuzhiyun 	uint16 rx_seqn;		/* d11 seq number */
606*4882a593Smuzhiyun 	uint16 pn_low;
607*4882a593Smuzhiyun 	uint32 pn_high;		/* local PN window start for the tid */
608*4882a593Smuzhiyun 	uint16 key_idx;		/* key idx in the keymgmt */
609*4882a593Smuzhiyun 	uint16 rx_pn_low;
610*4882a593Smuzhiyun 	uint32 rx_pn_high;	/* Rx PN window start for the tid */
611*4882a593Smuzhiyun 	uint32 span_time;	/* time elapsed since replay */
612*4882a593Smuzhiyun 	uint32 span_pkts;	/* pkt count since replay */
613*4882a593Smuzhiyun };
614*4882a593Smuzhiyun 
615*4882a593Smuzhiyun typedef struct wlc_wsec_ptk_pn_sync_error_v1 wlc_wsec_ptk_pn_sync_error_t;
616*4882a593Smuzhiyun 
617*4882a593Smuzhiyun /* WLC_E_WSEC event msg */
618*4882a593Smuzhiyun typedef struct wlc_wsec_event {
619*4882a593Smuzhiyun 	uint16 version;		/* 0x0001 */
620*4882a593Smuzhiyun 	uint16 length;		/* length of data that follows */
621*4882a593Smuzhiyun 	uint16 type;		/* wsec_event_type_t */
622*4882a593Smuzhiyun 	uint16 PAD1;
623*4882a593Smuzhiyun 	union {
624*4882a593Smuzhiyun 		wlc_wsec_ptk_pn_sync_error_t pn_sync_err;
625*4882a593Smuzhiyun 	} data;
626*4882a593Smuzhiyun } wlc_wsec_event_t;
627*4882a593Smuzhiyun 
628*4882a593Smuzhiyun /* Ucode reason codes carried in the WLC_E_MACDBG event */
629*4882a593Smuzhiyun #define WLC_E_MACDBG_LIST_PSM		0	/* Dump list update for PSM registers */
630*4882a593Smuzhiyun #define WLC_E_MACDBG_LIST_PSMX		1	/* Dump list update for PSMx registers */
631*4882a593Smuzhiyun #define WLC_E_MACDBG_REGALL		2	/* Dump all registers */
632*4882a593Smuzhiyun 
633*4882a593Smuzhiyun /* Event data for events that include frames received over the air */
634*4882a593Smuzhiyun /* WLC_E_PROBRESP_MSG
635*4882a593Smuzhiyun  * WLC_E_P2P_PROBREQ_MSG
636*4882a593Smuzhiyun  * WLC_E_ACTION_FRAME_RX
637*4882a593Smuzhiyun  */
638*4882a593Smuzhiyun 
639*4882a593Smuzhiyun #ifdef WLAWDL
640*4882a593Smuzhiyun #define WLC_E_AWDL_SCAN_START		1	/* Scan start indication to host */
641*4882a593Smuzhiyun #define WLC_E_AWDL_SCAN_DONE		0	/* Scan Done indication to host */
642*4882a593Smuzhiyun #endif /* WLAWDL */
643*4882a593Smuzhiyun 
644*4882a593Smuzhiyun #define MAX_PHY_CORE_NUM 4u
645*4882a593Smuzhiyun 
646*4882a593Smuzhiyun #define BCM_RX_FRAME_DATA_VERSION_2	2u
647*4882a593Smuzhiyun 
648*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data_v2 {
649*4882a593Smuzhiyun 	uint16	version;
650*4882a593Smuzhiyun 	uint16	len;
651*4882a593Smuzhiyun 	uint16	channel;	/* Matches chanspec_t format from bcmwifi_channels.h */
652*4882a593Smuzhiyun 	uint16	pad;
653*4882a593Smuzhiyun 	int32	rssi;
654*4882a593Smuzhiyun 	uint32	mactime;
655*4882a593Smuzhiyun 	uint32	rate;
656*4882a593Smuzhiyun 	int8    per_core_rssi[MAX_PHY_CORE_NUM];
657*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_v2_t;
658*4882a593Smuzhiyun 
659*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data_v1 {
660*4882a593Smuzhiyun 	uint16	version;
661*4882a593Smuzhiyun 	uint16	channel;	/* Matches chanspec_t format from bcmwifi_channels.h */
662*4882a593Smuzhiyun 	int32	rssi;
663*4882a593Smuzhiyun 	uint32	mactime;
664*4882a593Smuzhiyun 	uint32	rate;
665*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_v1_t;
666*4882a593Smuzhiyun 
667*4882a593Smuzhiyun #define BCM_RX_FRAME_DATA_VERSION_1 1u
668*4882a593Smuzhiyun 
669*4882a593Smuzhiyun #ifndef WL_EVENT_RX_FRAME_DATA_ALIAS
670*4882a593Smuzhiyun #define BCM_RX_FRAME_DATA_VERSION BCM_RX_FRAME_DATA_VERSION_1
671*4882a593Smuzhiyun typedef wl_event_rx_frame_data_v1_t wl_event_rx_frame_data_t;
672*4882a593Smuzhiyun #endif
673*4882a593Smuzhiyun 
674*4882a593Smuzhiyun /* WLC_E_IF event data */
675*4882a593Smuzhiyun typedef struct wl_event_data_if {
676*4882a593Smuzhiyun 	uint8 ifidx;		/* RTE virtual device index (for dongle) */
677*4882a593Smuzhiyun 	uint8 opcode;		/* see I/F opcode */
678*4882a593Smuzhiyun 	uint8 reserved;		/* bit mask (WLC_E_IF_FLAGS_XXX ) */
679*4882a593Smuzhiyun 	uint8 bssidx;		/* bsscfg index */
680*4882a593Smuzhiyun 	uint8 role;		/* see I/F role */
681*4882a593Smuzhiyun } wl_event_data_if_t;
682*4882a593Smuzhiyun 
683*4882a593Smuzhiyun /* WLC_E_NATOE event data */
684*4882a593Smuzhiyun typedef struct wl_event_data_natoe {
685*4882a593Smuzhiyun 	uint32 natoe_active;
686*4882a593Smuzhiyun 	uint32 sta_ip;
687*4882a593Smuzhiyun 	uint16 start_port;
688*4882a593Smuzhiyun 	uint16 end_port;
689*4882a593Smuzhiyun } wl_event_data_natoe_t;
690*4882a593Smuzhiyun 
691*4882a593Smuzhiyun /* opcode in WLC_E_IF event */
692*4882a593Smuzhiyun #define WLC_E_IF_ADD		1	/* bsscfg add */
693*4882a593Smuzhiyun #define WLC_E_IF_DEL		2	/* bsscfg delete */
694*4882a593Smuzhiyun #define WLC_E_IF_CHANGE		3	/* bsscfg role change */
695*4882a593Smuzhiyun 
696*4882a593Smuzhiyun /* I/F role code in WLC_E_IF event */
697*4882a593Smuzhiyun #define WLC_E_IF_ROLE_STA		0	/* Infra STA */
698*4882a593Smuzhiyun #define WLC_E_IF_ROLE_AP		1	/* Access Point */
699*4882a593Smuzhiyun #define WLC_E_IF_ROLE_WDS		2	/* WDS link */
700*4882a593Smuzhiyun #define WLC_E_IF_ROLE_P2P_GO		3	/* P2P Group Owner */
701*4882a593Smuzhiyun #define WLC_E_IF_ROLE_P2P_CLIENT	4	/* P2P Client */
702*4882a593Smuzhiyun 
703*4882a593Smuzhiyun #ifdef WLAWDL
704*4882a593Smuzhiyun #define WLC_E_IF_ROLE_AWDL		7	/* AWDL */
705*4882a593Smuzhiyun #endif /* WLAWDL */
706*4882a593Smuzhiyun 
707*4882a593Smuzhiyun #define WLC_E_IF_ROLE_IBSS		8	/* IBSS */
708*4882a593Smuzhiyun #define WLC_E_IF_ROLE_NAN		9	/* NAN */
709*4882a593Smuzhiyun 
710*4882a593Smuzhiyun #define WLC_E_IF_ROLE_MESH		10u	/* identifies the role as MESH */
711*4882a593Smuzhiyun 
712*4882a593Smuzhiyun /* WLC_E_RSSI event data */
713*4882a593Smuzhiyun typedef struct wl_event_data_rssi {
714*4882a593Smuzhiyun 	int32 rssi;
715*4882a593Smuzhiyun 	int32 snr;
716*4882a593Smuzhiyun 	int32 noise;
717*4882a593Smuzhiyun } wl_event_data_rssi_t;
718*4882a593Smuzhiyun 
719*4882a593Smuzhiyun #define WL_EVENT_WA_LQM_VER	0	/* initial version */
720*4882a593Smuzhiyun 
721*4882a593Smuzhiyun #define WL_EVENT_WA_LQM_BASIC	0	/* event sub-types */
722*4882a593Smuzhiyun typedef struct {			/* payload of subevent in xtlv */
723*4882a593Smuzhiyun 	int32 rssi;
724*4882a593Smuzhiyun 	int32 snr;
725*4882a593Smuzhiyun 	uint32 tx_rate;
726*4882a593Smuzhiyun 	uint32 rx_rate;
727*4882a593Smuzhiyun } wl_event_wa_lqm_basic_t;
728*4882a593Smuzhiyun 
729*4882a593Smuzhiyun typedef struct wl_event_wa_lqm {
730*4882a593Smuzhiyun 	uint16 ver;			/* version */
731*4882a593Smuzhiyun 	uint16 len;			/* total length structure */
732*4882a593Smuzhiyun 	uint8 subevent[];		/* sub-event data in bcm_xtlv_t format */
733*4882a593Smuzhiyun } wl_event_wa_lqm_t;
734*4882a593Smuzhiyun 
735*4882a593Smuzhiyun /* WLC_E_IF flag */
736*4882a593Smuzhiyun #define WLC_E_IF_FLAGS_BSSCFG_NOIF	0x1	/* no host I/F creation needed */
737*4882a593Smuzhiyun 
738*4882a593Smuzhiyun /* Reason codes for LINK */
739*4882a593Smuzhiyun /* Reason codes for LINK */
740*4882a593Smuzhiyun #define WLC_E_LINK_BCN_LOSS		1	/* Link down because of beacon loss */
741*4882a593Smuzhiyun #define WLC_E_LINK_DISASSOC		2	/* Link down because of disassoc */
742*4882a593Smuzhiyun #define WLC_E_LINK_ASSOC_REC		3	/* Link down because assoc recreate failed */
743*4882a593Smuzhiyun #define WLC_E_LINK_BSSCFG_DIS		4	/* Link down due to bsscfg down */
744*4882a593Smuzhiyun #define WLC_E_LINK_ASSOC_FAIL		5	/* Link down due to assoc to new AP during roam */
745*4882a593Smuzhiyun #define WLC_E_LINK_REASSOC_ROAM_FAIL	6	/* Link down due to reassoc roaming failed */
746*4882a593Smuzhiyun #define WLC_E_LINK_LOWRSSI_ROAM_FAIL	7	/* Link down due to Low rssi roaming failed */
747*4882a593Smuzhiyun #define WLC_E_LINK_NO_FIRST_BCN_RX	8	/* Link down due to 1st beacon rx failure */
748*4882a593Smuzhiyun 
749*4882a593Smuzhiyun /* WLC_E_NDIS_LINK event data */
750*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct ndis_link_parms {
751*4882a593Smuzhiyun 	struct ether_addr peer_mac; /* 6 bytes */
752*4882a593Smuzhiyun 	uint16 chanspec;            /* 2 bytes */
753*4882a593Smuzhiyun 	uint32 link_speed;          /* current datarate in units of 500 Kbit/s */
754*4882a593Smuzhiyun 	uint32 max_link_speed;      /* max possible datarate for link in units of 500 Kbit/s  */
755*4882a593Smuzhiyun 	int32  rssi;                /* average rssi */
756*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT ndis_link_parms_t;
757*4882a593Smuzhiyun 
758*4882a593Smuzhiyun /* reason codes for WLC_E_OVERLAY_REQ event */
759*4882a593Smuzhiyun #define WLC_E_OVL_DOWNLOAD		0	/* overlay download request */
760*4882a593Smuzhiyun #define WLC_E_OVL_UPDATE_IND	1	/* device indication of host overlay update */
761*4882a593Smuzhiyun 
762*4882a593Smuzhiyun /* reason codes for WLC_E_TDLS_PEER_EVENT event */
763*4882a593Smuzhiyun #define WLC_E_TDLS_PEER_DISCOVERED		0	/* peer is ready to establish TDLS */
764*4882a593Smuzhiyun #define WLC_E_TDLS_PEER_CONNECTED		1
765*4882a593Smuzhiyun #define WLC_E_TDLS_PEER_DISCONNECTED	2
766*4882a593Smuzhiyun 
767*4882a593Smuzhiyun /* reason codes for WLC_E_RMC_EVENT event */
768*4882a593Smuzhiyun #define WLC_E_REASON_RMC_NONE		0
769*4882a593Smuzhiyun #define WLC_E_REASON_RMC_AR_LOST		1
770*4882a593Smuzhiyun #define WLC_E_REASON_RMC_AR_NO_ACK		2
771*4882a593Smuzhiyun 
772*4882a593Smuzhiyun #ifdef WLTDLS
773*4882a593Smuzhiyun /* TDLS Action Category code */
774*4882a593Smuzhiyun #define TDLS_AF_CATEGORY		12
775*4882a593Smuzhiyun /* Wi-Fi Display (WFD) Vendor Specific Category */
776*4882a593Smuzhiyun /* used for WFD Tunneled Probe Request and Response */
777*4882a593Smuzhiyun #define TDLS_VENDOR_SPECIFIC		127
778*4882a593Smuzhiyun /* TDLS Action Field Values */
779*4882a593Smuzhiyun #define TDLS_ACTION_SETUP_REQ		0
780*4882a593Smuzhiyun #define TDLS_ACTION_SETUP_RESP		1
781*4882a593Smuzhiyun #define TDLS_ACTION_SETUP_CONFIRM	2
782*4882a593Smuzhiyun #define TDLS_ACTION_TEARDOWN		3
783*4882a593Smuzhiyun #define WLAN_TDLS_SET_PROBE_WFD_IE	11
784*4882a593Smuzhiyun #define WLAN_TDLS_SET_SETUP_WFD_IE	12
785*4882a593Smuzhiyun #define WLAN_TDLS_SET_WFD_ENABLED	13
786*4882a593Smuzhiyun #define WLAN_TDLS_SET_WFD_DISABLED	14
787*4882a593Smuzhiyun #endif
788*4882a593Smuzhiyun 
789*4882a593Smuzhiyun /* WLC_E_RANGING_EVENT subtypes */
790*4882a593Smuzhiyun #define WLC_E_RANGING_RESULTS	0
791*4882a593Smuzhiyun 
792*4882a593Smuzhiyun #define PHY_CAL_EVT_VERSION 1
793*4882a593Smuzhiyun typedef struct wlc_phy_cal_info {
794*4882a593Smuzhiyun 	uint16 version; /* structure version */
795*4882a593Smuzhiyun 	uint16 length; /* length of the rest of the structure */
796*4882a593Smuzhiyun 	uint16 chanspec;
797*4882a593Smuzhiyun 	uint8 start;
798*4882a593Smuzhiyun 	uint8 phase;
799*4882a593Smuzhiyun 	int16 temp;
800*4882a593Smuzhiyun 	uint8 reason;
801*4882a593Smuzhiyun 	uint8 slice;
802*4882a593Smuzhiyun } wlc_phy_cal_info_t;
803*4882a593Smuzhiyun 
804*4882a593Smuzhiyun #ifdef WLAWDL
805*4882a593Smuzhiyun /* WLC_E_AWDL_EVENT subtypes */
806*4882a593Smuzhiyun #define WLC_E_AWDL_SCAN_STATUS		0
807*4882a593Smuzhiyun #define WLC_E_AWDL_RX_ACT_FRAME		1
808*4882a593Smuzhiyun #define WLC_E_AWDL_RX_PRB_RESP		2
809*4882a593Smuzhiyun #define WLC_E_AWDL_PHYCAL_STATUS	3
810*4882a593Smuzhiyun #define WLC_E_AWDL_WOWL_NULLPKT		4
811*4882a593Smuzhiyun #define WLC_E_AWDL_OOB_AF_STATUS	5
812*4882a593Smuzhiyun /* WLC_E_AWDL_RANGING_RESULTS will be removed and only WLC_E_AWDL_UNUSED will be here
813*4882a593Smuzhiyun  * Keeping both of them to avoid compilation errot on trunk
814*4882a593Smuzhiyun  * It will be removed after wlc_ranging merge from IGUANA
815*4882a593Smuzhiyun  */
816*4882a593Smuzhiyun #define WLC_E_AWDL_RANGING_RESULTS	6
817*4882a593Smuzhiyun #define WLC_E_AWDL_UNUSED		6
818*4882a593Smuzhiyun #define WLC_E_AWDL_SUB_PEER_STATE	7
819*4882a593Smuzhiyun #define WLC_E_AWDL_SUB_INTERFACE_STATE	8
820*4882a593Smuzhiyun #define WLC_E_AWDL_UCAST_AF_TXSTATUS	9
821*4882a593Smuzhiyun #define WLC_E_AWDL_NAN_CLUSTER_MERGE	10
822*4882a593Smuzhiyun #define WLC_E_AWDL_NAN_RX_BEACON	11
823*4882a593Smuzhiyun #define WLC_E_AWDL_SD_DISCOVERY_RESULT	12
824*4882a593Smuzhiyun #define WLC_E_AWDL_SD_REPLIED		13
825*4882a593Smuzhiyun #define WLC_E_AWDL_SD_TERMINATED	14
826*4882a593Smuzhiyun #define WLC_E_AWDL_SD_RECEIVE		15
827*4882a593Smuzhiyun #define WLC_E_AWDL_SD_VNDR_IE		16
828*4882a593Smuzhiyun #define WLC_E_AWDL_SD_DEVICE_STATE_IE	17
829*4882a593Smuzhiyun #define WLC_E_AWDL_DFSP_NOTIF		18
830*4882a593Smuzhiyun #define WLC_E_AWDL_DFSP_SUSPECT		19
831*4882a593Smuzhiyun #define WLC_E_AWDL_DFSP_RESUME		20
832*4882a593Smuzhiyun 
833*4882a593Smuzhiyun /* WLC_E_AWDL_SCAN_STATUS status values */
834*4882a593Smuzhiyun #define WLC_E_AWDL_SCAN_START		1	/* Scan start indication to host */
835*4882a593Smuzhiyun #define WLC_E_AWDL_SCAN_DONE		0	/* Scan Done indication to host */
836*4882a593Smuzhiyun #define WLC_E_AWDL_PHYCAL_START		1	/* Phy calibration start indication to host */
837*4882a593Smuzhiyun #define WLC_E_AWDL_PHYCAL_DONE		0	/* Phy calibration done indication to host */
838*4882a593Smuzhiyun 
839*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct {
840*4882a593Smuzhiyun 	uint8 subscribe_id;	/* local subscribe instance id */
841*4882a593Smuzhiyun 	uint8 publish_id;	/* publiser's  insance id */
842*4882a593Smuzhiyun 	struct ether_addr addr;  /* publsher's address */
843*4882a593Smuzhiyun 	uint8 service_info_len;  /* length of the service specific information in data[] */
844*4882a593Smuzhiyun 	uint8 data[1];		/* service specific info */
845*4882a593Smuzhiyun } BWL_PRE_PACKED_STRUCT awdl_sd_discovery_result_t;
846*4882a593Smuzhiyun 
847*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct {
848*4882a593Smuzhiyun 	uint8 instance_id;
849*4882a593Smuzhiyun 	struct ether_addr addr;  /* publsher's address */
850*4882a593Smuzhiyun } BWL_PRE_PACKED_STRUCT awdl_sd_replied_event_t;
851*4882a593Smuzhiyun 
852*4882a593Smuzhiyun #define AWDL_SD_TERM_REASON_TIMEOUT	1
853*4882a593Smuzhiyun #define AWDL_SD_TERM_REASON_USERREQ	2
854*4882a593Smuzhiyun #define AWDL_SD_TERM_REASON_FAIL	3
855*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct {
856*4882a593Smuzhiyun 	uint8 instance_id;	/* publish instance id */
857*4882a593Smuzhiyun 	uint8 reason;		/* 1=timeout, 2=user request, 3=failure */
858*4882a593Smuzhiyun } BWL_PRE_PACKED_STRUCT awdl_sd_term_event_t;
859*4882a593Smuzhiyun 
860*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct {
861*4882a593Smuzhiyun 	uint8 instance_id;	/* local publish/subscribe instance id */
862*4882a593Smuzhiyun 	uint8 sender_instance_id;
863*4882a593Smuzhiyun 	struct ether_addr addr;	/* sender's address */
864*4882a593Smuzhiyun 	uint8 service_info_len;	/* length of the service specific information in data[] */
865*4882a593Smuzhiyun 	uint8 data[1];		/* service specific info */
866*4882a593Smuzhiyun } BWL_PRE_PACKED_STRUCT awdl_sd_receive_t;
867*4882a593Smuzhiyun 
868*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct {
869*4882a593Smuzhiyun 	struct ether_addr addr;	/* sender's address */
870*4882a593Smuzhiyun 	uint16 len;		/* length of data[] */
871*4882a593Smuzhiyun 	uint8 data[1];		/* vndr specific info */
872*4882a593Smuzhiyun } BWL_PRE_PACKED_STRUCT awdl_sd_vndr_ie_event_t;
873*4882a593Smuzhiyun 
874*4882a593Smuzhiyun #endif /* WLAWDL */
875*4882a593Smuzhiyun 
876*4882a593Smuzhiyun /* GAS event data */
877*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct wl_event_gas {
878*4882a593Smuzhiyun 	uint16	channel;	/* channel of GAS protocol */
879*4882a593Smuzhiyun 	uint8	dialog_token;	/* GAS dialog token */
880*4882a593Smuzhiyun 	uint8	fragment_id;	/* fragment id */
881*4882a593Smuzhiyun 	uint16	status_code;	/* status code on GAS completion */
882*4882a593Smuzhiyun 	uint16	data_len;	/* length of data to follow */
883*4882a593Smuzhiyun 	uint8	data[1];	/* variable length specified by data_len */
884*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_event_gas_t;
885*4882a593Smuzhiyun 
886*4882a593Smuzhiyun /* service discovery TLV */
887*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct wl_sd_tlv {
888*4882a593Smuzhiyun 	uint16	length;			/* length of response_data */
889*4882a593Smuzhiyun 	uint8	protocol;		/* service protocol type */
890*4882a593Smuzhiyun 	uint8	transaction_id;		/* service transaction id */
891*4882a593Smuzhiyun 	uint8	status_code;		/* status code */
892*4882a593Smuzhiyun 	uint8	data[1];		/* response data */
893*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_sd_tlv_t;
894*4882a593Smuzhiyun 
895*4882a593Smuzhiyun /* service discovery event data */
896*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct wl_event_sd {
897*4882a593Smuzhiyun 	uint16	channel;		/* channel */
898*4882a593Smuzhiyun 	uint8	count;			/* number of tlvs */
899*4882a593Smuzhiyun 	wl_sd_tlv_t	tlv[1];		/* service discovery TLV */
900*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_event_sd_t;
901*4882a593Smuzhiyun 
902*4882a593Smuzhiyun /* WLC_E_PKT_FILTER event sub-classification codes */
903*4882a593Smuzhiyun #define WLC_E_PKT_FILTER_TIMEOUT	1 /* Matching packet not received in last timeout seconds */
904*4882a593Smuzhiyun 
905*4882a593Smuzhiyun /* Note: proxd has a new API (ver 3.0) deprecates the following */
906*4882a593Smuzhiyun 
907*4882a593Smuzhiyun /* Reason codes for WLC_E_PROXD */
908*4882a593Smuzhiyun #define WLC_E_PROXD_FOUND		1	/* Found a proximity device */
909*4882a593Smuzhiyun #define WLC_E_PROXD_GONE		2	/* Lost a proximity device */
910*4882a593Smuzhiyun #define WLC_E_PROXD_START		3	/* used by: target  */
911*4882a593Smuzhiyun #define WLC_E_PROXD_STOP		4	/* used by: target   */
912*4882a593Smuzhiyun #define WLC_E_PROXD_COMPLETED		5	/* used by: initiator completed */
913*4882a593Smuzhiyun #define WLC_E_PROXD_ERROR		6	/* used by both initiator and target */
914*4882a593Smuzhiyun #define WLC_E_PROXD_COLLECT_START	7	/* used by: target & initiator */
915*4882a593Smuzhiyun #define WLC_E_PROXD_COLLECT_STOP	8	/* used by: target */
916*4882a593Smuzhiyun #define WLC_E_PROXD_COLLECT_COMPLETED	9	/* used by: initiator completed */
917*4882a593Smuzhiyun #define WLC_E_PROXD_COLLECT_ERROR	10	/* used by both initiator and target */
918*4882a593Smuzhiyun #define WLC_E_PROXD_NAN_EVENT		11	/* used by both initiator and target */
919*4882a593Smuzhiyun #define WLC_E_PROXD_TS_RESULTS          12      /* used by: initiator completed */
920*4882a593Smuzhiyun 
921*4882a593Smuzhiyun /*  proxd_event data */
922*4882a593Smuzhiyun typedef struct ftm_sample {
923*4882a593Smuzhiyun 	uint32 value;	/* RTT in ns */
924*4882a593Smuzhiyun 	int8 rssi;	/* RSSI */
925*4882a593Smuzhiyun } ftm_sample_t;
926*4882a593Smuzhiyun 
927*4882a593Smuzhiyun typedef struct ts_sample {
928*4882a593Smuzhiyun 	uint32 t1;
929*4882a593Smuzhiyun 	uint32 t2;
930*4882a593Smuzhiyun 	uint32 t3;
931*4882a593Smuzhiyun 	uint32 t4;
932*4882a593Smuzhiyun } ts_sample_t;
933*4882a593Smuzhiyun 
934*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct proxd_event_data {
935*4882a593Smuzhiyun 	uint16 ver;			/* version */
936*4882a593Smuzhiyun 	uint16 mode;			/* mode: target/initiator */
937*4882a593Smuzhiyun 	uint16 method;			/* method: rssi/TOF/AOA */
938*4882a593Smuzhiyun 	uint8  err_code;		/* error classification */
939*4882a593Smuzhiyun 	uint8  TOF_type;		/* one way or two way TOF */
940*4882a593Smuzhiyun 	uint8  OFDM_frame_type;		/* legacy or VHT */
941*4882a593Smuzhiyun 	uint8  bandwidth;		/* Bandwidth is 20, 40,80, MHZ */
942*4882a593Smuzhiyun 	struct ether_addr peer_mac;	/* (e.g for tgt:initiator's */
943*4882a593Smuzhiyun 	uint32 distance;		/* dst to tgt, units meter */
944*4882a593Smuzhiyun 	uint32 meanrtt;			/* mean delta */
945*4882a593Smuzhiyun 	uint32 modertt;			/* Mode delta */
946*4882a593Smuzhiyun 	uint32 medianrtt;		/* median RTT */
947*4882a593Smuzhiyun 	uint32 sdrtt;			/* Standard deviation of RTT */
948*4882a593Smuzhiyun 	int32  gdcalcresult;		/* Software or Hardware Kind of redundant, but if */
949*4882a593Smuzhiyun 					/* frame type is VHT, then we should do it by hardware */
950*4882a593Smuzhiyun 	int16  avg_rssi;		/* avg rssi accroos the ftm frames */
951*4882a593Smuzhiyun 	int16  validfrmcnt;		/* Firmware's valid frame counts */
952*4882a593Smuzhiyun 	int32  peer_router_info;	/* Peer router information if available in TLV, */
953*4882a593Smuzhiyun 					/* We will add this field later  */
954*4882a593Smuzhiyun 	int32 var1;			/* average of group delay */
955*4882a593Smuzhiyun 	int32 var2;			/* average of threshold crossing */
956*4882a593Smuzhiyun 	int32 var3;			/* difference between group delay and threshold crossing */
957*4882a593Smuzhiyun 					/* raw Fine Time Measurements (ftm) data */
958*4882a593Smuzhiyun 	uint16 ftm_unit;		/* ftm cnt resolution in picoseconds , 6250ps - default */
959*4882a593Smuzhiyun 	uint16 ftm_cnt;			/*  num of rtd measurments/length in the ftm buffer  */
960*4882a593Smuzhiyun 	ftm_sample_t ftm_buff[1];	/* 1 ... ftm_cnt  */
961*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_proxd_event_data_t;
962*4882a593Smuzhiyun 
963*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct proxd_event_ts_results {
964*4882a593Smuzhiyun 	uint16 ver;                     /* version */
965*4882a593Smuzhiyun 	uint16 mode;                    /* mode: target/initiator */
966*4882a593Smuzhiyun 	uint16 method;                  /* method: rssi/TOF/AOA */
967*4882a593Smuzhiyun 	uint8  err_code;                /* error classification */
968*4882a593Smuzhiyun 	uint8  TOF_type;                /* one way or two way TOF */
969*4882a593Smuzhiyun 	uint16  ts_cnt;                 /* number of timestamp measurements */
970*4882a593Smuzhiyun 	ts_sample_t ts_buff[1];         /* Timestamps */
971*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_proxd_event_ts_results_t;
972*4882a593Smuzhiyun 
973*4882a593Smuzhiyun #ifdef WLAWDL
974*4882a593Smuzhiyun /* WLC_E_AWDL_AW event data */
975*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct awdl_aws_event_data {
976*4882a593Smuzhiyun 	uint32	fw_time;			/* firmware PMU time */
977*4882a593Smuzhiyun 	struct	ether_addr current_master;	/* Current master Mac addr */
978*4882a593Smuzhiyun 	uint16	aw_counter;			/* AW seq# */
979*4882a593Smuzhiyun 	uint8	aw_ext_count;			/* AW extension count */
980*4882a593Smuzhiyun 	uint8	aw_role;			/* AW role */
981*4882a593Smuzhiyun 	uint8	flags;				/* AW event flag */
982*4882a593Smuzhiyun 	uint16	aw_chan;
983*4882a593Smuzhiyun 	uint8	infra_rssi;			/* rssi on the infra channel */
984*4882a593Smuzhiyun 	uint32	infra_rxbcn_count;		/* number of beacons received */
985*4882a593Smuzhiyun 	struct  ether_addr top_master;		/* Top master */
986*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT awdl_aws_event_data_t;
987*4882a593Smuzhiyun 
988*4882a593Smuzhiyun /* For awdl_aws_event_data_t.flags */
989*4882a593Smuzhiyun #define AWDL_AW_LAST_EXT	0x01
990*4882a593Smuzhiyun 
991*4882a593Smuzhiyun /* WLC_E_AWDL_OOB_AF_STATUS event data */
992*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct awdl_oob_af_status_data {
993*4882a593Smuzhiyun 	uint32	tx_time_diff;
994*4882a593Smuzhiyun 	uint16	pkt_tag;
995*4882a593Smuzhiyun 	uint8	tx_chan;
996*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT awdl_oob_af_status_data_t;
997*4882a593Smuzhiyun #endif /* WLAWDL */
998*4882a593Smuzhiyun 
999*4882a593Smuzhiyun /* Video Traffic Interference Monitor Event */
1000*4882a593Smuzhiyun #define INTFER_EVENT_VERSION		1
1001*4882a593Smuzhiyun #define INTFER_STREAM_TYPE_NONTCP	1
1002*4882a593Smuzhiyun #define INTFER_STREAM_TYPE_TCP		2
1003*4882a593Smuzhiyun #define WLINTFER_STATS_NSMPLS		4
1004*4882a593Smuzhiyun typedef struct wl_intfer_event {
1005*4882a593Smuzhiyun 	uint16 version;			/* version */
1006*4882a593Smuzhiyun 	uint16 status;			/* status */
1007*4882a593Smuzhiyun 	uint8 txfail_histo[WLINTFER_STATS_NSMPLS]; /* txfail histo */
1008*4882a593Smuzhiyun } wl_intfer_event_t;
1009*4882a593Smuzhiyun 
1010*4882a593Smuzhiyun #define RRM_EVENT_VERSION		0
1011*4882a593Smuzhiyun typedef struct wl_rrm_event {
1012*4882a593Smuzhiyun 	int16 version;
1013*4882a593Smuzhiyun 	int16 len;
1014*4882a593Smuzhiyun 	int16 cat;		/* Category */
1015*4882a593Smuzhiyun 	int16 subevent;
1016*4882a593Smuzhiyun 	char payload[1]; /* Measurement payload */
1017*4882a593Smuzhiyun } wl_rrm_event_t;
1018*4882a593Smuzhiyun 
1019*4882a593Smuzhiyun /* WLC_E_PSTA_PRIMARY_INTF_IND event data */
1020*4882a593Smuzhiyun typedef struct wl_psta_primary_intf_event {
1021*4882a593Smuzhiyun 	struct ether_addr prim_ea;	/* primary intf ether addr */
1022*4882a593Smuzhiyun } wl_psta_primary_intf_event_t;
1023*4882a593Smuzhiyun 
1024*4882a593Smuzhiyun /* WLC_E_DPSTA_INTF_IND event data */
1025*4882a593Smuzhiyun typedef enum {
1026*4882a593Smuzhiyun 	WL_INTF_PSTA = 1,
1027*4882a593Smuzhiyun 	WL_INTF_DWDS = 2
1028*4882a593Smuzhiyun } wl_dpsta_intf_type;
1029*4882a593Smuzhiyun 
1030*4882a593Smuzhiyun typedef struct wl_dpsta_intf_event {
1031*4882a593Smuzhiyun 	wl_dpsta_intf_type intf_type;    /* dwds/psta intf register */
1032*4882a593Smuzhiyun } wl_dpsta_intf_event_t;
1033*4882a593Smuzhiyun 
1034*4882a593Smuzhiyun /*  **********  NAN protocol events/subevents  ********** */
1035*4882a593Smuzhiyun #ifndef NAN_EVENT_BUFFER_SIZE
1036*4882a593Smuzhiyun #define NAN_EVENT_BUFFER_SIZE 512 /* max size */
1037*4882a593Smuzhiyun #endif /* NAN_EVENT_BUFFER_SIZE */
1038*4882a593Smuzhiyun /* NAN Events sent by firmware */
1039*4882a593Smuzhiyun 
1040*4882a593Smuzhiyun /*
1041*4882a593Smuzhiyun  * If you make changes to this enum, dont forget to update the mask (if need be).
1042*4882a593Smuzhiyun  */
1043*4882a593Smuzhiyun typedef enum wl_nan_events {
1044*4882a593Smuzhiyun 	WL_NAN_EVENT_START			= 1,	/* NAN cluster started */
1045*4882a593Smuzhiyun 	WL_NAN_EVENT_JOIN			= 2,	/* To be deprecated */
1046*4882a593Smuzhiyun 	WL_NAN_EVENT_ROLE			= 3,	/* Role changed */
1047*4882a593Smuzhiyun 	WL_NAN_EVENT_SCAN_COMPLETE		= 4,	/* To be deprecated */
1048*4882a593Smuzhiyun 	WL_NAN_EVENT_DISCOVERY_RESULT		= 5,	/* Subscribe Received */
1049*4882a593Smuzhiyun 	WL_NAN_EVENT_REPLIED			= 6,	/* Publish Sent */
1050*4882a593Smuzhiyun 	WL_NAN_EVENT_TERMINATED			= 7,	/* sub / pub is terminated */
1051*4882a593Smuzhiyun 	WL_NAN_EVENT_RECEIVE			= 8,	/* Follow up Received */
1052*4882a593Smuzhiyun 	WL_NAN_EVENT_STATUS_CHG			= 9,	/* change in nan_mac status */
1053*4882a593Smuzhiyun 	WL_NAN_EVENT_MERGE			= 10,	/* Merged to a NAN cluster */
1054*4882a593Smuzhiyun 	WL_NAN_EVENT_STOP			= 11,	/* To be deprecated */
1055*4882a593Smuzhiyun 	WL_NAN_EVENT_P2P			= 12,	/* Unused */
1056*4882a593Smuzhiyun 	WL_NAN_EVENT_WINDOW_BEGIN_P2P		= 13,	/* Unused */
1057*4882a593Smuzhiyun 	WL_NAN_EVENT_WINDOW_BEGIN_MESH		= 14,	/* Unused */
1058*4882a593Smuzhiyun 	WL_NAN_EVENT_WINDOW_BEGIN_IBSS		= 15,	/* Unused */
1059*4882a593Smuzhiyun 	WL_NAN_EVENT_WINDOW_BEGIN_RANGING	= 16,	/* Unused */
1060*4882a593Smuzhiyun 	WL_NAN_EVENT_POST_DISC			= 17,	/* Event for post discovery data */
1061*4882a593Smuzhiyun 	WL_NAN_EVENT_DATA_IF_ADD		= 18,	/* Unused */
1062*4882a593Smuzhiyun 	WL_NAN_EVENT_DATA_PEER_ADD		= 19,	/* Event for peer add */
1063*4882a593Smuzhiyun 	/* nan 2.0 */
1064*4882a593Smuzhiyun 	WL_NAN_EVENT_PEER_DATAPATH_IND		= 20,	/* Incoming DP req */
1065*4882a593Smuzhiyun 	WL_NAN_EVENT_DATAPATH_ESTB		= 21,	/* DP Established */
1066*4882a593Smuzhiyun 	WL_NAN_EVENT_SDF_RX			= 22,	/* SDF payload */
1067*4882a593Smuzhiyun 	WL_NAN_EVENT_DATAPATH_END		= 23,	/* DP Terminate recvd */
1068*4882a593Smuzhiyun 	WL_NAN_EVENT_BCN_RX			= 24,	/* received beacon payload */
1069*4882a593Smuzhiyun 	WL_NAN_EVENT_PEER_DATAPATH_RESP		= 25,	/* Peer's DP response */
1070*4882a593Smuzhiyun 	WL_NAN_EVENT_PEER_DATAPATH_CONF		= 26,	/* Peer's DP confirm */
1071*4882a593Smuzhiyun 	WL_NAN_EVENT_RNG_REQ_IND		= 27,	/* Range Request */
1072*4882a593Smuzhiyun 	WL_NAN_EVENT_RNG_RPT_IND		= 28,	/* Range Report */
1073*4882a593Smuzhiyun 	WL_NAN_EVENT_RNG_TERM_IND		= 29,	/* Range Termination */
1074*4882a593Smuzhiyun 	WL_NAN_EVENT_PEER_DATAPATH_SEC_INST	= 30,   /* Peer's DP sec install */
1075*4882a593Smuzhiyun 	WL_NAN_EVENT_TXS			= 31,   /* for tx status of follow-up and SDFs */
1076*4882a593Smuzhiyun 	WL_NAN_EVENT_DW_START			= 32,	/* dw start */
1077*4882a593Smuzhiyun 	WL_NAN_EVENT_DW_END			= 33,	/* dw end */
1078*4882a593Smuzhiyun 	WL_NAN_EVENT_CHAN_BOUNDARY		= 34,	/* channel switch event */
1079*4882a593Smuzhiyun 	WL_NAN_EVENT_MR_CHANGED			= 35,	/* AMR or IMR changed event during DW */
1080*4882a593Smuzhiyun 	WL_NAN_EVENT_RNG_RESP_IND		= 36,	/* Range Response Rx */
1081*4882a593Smuzhiyun 	WL_NAN_EVENT_PEER_SCHED_UPD_NOTIF	= 37,	/* Peer's schedule update notification */
1082*4882a593Smuzhiyun 	WL_NAN_EVENT_PEER_SCHED_REQ		= 38,	/* Peer's schedule request */
1083*4882a593Smuzhiyun 	WL_NAN_EVENT_PEER_SCHED_RESP		= 39,	/* Peer's schedule response */
1084*4882a593Smuzhiyun 	WL_NAN_EVENT_PEER_SCHED_CONF		= 40,	/* Peer's schedule confirm */
1085*4882a593Smuzhiyun 	WL_NAN_EVENT_SENT_DATAPATH_END		= 41,	/* Sent DP terminate frame */
1086*4882a593Smuzhiyun 	WL_NAN_EVENT_SLOT_START			= 42,	/* SLOT_START event */
1087*4882a593Smuzhiyun 	WL_NAN_EVENT_SLOT_END			= 43,	/* SLOT_END event */
1088*4882a593Smuzhiyun 	WL_NAN_EVENT_HOST_ASSIST_REQ		= 44,	/* Requesting host assist */
1089*4882a593Smuzhiyun 	WL_NAN_EVENT_RX_MGMT_FRM		= 45,	/* NAN management frame received */
1090*4882a593Smuzhiyun 	WL_NAN_EVENT_DISC_CACHE_TIMEOUT		= 46,	/* Disc cache timeout */
1091*4882a593Smuzhiyun 	WL_NAN_EVENT_OOB_AF_TXS			= 47,	/* OOB AF transmit status */
1092*4882a593Smuzhiyun 	WL_NAN_EVENT_OOB_AF_RX			= 48,   /* OOB AF receive event */
1093*4882a593Smuzhiyun 
1094*4882a593Smuzhiyun 	/* keep WL_NAN_EVENT_INVALID as the last element */
1095*4882a593Smuzhiyun 	WL_NAN_EVENT_INVALID				/* delimiter for max value */
1096*4882a593Smuzhiyun } nan_app_events_e;
1097*4882a593Smuzhiyun 
1098*4882a593Smuzhiyun /* remove after precommit */
1099*4882a593Smuzhiyun #define NAN_EV_MASK(ev)	(1 << (ev - 1))
1100*4882a593Smuzhiyun #define IS_NAN_EVT_ON(var, evt) ((var & (1 << (evt-1))) != 0)
1101*4882a593Smuzhiyun 
1102*4882a593Smuzhiyun #define NAN_EV_MASK_SET(var, evt)	\
1103*4882a593Smuzhiyun 	(((uint32)evt < WL_NAN_EVMASK_EXTN_LEN * 8) ? \
1104*4882a593Smuzhiyun 	((*((uint8 *)var + ((evt - 1)/8))) |= (1 << ((evt - 1) %8))) : 0)
1105*4882a593Smuzhiyun #define IS_NAN_EVENT_ON(var, evt)	\
1106*4882a593Smuzhiyun 	(((uint32)evt < WL_NAN_EVMASK_EXTN_LEN * 8) && \
1107*4882a593Smuzhiyun 	(((*((uint8 *)var + ((evt - 1)/8))) & (1 << ((evt - 1) %8))) != 0))
1108*4882a593Smuzhiyun 
1109*4882a593Smuzhiyun /*  ******************* end of NAN section *************** */
1110*4882a593Smuzhiyun 
1111*4882a593Smuzhiyun typedef enum wl_scan_events {
1112*4882a593Smuzhiyun 	WL_SCAN_START = 1,
1113*4882a593Smuzhiyun 	WL_SCAN_END = 2
1114*4882a593Smuzhiyun } wl_scan_events;
1115*4882a593Smuzhiyun 
1116*4882a593Smuzhiyun /* WLC_E_ULP event data */
1117*4882a593Smuzhiyun #define WL_ULP_EVENT_VERSION		1
1118*4882a593Smuzhiyun #define WL_ULP_DISABLE_CONSOLE		1	/* Disable console message on ULP entry */
1119*4882a593Smuzhiyun #define WL_ULP_UCODE_DOWNLOAD		2       /* Download ULP ucode file */
1120*4882a593Smuzhiyun 
1121*4882a593Smuzhiyun typedef struct wl_ulp_event {
1122*4882a593Smuzhiyun 	uint16 version;
1123*4882a593Smuzhiyun 	uint16 ulp_dongle_action;
1124*4882a593Smuzhiyun } wl_ulp_event_t;
1125*4882a593Smuzhiyun 
1126*4882a593Smuzhiyun /* TCP keepalive event data */
1127*4882a593Smuzhiyun typedef BWL_PRE_PACKED_STRUCT struct wl_event_tko {
1128*4882a593Smuzhiyun 	uint8 index;		/* TCP connection index, 0 to max-1 */
1129*4882a593Smuzhiyun 	uint8 pad[3];		/* 4-byte struct alignment */
1130*4882a593Smuzhiyun } BWL_POST_PACKED_STRUCT wl_event_tko_t;
1131*4882a593Smuzhiyun 
1132*4882a593Smuzhiyun typedef struct {
1133*4882a593Smuzhiyun 	uint8 radar_type;       /* one of RADAR_TYPE_XXX */
1134*4882a593Smuzhiyun 	uint16 min_pw;          /* minimum pulse-width (usec * 20) */
1135*4882a593Smuzhiyun 	uint16 max_pw;          /* maximum pulse-width (usec * 20) */
1136*4882a593Smuzhiyun 	uint16 min_pri;         /* minimum pulse repetition interval (usec) */
1137*4882a593Smuzhiyun 	uint16 max_pri;         /* maximum pulse repetition interval (usec) */
1138*4882a593Smuzhiyun 	uint16 subband;         /* subband/frequency */
1139*4882a593Smuzhiyun } radar_detected_event_info_t;
1140*4882a593Smuzhiyun typedef struct wl_event_radar_detect_data {
1141*4882a593Smuzhiyun 
1142*4882a593Smuzhiyun 	uint32 version;
1143*4882a593Smuzhiyun 	uint16 current_chanspec; /* chanspec on which the radar is recieved */
1144*4882a593Smuzhiyun 	uint16 target_chanspec; /*  Target chanspec after detection of radar on current_chanspec */
1145*4882a593Smuzhiyun 	radar_detected_event_info_t radar_info[2];
1146*4882a593Smuzhiyun } wl_event_radar_detect_data_t;
1147*4882a593Smuzhiyun 
1148*4882a593Smuzhiyun #define WL_EVENT_MODESW_VER_1			1
1149*4882a593Smuzhiyun #define WL_EVENT_MODESW_VER_CURRENT		WL_EVENT_MODESW_VER_1
1150*4882a593Smuzhiyun 
1151*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_MASK_DEVICE		0x01u /* mask of device: belongs to local or peer */
1152*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_MASK_FROM		0x02u /* mask of origin: firmware or user */
1153*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_MASK_STATE		0x0Cu /* mask of state: modesw progress state */
1154*4882a593Smuzhiyun 
1155*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_DEVICE_LOCAL		0x00u /* flag - device: info is about self/local */
1156*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_DEVICE_PEER		0x01u /* flag - device: info is about peer */
1157*4882a593Smuzhiyun 
1158*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_FROM_FIRMWARE		0x00u /* flag - from: request is from firmware */
1159*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_FROM_USER		0x02u /* flag - from: request is from user/iov */
1160*4882a593Smuzhiyun 
1161*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_STATE_REQUESTED	0x00u /* flag - state: mode switch request */
1162*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_STATE_INITIATED	0x04u /* flag - state: switch initiated */
1163*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_STATE_COMPLETE		0x08u /* flag - state: switch completed/success */
1164*4882a593Smuzhiyun #define WL_E_MODESW_FLAG_STATE_FAILURE		0x0Cu /* flag - state: failed to switch */
1165*4882a593Smuzhiyun 
1166*4882a593Smuzhiyun /* Get sizeof *X including variable data's length where X is pointer to wl_event_mode_switch_t */
1167*4882a593Smuzhiyun #define WL_E_MODESW_SIZE(X) (sizeof(*(X)) + (X)->length)
1168*4882a593Smuzhiyun 
1169*4882a593Smuzhiyun /* Get variable data's length where X is pointer to wl_event_mode_switch_t */
1170*4882a593Smuzhiyun #define WL_E_MODESW_DATA_SIZE(X) (((X)->length > sizeof(*(X))) ? ((X)->length - sizeof(*(X))) : 0)
1171*4882a593Smuzhiyun 
1172*4882a593Smuzhiyun #define WL_E_MODESW_REASON_UNKNOWN		0u /* reason: UNKNOWN */
1173*4882a593Smuzhiyun #define WL_E_MODESW_REASON_ACSD			1u /* reason: ACSD (based on events from FW */
1174*4882a593Smuzhiyun #define WL_E_MODESW_REASON_OBSS_DBS		2u /* reason: OBSS DBS (eg. on interference) */
1175*4882a593Smuzhiyun #define WL_E_MODESW_REASON_DFS			3u /* reason: DFS (eg. on subband radar) */
1176*4882a593Smuzhiyun #define WL_E_MODESW_REASON_DYN160		4u /* reason: DYN160 (160/2x2 - 80/4x4) */
1177*4882a593Smuzhiyun 
1178*4882a593Smuzhiyun /* event structure for WLC_E_MODE_SWITCH */
1179*4882a593Smuzhiyun typedef struct {
1180*4882a593Smuzhiyun 	uint16 version;
1181*4882a593Smuzhiyun 	uint16 length;	/* size including 'data' field */
1182*4882a593Smuzhiyun 	uint16 opmode_from;
1183*4882a593Smuzhiyun 	uint16 opmode_to;
1184*4882a593Smuzhiyun 	uint32 flags;	/* bit 0: peer(/local==0);
1185*4882a593Smuzhiyun 			 * bit 1: user(/firmware==0);
1186*4882a593Smuzhiyun 			 * bits 3,2: 00==requested, 01==initiated,
1187*4882a593Smuzhiyun 			 *           10==complete, 11==failure;
1188*4882a593Smuzhiyun 			 * rest: reserved
1189*4882a593Smuzhiyun 			 */
1190*4882a593Smuzhiyun 	uint16 reason;	/* value 0: unknown, 1: ACSD, 2: OBSS_DBS,
1191*4882a593Smuzhiyun 			 *       3: DFS, 4: DYN160, rest: reserved
1192*4882a593Smuzhiyun 			 */
1193*4882a593Smuzhiyun 	uint16 data_offset;	/* offset to 'data' from beginning of this struct.
1194*4882a593Smuzhiyun 				 * fields may be added between data_offset and data
1195*4882a593Smuzhiyun 				 */
1196*4882a593Smuzhiyun 	/* ADD NEW FIELDS HERE */
1197*4882a593Smuzhiyun 	uint8 data[];	/* reason specific data; could be empty */
1198*4882a593Smuzhiyun } wl_event_mode_switch_t;
1199*4882a593Smuzhiyun 
1200*4882a593Smuzhiyun /* when reason in WLC_E_MODE_SWITCH is DYN160, data will carry the following structure */
1201*4882a593Smuzhiyun typedef struct {
1202*4882a593Smuzhiyun 	uint16 trigger;		/* value 0: MU to SU, 1: SU to MU, 2: metric_dyn160, 3:re-/assoc,
1203*4882a593Smuzhiyun 				 *       4: disassoc, 5: rssi, 6: traffic, 7: interference,
1204*4882a593Smuzhiyun 				 *       8: chanim_stats
1205*4882a593Smuzhiyun 				 */
1206*4882a593Smuzhiyun 	struct ether_addr sta_addr;	/* causal STA's MAC address when known */
1207*4882a593Smuzhiyun 	uint16 metric_160_80;		/* latest dyn160 metric */
1208*4882a593Smuzhiyun 	uint8 nss;		/* NSS of the STA */
1209*4882a593Smuzhiyun 	uint8 bw;		/* BW of the STA */
1210*4882a593Smuzhiyun 	int8 rssi;		/* RSSI of the STA */
1211*4882a593Smuzhiyun 	uint8 traffic;		/* internal metric of traffic */
1212*4882a593Smuzhiyun } wl_event_mode_switch_dyn160;
1213*4882a593Smuzhiyun 
1214*4882a593Smuzhiyun #define WL_EVENT_FBT_VER_1		1
1215*4882a593Smuzhiyun 
1216*4882a593Smuzhiyun #define WL_E_FBT_TYPE_FBT_OTD_AUTH	1
1217*4882a593Smuzhiyun #define WL_E_FBT_TYPE_FBT_OTA_AUTH	2
1218*4882a593Smuzhiyun 
1219*4882a593Smuzhiyun /* event structure for WLC_E_FBT */
1220*4882a593Smuzhiyun typedef struct {
1221*4882a593Smuzhiyun 	uint16 version;
1222*4882a593Smuzhiyun 	uint16 length;	/* size including 'data' field */
1223*4882a593Smuzhiyun 	uint16 type; /* value 0: unknown, 1: FBT OTD Auth Req */
1224*4882a593Smuzhiyun 	uint16 data_offset;	/* offset to 'data' from beginning of this struct.
1225*4882a593Smuzhiyun 				 * fields may be added between data_offset and data
1226*4882a593Smuzhiyun 				 */
1227*4882a593Smuzhiyun 	/* ADD NEW FIELDS HERE */
1228*4882a593Smuzhiyun 	uint8 data[];	/* type specific data; could be empty */
1229*4882a593Smuzhiyun } wl_event_fbt_t;
1230*4882a593Smuzhiyun 
1231*4882a593Smuzhiyun /* TWT Setup Completion is designed to notify the user of TWT Setup process
1232*4882a593Smuzhiyun  * status. When 'status' field is value of BCME_OK, the user must check the
1233*4882a593Smuzhiyun  * 'setup_cmd' field value in 'wl_twt_sdesc_t' structure that at the end of
1234*4882a593Smuzhiyun  * the event data to see the response from the TWT Responding STA; when
1235*4882a593Smuzhiyun  * 'status' field is value of BCME_ERROR or non BCME_OK, user must not use
1236*4882a593Smuzhiyun  * anything from 'wl_twt_sdesc_t' structure as it is the TWT Requesting STA's
1237*4882a593Smuzhiyun  * own TWT parameter.
1238*4882a593Smuzhiyun  */
1239*4882a593Smuzhiyun 
1240*4882a593Smuzhiyun #define WL_TWT_EVENT_HDR_LEN (SIZE_OF(wl_twt_event_t, version) + SIZE_OF(wl_twt_event_t, length))
1241*4882a593Smuzhiyun #define WL_TWT_EVENT_BASE_LEN	sizeof(wl_twt_event_t)
1242*4882a593Smuzhiyun typedef enum wl_twt_event_type {
1243*4882a593Smuzhiyun 	WL_TWT_EVENT_SETUP		= 1,
1244*4882a593Smuzhiyun 	WL_TWT_EVENT_TEARDOWN		= 2,
1245*4882a593Smuzhiyun 	WL_TWT_EVENT_INFOFRM		= 3,
1246*4882a593Smuzhiyun 	WL_TWT_EVENT_NOTIFY		= 4
1247*4882a593Smuzhiyun } wl_twt_event_type_t;
1248*4882a593Smuzhiyun 
1249*4882a593Smuzhiyun #define WL_TWT_EVENT_VER	0u
1250*4882a593Smuzhiyun 
1251*4882a593Smuzhiyun /* WLC_E_TWT event Main-event */
1252*4882a593Smuzhiyun typedef struct wl_twt_event {
1253*4882a593Smuzhiyun 	uint16 version;
1254*4882a593Smuzhiyun 	uint16 length;	/* the byte count of fields from 'event_type' onwards */
1255*4882a593Smuzhiyun 	uint8 event_type;	/* See sub event types in wl_twt_event_type_t */
1256*4882a593Smuzhiyun 	uint8 PAD[3];
1257*4882a593Smuzhiyun 	uint8 event_info[];
1258*4882a593Smuzhiyun } wl_twt_event_t;
1259*4882a593Smuzhiyun 
1260*4882a593Smuzhiyun /* TWT Setup Completion is designed to notify the user of TWT Setup process
1261*4882a593Smuzhiyun  * status. When 'status' field is value of BCME_OK, the user must check the
1262*4882a593Smuzhiyun  * 'setup_cmd' field value in 'wl_twt_sdesc_t' structure that at the end of
1263*4882a593Smuzhiyun  * the event data to see the response from the TWT Responding STA; when
1264*4882a593Smuzhiyun  * 'status' field is value of BCME_ERROR or non BCME_OK, user must not use
1265*4882a593Smuzhiyun  * anything from 'wl_twt_sdesc_t' structure as it is the TWT Requesting STA's
1266*4882a593Smuzhiyun  * own TWT parameter.
1267*4882a593Smuzhiyun  */
1268*4882a593Smuzhiyun 
1269*4882a593Smuzhiyun #define WL_TWT_SETUP_CPLT_VER	0u
1270*4882a593Smuzhiyun 
1271*4882a593Smuzhiyun /* TWT Setup Reason code */
1272*4882a593Smuzhiyun typedef enum wl_twt_setup_rc {
1273*4882a593Smuzhiyun 	WL_TWT_SETUP_RC_ACCEPT	= 0u,	/* TWT Setup Accepted */
1274*4882a593Smuzhiyun 	WL_TWT_SETUP_RC_REJECT	= 1u,	/* TWT Setup Rejected */
1275*4882a593Smuzhiyun 	WL_TWT_SETUP_RC_TIMEOUT	= 2u,	/* TWT Setup Time-out */
1276*4882a593Smuzhiyun 	WL_TWT_SETUP_RC_IE	= 3u,	/* TWT Setup IE Validation failed */
1277*4882a593Smuzhiyun 	WL_TWT_SETUP_RC_PARAMS	= 4u,	/* TWT Setup IE Params invalid */
1278*4882a593Smuzhiyun 	/* Any new reason code add before this */
1279*4882a593Smuzhiyun 	WL_TWT_SETUP_RC_ERROR	= 255u,	/* Generic Error cases */
1280*4882a593Smuzhiyun } wl_twt_setup_rc_t;
1281*4882a593Smuzhiyun 
1282*4882a593Smuzhiyun /* TWT Setup Completion event data */
1283*4882a593Smuzhiyun typedef struct wl_twt_setup_cplt {
1284*4882a593Smuzhiyun 	uint16 version;
1285*4882a593Smuzhiyun 	uint16 length;	/* the byte count of fields from 'dialog' onwards */
1286*4882a593Smuzhiyun 	uint8 dialog;	/* Setup frame dialog token */
1287*4882a593Smuzhiyun 	uint8 reason_code;	/* see WL_TWT_SETUP_RC_XXXX */
1288*4882a593Smuzhiyun 	uint8 configID;	/* TWT Configuration ID */
1289*4882a593Smuzhiyun 	uint8 pad[1];
1290*4882a593Smuzhiyun 	int32 status;
1291*4882a593Smuzhiyun 	/* wl_twt_sdesc_t desc; - defined in wlioctl.h */
1292*4882a593Smuzhiyun } wl_twt_setup_cplt_t;
1293*4882a593Smuzhiyun 
1294*4882a593Smuzhiyun #define WL_TWT_TEARDOWN_CPLT_VER	0u
1295*4882a593Smuzhiyun 
1296*4882a593Smuzhiyun /* TWT teardown Reason code */
1297*4882a593Smuzhiyun typedef enum wl_twt_td_rc {
1298*4882a593Smuzhiyun 	WL_TWT_TD_RC_HOST	= 0u,	/* Teardown triggered by Host */
1299*4882a593Smuzhiyun 	WL_TWT_TD_RC_PEER	= 1u,	/* Peer initiated teardown */
1300*4882a593Smuzhiyun 	WL_TWT_TD_RC_MCHAN	= 2u,	/* Teardown due to MCHAN Active */
1301*4882a593Smuzhiyun 	WL_TWT_TD_RC_MCNX	= 3u,	/* Teardown due to MultiConnection */
1302*4882a593Smuzhiyun 	WL_TWT_TD_RC_CSA	= 4u,	/* Teardown due to CSA */
1303*4882a593Smuzhiyun 	WL_TWT_TD_RC_BTCX	= 5u,	/* Teardown due to BTCX */
1304*4882a593Smuzhiyun 	WL_TWT_TD_RC_SETUP_FAIL	= 6u, /* Setup fail midway. Teardown all connections */
1305*4882a593Smuzhiyun 	WL_TWT_TD_RC_SCHED	= 7u,	/* Teardown by TWT Scheduler */
1306*4882a593Smuzhiyun 	/* Any new reason code add before this */
1307*4882a593Smuzhiyun 	WL_TWT_TD_RC_ERROR	= 255u,	/* Generic Error cases */
1308*4882a593Smuzhiyun } wl_twt_td_rc_t;
1309*4882a593Smuzhiyun 
1310*4882a593Smuzhiyun /* TWT Teardown complete event data */
1311*4882a593Smuzhiyun typedef struct wl_twt_teardown_cplt {
1312*4882a593Smuzhiyun 	uint16 version;
1313*4882a593Smuzhiyun 	uint16 length;		/* the byte count of fields from 'reason_code' onwards */
1314*4882a593Smuzhiyun 	uint8 reason_code;	/* WL_TWT_TD_RC_XXXX */
1315*4882a593Smuzhiyun 	uint8 configID;		/* TWT Configuration ID */
1316*4882a593Smuzhiyun 	uint8 pad[2];
1317*4882a593Smuzhiyun 	int32 status;
1318*4882a593Smuzhiyun 	/* wl_twt_teardesc_t; - defined in wlioctl.h */
1319*4882a593Smuzhiyun } wl_twt_teardown_cplt_t;
1320*4882a593Smuzhiyun 
1321*4882a593Smuzhiyun #define WL_TWT_INFO_CPLT_VER	0u
1322*4882a593Smuzhiyun 
1323*4882a593Smuzhiyun /* TWT Info Reason code */
1324*4882a593Smuzhiyun typedef enum wl_twt_info_rc {
1325*4882a593Smuzhiyun 	WL_TWT_INFO_RC_HOST	= 0u,	/* Host initiated Info complete */
1326*4882a593Smuzhiyun 	WL_TWT_INFO_RC_PEER	= 1u,	/* Peer initiated TWT Info */
1327*4882a593Smuzhiyun 	/* Any new reason code add before this */
1328*4882a593Smuzhiyun 	WL_TWT_INFO_RC_ERROR	= 255u,	/* generic error conditions */
1329*4882a593Smuzhiyun } wl_twt_info_rc_t;
1330*4882a593Smuzhiyun 
1331*4882a593Smuzhiyun /* TWT Info complete event data */
1332*4882a593Smuzhiyun typedef struct wl_twt_info_cplt {
1333*4882a593Smuzhiyun 	uint16 version;
1334*4882a593Smuzhiyun 	uint16 length;		/* the byte count of fields from 'reason_code' onwards */
1335*4882a593Smuzhiyun 	uint8 reason_code;	/* WL_TWT_INFO_RC_XXXX */
1336*4882a593Smuzhiyun 	uint8 configID;		/* TWT Configuration ID */
1337*4882a593Smuzhiyun 	uint8 pad[2];
1338*4882a593Smuzhiyun 	int32 status;
1339*4882a593Smuzhiyun 	/* wl_twt_infodesc_t; - defined in wlioctl.h */
1340*4882a593Smuzhiyun } wl_twt_info_cplt_t;
1341*4882a593Smuzhiyun 
1342*4882a593Smuzhiyun #define WL_TWT_NOTIFY_VER	0u
1343*4882a593Smuzhiyun #define WL_TWT_NOTIFY_LEN sizeof(wl_twt_notify_t)
1344*4882a593Smuzhiyun #define WL_TWT_NOTIFY_HDR_LEN (SIZE_OF(wl_twt_notify_t, version) + SIZE_OF(wl_twt_notify_t, length))
1345*4882a593Smuzhiyun 
1346*4882a593Smuzhiyun typedef enum wl_twt_notification {
1347*4882a593Smuzhiyun 	WL_TWT_NOTIF_ALLOW_TWT	= 1,	/* Dongle indication of allowing TWT setup */
1348*4882a593Smuzhiyun } wl_twt_notification_t;
1349*4882a593Smuzhiyun 
1350*4882a593Smuzhiyun /* TWT notification event */
1351*4882a593Smuzhiyun typedef struct wl_twt_notify {
1352*4882a593Smuzhiyun 	uint16 version;
1353*4882a593Smuzhiyun 	uint16 length;		/* the byte count of fields from 'reason_code' onwards */
1354*4882a593Smuzhiyun 	uint8 notification;
1355*4882a593Smuzhiyun 	uint8 PAD[3];
1356*4882a593Smuzhiyun } wl_twt_notify_t;
1357*4882a593Smuzhiyun 
1358*4882a593Smuzhiyun #define WL_INVALID_IE_EVENT_VERSION	0
1359*4882a593Smuzhiyun 
1360*4882a593Smuzhiyun /* Invalid IE Event data */
1361*4882a593Smuzhiyun typedef struct wl_invalid_ie_event {
1362*4882a593Smuzhiyun 	uint16 version;
1363*4882a593Smuzhiyun 	uint16 len;      /* Length of the invalid IE copy */
1364*4882a593Smuzhiyun 	uint16 type;     /* Type/subtype of the frame which contains the invalid IE */
1365*4882a593Smuzhiyun 	uint16 error;    /* error code of the wrong IE, defined in ie_error_code_t */
1366*4882a593Smuzhiyun 	uint8  ie[];     /* Variable length buffer for the invalid IE copy */
1367*4882a593Smuzhiyun } wl_invalid_ie_event_t;
1368*4882a593Smuzhiyun 
1369*4882a593Smuzhiyun /* Fixed header portion of Invalid IE Event */
1370*4882a593Smuzhiyun typedef struct wl_invalid_ie_event_hdr {
1371*4882a593Smuzhiyun 	uint16 version;
1372*4882a593Smuzhiyun 	uint16 len;      /* Length of the invalid IE copy */
1373*4882a593Smuzhiyun 	uint16 type;     /* Type/subtype of the frame which contains the invalid IE */
1374*4882a593Smuzhiyun 	uint16 error;    /* error code of the wrong IE, defined in ie_error_code_t */
1375*4882a593Smuzhiyun 	/* var length IE data follows */
1376*4882a593Smuzhiyun } wl_invalid_ie_event_hdr_t;
1377*4882a593Smuzhiyun 
1378*4882a593Smuzhiyun typedef enum ie_error_code {
1379*4882a593Smuzhiyun 	IE_ERROR_OUT_OF_RANGE = 0x01
1380*4882a593Smuzhiyun } ie_error_code_t;
1381*4882a593Smuzhiyun 
1382*4882a593Smuzhiyun /* This marks the end of a packed structure section. */
1383*4882a593Smuzhiyun #include <packed_section_end.h>
1384*4882a593Smuzhiyun 
1385*4882a593Smuzhiyun /* reason of channel switch */
1386*4882a593Smuzhiyun typedef enum {
1387*4882a593Smuzhiyun 	CHANSW_DFS = 10,	/* channel switch due to DFS module */
1388*4882a593Smuzhiyun 	CHANSW_HOMECH_REQ = 14, /* channel switch due to HOME Channel Request */
1389*4882a593Smuzhiyun 	CHANSW_STA = 15,	/* channel switch due to STA */
1390*4882a593Smuzhiyun 	CHANSW_SOFTAP = 16,	/* channel switch due to SodtAP */
1391*4882a593Smuzhiyun 	CHANSW_AIBSS = 17,	/* channel switch due to AIBSS */
1392*4882a593Smuzhiyun 	CHANSW_NAN = 18,	/* channel switch due to NAN */
1393*4882a593Smuzhiyun 	CHANSW_NAN_DISC = 19,	/* channel switch due to NAN Disc */
1394*4882a593Smuzhiyun 	CHANSW_NAN_SCHED = 20,	/* channel switch due to NAN Sched */
1395*4882a593Smuzhiyun 
1396*4882a593Smuzhiyun #ifdef WLAWDL
1397*4882a593Smuzhiyun 	CHANSW_AWDL_AW = 21,	/* channel switch due to AWDL aw */
1398*4882a593Smuzhiyun 	CHANSW_AWDL_SYNC = 22,	/* channel switch due to AWDL sync */
1399*4882a593Smuzhiyun 	CHANSW_AWDL_CAL = 23,	/* channel switch due to AWDL Cal */
1400*4882a593Smuzhiyun 	CHANSW_AWDL_PSF = 24,	/* channel switch due to AWDL PSF */
1401*4882a593Smuzhiyun 	CHANSW_AWDL_OOB_AF = 25, /* channel switch due to AWDL OOB action frame */
1402*4882a593Smuzhiyun #endif /* WLAWDL */
1403*4882a593Smuzhiyun 
1404*4882a593Smuzhiyun 	CHANSW_TDLS = 26,	/* channel switch due to TDLS */
1405*4882a593Smuzhiyun 	CHANSW_PROXD = 27,	/* channel switch due to PROXD */
1406*4882a593Smuzhiyun 	CHANSW_SLOTTED_BSS = 28, /* channel switch due to slotted bss */
1407*4882a593Smuzhiyun 	CHANSW_SLOTTED_CMN_SYNC = 29, /* channel switch due to Common Sync Layer */
1408*4882a593Smuzhiyun 	CHANSW_SLOTTED_BSS_CAL = 30,	/* channel switch due to Cal request from slotted bss */
1409*4882a593Smuzhiyun 	CHANSW_MAX_NUMBER = 31	/* max channel switch reason */
1410*4882a593Smuzhiyun } wl_chansw_reason_t;
1411*4882a593Smuzhiyun 
1412*4882a593Smuzhiyun #define CHANSW_REASON(reason)	(1 << reason)
1413*4882a593Smuzhiyun 
1414*4882a593Smuzhiyun #define EVENT_AGGR_DATA_HDR_LEN	8
1415*4882a593Smuzhiyun 
1416*4882a593Smuzhiyun typedef struct event_aggr_data {
1417*4882a593Smuzhiyun 	uint16  num_events; /* No of events aggregated */
1418*4882a593Smuzhiyun 	uint16	len;	/* length of the aggregated events, excludes padding */
1419*4882a593Smuzhiyun 	uint8	pad[4]; /* Padding to make aggr event packet header aligned
1420*4882a593Smuzhiyun 					 * on 64-bit boundary, for a 64-bit host system.
1421*4882a593Smuzhiyun 					 */
1422*4882a593Smuzhiyun 	uint8	data[];	/* Aggregate buffer containing Events */
1423*4882a593Smuzhiyun } event_aggr_data_t;
1424*4882a593Smuzhiyun 
1425*4882a593Smuzhiyun /* WLC_E_TVPM_MITIGATION event structure version */
1426*4882a593Smuzhiyun #define WL_TVPM_MITIGATION_VERSION 1
1427*4882a593Smuzhiyun 
1428*4882a593Smuzhiyun /* TVPM mitigation on/off status bits */
1429*4882a593Smuzhiyun #define WL_TVPM_MITIGATION_TXDC		0x1
1430*4882a593Smuzhiyun #define WL_TVPM_MITIGATION_TXPOWER	0x2
1431*4882a593Smuzhiyun #define WL_TVPM_MITIGATION_TXCHAINS	0x4
1432*4882a593Smuzhiyun 
1433*4882a593Smuzhiyun /* Event structure for WLC_E_TVPM_MITIGATION */
1434*4882a593Smuzhiyun typedef struct wl_event_tvpm_mitigation {
1435*4882a593Smuzhiyun 	uint16 version;		/* structure version */
1436*4882a593Smuzhiyun 	uint16 length;		/* length of this structure */
1437*4882a593Smuzhiyun 	uint32 timestamp_ms;	/* millisecond timestamp */
1438*4882a593Smuzhiyun 	uint8 slice;		/* slice number */
1439*4882a593Smuzhiyun 	uint8 pad;
1440*4882a593Smuzhiyun 	uint16 on_off;		/* mitigation status bits */
1441*4882a593Smuzhiyun } wl_event_tvpm_mitigation_t;
1442*4882a593Smuzhiyun 
1443*4882a593Smuzhiyun /* Event structures for sub health checks of PHY */
1444*4882a593Smuzhiyun 
1445*4882a593Smuzhiyun #define WL_PHY_HC_DESENSE_STATS_VER (1)
1446*4882a593Smuzhiyun typedef struct wl_hc_desense_stats {
1447*4882a593Smuzhiyun 	uint16 version;
1448*4882a593Smuzhiyun 	uint16 chanspec;
1449*4882a593Smuzhiyun 	int8 allowed_weakest_rssi; /* based on weakest link RSSI */
1450*4882a593Smuzhiyun 	uint8 ofdm_desense; /* Desense requested for OFDM */
1451*4882a593Smuzhiyun 	uint8 bphy_desense; /* Desense requested for bphy */
1452*4882a593Smuzhiyun 	int8 glitch_upd_wait; /* wait post ACI mitigation */
1453*4882a593Smuzhiyun } wl_hc_desense_stats_v1_t;
1454*4882a593Smuzhiyun 
1455*4882a593Smuzhiyun #define WL_PHY_HC_TEMP_STATS_VER (1)
1456*4882a593Smuzhiyun typedef struct wl_hc_temp_stats {
1457*4882a593Smuzhiyun 	uint16 version;
1458*4882a593Smuzhiyun 	uint16 chanspec;
1459*4882a593Smuzhiyun 	int16 curtemp; /* Temperature */
1460*4882a593Smuzhiyun 	uint8 temp_disthresh; /* Threshold to reduce tx chain */
1461*4882a593Smuzhiyun 	uint8 temp_enthresh; /* Threshold to increase tx chains */
1462*4882a593Smuzhiyun 	uint tempsense_period; /* Temperature check period */
1463*4882a593Smuzhiyun 	bool heatedup; /* 1: temp throttling on */
1464*4882a593Smuzhiyun 	uint8 bitmap; /* Indicating rx and tx chains */
1465*4882a593Smuzhiyun 	uint8 pad[2];
1466*4882a593Smuzhiyun } wl_hc_temp_stats_v1_t;
1467*4882a593Smuzhiyun 
1468*4882a593Smuzhiyun #define WL_PHY_HC_TEMP_STATS_VER_2 (2)
1469*4882a593Smuzhiyun typedef struct {
1470*4882a593Smuzhiyun 	uint16 version;
1471*4882a593Smuzhiyun 	uint16 chanspec;
1472*4882a593Smuzhiyun 	int16 curtemp; /* Temperature */
1473*4882a593Smuzhiyun 	uint8 pad[2];
1474*4882a593Smuzhiyun } wl_hc_temp_stats_v2_t;
1475*4882a593Smuzhiyun 
1476*4882a593Smuzhiyun #define WL_PHY_HC_VCOCAL_STATS_VER (1)
1477*4882a593Smuzhiyun typedef struct wl_hc_vcocal_stats {
1478*4882a593Smuzhiyun 	uint16 version;
1479*4882a593Smuzhiyun 	uint16 chanspec;
1480*4882a593Smuzhiyun 	int16 curtemp;	/* Temperature */
1481*4882a593Smuzhiyun 	/* Ring buffer - Maintains history of previous 16 wake/sleep cycles */
1482*4882a593Smuzhiyun 	uint16 vcocal_status_wake;
1483*4882a593Smuzhiyun 	uint16 vcocal_status_sleep;
1484*4882a593Smuzhiyun 	uint16 plllock_status_wake;
1485*4882a593Smuzhiyun 	uint16 plllock_status_sleep;
1486*4882a593Smuzhiyun 	/* Cal Codes */
1487*4882a593Smuzhiyun 	uint16 cc_maincap;
1488*4882a593Smuzhiyun 	uint16 cc_secondcap;
1489*4882a593Smuzhiyun 	uint16 cc_auxcap;
1490*4882a593Smuzhiyun } wl_hc_vcocal_stats_v1_t;
1491*4882a593Smuzhiyun 
1492*4882a593Smuzhiyun #define WL_PHY_HC_TXPWR_STATS_VER (1)
1493*4882a593Smuzhiyun typedef struct wl_hc_tx_stats {
1494*4882a593Smuzhiyun 	uint16 version;
1495*4882a593Smuzhiyun 	uint16 chanspec;
1496*4882a593Smuzhiyun 	int8 tgt_pwr[MAX_PHY_CORE_NUM]; /* Target pwr (qdBm) */
1497*4882a593Smuzhiyun 	int8 estPwr[MAX_PHY_CORE_NUM]; /* Rate corrected (qdBm) */
1498*4882a593Smuzhiyun 	int8 estPwr_adj[MAX_PHY_CORE_NUM]; /* Max power (qdBm) */
1499*4882a593Smuzhiyun 	uint8 baseindex[MAX_PHY_CORE_NUM]; /* Tx base index */
1500*4882a593Smuzhiyun 	int16 temp;	/* Temperature */
1501*4882a593Smuzhiyun 	uint16 TxCtrlWrd[3]; /* 6 PHY ctrl bytes */
1502*4882a593Smuzhiyun 	int8 min_txpower; /* min tx power per ant */
1503*4882a593Smuzhiyun 	uint8 pad[3];
1504*4882a593Smuzhiyun } wl_hc_txpwr_stats_v1_t;
1505*4882a593Smuzhiyun 
1506*4882a593Smuzhiyun #define WL_PHY_HC_TXPWR_STATS_VER_2 (2)
1507*4882a593Smuzhiyun typedef struct {
1508*4882a593Smuzhiyun 	uint16 version;
1509*4882a593Smuzhiyun 	uint16 chanspec;
1510*4882a593Smuzhiyun 	int8 tgt_pwr[MAX_PHY_CORE_NUM]; /* Target pwr (qdBm) */
1511*4882a593Smuzhiyun 	uint8 estPwr[MAX_PHY_CORE_NUM]; /* Rate corrected (qdBm) */
1512*4882a593Smuzhiyun 	uint8 estPwr_adj[MAX_PHY_CORE_NUM]; /* Max power (qdBm) */
1513*4882a593Smuzhiyun 	uint8 baseindex[MAX_PHY_CORE_NUM]; /* Tx base index */
1514*4882a593Smuzhiyun 	int16 temp;	/* Temperature */
1515*4882a593Smuzhiyun 	uint16 TxCtrlWrd[3]; /* 6 PHY ctrl bytes */
1516*4882a593Smuzhiyun 	int8 min_txpower; /* min tx power per ant */
1517*4882a593Smuzhiyun 	uint8 pad[3];
1518*4882a593Smuzhiyun } wl_hc_txpwr_stats_v2_t;
1519*4882a593Smuzhiyun 
1520*4882a593Smuzhiyun typedef enum wl_mbo_event_type {
1521*4882a593Smuzhiyun 	WL_MBO_E_CELLULAR_NW_SWITCH = 1,
1522*4882a593Smuzhiyun 	WL_MBO_E_BTM_RCVD = 2,
1523*4882a593Smuzhiyun 	/* ADD before this */
1524*4882a593Smuzhiyun 	WL_MBO_E_LAST = 3  /* highest val + 1 for range checking */
1525*4882a593Smuzhiyun } wl_mbo_event_type_t;
1526*4882a593Smuzhiyun 
1527*4882a593Smuzhiyun /* WLC_E_MBO event structure version */
1528*4882a593Smuzhiyun #define WL_MBO_EVT_VER 1
1529*4882a593Smuzhiyun 
1530*4882a593Smuzhiyun struct wl_event_mbo {
1531*4882a593Smuzhiyun 	uint16 version;	/* structure version */
1532*4882a593Smuzhiyun 	uint16 length;		/* length of the rest of the structure from type */
1533*4882a593Smuzhiyun 	wl_mbo_event_type_t  type;		/* Event type */
1534*4882a593Smuzhiyun 	uint8  data[];    /* Variable length data */
1535*4882a593Smuzhiyun };
1536*4882a593Smuzhiyun 
1537*4882a593Smuzhiyun /* WLC_E_MBO_CELLULAR_NW_SWITCH event structure version */
1538*4882a593Smuzhiyun #define WL_MBO_CELLULAR_NW_SWITCH_VER 1
1539*4882a593Smuzhiyun 
1540*4882a593Smuzhiyun /* WLC_E_MBO_CELLULAR_NW_SWITCH event data */
1541*4882a593Smuzhiyun struct wl_event_mbo_cell_nw_switch {
1542*4882a593Smuzhiyun 	uint16 version;		/* structure version */
1543*4882a593Smuzhiyun 	uint16 length;		/* length of the rest of the structure from reason */
1544*4882a593Smuzhiyun 	/* Reason of switch as per MBO Tech spec */
1545*4882a593Smuzhiyun 	uint8 reason;
1546*4882a593Smuzhiyun 	/* pad */
1547*4882a593Smuzhiyun 	uint8 pad;
1548*4882a593Smuzhiyun 	/* delay after which re-association can be tried to current BSS (seconds) */
1549*4882a593Smuzhiyun 	uint16 reassoc_delay;
1550*4882a593Smuzhiyun 	/* How long current association will be there (milli seconds).
1551*4882a593Smuzhiyun 	* This is zero if not known or value is overflowing.
1552*4882a593Smuzhiyun 	*/
1553*4882a593Smuzhiyun 	uint32 assoc_time_remain;
1554*4882a593Smuzhiyun };
1555*4882a593Smuzhiyun 
1556*4882a593Smuzhiyun /* WLC_E_MBO_BTM_RCVD event structure version */
1557*4882a593Smuzhiyun #define WL_BTM_EVENT_DATA_VER_1       1
1558*4882a593Smuzhiyun /* Specific btm event type data */
1559*4882a593Smuzhiyun struct wl_btm_event_type_data {
1560*4882a593Smuzhiyun 	uint16	version;
1561*4882a593Smuzhiyun 	uint16	len;
1562*4882a593Smuzhiyun 	uint8	transition_reason;	/* transition reason code */
1563*4882a593Smuzhiyun 	uint8	pad[3];			/* pad */
1564*4882a593Smuzhiyun };
1565*4882a593Smuzhiyun 
1566*4882a593Smuzhiyun /* WLC_E_PRUNE event structure version */
1567*4882a593Smuzhiyun #define WL_BSSID_PRUNE_EVT_VER_1	1
1568*4882a593Smuzhiyun /* MBO-OCE params */
1569*4882a593Smuzhiyun struct wl_bssid_prune_evt_info {
1570*4882a593Smuzhiyun 	uint16 version;
1571*4882a593Smuzhiyun 	uint16 len;
1572*4882a593Smuzhiyun 	uint8	SSID[32];
1573*4882a593Smuzhiyun 	uint32	time_remaining;		/* Time remaining */
1574*4882a593Smuzhiyun 	struct ether_addr BSSID;
1575*4882a593Smuzhiyun 	uint8	SSID_len;
1576*4882a593Smuzhiyun 	uint8	reason;			/* Reason code */
1577*4882a593Smuzhiyun 	int8	rssi_threshold;		/* RSSI threshold */
1578*4882a593Smuzhiyun 	uint8	pad[3];			/* pad */
1579*4882a593Smuzhiyun };
1580*4882a593Smuzhiyun 
1581*4882a593Smuzhiyun /* WLC_E_ADPS status */
1582*4882a593Smuzhiyun enum {
1583*4882a593Smuzhiyun 	WL_E_STATUS_ADPS_DEAUTH = 0,
1584*4882a593Smuzhiyun 	WL_E_STATUS_ADPS_MAX
1585*4882a593Smuzhiyun };
1586*4882a593Smuzhiyun 
1587*4882a593Smuzhiyun /* WLC_E_ADPS event data */
1588*4882a593Smuzhiyun #define WL_EVENT_ADPS_VER_1		1
1589*4882a593Smuzhiyun 
1590*4882a593Smuzhiyun /* WLC_E_ADPS event type */
1591*4882a593Smuzhiyun #define WL_E_TYPE_ADPS_BAD_AP		1
1592*4882a593Smuzhiyun 
1593*4882a593Smuzhiyun typedef struct wl_event_adps_bad_ap {
1594*4882a593Smuzhiyun 	uint32 status;
1595*4882a593Smuzhiyun 	uint32 reason;
1596*4882a593Smuzhiyun 	struct ether_addr ea;	/* bssid */
1597*4882a593Smuzhiyun } wl_event_adps_bad_ap_t;
1598*4882a593Smuzhiyun 
1599*4882a593Smuzhiyun typedef struct wl_event_adps {
1600*4882a593Smuzhiyun 	uint16	version;	/* structure version */
1601*4882a593Smuzhiyun 	uint16	length;		/* length of structure */
1602*4882a593Smuzhiyun 	uint32	type;		/* event type */
1603*4882a593Smuzhiyun 	uint8	data[];		/* variable length data */
1604*4882a593Smuzhiyun } wl_event_adps_v1_t;
1605*4882a593Smuzhiyun 
1606*4882a593Smuzhiyun typedef wl_event_adps_v1_t wl_event_adps_t;
1607*4882a593Smuzhiyun 
1608*4882a593Smuzhiyun #define WLC_USER_E_KEY_UPDATE	1 /* Key add/remove */
1609*4882a593Smuzhiyun #define WLC_USER_E_FORCE_FLUSH	2 /* SDC force flush */
1610*4882a593Smuzhiyun 
1611*4882a593Smuzhiyun /* OBSS HW event data */
1612*4882a593Smuzhiyun typedef struct wlc_obss_hw_event_data {
1613*4882a593Smuzhiyun 	uint16 available_chanspec;	/* Contains band, channel and BW info */
1614*4882a593Smuzhiyun } wlc_obss_hw_event_data_t;
1615*4882a593Smuzhiyun 
1616*4882a593Smuzhiyun /* status when WLC_E_OBSS_DETECTION */
1617*4882a593Smuzhiyun #define WLC_OBSS_BW_UPDATED	1 /* Sent when BW is update at SW */
1618*4882a593Smuzhiyun #define WLC_OBSS_BW_AVAILABLE	2 /* Sent When a change in BW is detected / noticed */
1619*4882a593Smuzhiyun 
1620*4882a593Smuzhiyun /* WLC_E_DYNSAR event structure version */
1621*4882a593Smuzhiyun #define WL_DYNSAR_VERSION 1
1622*4882a593Smuzhiyun 
1623*4882a593Smuzhiyun /* bits used in status field */
1624*4882a593Smuzhiyun #define WL_STATUS_DYNSAR_PWR_OPT	(1 << 0)	/* power optimized */
1625*4882a593Smuzhiyun #define WL_STATUS_DYNSAR_FAILSAFE	(1 << 1)	/* radio is using failsafe cap values */
1626*4882a593Smuzhiyun #define WL_STATUS_DYNSAR_NOMUTE_OPT	(1 << 2)	/* ack mute */
1627*4882a593Smuzhiyun 
1628*4882a593Smuzhiyun /* Event structure for WLC_E_DYNSAR */
1629*4882a593Smuzhiyun typedef struct wl_event_dynsar {
1630*4882a593Smuzhiyun 	uint16 version;         /* structure version */
1631*4882a593Smuzhiyun 	uint16 length;          /* length of this structure */
1632*4882a593Smuzhiyun 	uint32 timestamp_ms;    /* millisecond timestamp */
1633*4882a593Smuzhiyun 	uint8  opt;             /* optimization power offset */
1634*4882a593Smuzhiyun 	uint8  slice;           /* slice number */
1635*4882a593Smuzhiyun 	uint8  status;		/* WL_STATUS_DYNSAR_XXX, to indicate which optimization
1636*4882a593Smuzhiyun 				* is being applied
1637*4882a593Smuzhiyun 				*/
1638*4882a593Smuzhiyun 	uint8  pad;
1639*4882a593Smuzhiyun } wl_event_dynsar_t;
1640*4882a593Smuzhiyun 
1641*4882a593Smuzhiyun /* status when WLC_E_AP_BCN_MUTE event is sent */
1642*4882a593Smuzhiyun #define BCN_MUTE_MITI_ACTIVE	1u	/* Mitigation is activated when probe response received
1643*4882a593Smuzhiyun 					 * but Beacon is not received
1644*4882a593Smuzhiyun 					 */
1645*4882a593Smuzhiyun #define BCN_MUTE_MITI_END	2u	/* Sent when beacon is received */
1646*4882a593Smuzhiyun #define BCN_MUTE_MITI_TIMEOUT	3u	/* Mitigation period is reached */
1647*4882a593Smuzhiyun 
1648*4882a593Smuzhiyun /* bcn_mute_miti event data */
1649*4882a593Smuzhiyun #define WLC_BCN_MUTE_MITI_EVENT_DATA_VER_1	1u
1650*4882a593Smuzhiyun typedef struct wlc_bcn_mute_miti_event_data_v1 {
1651*4882a593Smuzhiyun 	uint16	version;	/* Structure version number */
1652*4882a593Smuzhiyun 	uint16	length;		/* Length of the whole struct */
1653*4882a593Smuzhiyun 	uint16	uatbtt_count;	/* Number of UATBTT during mitigation */
1654*4882a593Smuzhiyun 	uint8	PAD[2];		/* Pad to fit to 32 bit alignment */
1655*4882a593Smuzhiyun } wlc_bcn_mute_miti_event_data_v1_t;
1656*4882a593Smuzhiyun 
1657*4882a593Smuzhiyun /* bcn_drift event data */
1658*4882a593Smuzhiyun #define WLC_BCN_DRIFT_EVENT_DATA_VER_1	(1u)
1659*4882a593Smuzhiyun typedef struct wlc_bcn_drift_event_data_v1 {
1660*4882a593Smuzhiyun 	uint16	version;	/* Structure version number */
1661*4882a593Smuzhiyun 	uint16	length;		/* Length of the whole struct */
1662*4882a593Smuzhiyun 	int16	drift;		/* in ms */
1663*4882a593Smuzhiyun 	int16	jitter;		/* in ms */
1664*4882a593Smuzhiyun } wlc_bcn_drift_event_data_v1_t;
1665*4882a593Smuzhiyun 
1666*4882a593Smuzhiyun #endif /* _BCMEVENT_H_ */
1667