1/*
2 * Broadcom Event  protocol definitions
3 *
4 * Copyright (C) 1999-2013, Broadcom Corporation
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 * Dependencies: proto/bcmeth.h
19 *
20 * $Id: bcmevent.h 386716 2013-02-21 18:16:10Z $
21 *
22 */
23
24/*
25 * Broadcom Ethernet Events protocol defines
26 *
27 */
28
29#ifndef _BCMEVENT_H_
30#define _BCMEVENT_H_
31
32#ifndef _TYPEDEFS_H_
33#include <typedefs.h>
34#endif
35/* #include <ethernet.h> -- TODO: req., excluded to overwhelming coupling (break up ethernet.h) */
36#include <proto/bcmeth.h>
37
38/* This marks the start of a packed structure section. */
39#include <packed_section_start.h>
40
41#define BCM_EVENT_MSG_VERSION		2	/* wl_event_msg_t struct version */
42#define BCM_MSG_IFNAME_MAX		16	/* max length of interface name */
43
44/* flags */
45#define WLC_EVENT_MSG_LINK		0x01	/* link is up */
46#define WLC_EVENT_MSG_FLUSHTXQ		0x02	/* flush tx queue on MIC error */
47#define WLC_EVENT_MSG_GROUP		0x04	/* group MIC error */
48#define WLC_EVENT_MSG_UNKBSS		0x08	/* unknown source bsscfg */
49#define WLC_EVENT_MSG_UNKIF		0x10	/* unknown source OS i/f */
50
51/* these fields are stored in network order */
52
53/* version 1 */
54typedef BWL_PRE_PACKED_STRUCT struct
55{
56	uint16	version;
57	uint16	flags;			/* see flags below */
58	uint32	event_type;		/* Message (see below) */
59	uint32	status;			/* Status code (see below) */
60	uint32	reason;			/* Reason code (if applicable) */
61	uint32	auth_type;		/* WLC_E_AUTH */
62	uint32	datalen;		/* data buf */
63	struct ether_addr	addr;	/* Station address (if applicable) */
64	char	ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
65} BWL_POST_PACKED_STRUCT wl_event_msg_v1_t;
66
67/* the current version */
68typedef BWL_PRE_PACKED_STRUCT struct
69{
70	uint16	version;
71	uint16	flags;			/* see flags below */
72	uint32	event_type;		/* Message (see below) */
73	uint32	status;			/* Status code (see below) */
74	uint32	reason;			/* Reason code (if applicable) */
75	uint32	auth_type;		/* WLC_E_AUTH */
76	uint32	datalen;		/* data buf */
77	struct ether_addr	addr;	/* Station address (if applicable) */
78	char	ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
79	uint8	ifidx;			/* destination OS i/f index */
80	uint8	bsscfgidx;		/* source bsscfg index */
81} BWL_POST_PACKED_STRUCT wl_event_msg_t;
82
83/* used by driver msgs */
84typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
85	struct ether_header eth;
86	bcmeth_hdr_t		bcm_hdr;
87	wl_event_msg_t		event;
88	/* data portion follows */
89} BWL_POST_PACKED_STRUCT bcm_event_t;
90
91#define BCM_MSG_LEN	(sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
92
93/* Event messages */
94#define WLC_E_SET_SSID		0	/* indicates status of set SSID */
95#define WLC_E_JOIN		1	/* differentiates join IBSS from found (WLC_E_START) IBSS */
96#define WLC_E_START		2	/* STA founded an IBSS or AP started a BSS */
97#define WLC_E_AUTH		3	/* 802.11 AUTH request */
98#define WLC_E_AUTH_IND		4	/* 802.11 AUTH indication */
99#define WLC_E_DEAUTH		5	/* 802.11 DEAUTH request */
100#define WLC_E_DEAUTH_IND	6	/* 802.11 DEAUTH indication */
101#define WLC_E_ASSOC		7	/* 802.11 ASSOC request */
102#define WLC_E_ASSOC_IND		8	/* 802.11 ASSOC indication */
103#define WLC_E_REASSOC		9	/* 802.11 REASSOC request */
104#define WLC_E_REASSOC_IND	10	/* 802.11 REASSOC indication */
105#define WLC_E_DISASSOC		11	/* 802.11 DISASSOC request */
106#define WLC_E_DISASSOC_IND	12	/* 802.11 DISASSOC indication */
107#define WLC_E_QUIET_START	13	/* 802.11h Quiet period started */
108#define WLC_E_QUIET_END		14	/* 802.11h Quiet period ended */
109#define WLC_E_BEACON_RX		15	/* BEACONS received/lost indication */
110#define WLC_E_LINK		16	/* generic link indication */
111#define WLC_E_MIC_ERROR		17	/* TKIP MIC error occurred */
112#define WLC_E_NDIS_LINK		18	/* NDIS style link indication */
113#define WLC_E_ROAM		19	/* roam attempt occurred: indicate status & reason */
114#define WLC_E_TXFAIL		20	/* change in dot11FailedCount (txfail) */
115#define WLC_E_PMKID_CACHE	21	/* WPA2 pmkid cache indication */
116#define WLC_E_RETROGRADE_TSF	22	/* current AP's TSF value went backward */
117#define WLC_E_PRUNE		23	/* AP was pruned from join list for reason */
118#define WLC_E_AUTOAUTH		24	/* report AutoAuth table entry match for join attempt */
119#define WLC_E_EAPOL_MSG		25	/* Event encapsulating an EAPOL message */
120#define WLC_E_SCAN_COMPLETE	26	/* Scan results are ready or scan was aborted */
121#define WLC_E_ADDTS_IND		27	/* indicate to host addts fail/success */
122#define WLC_E_DELTS_IND		28	/* indicate to host delts fail/success */
123#define WLC_E_BCNSENT_IND	29	/* indicate to host of beacon transmit */
124#define WLC_E_BCNRX_MSG		30	/* Send the received beacon up to the host */
125#define WLC_E_BCNLOST_MSG	31	/* indicate to host loss of beacon */
126#define WLC_E_ROAM_PREP		32	/* before attempting to roam */
127#define WLC_E_PFN_NET_FOUND	33	/* PFN network found event */
128#define WLC_E_PFN_NET_LOST	34	/* PFN network lost event */
129#define WLC_E_RESET_COMPLETE	35
130#define WLC_E_JOIN_START	36
131#define WLC_E_ROAM_START	37
132#define WLC_E_ASSOC_START	38
133#define WLC_E_IBSS_ASSOC	39
134#define WLC_E_RADIO		40
135#define WLC_E_PSM_WATCHDOG	41	/* PSM microcode watchdog fired */
136#define WLC_E_PROBREQ_MSG       44      /* probe request received */
137#define WLC_E_SCAN_CONFIRM_IND  45
138#define WLC_E_PSK_SUP		46	/* WPA Handshake fail */
139#define WLC_E_COUNTRY_CODE_CHANGED	47
140#define	WLC_E_EXCEEDED_MEDIUM_TIME	48	/* WMMAC excedded medium time */
141#define WLC_E_ICV_ERROR		49	/* WEP ICV error occurred */
142#define WLC_E_UNICAST_DECODE_ERROR	50	/* Unsupported unicast encrypted frame */
143#define WLC_E_MULTICAST_DECODE_ERROR	51	/* Unsupported multicast encrypted frame */
144#define WLC_E_TRACE		52
145#define WLC_E_IF		54	/* I/F change (for dongle host notification) */
146#define WLC_E_P2P_DISC_LISTEN_COMPLETE	55	/* listen state expires */
147#define WLC_E_RSSI		56	/* indicate RSSI change based on configured levels */
148#define WLC_E_PFN_SCAN_COMPLETE	57	/* PFN completed scan of network list */
149#define WLC_E_EXTLOG_MSG	58
150#define WLC_E_ACTION_FRAME      59 	/* Action frame Rx */
151#define WLC_E_ACTION_FRAME_COMPLETE	60	/* Action frame Tx complete */
152#define WLC_E_PRE_ASSOC_IND	61	/* assoc request received */
153#define WLC_E_PRE_REASSOC_IND	62	/* re-assoc request received */
154#define WLC_E_CHANNEL_ADOPTED	63
155#define WLC_E_AP_STARTED	64	/* AP started */
156#define WLC_E_DFS_AP_STOP	65	/* AP stopped due to DFS */
157#define WLC_E_DFS_AP_RESUME	66	/* AP resumed due to DFS */
158#define WLC_E_WAI_STA_EVENT	67	/* WAI stations event */
159#define WLC_E_WAI_MSG 		68	/* event encapsulating an WAI message */
160#define WLC_E_ESCAN_RESULT 	69	/* escan result event */
161#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 	70	/* action frame off channel complete */
162#define WLC_E_PROBRESP_MSG	71	/* probe response received */
163#define WLC_E_P2P_PROBREQ_MSG	72	/* P2P Probe request received */
164#define WLC_E_DCS_REQUEST	73
165#define WLC_E_FIFO_CREDIT_MAP	74	/* credits for D11 FIFOs. [AC0,AC1,AC2,AC3,BC_MC,ATIM] */
166#define WLC_E_ACTION_FRAME_RX	75	/* Received action frame event WITH
167					 * wl_event_rx_frame_data_t header
168					 */
169#define WLC_E_WAKE_EVENT	76	/* Wake Event timer fired, used for wake WLAN test mode */
170#define WLC_E_RM_COMPLETE	77	/* Radio measurement complete */
171#define WLC_E_HTSFSYNC		78	/* Synchronize TSF with the host */
172#define WLC_E_OVERLAY_REQ	79	/* request an overlay IOCTL/iovar from the host */
173#define WLC_E_CSA_COMPLETE_IND		80	/* 802.11 CHANNEL SWITCH ACTION completed */
174#define WLC_E_EXCESS_PM_WAKE_EVENT	81	/* excess PM Wake Event to inform host  */
175#define WLC_E_PFN_SCAN_NONE		82	/* no PFN networks around */
176#define WLC_E_PFN_SCAN_ALLGONE		83	/* last found PFN network gets lost */
177#define WLC_E_GTK_PLUMBED		84
178#define WLC_E_ASSOC_IND_NDIS		85	/* 802.11 ASSOC indication for NDIS only */
179#define WLC_E_REASSOC_IND_NDIS		86	/* 802.11 REASSOC indication for NDIS only */
180#define WLC_E_ASSOC_REQ_IE		87
181#define WLC_E_ASSOC_RESP_IE		88
182#define WLC_E_ASSOC_RECREATED		89	/* association recreated on resume */
183#define WLC_E_ACTION_FRAME_RX_NDIS	90	/* rx action frame event for NDIS only */
184#define WLC_E_AUTH_REQ			91	/* authentication request received */
185#define WLC_E_TDLS_PEER_EVENT		92	/* discovered peer, connected/disconnected peer */
186#define WLC_E_SPEEDY_RECREATE_FAIL	93	/* fast assoc recreation failed */
187#define WLC_E_NATIVE			94	/* port-specific event and payload (e.g. NDIS) */
188#define WLC_E_PKTDELAY_IND		95	/* event for tx pkt delay suddently jump */
189#define WLC_E_AWDL_AW			96	/* AWDL AW period starts */
190#define WLC_E_AWDL_ROLE			97	/* AWDL Master/Slave/NE master role event */
191#define WLC_E_AWDL_EVENT		98	/* Generic AWDL event */
192#ifdef WLNIC
193#define WLC_E_NIC_AF_TXS		99	/* NIC AF txstatus */
194#define WLC_E_NIC_NIC_REPORT		100	/* NIC period report */
195#endif
196#define WLC_E_BEACON_FRAME_RX		101
197#define WLC_E_SERVICE_FOUND		102	/* desired service found */
198#define WLC_E_GAS_FRAGMENT_RX		103	/* GAS fragment received */
199#define WLC_E_GAS_COMPLETE		104	/* GAS sessions all complete */
200#define WLC_E_P2PO_ADD_DEVICE		105	/* New device found by p2p offload */
201#define WLC_E_P2PO_DEL_DEVICE		106	/* device has been removed by p2p offload */
202#define WLC_E_WNM_STA_SLEEP		107	/* WNM event to notify STA enter sleep mode */
203#define WLC_E_NONE			108	/* event removed, free to be reused */
204#define WLC_E_PROXD			109	/* Proximity Detection event */
205#define WLC_E_IBSS_COALESCE		110	/* IBSS Coalescing */
206#define WLC_E_AWDL_AW_EXT_END		111	/* AWDL extended period ends */
207#define WLC_E_AWDL_AW_EXT_START		112	/* SWDL AW extension start */
208#define WLC_E_AWDL_AW_START		113	/* AWDL start Event to inform host  */
209#define WLC_E_AWDL_RADIO_OFF		114	/* Radio Off  */
210#define WLC_E_AWDL_PEER_STATE		115	/* AWDL peer state open/close */
211#define WLC_E_AWDL_SYNC_STATE_CHANGED	116	/* AWDL sync role changed */
212#define WLC_E_AWDL_CHIP_RESET		117	/* infroms the interface of a chip rest */
213#define WLC_E_AWDL_INTERLEAVED_SCAN_START		118
214#define WLC_E_AWDL_INTERLEAVED_SCAN_STOP		119
215#define WLC_E_AWDL_PEER_CACHE_CONTROL			120
216#define WLC_E_CSA_START_IND		121
217#define WLC_E_CSA_DONE_IND		122
218#define WLC_E_CSA_FAILURE_IND		123
219#define WLC_E_CCA_CHAN_QUAL		124	/* CCA based channel quality report */
220#define WLC_E_LAST			125	/* highest val + 1 for range checking */
221
222
223/* Table of event name strings for UIs and debugging dumps */
224typedef struct {
225	uint event;
226	const char *name;
227} bcmevent_name_t;
228
229extern const bcmevent_name_t	bcmevent_names[];
230extern const int		bcmevent_names_size;
231
232/* Event status codes */
233#define WLC_E_STATUS_SUCCESS		0	/* operation was successful */
234#define WLC_E_STATUS_FAIL		1	/* operation failed */
235#define WLC_E_STATUS_TIMEOUT		2	/* operation timed out */
236#define WLC_E_STATUS_NO_NETWORKS	3	/* failed due to no matching network found */
237#define WLC_E_STATUS_ABORT		4	/* operation was aborted */
238#define WLC_E_STATUS_NO_ACK		5	/* protocol failure: packet not ack'd */
239#define WLC_E_STATUS_UNSOLICITED	6	/* AUTH or ASSOC packet was unsolicited */
240#define WLC_E_STATUS_ATTEMPT		7	/* attempt to assoc to an auto auth configuration */
241#define WLC_E_STATUS_PARTIAL		8	/* scan results are incomplete */
242#define WLC_E_STATUS_NEWSCAN		9	/* scan aborted by another scan */
243#define WLC_E_STATUS_NEWASSOC		10	/* scan aborted due to assoc in progress */
244#define WLC_E_STATUS_11HQUIET		11	/* 802.11h quiet period started */
245#define WLC_E_STATUS_SUPPRESS		12	/* user disabled scanning (WLC_SET_SCANSUPPRESS) */
246#define WLC_E_STATUS_NOCHANS		13	/* no allowable channels to scan */
247#define WLC_E_STATUS_CS_ABORT		15	/* abort channel select */
248#define WLC_E_STATUS_ERROR		16	/* request failed due to error */
249
250/* roam reason codes */
251#define WLC_E_REASON_INITIAL_ASSOC	0	/* initial assoc */
252#define WLC_E_REASON_LOW_RSSI		1	/* roamed due to low RSSI */
253#define WLC_E_REASON_DEAUTH		2	/* roamed due to DEAUTH indication */
254#define WLC_E_REASON_DISASSOC		3	/* roamed due to DISASSOC indication */
255#define WLC_E_REASON_BCNS_LOST		4	/* roamed due to lost beacons */
256
257/* Roam codes used primarily by CCX */
258#define WLC_E_REASON_FAST_ROAM_FAILED	5	/* roamed due to fast roam failure */
259#define WLC_E_REASON_DIRECTED_ROAM	6	/* roamed due to request by AP */
260#define WLC_E_REASON_TSPEC_REJECTED	7	/* roamed due to TSPEC rejection */
261#define WLC_E_REASON_BETTER_AP		8	/* roamed due to finding better AP */
262#define WLC_E_REASON_MINTXRATE		9	/* roamed because at mintxrate for too long */
263#define WLC_E_REASON_TXFAIL		10	/* We can hear AP, but AP can't hear us */
264
265#define WLC_E_REASON_REQUESTED_ROAM 11	/* roamed due to BSS Mgmt Transition request by AP */
266
267
268/* prune reason codes */
269#define WLC_E_PRUNE_ENCR_MISMATCH	1	/* encryption mismatch */
270#define WLC_E_PRUNE_BCAST_BSSID		2	/* AP uses a broadcast BSSID */
271#define WLC_E_PRUNE_MAC_DENY		3	/* STA's MAC addr is in AP's MAC deny list */
272#define WLC_E_PRUNE_MAC_NA		4	/* STA's MAC addr is not in AP's MAC allow list */
273#define WLC_E_PRUNE_REG_PASSV		5	/* AP not allowed due to regulatory restriction */
274#define WLC_E_PRUNE_SPCT_MGMT		6	/* AP does not support STA locale spectrum mgmt */
275#define WLC_E_PRUNE_RADAR		7	/* AP is on a radar channel of STA locale */
276#define WLC_E_RSN_MISMATCH		8	/* STA does not support AP's RSN */
277#define WLC_E_PRUNE_NO_COMMON_RATES	9	/* No rates in common with AP */
278#define WLC_E_PRUNE_BASIC_RATES		10	/* STA does not support all basic rates of BSS */
279#define WLC_E_PRUNE_CIPHER_NA		12	/* BSS's cipher not supported */
280#define WLC_E_PRUNE_KNOWN_STA		13	/* AP is already known to us as a STA */
281#define WLC_E_PRUNE_WDS_PEER		15	/* AP is already known to us as a WDS peer */
282#define WLC_E_PRUNE_QBSS_LOAD		16	/* QBSS LOAD - AAC is too low */
283#define WLC_E_PRUNE_HOME_AP		17	/* prune home AP */
284
285/* WPA failure reason codes carried in the WLC_E_PSK_SUP event */
286#define WLC_E_SUP_OTHER			0	/* Other reason */
287#define WLC_E_SUP_DECRYPT_KEY_DATA	1	/* Decryption of key data failed */
288#define WLC_E_SUP_BAD_UCAST_WEP128	2	/* Illegal use of ucast WEP128 */
289#define WLC_E_SUP_BAD_UCAST_WEP40	3	/* Illegal use of ucast WEP40 */
290#define WLC_E_SUP_UNSUP_KEY_LEN		4	/* Unsupported key length */
291#define WLC_E_SUP_PW_KEY_CIPHER		5	/* Unicast cipher mismatch in pairwise key */
292#define WLC_E_SUP_MSG3_TOO_MANY_IE	6	/* WPA IE contains > 1 RSN IE in key msg 3 */
293#define WLC_E_SUP_MSG3_IE_MISMATCH	7	/* WPA IE mismatch in key message 3 */
294#define WLC_E_SUP_NO_INSTALL_FLAG	8	/* INSTALL flag unset in 4-way msg */
295#define WLC_E_SUP_MSG3_NO_GTK		9	/* encapsulated GTK missing from msg 3 */
296#define WLC_E_SUP_GRP_KEY_CIPHER	10	/* Multicast cipher mismatch in group key */
297#define WLC_E_SUP_GRP_MSG1_NO_GTK	11	/* encapsulated GTK missing from group msg 1 */
298#define WLC_E_SUP_GTK_DECRYPT_FAIL	12	/* GTK decrypt failure */
299#define WLC_E_SUP_SEND_FAIL		13	/* message send failure */
300#define WLC_E_SUP_DEAUTH		14	/* received FC_DEAUTH */
301#define WLC_E_SUP_WPA_PSK_TMO		15	/* WPA PSK 4-way handshake timeout */
302
303/* Event data for events that include frames received over the air */
304/* WLC_E_PROBRESP_MSG
305 * WLC_E_P2P_PROBREQ_MSG
306 * WLC_E_ACTION_FRAME_RX
307 */
308#ifdef WLAWDL
309#define WLC_E_AWDL_SCAN_START		1	/* Scan start indication to host */
310#define WLC_E_AWDL_SCAN_DONE		0	/* Scan Done indication to host */
311
312#define WLC_E_AWDL_RX_ACT_FRAME					1
313#define WLC_E_AWDL_RX_PRB_RESP					2
314
315#endif
316typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data {
317	uint16	version;
318	uint16	channel;	/* Matches chanspec_t format from bcmwifi_channels.h */
319	int32	rssi;
320	uint32	mactime;
321	uint32	rate;
322} BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_t;
323
324#define BCM_RX_FRAME_DATA_VERSION 1
325
326/* WLC_E_IF event data */
327typedef struct wl_event_data_if {
328	uint8 ifidx;		/* RTE virtual device index (for dongle) */
329	uint8 opcode;		/* see I/F opcode */
330	uint8 reserved;		/* bit mask (WLC_E_IF_FLAGS_XXX ) */
331	uint8 bssidx;		/* bsscfg index */
332	uint8 role;		/* see I/F role */
333} wl_event_data_if_t;
334
335/* opcode in WLC_E_IF event */
336#define WLC_E_IF_ADD		1	/* bsscfg add */
337#define WLC_E_IF_DEL		2	/* bsscfg delete */
338#define WLC_E_IF_CHANGE		3	/* bsscfg role change */
339
340/* I/F role code in WLC_E_IF event */
341#define WLC_E_IF_ROLE_STA		0	/* Infra STA */
342#define WLC_E_IF_ROLE_AP		1	/* Access Point */
343#define WLC_E_IF_ROLE_WDS		2	/* WDS link */
344#define WLC_E_IF_ROLE_P2P_GO		3	/* P2P Group Owner */
345#define WLC_E_IF_ROLE_P2P_CLIENT	4	/* P2P Client */
346
347/* WLC_E_RSSI event data */
348typedef struct wl_event_data_rssi {
349	int32 rssi;
350	int32 snr;
351	int32 noise;
352} wl_event_data_rssi_t;
353
354/* WLC_E_IF flag */
355#define WLC_E_IF_FLAGS_BSSCFG_NOIF	0x1	/* no host I/F creation needed */
356
357/* Reason codes for LINK */
358#define WLC_E_LINK_BCN_LOSS	1	/* Link down because of beacon loss */
359#define WLC_E_LINK_DISASSOC	2	/* Link down because of disassoc */
360#define WLC_E_LINK_ASSOC_REC	3	/* Link down because assoc recreate failed */
361#define WLC_E_LINK_BSSCFG_DIS	4	/* Link down due to bsscfg down */
362
363/* reason codes for WLC_E_OVERLAY_REQ event */
364#define WLC_E_OVL_DOWNLOAD		0	/* overlay download request */
365#define WLC_E_OVL_UPDATE_IND	1	/* device indication of host overlay update */
366
367/* reason codes for WLC_E_TDLS_PEER_EVENT event */
368#define WLC_E_TDLS_PEER_DISCOVERED		0	/* peer is ready to establish TDLS */
369#define WLC_E_TDLS_PEER_CONNECTED		1
370#define WLC_E_TDLS_PEER_DISCONNECTED	2
371
372#ifdef WLAWDL
373/* WLC_E_AWDL_EVENT subtypes */
374#define WLC_E_AWDL_SCAN_STATUS	0
375#define WLC_E_AWDL_RX_ACT_FRAME	1
376#define WLC_E_AWDL_RX_PRB_RESP	2
377#define WLC_E_AWDL_PHYCAL_STATUS	3
378#define WLC_E_AWDL_WOWL_NULLPKT	4
379#define WLC_E_AWDL_OOB_AF_STATUS	5
380
381/* WLC_E_AWDL_SCAN_STATUS status values */
382#define WLC_E_AWDL_SCAN_START		1	/* Scan start indication to host */
383#define WLC_E_AWDL_SCAN_DONE		0	/* Scan Done indication to host */
384#define WLC_E_AWDL_PHYCAL_START		1	/* Phy calibration start indication to host */
385#define WLC_E_AWDL_PHYCAL_DONE		0	/* Phy calibration done indication to host */
386#endif
387
388/* GAS event data */
389typedef BWL_PRE_PACKED_STRUCT struct wl_event_gas {
390	uint16	channel;		/* channel of GAS protocol */
391	uint8	dialog_token;	/* GAS dialog token */
392	uint8	fragment_id;	/* fragment id */
393	uint16	status_code;	/* status code on GAS completion */
394	uint16 	data_len;		/* length of data to follow */
395	uint8	data[1];		/* variable length specified by data_len */
396} BWL_POST_PACKED_STRUCT wl_event_gas_t;
397
398/* service discovery TLV */
399typedef BWL_PRE_PACKED_STRUCT struct wl_sd_tlv {
400	uint16	length;			/* length of response_data */
401	uint8	protocol;		/* service protocol type */
402	uint8	transaction_id;		/* service transaction id */
403	uint8	status_code;		/* status code */
404	uint8	data[1];		/* response data */
405} BWL_POST_PACKED_STRUCT wl_sd_tlv_t;
406
407/* service discovery event data */
408typedef BWL_PRE_PACKED_STRUCT struct wl_event_sd {
409	uint16	channel;		/* channel */
410	uint8	count;			/* number of tlvs */
411	wl_sd_tlv_t	tlv[1];		/* service discovery TLV */
412} BWL_POST_PACKED_STRUCT wl_event_sd_t;
413
414/* Reason codes for WLC_E_PROXD */
415#define WLC_E_PROXD_FOUND	1	/* Found a proximity device */
416#define WLC_E_PROXD_GONE	2	/* Lost a proximity device */
417
418/* WLC_E_AWDL_AW event data */
419typedef BWL_PRE_PACKED_STRUCT struct awdl_aws_event_data {
420	uint32	fw_time;			/* firmware PMU time */
421	struct	ether_addr current_master;	/* Current master Mac addr */
422	uint16	aw_counter;			/* AW seq# */
423	uint8	aw_ext_count;			/* AW extension count */
424	uint8	aw_role;			/* AW role */
425	uint8	flags;				/* AW event flag */
426	uint16	aw_chan;
427} BWL_POST_PACKED_STRUCT awdl_aws_event_data_t;
428
429/* For awdl_aws_event_data_t.flags */
430#define AWDL_AW_LAST_EXT	0x01
431
432/* This marks the end of a packed structure section. */
433#include <packed_section_end.h>
434
435#endif /* _BCMEVENT_H_ */
436