• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Broadcom Event  protocol definitions
4  *
5  * Dependencies: bcmeth.h
6  *
7  * Copyright (C) 1999-2019, Broadcom.
8  *
9  *      Unless you and Broadcom execute a separate written software license
10  * agreement governing use of this software, this software is licensed to you
11  * under the terms of the GNU General Public License version 2 (the "GPL"),
12  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
13  * following added to such license:
14  *
15  *      As a special exception, the copyright holders of this software give you
16  * permission to link this software with independent modules, and to copy and
17  * distribute the resulting executable under terms of your choice, provided that
18  * you also meet, for each linked independent module, the terms and conditions of
19  * the license of that module.  An independent module is a module which is not
20  * derived from this software.  The special exception does not apply to any
21  * modifications of the software.
22  *
23  *      Notwithstanding the above, under no circumstances may you combine this
24  * software in any way with any other Broadcom software provided under a license
25  * other than the GPL, without Broadcom's express prior written consent.
26  *
27  *
28  * <<Broadcom-WL-IPTag/Open:>>
29  *
30  * $Id: bcmevent.h 822151 2019-05-28 18:37:23Z $
31  *
32  */
33 
34 /*
35  * Broadcom Ethernet Events protocol defines
36  *
37  */
38 
39 #ifndef _BCMEVENT_H_
40 #define _BCMEVENT_H_
41 
42 #include <typedefs.h>
43 /* #include <ethernet.h> -- TODO: req., excluded to overwhelming coupling (break up ethernet.h) */
44 #include <bcmeth.h>
45 #if defined(DNGL_EVENT_SUPPORT)
46 #include <dnglevent.h>
47 #endif // endif
48 
49 /* This marks the start of a packed structure section. */
50 #include <packed_section_start.h>
51 
52 #define BCM_EVENT_MSG_VERSION		2	/* wl_event_msg_t struct version */
53 #define BCM_MSG_IFNAME_MAX		16	/* max length of interface name */
54 
55 /* flags */
56 #define WLC_EVENT_MSG_LINK		0x01	/* link is up */
57 #define WLC_EVENT_MSG_FLUSHTXQ		0x02	/* flush tx queue on MIC error */
58 #define WLC_EVENT_MSG_GROUP		0x04	/* group MIC error */
59 #define WLC_EVENT_MSG_UNKBSS		0x08	/* unknown source bsscfg */
60 #define WLC_EVENT_MSG_UNKIF		0x10	/* unknown source OS i/f */
61 
62 /* these fields are stored in network order */
63 
64 /* version 1 */
65 typedef BWL_PRE_PACKED_STRUCT struct
66 {
67 	uint16	version;
68 	uint16	flags;			/* see flags below */
69 	uint32	event_type;		/* Message (see below) */
70 	uint32	status;			/* Status code (see below) */
71 	uint32	reason;			/* Reason code (if applicable) */
72 	uint32	auth_type;		/* WLC_E_AUTH */
73 	uint32	datalen;		/* data buf */
74 	struct ether_addr	addr;	/* Station address (if applicable) */
75 	char	ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
76 } BWL_POST_PACKED_STRUCT wl_event_msg_v1_t;
77 
78 /* the current version */
79 typedef BWL_PRE_PACKED_STRUCT struct
80 {
81 	uint16	version;
82 	uint16	flags;			/* see flags below */
83 	uint32	event_type;		/* Message (see below) */
84 	uint32	status;			/* Status code (see below) */
85 	uint32	reason;			/* Reason code (if applicable) */
86 	uint32	auth_type;		/* WLC_E_AUTH */
87 	uint32	datalen;		/* data buf */
88 	struct ether_addr	addr;	/* Station address (if applicable) */
89 	char	ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
90 	uint8	ifidx;			/* destination OS i/f index */
91 	uint8	bsscfgidx;		/* source bsscfg index */
92 } BWL_POST_PACKED_STRUCT wl_event_msg_t;
93 
94 /* used by driver msgs */
95 typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
96 	struct ether_header eth;
97 	bcmeth_hdr_t		bcm_hdr;
98 	wl_event_msg_t		event;
99 	/* data portion follows */
100 } BWL_POST_PACKED_STRUCT bcm_event_t;
101 
102 /*
103  * used by host event
104  * note: if additional event types are added, it should go with is_wlc_event_frame() as well.
105  */
106 typedef union bcm_event_msg_u {
107 	wl_event_msg_t		event;
108 #if defined(DNGL_EVENT_SUPPORT)
109 	bcm_dngl_event_msg_t	dngl_event;
110 #endif // endif
111 
112 	/* add new event here */
113 } bcm_event_msg_u_t;
114 
115 #define BCM_MSG_LEN	(sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
116 
117 /* Event messages */
118 #define WLC_E_SET_SSID		0	/* indicates status of set SSID */
119 #define WLC_E_JOIN		1	/* differentiates join IBSS from found (WLC_E_START) IBSS */
120 #define WLC_E_START		2	/* STA founded an IBSS or AP started a BSS */
121 #define WLC_E_AUTH		3	/* 802.11 AUTH request */
122 #define WLC_E_AUTH_IND		4	/* 802.11 AUTH indication */
123 #define WLC_E_DEAUTH		5	/* 802.11 DEAUTH request */
124 #define WLC_E_DEAUTH_IND	6	/* 802.11 DEAUTH indication */
125 #define WLC_E_ASSOC		7	/* 802.11 ASSOC request */
126 #define WLC_E_ASSOC_IND		8	/* 802.11 ASSOC indication */
127 #define WLC_E_REASSOC		9	/* 802.11 REASSOC request */
128 #define WLC_E_REASSOC_IND	10	/* 802.11 REASSOC indication */
129 #define WLC_E_DISASSOC		11	/* 802.11 DISASSOC request */
130 #define WLC_E_DISASSOC_IND	12	/* 802.11 DISASSOC indication */
131 #define WLC_E_QUIET_START	13	/* 802.11h Quiet period started */
132 #define WLC_E_QUIET_END		14	/* 802.11h Quiet period ended */
133 #define WLC_E_BEACON_RX		15	/* BEACONS received/lost indication */
134 #define WLC_E_LINK		16	/* generic link indication */
135 #define WLC_E_MIC_ERROR		17	/* TKIP MIC error occurred */
136 #define WLC_E_NDIS_LINK		18	/* NDIS style link indication */
137 #define WLC_E_ROAM		19	/* roam complete: indicate status & reason */
138 #define WLC_E_TXFAIL		20	/* change in dot11FailedCount (txfail) */
139 #define WLC_E_PMKID_CACHE	21	/* WPA2 pmkid cache indication */
140 #define WLC_E_RETROGRADE_TSF	22	/* current AP's TSF value went backward */
141 #define WLC_E_PRUNE		23	/* AP was pruned from join list for reason */
142 #define WLC_E_AUTOAUTH		24	/* report AutoAuth table entry match for join attempt */
143 #define WLC_E_EAPOL_MSG		25	/* Event encapsulating an EAPOL message */
144 #define WLC_E_SCAN_COMPLETE	26	/* Scan results are ready or scan was aborted */
145 #define WLC_E_ADDTS_IND		27	/* indicate to host addts fail/success */
146 #define WLC_E_DELTS_IND		28	/* indicate to host delts fail/success */
147 #define WLC_E_BCNSENT_IND	29	/* indicate to host of beacon transmit */
148 #define WLC_E_BCNRX_MSG		30	/* Send the received beacon up to the host */
149 #define WLC_E_BCNLOST_MSG	31	/* indicate to host loss of beacon */
150 #define WLC_E_ROAM_PREP		32	/* before attempting to roam association */
151 #define WLC_E_PFN_NET_FOUND	33	/* PFN network found event */
152 #define WLC_E_PFN_NET_LOST	34	/* PFN network lost event */
153 #define WLC_E_RESET_COMPLETE	35
154 #define WLC_E_JOIN_START	36
155 #define WLC_E_ROAM_START	37	/* roam attempt started: indicate reason */
156 #define WLC_E_ASSOC_START	38
157 #define WLC_E_IBSS_ASSOC	39
158 #define WLC_E_RADIO		40
159 #define WLC_E_PSM_WATCHDOG	41	/* PSM microcode watchdog fired */
160 
161 #define WLC_E_PROBREQ_MSG       44      /* probe request received */
162 #define WLC_E_SCAN_CONFIRM_IND  45
163 #define WLC_E_PSK_SUP		46	/* WPA Handshake fail */
164 #define WLC_E_COUNTRY_CODE_CHANGED	47
165 #define	WLC_E_EXCEEDED_MEDIUM_TIME	48	/* WMMAC excedded medium time */
166 #define WLC_E_ICV_ERROR		49	/* WEP ICV error occurred */
167 #define WLC_E_UNICAST_DECODE_ERROR	50	/* Unsupported unicast encrypted frame */
168 #define WLC_E_MULTICAST_DECODE_ERROR	51	/* Unsupported multicast encrypted frame */
169 #define WLC_E_TRACE		52
170 #define WLC_E_IF		54	/* I/F change (for dongle host notification) */
171 #define WLC_E_P2P_DISC_LISTEN_COMPLETE	55	/* listen state expires */
172 #define WLC_E_RSSI		56	/* indicate RSSI change based on configured levels */
173 #define WLC_E_PFN_BEST_BATCHING	57	/* PFN best network batching event */
174 #define WLC_E_EXTLOG_MSG	58
175 #define WLC_E_ACTION_FRAME      59	/* Action frame Rx */
176 #define WLC_E_ACTION_FRAME_COMPLETE	60	/* Action frame Tx complete */
177 #define WLC_E_PRE_ASSOC_IND	61	/* assoc request received */
178 #define WLC_E_PRE_REASSOC_IND	62	/* re-assoc request received */
179 #ifdef CSI_SUPPORT
180 #define WLC_E_CSI		63
181 #else
182 #define WLC_E_CHANNEL_ADOPTED	63
183 #endif /* CSI_SUPPORT */
184 #define WLC_E_AP_STARTED	64	/* AP started */
185 #define WLC_E_DFS_AP_STOP	65	/* AP stopped due to DFS */
186 #define WLC_E_DFS_AP_RESUME	66	/* AP resumed due to DFS */
187 #define WLC_E_WAI_STA_EVENT	67	/* WAI stations event */
188 #define WLC_E_WAI_MSG 		68	/* event encapsulating an WAI message */
189 #define WLC_E_ESCAN_RESULT 	69	/* escan result event */
190 #define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 	70	/* action frame off channel complete */
191 #define WLC_E_PROBRESP_MSG	71	/* probe response received */
192 #define WLC_E_P2P_PROBREQ_MSG	72	/* P2P Probe request received */
193 #define WLC_E_DCS_REQUEST	73
194 #define WLC_E_FIFO_CREDIT_MAP	74	/* credits for D11 FIFOs. [AC0,AC1,AC2,AC3,BC_MC,ATIM] */
195 #define WLC_E_ACTION_FRAME_RX	75	/* Received action frame event WITH
196 					 * wl_event_rx_frame_data_t header
197 					 */
198 #define WLC_E_WAKE_EVENT	76	/* Wake Event timer fired, used for wake WLAN test mode */
199 #define WLC_E_RM_COMPLETE	77	/* Radio measurement complete */
200 #define WLC_E_HTSFSYNC		78	/* Synchronize TSF with the host */
201 #define WLC_E_OVERLAY_REQ	79	/* request an overlay IOCTL/iovar from the host */
202 #define WLC_E_CSA_COMPLETE_IND		80	/* 802.11 CHANNEL SWITCH ACTION completed */
203 #define WLC_E_EXCESS_PM_WAKE_EVENT	81	/* excess PM Wake Event to inform host  */
204 #define WLC_E_PFN_SCAN_NONE		82	/* no PFN networks around */
205 /* PFN BSSID network found event, conflict/share with  WLC_E_PFN_SCAN_NONE */
206 #define WLC_E_PFN_BSSID_NET_FOUND	82
207 #define WLC_E_PFN_SCAN_ALLGONE		83	/* last found PFN network gets lost */
208 /* PFN BSSID network lost event, conflict/share with WLC_E_PFN_SCAN_ALLGONE */
209 #define WLC_E_PFN_BSSID_NET_LOST	83
210 #define WLC_E_GTK_PLUMBED		84
211 #define WLC_E_ASSOC_IND_NDIS		85	/* 802.11 ASSOC indication for NDIS only */
212 #define WLC_E_REASSOC_IND_NDIS		86	/* 802.11 REASSOC indication for NDIS only */
213 #define WLC_E_ASSOC_REQ_IE		87
214 #define WLC_E_ASSOC_RESP_IE		88
215 #define WLC_E_ASSOC_RECREATED		89	/* association recreated on resume */
216 #define WLC_E_ACTION_FRAME_RX_NDIS	90	/* rx action frame event for NDIS only */
217 #define WLC_E_AUTH_REQ			91	/* authentication request received */
218 #define WLC_E_TDLS_PEER_EVENT		92	/* discovered peer, connected/disconnected peer */
219 #define WLC_E_SPEEDY_RECREATE_FAIL	93	/* fast assoc recreation failed */
220 #define WLC_E_NATIVE			94	/* port-specific event and payload (e.g. NDIS) */
221 #define WLC_E_PKTDELAY_IND		95	/* event for tx pkt delay suddently jump */
222 #define WLC_E_PSTA_PRIMARY_INTF_IND	99	/* psta primary interface indication */
223 #define WLC_E_NAN			100     /* NAN event - Reserved for future */
224 #define WLC_E_BEACON_FRAME_RX		101
225 #define WLC_E_SERVICE_FOUND		102	/* desired service found */
226 #define WLC_E_GAS_FRAGMENT_RX		103	/* GAS fragment received */
227 #define WLC_E_GAS_COMPLETE		104	/* GAS sessions all complete */
228 #define WLC_E_P2PO_ADD_DEVICE		105	/* New device found by p2p offload */
229 #define WLC_E_P2PO_DEL_DEVICE		106	/* device has been removed by p2p offload */
230 #define WLC_E_WNM_STA_SLEEP		107	/* WNM event to notify STA enter sleep mode */
231 #define WLC_E_TXFAIL_THRESH		108	/* Indication of MAC tx failures (exhaustion of
232 						 * 802.11 retries) exceeding threshold(s)
233 						 */
234 #define WLC_E_PROXD			109	/* Proximity Detection event */
235 #define WLC_E_IBSS_COALESCE		110	/* IBSS Coalescing */
236 #define WLC_E_AIBSS_TXFAIL		110	/* TXFAIL event for AIBSS, re using event 110 */
237 #define WLC_E_BSS_LOAD			114	/* Inform host of beacon bss load */
238 #define WLC_E_MIMO_PWR_SAVE		115	/* Inform host MIMO PWR SAVE learning events */
239 #define WLC_E_LEAKY_AP_STATS	116 /* Inform host leaky Ap stats events */
240 #define WLC_E_ALLOW_CREDIT_BORROW 117	/* Allow or disallow wlfc credit borrowing in DHD */
241 #define WLC_E_MSCH			120	/* Multiple channel scheduler event */
242 #define WLC_E_CSA_START_IND		121
243 #define WLC_E_CSA_DONE_IND		122
244 #define WLC_E_CSA_FAILURE_IND		123
245 #define WLC_E_CCA_CHAN_QUAL		124	/* CCA based channel quality report */
246 #define WLC_E_BSSID		125	/* to report change in BSSID while roaming */
247 #define WLC_E_TX_STAT_ERROR		126	/* tx error indication */
248 #define WLC_E_BCMC_CREDIT_SUPPORT	127	/* credit check for BCMC supported */
249 #define WLC_E_PEER_TIMEOUT	128 /* silently drop a STA because of inactivity */
250 #define WLC_E_BT_WIFI_HANDOVER_REQ	130	/* Handover Request Initiated */
251 #define WLC_E_SPW_TXINHIBIT		131     /* Southpaw TxInhibit notification */
252 #define WLC_E_FBT_AUTH_REQ_IND		132	/* FBT Authentication Request Indication */
253 #define WLC_E_RSSI_LQM			133	/* Enhancement addition for WLC_E_RSSI */
254 #define WLC_E_PFN_GSCAN_FULL_RESULT		134 /* Full probe/beacon (IEs etc) results */
255 #define WLC_E_PFN_SWC		135 /* Significant change in rssi of bssids being tracked */
256 #define WLC_E_AUTHORIZED	136	/* a STA been authroized for traffic */
257 #define WLC_E_PROBREQ_MSG_RX	137 /* probe req with wl_event_rx_frame_data_t header */
258 #define WLC_E_PFN_SCAN_COMPLETE	138	/* PFN completed scan of network list */
259 #define WLC_E_RMC_EVENT		139	/* RMC Event */
260 #define WLC_E_DPSTA_INTF_IND	140	/* DPSTA interface indication */
261 #define WLC_E_RRM		141	/* RRM Event */
262 #define WLC_E_PFN_SSID_EXT	142	/* SSID EXT event */
263 #define WLC_E_ROAM_EXP_EVENT	143	/* Expanded roam event */
264 #define WLC_E_ULP			146	/* ULP entered indication */
265 #define WLC_E_MACDBG			147	/* Ucode debugging event */
266 #define WLC_E_RESERVED			148	/* reserved */
267 #define WLC_E_PRE_ASSOC_RSEP_IND	149	/* assoc resp received */
268 #define WLC_E_PSK_AUTH			150	/* PSK AUTH WPA2-PSK 4 WAY Handshake failure */
269 #define WLC_E_TKO			151     /* TCP keepalive offload */
270 #define WLC_E_SDB_TRANSITION            152     /* SDB mode-switch event */
271 #define WLC_E_NATOE_NFCT		153     /* natoe event */
272 #define WLC_E_TEMP_THROTTLE		154	/* Temperature throttling control event */
273 #define WLC_E_LINK_QUALITY		155     /* Link quality measurement complete */
274 #define WLC_E_BSSTRANS_RESP		156	/* BSS Transition Response received */
275 #define WLC_E_TWT_SETUP			157	/* TWT Setup Complete event */
276 #define WLC_E_HE_TWT_SETUP		157	/* TODO:Remove after merging TWT changes to trunk */
277 #define WLC_E_NAN_CRITICAL		158	/* NAN Critical Event */
278 #define WLC_E_NAN_NON_CRITICAL		159	/* NAN Non-Critical Event */
279 #define WLC_E_RADAR_DETECTED		160	/* Radar Detected event */
280 #define WLC_E_RANGING_EVENT		161	/* Ranging event */
281 #define WLC_E_INVALID_IE		162	/* Received invalid IE */
282 #define WLC_E_MODE_SWITCH		163	/* Mode switch event */
283 #define WLC_E_PKT_FILTER		164	/* Packet filter event */
284 #define WLC_E_DMA_TXFLUSH_COMPLETE	165	/* TxFlush done before changing tx/rxchain */
285 #define WLC_E_FBT			166	/* FBT event */
286 #define WLC_E_PFN_SCAN_BACKOFF		167	/* PFN SCAN Backoff event */
287 #define WLC_E_PFN_BSSID_SCAN_BACKOFF	168	/* PFN BSSID SCAN BAckoff event */
288 #define WLC_E_AGGR_EVENT		169	/* Aggregated event */
289 #define WLC_E_TVPM_MITIGATION		171	/* Change in mitigation applied by TVPM */
290 #define WLC_E_SCAN_START		172	/* Deprecated */
291 #define WLC_E_SCAN			172	/* Scan event */
292 #define WLC_E_MBO			173	/* MBO event */
293 #define WLC_E_PHY_CAL			174	/* Phy calibration start indication to host */
294 #define WLC_E_RPSNOA			175	/* Radio power save start/end indication to host */
295 #define WLC_E_ADPS			176	/* ADPS event */
296 #define WLC_E_SLOTTED_BSS_PEER_OP	177	/* Per peer SCB delete */
297 #define WLC_E_HWA			178	/* HWA events */
298 #define WLC_E_GTK_KEYROT_NO_CHANSW	179	/* Avoid Chanswitch while GTK key rotation */
299 #define WLC_E_ONBODY_STATUS_CHANGE	180	/* Indication of onbody status change */
300 #define WLC_E_BCNRECV_ABORTED		181	/* Fake AP bcnrecv aborted roam event */
301 #define WLC_E_PMK_INFO			182	/* PMK,PMKID information event */
302 #define WLC_E_BSSTRANS			183	/* BSS Transition request / Response */
303 #define WLC_E_WA_LQM			184	/* link quality monitoring */
304 #define WLC_E_ACTION_FRAME_OFF_CHAN_DWELL_COMPLETE  185 /* action frame off channel
305 						 *  dwell time complete
306 						 */
307 #define WLC_E_WSEC			186	/* wsec keymgmt event */
308 #define WLC_E_LAST			187	/* highest val + 1 for range checking */
309 #if (WLC_E_LAST > 187)
310 #error "WLC_E_LAST: Invalid value for last event; must be <= 187."
311 #endif /* WLC_E_LAST */
312 
313 /* define an API for getting the string name of an event */
314 extern const char *bcmevent_get_name(uint event_type);
315 extern void wl_event_to_host_order(wl_event_msg_t * evt);
316 extern void wl_event_to_network_order(wl_event_msg_t * evt);
317 
318 /* validate if the event is proper and if valid copy event header to event */
319 extern int is_wlc_event_frame(void *pktdata, uint pktlen, uint16 exp_usr_subtype,
320 	bcm_event_msg_u_t *out_event);
321 
322 /* conversion between host and network order for events */
323 void wl_event_to_host_order(wl_event_msg_t * evt);
324 void wl_event_to_network_order(wl_event_msg_t * evt);
325 
326 /* Event status codes */
327 #define WLC_E_STATUS_SUCCESS		0	/* operation was successful */
328 #define WLC_E_STATUS_FAIL		1	/* operation failed */
329 #define WLC_E_STATUS_TIMEOUT		2	/* operation timed out */
330 #define WLC_E_STATUS_NO_NETWORKS	3	/* failed due to no matching network found */
331 #define WLC_E_STATUS_ABORT		4	/* operation was aborted */
332 #define WLC_E_STATUS_NO_ACK		5	/* protocol failure: packet not ack'd */
333 #define WLC_E_STATUS_UNSOLICITED	6	/* AUTH or ASSOC packet was unsolicited */
334 #define WLC_E_STATUS_ATTEMPT		7	/* attempt to assoc to an auto auth configuration */
335 #define WLC_E_STATUS_PARTIAL		8	/* scan results are incomplete */
336 #define WLC_E_STATUS_NEWSCAN		9	/* scan aborted by another scan */
337 #define WLC_E_STATUS_NEWASSOC		10	/* scan aborted due to assoc in progress */
338 #define WLC_E_STATUS_11HQUIET		11	/* 802.11h quiet period started */
339 #define WLC_E_STATUS_SUPPRESS		12	/* user disabled scanning (WLC_SET_SCANSUPPRESS) */
340 #define WLC_E_STATUS_NOCHANS		13	/* no allowable channels to scan */
341 #ifdef BCMCCX
342 #define WLC_E_STATUS_CCXFASTRM		14	/* scan aborted due to CCX fast roam */
343 #endif /* BCMCCX */
344 #define WLC_E_STATUS_CS_ABORT		15	/* abort channel select */
345 #define WLC_E_STATUS_ERROR		16	/* request failed due to error */
346 #define WLC_E_STATUS_SLOTTED_PEER_ADD	17	/* Slotted scb for peer addition status */
347 #define WLC_E_STATUS_SLOTTED_PEER_DEL	18	/* Slotted scb for peer deletion status */
348 #define WLC_E_STATUS_RXBCN		19	/* Rx Beacon event for FAKEAP feature	*/
349 #define WLC_E_STATUS_RXBCN_ABORT	20	/* Rx Beacon abort event for FAKEAP feature */
350 #define WLC_E_STATUS_LOWPOWER_ON_LOWSPAN	21	/* LOWPOWER scan request during LOWSPAN */
351 #define WLC_E_STATUS_INVALID 0xff  /* Invalid status code to init variables. */
352 
353 /* 4-way handshake event type */
354 #define WLC_E_PSK_AUTH_SUB_EAPOL_START		1	/* EAPOL start */
355 #define WLC_E_PSK_AUTH_SUB_EAPOL_DONE		2	/* EAPOL end */
356 /* GTK event type */
357 #define	WLC_E_PSK_AUTH_SUB_GTK_DONE		3	/* GTK end */
358 
359 /* 4-way handshake event status code */
360 #define WLC_E_STATUS_PSK_AUTH_WPA_TIMOUT	1	/* operation timed out */
361 #define WLC_E_STATUS_PSK_AUTH_MIC_WPA_ERR		2	/* MIC error */
362 #define WLC_E_STATUS_PSK_AUTH_IE_MISMATCH_ERR		3	/* IE Missmatch error */
363 #define WLC_E_STATUS_PSK_AUTH_REPLAY_COUNT_ERR		4
364 #define WLC_E_STATUS_PSK_AUTH_PEER_BLACKISTED	5	/* Blaclisted peer */
365 #define WLC_E_STATUS_PSK_AUTH_GTK_REKEY_FAIL	6	/* GTK event status code */
366 
367 /* SDB transition status code */
368 #define WLC_E_STATUS_SDB_START			1
369 #define WLC_E_STATUS_SDB_COMPLETE		2
370 /* Slice-swap status code */
371 #define WLC_E_STATUS_SLICE_SWAP_START		3
372 #define WLC_E_STATUS_SLICE_SWAP_COMPLETE	4
373 
374 /* SDB transition reason code */
375 #define WLC_E_REASON_HOST_DIRECT	0
376 #define WLC_E_REASON_INFRA_ASSOC	1
377 #define WLC_E_REASON_INFRA_ROAM		2
378 #define WLC_E_REASON_INFRA_DISASSOC	3
379 #define WLC_E_REASON_NO_MODE_CHANGE_NEEDED	4
380 
381 /* WLC_E_SDB_TRANSITION event data */
382 #define WL_MAX_BSSCFG     4
383 #define WL_EVENT_SDB_TRANSITION_VER     1
384 typedef struct wl_event_sdb_data {
385 	uint8 wlunit;           /* Core index */
386 	uint8 is_iftype;        /* Interface Type(Station, SoftAP, P2P_GO, P2P_GC */
387 	uint16 chanspec;        /* Interface Channel/Chanspec */
388 	char ssidbuf[(4 * 32) + 1];	/* SSID_FMT_BUF_LEN: ((4 * DOT11_MAX_SSID_LEN) + 1) */
389 } wl_event_sdb_data_t;
390 
391 typedef struct wl_event_sdb_trans {
392 	uint8 version;          /* Event Data Version */
393 	uint8 rsdb_mode;
394 	uint8 enable_bsscfg;
395 	uint8 reserved;
396 	struct wl_event_sdb_data values[WL_MAX_BSSCFG];
397 } wl_event_sdb_trans_t;
398 
399 /* reason codes for WLC_E_GTK_KEYROT_NO_CHANSW event */
400 #define WLC_E_GTKKEYROT_SCANDELAY       0       /* Delay scan while gtk in progress */
401 #define WLC_E_GTKKEYROT_SKIPCHANSW_P2P  2       /* Avoid chansw by p2p while gtk in progress */
402 
403 /* roam reason codes */
404 #define WLC_E_REASON_INITIAL_ASSOC	0	/* initial assoc */
405 #define WLC_E_REASON_LOW_RSSI		1	/* roamed due to low RSSI */
406 #define WLC_E_REASON_DEAUTH		2	/* roamed due to DEAUTH indication */
407 #define WLC_E_REASON_DISASSOC		3	/* roamed due to DISASSOC indication */
408 #define WLC_E_REASON_BCNS_LOST		4	/* roamed due to lost beacons */
409 
410 #define WLC_E_REASON_FAST_ROAM_FAILED	5	/* roamed due to fast roam failure */
411 #define WLC_E_REASON_DIRECTED_ROAM	6	/* roamed due to request by AP */
412 #define WLC_E_REASON_TSPEC_REJECTED	7	/* roamed due to TSPEC rejection */
413 #define WLC_E_REASON_BETTER_AP		8	/* roamed due to finding better AP */
414 #define WLC_E_REASON_MINTXRATE		9	/* roamed because at mintxrate for too long */
415 #define WLC_E_REASON_TXFAIL		10	/* We can hear AP, but AP can't hear us */
416 /* retained for precommit auto-merging errors; remove once all branches are synced */
417 #define WLC_E_REASON_REQUESTED_ROAM	11
418 #define WLC_E_REASON_BSSTRANS_REQ	11	/* roamed due to BSS Transition request by AP */
419 #define WLC_E_REASON_LOW_RSSI_CU	12	/* roamed due to low RSSI and Channel Usage */
420 #define WLC_E_REASON_RADAR_DETECTED	13	/* roamed due to radar detection by STA */
421 #define WLC_E_REASON_CSA		14	/* roamed due to CSA from AP */
422 #define WLC_E_REASON_ESTM_LOW		15	/* roamed due to ESTM low tput */
423 #define WLC_E_REASON_SILENT_ROAM	16	/* roamed due to Silent roam */
424 #define WLC_E_REASON_INACTIVITY		17	/* full roam scan due to inactivity */
425 #define WLC_E_REASON_ROAM_SCAN_TIMEOUT		18	/* roam scan timer timeout */
426 #define WLC_E_REASON_LAST		19	/* NOTE: increment this as you add reasons above */
427 
428 /* prune reason codes */
429 #define WLC_E_PRUNE_ENCR_MISMATCH	1	/* encryption mismatch */
430 #define WLC_E_PRUNE_BCAST_BSSID		2	/* AP uses a broadcast BSSID */
431 #define WLC_E_PRUNE_MAC_DENY		3	/* STA's MAC addr is in AP's MAC deny list */
432 #define WLC_E_PRUNE_MAC_NA		4	/* STA's MAC addr is not in AP's MAC allow list */
433 #define WLC_E_PRUNE_REG_PASSV		5	/* AP not allowed due to regulatory restriction */
434 #define WLC_E_PRUNE_SPCT_MGMT		6	/* AP does not support STA locale spectrum mgmt */
435 #define WLC_E_PRUNE_RADAR		7	/* AP is on a radar channel of STA locale */
436 #define WLC_E_RSN_MISMATCH		8	/* STA does not support AP's RSN */
437 #define WLC_E_PRUNE_NO_COMMON_RATES	9	/* No rates in common with AP */
438 #define WLC_E_PRUNE_BASIC_RATES		10	/* STA does not support all basic rates of BSS */
439 #ifdef BCMCCX
440 #define WLC_E_PRUNE_CCXFAST_PREVAP	11	/* CCX FAST ROAM: prune previous AP */
441 #endif /* def BCMCCX */
442 #define WLC_E_PRUNE_CIPHER_NA		12	/* BSS's cipher not supported */
443 #define WLC_E_PRUNE_KNOWN_STA		13	/* AP is already known to us as a STA */
444 #ifdef BCMCCX
445 #define WLC_E_PRUNE_CCXFAST_DROAM	14	/* CCX FAST ROAM: prune unqualified AP */
446 #endif /* def BCMCCX */
447 #define WLC_E_PRUNE_WDS_PEER		15	/* AP is already known to us as a WDS peer */
448 #define WLC_E_PRUNE_QBSS_LOAD		16	/* QBSS LOAD - AAC is too low */
449 #define WLC_E_PRUNE_HOME_AP		17	/* prune home AP */
450 #ifdef BCMCCX
451 #define WLC_E_PRUNE_AP_BLOCKED		18	/* prune blocked AP */
452 #define WLC_E_PRUNE_NO_DIAG_SUPPORT	19	/* prune due to diagnostic mode not supported */
453 #endif /* BCMCCX */
454 #define WLC_E_PRUNE_AUTH_RESP_MAC	20	/* suppress auth resp by MAC filter */
455 #define WLC_E_PRUNE_ASSOC_RETRY_DELAY	21	/* MBO assoc retry delay */
456 #define WLC_E_PRUNE_RSSI_ASSOC_REJ	22	/* OCE RSSI-based assoc rejection */
457 
458 /* WPA failure reason codes carried in the WLC_E_PSK_SUP event */
459 #define WLC_E_SUP_OTHER			0	/* Other reason */
460 #define WLC_E_SUP_DECRYPT_KEY_DATA	1	/* Decryption of key data failed */
461 #define WLC_E_SUP_BAD_UCAST_WEP128	2	/* Illegal use of ucast WEP128 */
462 #define WLC_E_SUP_BAD_UCAST_WEP40	3	/* Illegal use of ucast WEP40 */
463 #define WLC_E_SUP_UNSUP_KEY_LEN		4	/* Unsupported key length */
464 #define WLC_E_SUP_PW_KEY_CIPHER		5	/* Unicast cipher mismatch in pairwise key */
465 #define WLC_E_SUP_MSG3_TOO_MANY_IE	6	/* WPA IE contains > 1 RSN IE in key msg 3 */
466 #define WLC_E_SUP_MSG3_IE_MISMATCH	7	/* WPA IE mismatch in key message 3 */
467 #define WLC_E_SUP_NO_INSTALL_FLAG	8	/* INSTALL flag unset in 4-way msg */
468 #define WLC_E_SUP_MSG3_NO_GTK		9	/* encapsulated GTK missing from msg 3 */
469 #define WLC_E_SUP_GRP_KEY_CIPHER	10	/* Multicast cipher mismatch in group key */
470 #define WLC_E_SUP_GRP_MSG1_NO_GTK	11	/* encapsulated GTK missing from group msg 1 */
471 #define WLC_E_SUP_GTK_DECRYPT_FAIL	12	/* GTK decrypt failure */
472 #define WLC_E_SUP_SEND_FAIL		13	/* message send failure */
473 #define WLC_E_SUP_DEAUTH		14	/* received FC_DEAUTH */
474 #define WLC_E_SUP_WPA_PSK_TMO		15	/* WPA PSK 4-way handshake timeout */
475 #define WLC_E_SUP_WPA_PSK_M1_TMO	16	/* WPA PSK 4-way handshake M1 timeout */
476 #define WLC_E_SUP_WPA_PSK_M3_TMO	17	/* WPA PSK 4-way handshake M3 timeout */
477 #define WLC_E_SUP_GTK_UPDATE_FAIL	18  /* GTK update failure */
478 #define WLC_E_SUP_TK_UPDATE_FAIL	19  /* TK update failure */
479 #define WLC_E_SUP_KEY_INSTALL_FAIL	20  /* Buffered key install failure */
480 #define WLC_E_SUP_PTK_UPDATE		21	/* PTK update */
481 #define WLC_E_SUP_MSG1_PMKID_MISMATCH	22	/* MSG1 PMKID not matched to PMKSA cache list */
482 
483 /* event msg for WLC_E_SUP_PTK_UPDATE */
484 typedef struct wlc_sup_ptk_update {
485 	uint16 version;		/* 0x0001 */
486 	uint16 length;		/* length of data that follows */
487 	uint32 tsf_low;		/* tsf at which ptk updated by internal supplicant */
488 	uint32 tsf_high;
489 	uint8 key_id;		/* always 0 for PTK update */
490 	uint8 tid;		/* tid for the PN below - PTK refresh is per key */
491 	uint16 pn_low;
492 	uint32 pn_high;		/* local highest PN of any tid of the key when M4 was sent */
493 } wlc_sup_ptk_update_t;
494 
495 /* sub event of WLC_E_WSEC */
496 typedef enum {
497 	WLC_WSEC_EVENT_PTK_PN_SYNC_ERROR = 0x01
498 } wl_wsec_event_type_t;
499 
500 /* sub event msg - WLC_WSEC_EVENT_PTK_PN_SYNC_ERROR */
501 struct wlc_wsec_ptk_pn_sync_error_v1 {
502 	uint32 tsf_low;		/* tsf at which PN sync error happened */
503 	uint32 tsf_high;
504 	uint8 key_id;		/* always 0 for PTK update */
505 	uint8 tid;		/* tid for the PN below - PTK refresh is per key */
506 	uint16 PAD1;
507 	uint16 rx_seqn;		/* d11 seq number */
508 	uint16 pn_low;
509 	uint32 pn_high;		/* local PN window start for the tid */
510 	uint16 key_idx;		/* key idx in the keymgmt */
511 	uint16 rx_pn_low;
512 	uint32 rx_pn_high;	/* Rx PN window start for the tid */
513 	uint32 span_time;	/* time elapsed since replay */
514 	uint32 span_pkts;	/* pkt count since replay */
515 };
516 
517 typedef struct wlc_wsec_ptk_pn_sync_error_v1 wlc_wsec_ptk_pn_sync_error_t;
518 
519 /* WLC_E_WSEC event msg */
520 typedef struct wlc_wsec_event {
521 	uint16 version;		/* 0x0001 */
522 	uint16 length;		/* length of data that follows */
523 	uint16 type;		/* wsec_event_type_t */
524 	uint16 PAD1;
525 	union {
526 		wlc_wsec_ptk_pn_sync_error_t pn_sync_err;
527 	} data;
528 } wlc_wsec_event_t;
529 
530 /* Ucode reason codes carried in the WLC_E_MACDBG event */
531 #define WLC_E_MACDBG_LIST_PSM		0	/* Dump list update for PSM registers */
532 #define WLC_E_MACDBG_LIST_PSMX		1	/* Dump list update for PSMx registers */
533 #define WLC_E_MACDBG_REGALL		2	/* Dump all registers */
534 
535 /* Event data for events that include frames received over the air */
536 /* WLC_E_PROBRESP_MSG
537  * WLC_E_P2P_PROBREQ_MSG
538  * WLC_E_ACTION_FRAME_RX
539  */
540 
541 #define MAX_PHY_CORE_NUM 4u
542 
543 #define BCM_RX_FRAME_DATA_VERSION_2	2u
544 
545 typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data_v2 {
546 	uint16	version;
547 	uint16	len;
548 	uint16	channel;	/* Matches chanspec_t format from bcmwifi_channels.h */
549 	uint16	pad;
550 	int32	rssi;
551 	uint32	mactime;
552 	uint32	rate;
553 	int8    per_core_rssi[MAX_PHY_CORE_NUM];
554 } BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_v2_t;
555 
556 typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data_v1 {
557 	uint16	version;
558 	uint16	channel;	/* Matches chanspec_t format from bcmwifi_channels.h */
559 	int32	rssi;
560 	uint32	mactime;
561 	uint32	rate;
562 } BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_v1_t;
563 
564 #define BCM_RX_FRAME_DATA_VERSION_1 1u
565 
566 #ifndef WL_EVENT_RX_FRAME_DATA_ALIAS
567 #define BCM_RX_FRAME_DATA_VERSION BCM_RX_FRAME_DATA_VERSION_1
568 typedef wl_event_rx_frame_data_v1_t wl_event_rx_frame_data_t;
569 #endif // endif
570 
571 /* WLC_E_IF event data */
572 typedef struct wl_event_data_if {
573 	uint8 ifidx;		/* RTE virtual device index (for dongle) */
574 	uint8 opcode;		/* see I/F opcode */
575 	uint8 reserved;		/* bit mask (WLC_E_IF_FLAGS_XXX ) */
576 	uint8 bssidx;		/* bsscfg index */
577 	uint8 role;		/* see I/F role */
578 } wl_event_data_if_t;
579 
580 /* WLC_E_NATOE event data */
581 typedef struct wl_event_data_natoe {
582 	uint32 natoe_active;
583 	uint32 sta_ip;
584 	uint16 start_port;
585 	uint16 end_port;
586 } wl_event_data_natoe_t;
587 
588 /* opcode in WLC_E_IF event */
589 #define WLC_E_IF_ADD		1	/* bsscfg add */
590 #define WLC_E_IF_DEL		2	/* bsscfg delete */
591 #define WLC_E_IF_CHANGE		3	/* bsscfg role change */
592 
593 /* I/F role code in WLC_E_IF event */
594 #define WLC_E_IF_ROLE_STA		0	/* Infra STA */
595 #define WLC_E_IF_ROLE_AP		1	/* Access Point */
596 #define WLC_E_IF_ROLE_WDS		2	/* WDS link */
597 #define WLC_E_IF_ROLE_P2P_GO		3	/* P2P Group Owner */
598 #define WLC_E_IF_ROLE_P2P_CLIENT	4	/* P2P Client */
599 #ifdef WLMESH_CFG80211
600 #define WLC_E_IF_ROLE_MESH		5	/* MESH */
601 #endif /* WLMESH_CFG80211 */
602 #define WLC_E_IF_ROLE_IBSS		8	/* IBSS */
603 #define WLC_E_IF_ROLE_NAN		9	/* NAN */
604 
605 /* WLC_E_RSSI event data */
606 typedef struct wl_event_data_rssi {
607 	int32 rssi;
608 	int32 snr;
609 	int32 noise;
610 } wl_event_data_rssi_t;
611 
612 #define WL_EVENT_WA_LQM_VER	0	/* initial version */
613 
614 #define WL_EVENT_WA_LQM_BASIC	0	/* event sub-types */
615 typedef struct {			/* payload of subevent in xtlv */
616 	int32 rssi;
617 	int32 snr;
618 	uint32 tx_rate;
619 	uint32 rx_rate;
620 } wl_event_wa_lqm_basic_t;
621 
622 typedef struct wl_event_wa_lqm {
623 	uint16 ver;			/* version */
624 	uint16 len;			/* total length structure */
625 	uint8 subevent[];		/* sub-event data in bcm_xtlv_t format */
626 } wl_event_wa_lqm_t;
627 
628 /* WLC_E_IF flag */
629 #define WLC_E_IF_FLAGS_BSSCFG_NOIF	0x1	/* no host I/F creation needed */
630 
631 /* Reason codes for LINK */
632 #define WLC_E_LINK_BCN_LOSS     1   /* Link down because of beacon loss */
633 #define WLC_E_LINK_DISASSOC     2   /* Link down because of disassoc */
634 #define WLC_E_LINK_ASSOC_REC    3   /* Link down because assoc recreate failed */
635 #define WLC_E_LINK_BSSCFG_DIS   4   /* Link down due to bsscfg down */
636 #define WLC_E_LINK_ASSOC_FAIL   5   /* Link down because assoc to new AP during roaming failed */
637 
638 /* WLC_E_NDIS_LINK event data */
639 typedef BWL_PRE_PACKED_STRUCT struct ndis_link_parms {
640 	struct ether_addr peer_mac; /* 6 bytes */
641 	uint16 chanspec;            /* 2 bytes */
642 	uint32 link_speed;          /* current datarate in units of 500 Kbit/s */
643 	uint32 max_link_speed;      /* max possible datarate for link in units of 500 Kbit/s  */
644 	int32  rssi;                /* average rssi */
645 } BWL_POST_PACKED_STRUCT ndis_link_parms_t;
646 
647 /* reason codes for WLC_E_OVERLAY_REQ event */
648 #define WLC_E_OVL_DOWNLOAD		0	/* overlay download request */
649 #define WLC_E_OVL_UPDATE_IND	1	/* device indication of host overlay update */
650 
651 /* reason codes for WLC_E_TDLS_PEER_EVENT event */
652 #define WLC_E_TDLS_PEER_DISCOVERED		0	/* peer is ready to establish TDLS */
653 #define WLC_E_TDLS_PEER_CONNECTED		1
654 #define WLC_E_TDLS_PEER_DISCONNECTED	2
655 
656 /* reason codes for WLC_E_RMC_EVENT event */
657 #define WLC_E_REASON_RMC_NONE		0
658 #define WLC_E_REASON_RMC_AR_LOST		1
659 #define WLC_E_REASON_RMC_AR_NO_ACK		2
660 
661 #ifdef WLTDLS
662 /* TDLS Action Category code */
663 #define TDLS_AF_CATEGORY		12
664 /* Wi-Fi Display (WFD) Vendor Specific Category */
665 /* used for WFD Tunneled Probe Request and Response */
666 #define TDLS_VENDOR_SPECIFIC		127
667 /* TDLS Action Field Values */
668 #define TDLS_ACTION_SETUP_REQ		0
669 #define TDLS_ACTION_SETUP_RESP		1
670 #define TDLS_ACTION_SETUP_CONFIRM	2
671 #define TDLS_ACTION_TEARDOWN		3
672 #define WLAN_TDLS_SET_PROBE_WFD_IE	11
673 #define WLAN_TDLS_SET_SETUP_WFD_IE	12
674 #define WLAN_TDLS_SET_WFD_ENABLED	13
675 #define WLAN_TDLS_SET_WFD_DISABLED	14
676 #endif // endif
677 
678 /* WLC_E_RANGING_EVENT subtypes */
679 #define WLC_E_RANGING_RESULTS	0
680 
681 #define PHY_CAL_EVT_VERSION 1
682 typedef struct wlc_phy_cal_info {
683 	uint16 version; /* structure version */
684 	uint16 length; /* length of the rest of the structure - pad */
685 	uint16 chanspec;
686 	uint8 start;
687 	uint8 phase;
688 	int16 temp;
689 	uint8 reason;
690 	uint8 pad;
691 } wlc_phy_cal_info_t;
692 
693 /* GAS event data */
694 typedef BWL_PRE_PACKED_STRUCT struct wl_event_gas {
695 	uint16	channel;		/* channel of GAS protocol */
696 	uint8	dialog_token;	/* GAS dialog token */
697 	uint8	fragment_id;	/* fragment id */
698 	uint16	status_code;	/* status code on GAS completion */
699 	uint16 	data_len;		/* length of data to follow */
700 	uint8	data[1];		/* variable length specified by data_len */
701 } BWL_POST_PACKED_STRUCT wl_event_gas_t;
702 
703 /* service discovery TLV */
704 typedef BWL_PRE_PACKED_STRUCT struct wl_sd_tlv {
705 	uint16	length;			/* length of response_data */
706 	uint8	protocol;		/* service protocol type */
707 	uint8	transaction_id;		/* service transaction id */
708 	uint8	status_code;		/* status code */
709 	uint8	data[1];		/* response data */
710 } BWL_POST_PACKED_STRUCT wl_sd_tlv_t;
711 
712 /* service discovery event data */
713 typedef BWL_PRE_PACKED_STRUCT struct wl_event_sd {
714 	uint16	channel;		/* channel */
715 	uint8	count;			/* number of tlvs */
716 	wl_sd_tlv_t	tlv[1];		/* service discovery TLV */
717 } BWL_POST_PACKED_STRUCT wl_event_sd_t;
718 
719 /* WLC_E_PKT_FILTER event sub-classification codes */
720 #define WLC_E_PKT_FILTER_TIMEOUT	1 /* Matching packet not received in last timeout seconds */
721 
722 /* Note: proxd has a new API (ver 3.0) deprecates the following */
723 
724 /* Reason codes for WLC_E_PROXD */
725 #define WLC_E_PROXD_FOUND		1	/* Found a proximity device */
726 #define WLC_E_PROXD_GONE		2	/* Lost a proximity device */
727 #define WLC_E_PROXD_START		3	/* used by: target  */
728 #define WLC_E_PROXD_STOP		4	/* used by: target   */
729 #define WLC_E_PROXD_COMPLETED		5	/* used by: initiator completed */
730 #define WLC_E_PROXD_ERROR		6	/* used by both initiator and target */
731 #define WLC_E_PROXD_COLLECT_START	7	/* used by: target & initiator */
732 #define WLC_E_PROXD_COLLECT_STOP	8	/* used by: target */
733 #define WLC_E_PROXD_COLLECT_COMPLETED	9	/* used by: initiator completed */
734 #define WLC_E_PROXD_COLLECT_ERROR	10	/* used by both initiator and target */
735 #define WLC_E_PROXD_NAN_EVENT		11	/* used by both initiator and target */
736 #define WLC_E_PROXD_TS_RESULTS          12      /* used by: initiator completed */
737 
738 /*  proxd_event data */
739 typedef struct ftm_sample {
740 	uint32 value;	/* RTT in ns */
741 	int8 rssi;	/* RSSI */
742 } ftm_sample_t;
743 
744 typedef struct ts_sample {
745 	uint32 t1;
746 	uint32 t2;
747 	uint32 t3;
748 	uint32 t4;
749 } ts_sample_t;
750 
751 typedef BWL_PRE_PACKED_STRUCT struct proxd_event_data {
752 	uint16 ver;			/* version */
753 	uint16 mode;			/* mode: target/initiator */
754 	uint16 method;			/* method: rssi/TOF/AOA */
755 	uint8  err_code;		/* error classification */
756 	uint8  TOF_type;		/* one way or two way TOF */
757 	uint8  OFDM_frame_type;		/* legacy or VHT */
758 	uint8  bandwidth;		/* Bandwidth is 20, 40,80, MHZ */
759 	struct ether_addr peer_mac;	/* (e.g for tgt:initiator's */
760 	uint32 distance;		/* dst to tgt, units meter */
761 	uint32 meanrtt;			/* mean delta */
762 	uint32 modertt;			/* Mode delta */
763 	uint32 medianrtt;		/* median RTT */
764 	uint32 sdrtt;			/* Standard deviation of RTT */
765 	int32  gdcalcresult;		/* Software or Hardware Kind of redundant, but if */
766 					/* frame type is VHT, then we should do it by hardware */
767 	int16  avg_rssi;		/* avg rssi accroos the ftm frames */
768 	int16  validfrmcnt;		/* Firmware's valid frame counts */
769 	int32  peer_router_info;	/* Peer router information if available in TLV, */
770 					/* We will add this field later  */
771 	int32 var1;			/* average of group delay */
772 	int32 var2;			/* average of threshold crossing */
773 	int32 var3;			/* difference between group delay and threshold crossing */
774 					/* raw Fine Time Measurements (ftm) data */
775 	uint16 ftm_unit;		/* ftm cnt resolution in picoseconds , 6250ps - default */
776 	uint16 ftm_cnt;			/*  num of rtd measurments/length in the ftm buffer  */
777 	ftm_sample_t ftm_buff[1];	/* 1 ... ftm_cnt  */
778 } BWL_POST_PACKED_STRUCT wl_proxd_event_data_t;
779 
780 typedef BWL_PRE_PACKED_STRUCT struct proxd_event_ts_results {
781 	uint16 ver;                     /* version */
782 	uint16 mode;                    /* mode: target/initiator */
783 	uint16 method;                  /* method: rssi/TOF/AOA */
784 	uint8  err_code;                /* error classification */
785 	uint8  TOF_type;                /* one way or two way TOF */
786 	uint16  ts_cnt;                 /* number of timestamp measurements */
787 	ts_sample_t ts_buff[1];         /* Timestamps */
788 } BWL_POST_PACKED_STRUCT wl_proxd_event_ts_results_t;
789 
790 /* Video Traffic Interference Monitor Event */
791 #define INTFER_EVENT_VERSION		1
792 #define INTFER_STREAM_TYPE_NONTCP	1
793 #define INTFER_STREAM_TYPE_TCP		2
794 #define WLINTFER_STATS_NSMPLS		4
795 typedef struct wl_intfer_event {
796 	uint16 version;			/* version */
797 	uint16 status;			/* status */
798 	uint8 txfail_histo[WLINTFER_STATS_NSMPLS]; /* txfail histo */
799 } wl_intfer_event_t;
800 
801 #define RRM_EVENT_VERSION		0
802 typedef struct wl_rrm_event {
803 	int16 version;
804 	int16 len;
805 	int16 cat;		/* Category */
806 	int16 subevent;
807 	char payload[1]; /* Measurement payload */
808 } wl_rrm_event_t;
809 
810 /* WLC_E_PSTA_PRIMARY_INTF_IND event data */
811 typedef struct wl_psta_primary_intf_event {
812 	struct ether_addr prim_ea;	/* primary intf ether addr */
813 } wl_psta_primary_intf_event_t;
814 
815 /* WLC_E_DPSTA_INTF_IND event data */
816 typedef enum {
817 	WL_INTF_PSTA = 1,
818 	WL_INTF_DWDS = 2
819 } wl_dpsta_intf_type;
820 
821 typedef struct wl_dpsta_intf_event {
822 	wl_dpsta_intf_type intf_type;    /* dwds/psta intf register */
823 } wl_dpsta_intf_event_t;
824 
825 /*  **********  NAN protocol events/subevents  ********** */
826 #ifndef NAN_EVENT_BUFFER_SIZE
827 #define NAN_EVENT_BUFFER_SIZE 512 /* max size */
828 #endif /* NAN_EVENT_BUFFER_SIZE */
829 /* NAN Events sent by firmware */
830 
831 /*
832  * If you make changes to this enum, dont forget to update the mask (if need be).
833  */
834 typedef enum wl_nan_events {
835 	WL_NAN_EVENT_START			= 1,	/* NAN cluster started */
836 	WL_NAN_EVENT_JOIN			= 2,	/* To be deprecated */
837 	WL_NAN_EVENT_ROLE			= 3,	/* Role changed */
838 	WL_NAN_EVENT_SCAN_COMPLETE		= 4,	/* To be deprecated */
839 	WL_NAN_EVENT_DISCOVERY_RESULT		= 5,	/* Subscribe Received */
840 	WL_NAN_EVENT_REPLIED			= 6,	/* Publish Sent */
841 	WL_NAN_EVENT_TERMINATED			= 7,	/* sub / pub is terminated */
842 	WL_NAN_EVENT_RECEIVE			= 8,	/* Follow up Received */
843 	WL_NAN_EVENT_STATUS_CHG			= 9,	/* change in nan_mac status */
844 	WL_NAN_EVENT_MERGE			= 10,	/* Merged to a NAN cluster */
845 	WL_NAN_EVENT_STOP			= 11,	/* To be deprecated */
846 	WL_NAN_EVENT_P2P			= 12,	/* Unused */
847 	WL_NAN_EVENT_WINDOW_BEGIN_P2P		= 13,	/* Unused */
848 	WL_NAN_EVENT_WINDOW_BEGIN_MESH		= 14,	/* Unused */
849 	WL_NAN_EVENT_WINDOW_BEGIN_IBSS		= 15,	/* Unused */
850 	WL_NAN_EVENT_WINDOW_BEGIN_RANGING	= 16,	/* Unused */
851 	WL_NAN_EVENT_POST_DISC			= 17,	/* Event for post discovery data */
852 	WL_NAN_EVENT_DATA_IF_ADD		= 18,	/* Unused */
853 	WL_NAN_EVENT_DATA_PEER_ADD		= 19,	/* Event for peer add */
854 	/* nan 2.0 */
855 	WL_NAN_EVENT_PEER_DATAPATH_IND		= 20,	/* Incoming DP req */
856 	WL_NAN_EVENT_DATAPATH_ESTB		= 21,	/* DP Established */
857 	WL_NAN_EVENT_SDF_RX			= 22,	/* SDF payload */
858 	WL_NAN_EVENT_DATAPATH_END		= 23,	/* DP Terminate recvd */
859 	WL_NAN_EVENT_BCN_RX			= 24,	/* received beacon payload */
860 	WL_NAN_EVENT_PEER_DATAPATH_RESP		= 25,	/* Peer's DP response */
861 	WL_NAN_EVENT_PEER_DATAPATH_CONF		= 26,	/* Peer's DP confirm */
862 	WL_NAN_EVENT_RNG_REQ_IND		= 27,	/* Range Request */
863 	WL_NAN_EVENT_RNG_RPT_IND		= 28,	/* Range Report */
864 	WL_NAN_EVENT_RNG_TERM_IND		= 29,	/* Range Termination */
865 	WL_NAN_EVENT_PEER_DATAPATH_SEC_INST	= 30,   /* Peer's DP sec install */
866 	WL_NAN_EVENT_TXS			= 31,   /* for tx status of follow-up and SDFs */
867 	WL_NAN_EVENT_DW_START			= 32,	/* dw start */
868 	WL_NAN_EVENT_DW_END			= 33,	/* dw end */
869 	WL_NAN_EVENT_CHAN_BOUNDARY		= 34,	/* channel switch event */
870 	WL_NAN_EVENT_MR_CHANGED			= 35,	/* AMR or IMR changed event during DW */
871 	WL_NAN_EVENT_RNG_RESP_IND		= 36,	/* Range Response Rx */
872 	WL_NAN_EVENT_PEER_SCHED_UPD_NOTIF	= 37,	/* Peer's schedule update notification */
873 	WL_NAN_EVENT_PEER_SCHED_REQ		= 38,	/* Peer's schedule request */
874 	WL_NAN_EVENT_PEER_SCHED_RESP		= 39,	/* Peer's schedule response */
875 	WL_NAN_EVENT_PEER_SCHED_CONF		= 40,	/* Peer's schedule confirm */
876 	WL_NAN_EVENT_SENT_DATAPATH_END		= 41,	/* Sent DP terminate frame */
877 	WL_NAN_EVENT_SLOT_START			= 42,	/* SLOT_START event */
878 	WL_NAN_EVENT_SLOT_END			= 43,	/* SLOT_END event */
879 	WL_NAN_EVENT_HOST_ASSIST_REQ		= 44,	/* Requesting host assist */
880 	WL_NAN_EVENT_RX_MGMT_FRM		= 45,	/* NAN management frame received */
881 	WL_NAN_EVENT_DISC_CACHE_TIMEOUT		= 46,	/* Disc cache timeout */
882 
883 	WL_NAN_EVENT_INVALID				/* delimiter for max value */
884 } nan_app_events_e;
885 
886 #define NAN_EV_MASK(ev)	(1 << (ev - 1))
887 #define IS_NAN_EVT_ON(var, evt) ((var & (1 << (evt-1))) != 0)
888 
889 #define NAN_EV_MASK_SET(var, evt)	\
890 	((evt < WL_NAN_EVMASK_EXTN_LEN * 8) ? \
891 	((*((uint8 *)var + ((evt - 1)/8))) |= (1 << ((evt - 1) %8))) : 0)
892 #define IS_NAN_EVENT_ON(var, evt)	\
893 	((evt < WL_NAN_EVMASK_EXTN_LEN * 8) && \
894 	(((*((uint8 *)var + ((evt - 1)/8))) & (1 << ((evt - 1) %8))) != 0))
895 
896 /*  ******************* end of NAN section *************** */
897 
898 typedef enum wl_scan_events {
899 	WL_SCAN_START = 1,
900 	WL_SCAN_END = 2
901 } wl_scan_events;
902 
903 /* WLC_E_ULP event data */
904 #define WL_ULP_EVENT_VERSION		1
905 #define WL_ULP_DISABLE_CONSOLE		1	/* Disable console message on ULP entry */
906 #define WL_ULP_UCODE_DOWNLOAD		2       /* Download ULP ucode file */
907 
908 typedef struct wl_ulp_event {
909 	uint16 version;
910 	uint16 ulp_dongle_action;
911 } wl_ulp_event_t;
912 
913 /* TCP keepalive event data */
914 typedef BWL_PRE_PACKED_STRUCT struct wl_event_tko {
915 	uint8 index;		/* TCP connection index, 0 to max-1 */
916 	uint8 pad[3];		/* 4-byte struct alignment */
917 } BWL_POST_PACKED_STRUCT wl_event_tko_t;
918 
919 typedef struct {
920 	uint8 radar_type;       /* one of RADAR_TYPE_XXX */
921 	uint16 min_pw;          /* minimum pulse-width (usec * 20) */
922 	uint16 max_pw;          /* maximum pulse-width (usec * 20) */
923 	uint16 min_pri;         /* minimum pulse repetition interval (usec) */
924 	uint16 max_pri;         /* maximum pulse repetition interval (usec) */
925 	uint16 subband;         /* subband/frequency */
926 } radar_detected_event_info_t;
927 typedef struct wl_event_radar_detect_data {
928 
929 	uint32 version;
930 	uint16 current_chanspec; /* chanspec on which the radar is recieved */
931 	uint16 target_chanspec; /*  Target chanspec after detection of radar on current_chanspec */
932 	radar_detected_event_info_t radar_info[2];
933 } wl_event_radar_detect_data_t;
934 
935 #define WL_EVENT_MODESW_VER_1			1
936 #define WL_EVENT_MODESW_VER_CURRENT		WL_EVENT_MODESW_VER_1
937 
938 #define WL_E_MODESW_FLAG_MASK_DEVICE		0x01u /* mask of device: belongs to local or peer */
939 #define WL_E_MODESW_FLAG_MASK_FROM		0x02u /* mask of origin: firmware or user */
940 #define WL_E_MODESW_FLAG_MASK_STATE		0x0Cu /* mask of state: modesw progress state */
941 
942 #define WL_E_MODESW_FLAG_DEVICE_LOCAL		0x00u /* flag - device: info is about self/local */
943 #define WL_E_MODESW_FLAG_DEVICE_PEER		0x01u /* flag - device: info is about peer */
944 
945 #define WL_E_MODESW_FLAG_FROM_FIRMWARE		0x00u /* flag - from: request is from firmware */
946 #define WL_E_MODESW_FLAG_FROM_USER		0x02u /* flag - from: request is from user/iov */
947 
948 #define WL_E_MODESW_FLAG_STATE_REQUESTED	0x00u /* flag - state: mode switch request */
949 #define WL_E_MODESW_FLAG_STATE_INITIATED	0x04u /* flag - state: switch initiated */
950 #define WL_E_MODESW_FLAG_STATE_COMPLETE		0x08u /* flag - state: switch completed/success */
951 #define WL_E_MODESW_FLAG_STATE_FAILURE		0x0Cu /* flag - state: failed to switch */
952 
953 /* Get sizeof *X including variable data's length where X is pointer to wl_event_mode_switch_t */
954 #define WL_E_MODESW_SIZE(X) (sizeof(*(X)) + (X)->length)
955 
956 /* Get variable data's length where X is pointer to wl_event_mode_switch_t */
957 #define WL_E_MODESW_DATA_SIZE(X) (((X)->length > sizeof(*(X))) ? ((X)->length - sizeof(*(X))) : 0)
958 
959 #define WL_E_MODESW_REASON_UNKNOWN		0u /* reason: UNKNOWN */
960 #define WL_E_MODESW_REASON_ACSD			1u /* reason: ACSD (based on events from FW */
961 #define WL_E_MODESW_REASON_OBSS_DBS		2u /* reason: OBSS DBS (eg. on interference) */
962 #define WL_E_MODESW_REASON_DFS			3u /* reason: DFS (eg. on subband radar) */
963 #define WL_E_MODESW_REASON_DYN160		4u /* reason: DYN160 (160/2x2 - 80/4x4) */
964 
965 /* event structure for WLC_E_MODE_SWITCH */
966 typedef struct {
967 	uint16 version;
968 	uint16 length;	/* size including 'data' field */
969 	uint16 opmode_from;
970 	uint16 opmode_to;
971 	uint32 flags;	/* bit 0: peer(/local==0);
972 			 * bit 1: user(/firmware==0);
973 			 * bits 3,2: 00==requested, 01==initiated,
974 			 *           10==complete, 11==failure;
975 			 * rest: reserved
976 			 */
977 	uint16 reason;	/* value 0: unknown, 1: ACSD, 2: OBSS_DBS,
978 			 *       3: DFS, 4: DYN160, rest: reserved
979 			 */
980 	uint16 data_offset;	/* offset to 'data' from beginning of this struct.
981 				 * fields may be added between data_offset and data
982 				 */
983 	/* ADD NEW FIELDS HERE */
984 	uint8 data[];	/* reason specific data; could be empty */
985 } wl_event_mode_switch_t;
986 
987 /* when reason in WLC_E_MODE_SWITCH is DYN160, data will carry the following structure */
988 typedef struct {
989 	uint16 trigger;		/* value 0: MU to SU, 1: SU to MU, 2: metric_dyn160, 3:re-/assoc,
990 				 *       4: disassoc, 5: rssi, 6: traffic, 7: interference,
991 				 *       8: chanim_stats
992 				 */
993 	struct ether_addr sta_addr;	/* causal STA's MAC address when known */
994 	uint16 metric_160_80;		/* latest dyn160 metric */
995 	uint8 nss;		/* NSS of the STA */
996 	uint8 bw;		/* BW of the STA */
997 	int8 rssi;		/* RSSI of the STA */
998 	uint8 traffic;		/* internal metric of traffic */
999 } wl_event_mode_switch_dyn160;
1000 
1001 #define WL_EVENT_FBT_VER_1		1
1002 
1003 #define WL_E_FBT_TYPE_FBT_OTD_AUTH	1
1004 #define WL_E_FBT_TYPE_FBT_OTA_AUTH	2
1005 
1006 /* event structure for WLC_E_FBT */
1007 typedef struct {
1008 	uint16 version;
1009 	uint16 length;	/* size including 'data' field */
1010 	uint16 type; /* value 0: unknown, 1: FBT OTD Auth Req */
1011 	uint16 data_offset;	/* offset to 'data' from beginning of this struct.
1012 				 * fields may be added between data_offset and data
1013 				 */
1014 	/* ADD NEW FIELDS HERE */
1015 	uint8 data[];	/* type specific data; could be empty */
1016 } wl_event_fbt_t;
1017 
1018 /* TWT Setup Completion is designed to notify the user of TWT Setup process
1019  * status. When 'status' field is value of BCME_OK, the user must check the
1020  * 'setup_cmd' field value in 'wl_twt_sdesc_t' structure that at the end of
1021  * the event data to see the response from the TWT Responding STA; when
1022  * 'status' field is value of BCME_ERROR or non BCME_OK, user must not use
1023  * anything from 'wl_twt_sdesc_t' structure as it is the TWT Requesting STA's
1024  * own TWT parameter.
1025  */
1026 
1027 #define WL_TWT_SETUP_CPLT_VER	0
1028 
1029 /* TWT Setup Completion event data */
1030 typedef struct wl_twt_setup_cplt {
1031 	uint16 version;
1032 	uint16 length;	/* the byte count of fields from 'dialog' onwards */
1033 	uint8 dialog;	/* the dialog token user supplied to the TWT setup API */
1034 	uint8 pad[3];
1035 	int32 status;
1036 	/* wl_twt_sdesc_t desc; - defined in wlioctl.h */
1037 } wl_twt_setup_cplt_t;
1038 
1039 #define WL_INVALID_IE_EVENT_VERSION	0
1040 
1041 /* Invalid IE Event data */
1042 typedef struct wl_invalid_ie_event {
1043 	uint16 version;
1044 	uint16 len;      /* Length of the invalid IE copy */
1045 	uint16 type;     /* Type/subtype of the frame which contains the invalid IE */
1046 	uint16 error;    /* error code of the wrong IE, defined in ie_error_code_t */
1047 	uint8  ie[];     /* Variable length buffer for the invalid IE copy */
1048 } wl_invalid_ie_event_t;
1049 
1050 /* Fixed header portion of Invalid IE Event */
1051 typedef struct wl_invalid_ie_event_hdr {
1052 	uint16 version;
1053 	uint16 len;      /* Length of the invalid IE copy */
1054 	uint16 type;     /* Type/subtype of the frame which contains the invalid IE */
1055 	uint16 error;    /* error code of the wrong IE, defined in ie_error_code_t */
1056 	/* var length IE data follows */
1057 } wl_invalid_ie_event_hdr_t;
1058 
1059 typedef enum ie_error_code {
1060 	IE_ERROR_OUT_OF_RANGE = 0x01
1061 } ie_error_code_t;
1062 
1063 /* This marks the end of a packed structure section. */
1064 #include <packed_section_end.h>
1065 
1066 /* reason of channel switch */
1067 typedef enum {
1068 	CHANSW_DFS = 10,	/* channel switch due to DFS module */
1069 	CHANSW_HOMECH_REQ = 14, /* channel switch due to HOME Channel Request */
1070 	CHANSW_STA = 15,	/* channel switch due to STA */
1071 	CHANSW_SOFTAP = 16,	/* channel switch due to SodtAP */
1072 	CHANSW_AIBSS = 17,	/* channel switch due to AIBSS */
1073 	CHANSW_NAN = 18,	/* channel switch due to NAN */
1074 	CHANSW_NAN_DISC = 19,	/* channel switch due to NAN Disc */
1075 	CHANSW_NAN_SCHED = 20,	/* channel switch due to NAN Sched */
1076 	CHANSW_TDLS = 26,	/* channel switch due to TDLS */
1077 	CHANSW_PROXD = 27,	/* channel switch due to PROXD */
1078 	CHANSW_SLOTTED_BSS = 28, /* channel switch due to slotted bss */
1079 	CHANSW_SLOTTED_CMN_SYNC = 29, /* channel switch due to Common Sync Layer */
1080 	CHANSW_SLOTTED_BSS_CAL = 30,	/* channel switch due to Cal request from slotted bss */
1081 	CHANSW_MAX_NUMBER = 31	/* max channel switch reason */
1082 } wl_chansw_reason_t;
1083 
1084 #define CHANSW_REASON(reason)	(1 << reason)
1085 
1086 #define EVENT_AGGR_DATA_HDR_LEN	8
1087 
1088 typedef struct event_aggr_data {
1089 	uint16  num_events; /* No of events aggregated */
1090 	uint16	len;	/* length of the aggregated events, excludes padding */
1091 	uint8	pad[4]; /* Padding to make aggr event packet header aligned
1092 					 * on 64-bit boundary, for a 64-bit host system.
1093 					 */
1094 	uint8	data[];	/* Aggregate buffer containing Events */
1095 } event_aggr_data_t;
1096 
1097 /* WLC_E_TVPM_MITIGATION event structure version */
1098 #define WL_TVPM_MITIGATION_VERSION 1
1099 
1100 /* TVPM mitigation on/off status bits */
1101 #define WL_TVPM_MITIGATION_TXDC		0x1
1102 #define WL_TVPM_MITIGATION_TXPOWER	0x2
1103 #define WL_TVPM_MITIGATION_TXCHAINS	0x4
1104 
1105 /* Event structure for WLC_E_TVPM_MITIGATION */
1106 typedef struct wl_event_tvpm_mitigation {
1107 	uint16 version;		/* structure version */
1108 	uint16 length;		/* length of this structure */
1109 	uint32 timestamp_ms;	/* millisecond timestamp */
1110 	uint8 slice;		/* slice number */
1111 	uint8 pad;
1112 	uint16 on_off;		/* mitigation status bits */
1113 } wl_event_tvpm_mitigation_t;
1114 
1115 /* Event structures for sub health checks of PHY */
1116 
1117 #define WL_PHY_HC_DESENSE_STATS_VER (1)
1118 typedef struct wl_hc_desense_stats {
1119 	uint16 version;
1120 	uint16 chanspec;
1121 	int8 allowed_weakest_rssi; /* based on weakest link RSSI */
1122 	uint8 ofdm_desense; /* Desense requested for OFDM */
1123 	uint8 bphy_desense; /* Desense requested for bphy */
1124 	int8 glitch_upd_wait; /* wait post ACI mitigation */
1125 } wl_hc_desense_stats_v1_t;
1126 
1127 #define WL_PHY_HC_TEMP_STATS_VER (1)
1128 typedef struct wl_hc_temp_stats {
1129 	uint16 version;
1130 	uint16 chanspec;
1131 	int16 curtemp; /* Temperature */
1132 	uint8 temp_disthresh; /* Threshold to reduce tx chain */
1133 	uint8 temp_enthresh; /* Threshold to increase tx chains */
1134 	uint tempsense_period; /* Temperature check period */
1135 	bool heatedup; /* 1: temp throttling on */
1136 	uint8 bitmap; /* Indicating rx and tx chains */
1137 	uint8 pad[2];
1138 } wl_hc_temp_stats_v1_t;
1139 
1140 #define WL_PHY_HC_TEMP_STATS_VER_2 (2)
1141 typedef struct {
1142 	uint16 version;
1143 	uint16 chanspec;
1144 	int16 curtemp; /* Temperature */
1145 	uint8 pad[2];
1146 } wl_hc_temp_stats_v2_t;
1147 
1148 #define WL_PHY_HC_VCOCAL_STATS_VER (1)
1149 typedef struct wl_hc_vcocal_stats {
1150 	uint16 version;
1151 	uint16 chanspec;
1152 	int16 curtemp;	/* Temperature */
1153 	/* Ring buffer - Maintains history of previous 16 wake/sleep cycles */
1154 	uint16 vcocal_status_wake;
1155 	uint16 vcocal_status_sleep;
1156 	uint16 plllock_status_wake;
1157 	uint16 plllock_status_sleep;
1158 	/* Cal Codes */
1159 	uint16 cc_maincap;
1160 	uint16 cc_secondcap;
1161 	uint16 cc_auxcap;
1162 } wl_hc_vcocal_stats_v1_t;
1163 
1164 #define WL_PHY_HC_TXPWR_STATS_VER (1)
1165 typedef struct wl_hc_tx_stats {
1166 	uint16 version;
1167 	uint16 chanspec;
1168 	int8 tgt_pwr[MAX_PHY_CORE_NUM]; /* Target pwr (qdBm) */
1169 	int8 estPwr[MAX_PHY_CORE_NUM]; /* Rate corrected (qdBm) */
1170 	int8 estPwr_adj[MAX_PHY_CORE_NUM]; /* Max power (qdBm) */
1171 	uint8 baseindex[MAX_PHY_CORE_NUM]; /* Tx base index */
1172 	int16 temp;	/* Temperature */
1173 	uint16 TxCtrlWrd[3]; /* 6 PHY ctrl bytes */
1174 	int8 min_txpower; /* min tx power per ant */
1175 	uint8 pad[3];
1176 } wl_hc_txpwr_stats_v1_t;
1177 
1178 #define WL_PHY_HC_TXPWR_STATS_VER_2 (2)
1179 typedef struct {
1180 	uint16 version;
1181 	uint16 chanspec;
1182 	int8 tgt_pwr[MAX_PHY_CORE_NUM]; /* Target pwr (qdBm) */
1183 	uint8 estPwr[MAX_PHY_CORE_NUM]; /* Rate corrected (qdBm) */
1184 	uint8 estPwr_adj[MAX_PHY_CORE_NUM]; /* Max power (qdBm) */
1185 	uint8 baseindex[MAX_PHY_CORE_NUM]; /* Tx base index */
1186 	int16 temp;	/* Temperature */
1187 	uint16 TxCtrlWrd[3]; /* 6 PHY ctrl bytes */
1188 	int8 min_txpower; /* min tx power per ant */
1189 	uint8 pad[3];
1190 } wl_hc_txpwr_stats_v2_t;
1191 
1192 typedef enum wl_mbo_event_type {
1193 	WL_MBO_E_CELLULAR_NW_SWITCH = 1,
1194 	WL_MBO_E_BTM_RCVD = 2,
1195 	/* ADD before this */
1196 	WL_MBO_E_LAST = 3  /* highest val + 1 for range checking */
1197 } wl_mbo_event_type_t;
1198 
1199 /* WLC_E_MBO event structure version */
1200 #define WL_MBO_EVT_VER 1
1201 
1202 struct wl_event_mbo {
1203 	uint16 version;	/* structure version */
1204 	uint16 length;		/* length of the rest of the structure from type */
1205 	wl_mbo_event_type_t  type;		/* Event type */
1206 	uint8  data[];    /* Variable length data */
1207 };
1208 
1209 /* WLC_E_MBO_CELLULAR_NW_SWITCH event structure version */
1210 #define WL_MBO_CELLULAR_NW_SWITCH_VER 1
1211 
1212 /* WLC_E_MBO_CELLULAR_NW_SWITCH event data */
1213 struct wl_event_mbo_cell_nw_switch {
1214 	uint16 version;		/* structure version */
1215 	uint16 length;		/* length of the rest of the structure from reason */
1216 	/* Reason of switch as per MBO Tech spec */
1217 	uint8 reason;
1218 	/* pad */
1219 	uint8 pad;
1220 	/* delay after which re-association can be tried to current BSS (seconds) */
1221 	uint16 reassoc_delay;
1222 	/* How long current association will be there (milli seconds).
1223 	* This is zero if not known or value is overflowing.
1224 	*/
1225 	uint32 assoc_time_remain;
1226 };
1227 
1228 /* WLC_E_MBO_BTM_RCVD event structure version */
1229 #define WL_BTM_EVENT_DATA_VER_1       1
1230 /* Specific btm event type data */
1231 struct wl_btm_event_type_data {
1232 	uint16	version;
1233 	uint16	len;
1234 	uint8	transition_reason;	/* transition reason code */
1235 	uint8	pad[3];			/* pad */
1236 };
1237 
1238 /* WLC_E_PRUNE event structure version */
1239 #define WL_BSSID_PRUNE_EVT_VER_1	1
1240 /* MBO-OCE params */
1241 struct wl_bssid_prune_evt_info {
1242 	uint16 version;
1243 	uint16 len;
1244 	uint8	SSID[32];
1245 	uint32	time_remaining;		/* Time remaining */
1246 	struct ether_addr BSSID;
1247 	uint8	SSID_len;
1248 	uint8	reason;			/* Reason code */
1249 	int8	rssi_threshold;		/* RSSI threshold */
1250 	uint8	pad[3];			/* pad */
1251 };
1252 
1253 /* WLC_E_HWA Event structure */
1254 typedef struct wl_event_hwa {
1255 	uint16 version; /* structure version */
1256 	uint16 length; /* length of structure */
1257 	uint32 sub_type; /* Sub event type */
1258 	uint8 data[0]; /* variable length data */
1259 } wl_event_hwa_t;
1260 
1261 #define WL_HWA_EVENT_VER	1
1262 
1263 typedef enum wl_event_hwa_subtype {
1264 	WL_HWA_EVENT_SUBTYPE_ERROR = 1,
1265 	WL_HWA_EVENT_SUBTYPE_LAST = 2
1266 } wl_event_hwa_subtype_t;
1267 
1268 /* WLC_E_ADPS status */
1269 enum {
1270 	WL_E_STATUS_ADPS_DEAUTH = 0,
1271 	WL_E_STATUS_ADPS_MAX
1272 };
1273 
1274 /* WLC_E_ADPS event data */
1275 #define WL_EVENT_ADPS_VER_1		1
1276 
1277 /* WLC_E_ADPS event type */
1278 #define WL_E_TYPE_ADPS_BAD_AP		1
1279 
1280 typedef struct wl_event_adps_bad_ap {
1281 	uint32 status;
1282 	uint32 reason;
1283 	struct ether_addr ea;	/* bssid */
1284 } wl_event_adps_bad_ap_t;
1285 
1286 typedef struct wl_event_adps {
1287 	uint16	version;	/* structure version */
1288 	uint16	length;		/* length of structure */
1289 	uint32	type;		/* event type */
1290 	uint8	data[];		/* variable length data */
1291 } wl_event_adps_v1_t;
1292 
1293 typedef wl_event_adps_v1_t wl_event_adps_t;
1294 
1295 #define WLC_USER_E_KEY_UPDATE	1 /* Key add/remove */
1296 
1297 #endif /* _BCMEVENT_H_ */
1298