1/*
2 * Broadcom Event  protocol definitions
3 *
4 * Copyright (C) 2015, Broadcom Corporation. All Rights Reserved.
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 477020 2014-05-12 09:39:58Z $
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/* PFN best network batching event, re-use obsolete WLC_E_PFN_SCAN_COMPLETE */
150#define WLC_E_PFN_BEST_BATCHING	57
151#define WLC_E_EXTLOG_MSG	58
152#define WLC_E_ACTION_FRAME      59	/* Action frame Rx */
153#define WLC_E_ACTION_FRAME_COMPLETE	60	/* Action frame Tx complete */
154#define WLC_E_PRE_ASSOC_IND	61	/* assoc request received */
155#define WLC_E_PRE_REASSOC_IND	62	/* re-assoc request received */
156#define WLC_E_CHANNEL_ADOPTED	63
157#define WLC_E_AP_STARTED	64	/* AP started */
158#define WLC_E_DFS_AP_STOP	65	/* AP stopped due to DFS */
159#define WLC_E_DFS_AP_RESUME	66	/* AP resumed due to DFS */
160#define WLC_E_WAI_STA_EVENT	67	/* WAI stations event */
161#define WLC_E_WAI_MSG 		68	/* event encapsulating an WAI message */
162#define WLC_E_ESCAN_RESULT 	69	/* escan result event */
163#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 	70	/* action frame off channel complete */
164#define WLC_E_PROBRESP_MSG	71	/* probe response received */
165#define WLC_E_P2P_PROBREQ_MSG	72	/* P2P Probe request received */
166#define WLC_E_DCS_REQUEST	73
167#define WLC_E_FIFO_CREDIT_MAP	74	/* credits for D11 FIFOs. [AC0,AC1,AC2,AC3,BC_MC,ATIM] */
168#define WLC_E_ACTION_FRAME_RX	75	/* Received action frame event WITH
169					 * wl_event_rx_frame_data_t header
170					 */
171#define WLC_E_WAKE_EVENT	76	/* Wake Event timer fired, used for wake WLAN test mode */
172#define WLC_E_RM_COMPLETE	77	/* Radio measurement complete */
173#define WLC_E_HTSFSYNC		78	/* Synchronize TSF with the host */
174#define WLC_E_OVERLAY_REQ	79	/* request an overlay IOCTL/iovar from the host */
175#define WLC_E_CSA_COMPLETE_IND		80	/* 802.11 CHANNEL SWITCH ACTION completed */
176#define WLC_E_EXCESS_PM_WAKE_EVENT	81	/* excess PM Wake Event to inform host  */
177#define WLC_E_PFN_SCAN_NONE		82	/* no PFN networks around */
178/* PFN BSSID network found event, conflict/share with  WLC_E_PFN_SCAN_NONE */
179#define WLC_E_PFN_BSSID_NET_FOUND	82
180#define WLC_E_PFN_SCAN_ALLGONE		83	/* last found PFN network gets lost */
181/* PFN BSSID network lost event, conflict/share with WLC_E_PFN_SCAN_ALLGONE */
182#define WLC_E_PFN_BSSID_NET_LOST	83
183#define WLC_E_GTK_PLUMBED		84
184#define WLC_E_ASSOC_IND_NDIS		85	/* 802.11 ASSOC indication for NDIS only */
185#define WLC_E_REASSOC_IND_NDIS		86	/* 802.11 REASSOC indication for NDIS only */
186#define WLC_E_ASSOC_REQ_IE		87
187#define WLC_E_ASSOC_RESP_IE		88
188#define WLC_E_ASSOC_RECREATED		89	/* association recreated on resume */
189#define WLC_E_ACTION_FRAME_RX_NDIS	90	/* rx action frame event for NDIS only */
190#define WLC_E_AUTH_REQ			91	/* authentication request received */
191#define WLC_E_TDLS_PEER_EVENT		92	/* discovered peer, connected/disconnected peer */
192#define WLC_E_SPEEDY_RECREATE_FAIL	93	/* fast assoc recreation failed */
193#define WLC_E_NATIVE			94	/* port-specific event and payload (e.g. NDIS) */
194#define WLC_E_PKTDELAY_IND		95	/* event for tx pkt delay suddently jump */
195#define WLC_E_AWDL_AW			96	/* AWDL AW period starts */
196#define WLC_E_AWDL_ROLE			97	/* AWDL Master/Slave/NE master role event */
197#define WLC_E_AWDL_EVENT		98	/* Generic AWDL event */
198#define WLC_E_PSTA_PRIMARY_INTF_IND	99	/* psta primary interface indication */
199#define WLC_E_EVENT_100			100
200#define WLC_E_BEACON_FRAME_RX		101
201#define WLC_E_SERVICE_FOUND		102	/* desired service found */
202#define WLC_E_GAS_FRAGMENT_RX		103	/* GAS fragment received */
203#define WLC_E_GAS_COMPLETE		104	/* GAS sessions all complete */
204#define WLC_E_P2PO_ADD_DEVICE		105	/* New device found by p2p offload */
205#define WLC_E_P2PO_DEL_DEVICE		106	/* device has been removed by p2p offload */
206#define WLC_E_WNM_STA_SLEEP		107	/* WNM event to notify STA enter sleep mode */
207#define WLC_E_TXFAIL_THRESH		108	/* Indication of MAC tx failures (exhaustion of
208						 * 802.11 retries) exceeding threshold(s)
209						 */
210#define WLC_E_PROXD			109	/* Proximity Detection event */
211#define WLC_E_IBSS_COALESCE		110	/* IBSS Coalescing */
212#define WLC_E_AIBSS_TXFAIL		110	/* TXFAIL event for AIBSS, re using event 110 */
213#define WLC_E_AWDL_AW_EXT_END		111	/* AWDL extended period ends */
214#define WLC_E_AWDL_AW_EXT_START		112	/* AWDL AW extension start */
215#define WLC_E_AWDL_AW_START		113	/* AWDL start Event to inform host  */
216#define WLC_E_AWDL_RADIO_OFF		114	/* Radio Off  */
217#define WLC_E_BSS_LOAD			114	/* Inform host of beacon bss load */
218#define WLC_E_AWDL_PEER_STATE		115	/* AWDL peer state open/close */
219#define WLC_E_AWDL_SYNC_STATE_CHANGED	116	/* AWDL sync role changed */
220#define WLC_E_AWDL_CHIP_RESET		117	/* informs the interface of a chip rest */
221#define WLC_E_AWDL_INTERLEAVED_SCAN_START		118
222#define WLC_E_AWDL_INTERLEAVED_SCAN_STOP		119
223#define WLC_E_AWDL_PEER_CACHE_CONTROL			120
224#define WLC_E_CSA_START_IND		121
225#define WLC_E_CSA_DONE_IND		122
226#define WLC_E_CSA_FAILURE_IND		123
227#define WLC_E_CCA_CHAN_QUAL		124	/* CCA based channel quality report */
228#define WLC_E_BSSID		125	/* to report change in BSSID while roaming */
229#define WLC_E_TX_STAT_ERROR		126	/* tx error indication */
230#define WLC_E_BCMC_CREDIT_SUPPORT	127	/* credit check for BCMC supported */
231#define WLC_E_AUTHORIZED	136	/* a STA been authroized for traffic */
232#define WLC_E_PROBREQ_MSG_RX	137 /* probe req with wl_event_rx_frame_data_t header */
233#define WLC_E_PROBREQ_RSSI_RATE       138      /* probe request rssi & rate */
234#define WLC_E_LAST			139	/* highest val + 1 for range checking */
235#if (WLC_E_LAST > 139)
236#error "WLC_E_LAST: Invalid value for last event; must be <= 138."
237#endif /* WLC_E_LAST */
238
239/* define an API for getting the string name of an event */
240extern const char *bcmevent_get_name(uint event_type);
241
242
243
244/* Event status codes */
245#define WLC_E_STATUS_SUCCESS		0	/* operation was successful */
246#define WLC_E_STATUS_FAIL		1	/* operation failed */
247#define WLC_E_STATUS_TIMEOUT		2	/* operation timed out */
248#define WLC_E_STATUS_NO_NETWORKS	3	/* failed due to no matching network found */
249#define WLC_E_STATUS_ABORT		4	/* operation was aborted */
250#define WLC_E_STATUS_NO_ACK		5	/* protocol failure: packet not ack'd */
251#define WLC_E_STATUS_UNSOLICITED	6	/* AUTH or ASSOC packet was unsolicited */
252#define WLC_E_STATUS_ATTEMPT		7	/* attempt to assoc to an auto auth configuration */
253#define WLC_E_STATUS_PARTIAL		8	/* scan results are incomplete */
254#define WLC_E_STATUS_NEWSCAN		9	/* scan aborted by another scan */
255#define WLC_E_STATUS_NEWASSOC		10	/* scan aborted due to assoc in progress */
256#define WLC_E_STATUS_11HQUIET		11	/* 802.11h quiet period started */
257#define WLC_E_STATUS_SUPPRESS		12	/* user disabled scanning (WLC_SET_SCANSUPPRESS) */
258#define WLC_E_STATUS_NOCHANS		13	/* no allowable channels to scan */
259#define WLC_E_STATUS_CS_ABORT		15	/* abort channel select */
260#define WLC_E_STATUS_ERROR		16	/* request failed due to error */
261#define WLC_E_STATUS_INVALID 0xff  /* Invalid status code to init variables. */
262
263
264/* roam reason codes */
265#define WLC_E_REASON_INITIAL_ASSOC	0	/* initial assoc */
266#define WLC_E_REASON_LOW_RSSI		1	/* roamed due to low RSSI */
267#define WLC_E_REASON_DEAUTH		2	/* roamed due to DEAUTH indication */
268#define WLC_E_REASON_DISASSOC		3	/* roamed due to DISASSOC indication */
269#define WLC_E_REASON_BCNS_LOST		4	/* roamed due to lost beacons */
270
271/* Roam codes used primarily by CCX */
272#define WLC_E_REASON_FAST_ROAM_FAILED	5	/* roamed due to fast roam failure */
273#define WLC_E_REASON_DIRECTED_ROAM	6	/* roamed due to request by AP */
274#define WLC_E_REASON_TSPEC_REJECTED	7	/* roamed due to TSPEC rejection */
275#define WLC_E_REASON_BETTER_AP		8	/* roamed due to finding better AP */
276#define WLC_E_REASON_MINTXRATE		9	/* roamed because at mintxrate for too long */
277#define WLC_E_REASON_TXFAIL		10	/* We can hear AP, but AP can't hear us */
278/* retained for precommit auto-merging errors; remove once all branches are synced */
279#define WLC_E_REASON_REQUESTED_ROAM	11
280#define WLC_E_REASON_BSSTRANS_REQ	11	/* roamed due to BSS Transition request by AP */
281
282/* prune reason codes */
283#define WLC_E_PRUNE_ENCR_MISMATCH	1	/* encryption mismatch */
284#define WLC_E_PRUNE_BCAST_BSSID		2	/* AP uses a broadcast BSSID */
285#define WLC_E_PRUNE_MAC_DENY		3	/* STA's MAC addr is in AP's MAC deny list */
286#define WLC_E_PRUNE_MAC_NA		4	/* STA's MAC addr is not in AP's MAC allow list */
287#define WLC_E_PRUNE_REG_PASSV		5	/* AP not allowed due to regulatory restriction */
288#define WLC_E_PRUNE_SPCT_MGMT		6	/* AP does not support STA locale spectrum mgmt */
289#define WLC_E_PRUNE_RADAR		7	/* AP is on a radar channel of STA locale */
290#define WLC_E_RSN_MISMATCH		8	/* STA does not support AP's RSN */
291#define WLC_E_PRUNE_NO_COMMON_RATES	9	/* No rates in common with AP */
292#define WLC_E_PRUNE_BASIC_RATES		10	/* STA does not support all basic rates of BSS */
293#define WLC_E_PRUNE_CIPHER_NA		12	/* BSS's cipher not supported */
294#define WLC_E_PRUNE_KNOWN_STA		13	/* AP is already known to us as a STA */
295#define WLC_E_PRUNE_WDS_PEER		15	/* AP is already known to us as a WDS peer */
296#define WLC_E_PRUNE_QBSS_LOAD		16	/* QBSS LOAD - AAC is too low */
297#define WLC_E_PRUNE_HOME_AP		17	/* prune home AP */
298#define WLC_E_PRUNE_AUTH_RESP_MAC	20	/* suppress auth resp by MAC filter */
299
300/* WPA failure reason codes carried in the WLC_E_PSK_SUP event */
301#define WLC_E_SUP_OTHER			0	/* Other reason */
302#define WLC_E_SUP_DECRYPT_KEY_DATA	1	/* Decryption of key data failed */
303#define WLC_E_SUP_BAD_UCAST_WEP128	2	/* Illegal use of ucast WEP128 */
304#define WLC_E_SUP_BAD_UCAST_WEP40	3	/* Illegal use of ucast WEP40 */
305#define WLC_E_SUP_UNSUP_KEY_LEN		4	/* Unsupported key length */
306#define WLC_E_SUP_PW_KEY_CIPHER		5	/* Unicast cipher mismatch in pairwise key */
307#define WLC_E_SUP_MSG3_TOO_MANY_IE	6	/* WPA IE contains > 1 RSN IE in key msg 3 */
308#define WLC_E_SUP_MSG3_IE_MISMATCH	7	/* WPA IE mismatch in key message 3 */
309#define WLC_E_SUP_NO_INSTALL_FLAG	8	/* INSTALL flag unset in 4-way msg */
310#define WLC_E_SUP_MSG3_NO_GTK		9	/* encapsulated GTK missing from msg 3 */
311#define WLC_E_SUP_GRP_KEY_CIPHER	10	/* Multicast cipher mismatch in group key */
312#define WLC_E_SUP_GRP_MSG1_NO_GTK	11	/* encapsulated GTK missing from group msg 1 */
313#define WLC_E_SUP_GTK_DECRYPT_FAIL	12	/* GTK decrypt failure */
314#define WLC_E_SUP_SEND_FAIL		13	/* message send failure */
315#define WLC_E_SUP_DEAUTH		14	/* received FC_DEAUTH */
316#define WLC_E_SUP_WPA_PSK_TMO		15	/* WPA PSK 4-way handshake timeout */
317
318/* probsup reason codes */
319#define WLC_E_PROBSUP_OTHER_SUP  0  /* suppress with other reasons */
320#define WLC_E_PROBSUP_AUTH_SUP   1  /* suppress auth resp. */
321#define WLC_E_PROBSUP_PROBE_SUP  2  /* suppress probe resp. */
322
323
324/* Event data for events that include frames received over the air */
325/* WLC_E_PROBRESP_MSG
326 * WLC_E_P2P_PROBREQ_MSG
327 * WLC_E_ACTION_FRAME_RX
328 */
329typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data {
330	uint16	version;
331	uint16	channel;	/* Matches chanspec_t format from bcmwifi_channels.h */
332	int32	rssi;
333	uint32	mactime;
334	uint32	rate;
335} BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_t;
336
337#define BCM_RX_FRAME_DATA_VERSION 1
338
339/* WLC_E_IF event data */
340typedef struct wl_event_data_if {
341	uint8 ifidx;		/* RTE virtual device index (for dongle) */
342	uint8 opcode;		/* see I/F opcode */
343	uint8 reserved;		/* bit mask (WLC_E_IF_FLAGS_XXX ) */
344	uint8 bssidx;		/* bsscfg index */
345	uint8 role;		/* see I/F role */
346} wl_event_data_if_t;
347
348/* opcode in WLC_E_IF event */
349#define WLC_E_IF_ADD		1	/* bsscfg add */
350#define WLC_E_IF_DEL		2	/* bsscfg delete */
351#define WLC_E_IF_CHANGE		3	/* bsscfg role change */
352
353/* I/F role code in WLC_E_IF event */
354#define WLC_E_IF_ROLE_STA		0	/* Infra STA */
355#define WLC_E_IF_ROLE_AP		1	/* Access Point */
356#define WLC_E_IF_ROLE_WDS		2	/* WDS link */
357#define WLC_E_IF_ROLE_P2P_GO		3	/* P2P Group Owner */
358#define WLC_E_IF_ROLE_P2P_CLIENT	4	/* P2P Client */
359#define WLC_E_IF_ROLE_AWDL              7       /* AWDL */
360
361/* WLC_E_RSSI event data */
362typedef struct wl_event_data_rssi {
363	int32 rssi;
364	int32 snr;
365	int32 noise;
366} wl_event_data_rssi_t;
367
368/* WLC_E_IF flag */
369#define WLC_E_IF_FLAGS_BSSCFG_NOIF	0x1	/* no host I/F creation needed */
370
371/* Reason codes for LINK */
372#define WLC_E_LINK_BCN_LOSS	1	/* Link down because of beacon loss */
373#define WLC_E_LINK_DISASSOC	2	/* Link down because of disassoc */
374#define WLC_E_LINK_ASSOC_REC	3	/* Link down because assoc recreate failed */
375#define WLC_E_LINK_BSSCFG_DIS	4	/* Link down due to bsscfg down */
376
377/* reason codes for WLC_E_OVERLAY_REQ event */
378#define WLC_E_OVL_DOWNLOAD		0	/* overlay download request */
379#define WLC_E_OVL_UPDATE_IND	1	/* device indication of host overlay update */
380
381/* reason codes for WLC_E_TDLS_PEER_EVENT event */
382#define WLC_E_TDLS_PEER_DISCOVERED		0	/* peer is ready to establish TDLS */
383#define WLC_E_TDLS_PEER_CONNECTED		1
384#define WLC_E_TDLS_PEER_DISCONNECTED	2
385
386
387/* GAS event data */
388typedef BWL_PRE_PACKED_STRUCT struct wl_event_gas {
389	uint16	channel;		/* channel of GAS protocol */
390	uint8	dialog_token;	/* GAS dialog token */
391	uint8	fragment_id;	/* fragment id */
392	uint16	status_code;	/* status code on GAS completion */
393	uint16 	data_len;		/* length of data to follow */
394	uint8	data[1];		/* variable length specified by data_len */
395} BWL_POST_PACKED_STRUCT wl_event_gas_t;
396
397/* service discovery TLV */
398typedef BWL_PRE_PACKED_STRUCT struct wl_sd_tlv {
399	uint16	length;			/* length of response_data */
400	uint8	protocol;		/* service protocol type */
401	uint8	transaction_id;		/* service transaction id */
402	uint8	status_code;		/* status code */
403	uint8	data[1];		/* response data */
404} BWL_POST_PACKED_STRUCT wl_sd_tlv_t;
405
406/* service discovery event data */
407typedef BWL_PRE_PACKED_STRUCT struct wl_event_sd {
408	uint16	channel;		/* channel */
409	uint8	count;			/* number of tlvs */
410	wl_sd_tlv_t	tlv[1];		/* service discovery TLV */
411} BWL_POST_PACKED_STRUCT wl_event_sd_t;
412
413/* Reason codes for WLC_E_PROXD */
414#define WLC_E_PROXD_FOUND		1	/* Found a proximity device */
415#define WLC_E_PROXD_GONE		2	/* Lost a proximity device */
416#define WLC_E_PROXD_START		3	/* used by: target  */
417#define WLC_E_PROXD_STOP		4	/* used by: target   */
418#define WLC_E_PROXD_COMPLETED		5	/* used by: initiator completed */
419#define WLC_E_PROXD_ERROR		6	/* used by both initiator and target */
420#define WLC_E_PROXD_COLLECT_START	7	/* used by: target & initiator */
421#define WLC_E_PROXD_COLLECT_STOP	8	/* used by: target */
422#define WLC_E_PROXD_COLLECT_COMPLETED	9	/* used by: initiator completed */
423#define WLC_E_PROXD_COLLECT_ERROR	10	/* used by both initiator and target */
424
425/*  proxd_event data */
426typedef struct ftm_sample {
427	uint32 value;	/* RTT in ns */
428	int8 rssi;	/* RSSI */
429} ftm_sample_t;
430
431typedef BWL_PRE_PACKED_STRUCT struct proxd_event_data {
432	uint16 ver;			/* version */
433	uint16 mode;			/* mode: target/initiator */
434	uint16 method;			/* method: rssi/TOF/AOA */
435	uint8  err_code;		/* error classification */
436	uint8  TOF_type;		/* one way or two way TOF */
437	uint8  OFDM_frame_type;		/* legacy or VHT */
438	uint8  bandwidth;		/* Bandwidth is 20, 40,80, MHZ */
439	struct ether_addr peer_mac;	/* (e.g for tgt:initiator's */
440	uint32 distance;		/* dst to tgt, units meter */
441	uint32 meanrtt;			/* mean delta */
442	uint32 modertt;			/* Mode delta */
443	uint32 medianrtt;		/* median RTT */
444	uint32 sdrtt;			/* Standard deviation of RTT */
445	int    gdcalcresult;		/* Software or Hardware Kind of redundant, but if */
446					/* frame type is VHT, then we should do it by hardware */
447	int16  avg_rssi;		/* avg rssi accroos the ftm frames */
448	int16  validfrmcnt;		/* Firmware's valid frame counts */
449	char  *peer_router_info;	/* Peer router information if available in TLV, */
450					/* We will add this field later  */
451	int32 var1;			/* average of group delay */
452	int32 var2;			/* average of threshold crossing */
453	int32 var3;			/* difference between group delay and threshold crossing */
454					/* raw Fine Time Measurements (ftm) data */
455	uint16 ftm_unit;		/* ftm cnt resolution in picoseconds , 6250ps - default */
456	uint16 ftm_cnt;			/*  num of rtd measurments/length in the ftm buffer  */
457	ftm_sample_t ftm_buff[1];	/* 1 ... ftm_cnt  */
458} BWL_POST_PACKED_STRUCT wl_proxd_event_data_t;
459
460/* WLC_E_AWDL_AW event data */
461typedef BWL_PRE_PACKED_STRUCT struct awdl_aws_event_data {
462	uint32	fw_time;			/* firmware PMU time */
463	struct	ether_addr current_master;	/* Current master Mac addr */
464	uint16	aw_counter;			/* AW seq# */
465	uint8	aw_ext_count;			/* AW extension count */
466	uint8	aw_role;			/* AW role */
467	uint8	flags;				/* AW event flag */
468	uint16	aw_chan;
469	uint8	infra_rssi;			/* rssi on the infra channel */
470	uint32 	infra_rxbcn_count; 	/* number of beacons received */
471} BWL_POST_PACKED_STRUCT awdl_aws_event_data_t;
472
473/* For awdl_aws_event_data_t.flags */
474#define AWDL_AW_LAST_EXT	0x01
475
476/* WLC_E_AWDL_OOB_AF_STATUS event data */
477typedef BWL_PRE_PACKED_STRUCT struct awdl_oob_af_status_data {
478	uint32	tx_time_diff;
479	uint16	pkt_tag;
480	uint8	tx_chan;
481} BWL_POST_PACKED_STRUCT awdl_oob_af_status_data_t;
482
483/* Video Traffic Interference Monitor Event */
484#define INTFER_EVENT_VERSION		1
485#define INTFER_STREAM_TYPE_NONTCP	1
486#define INTFER_STREAM_TYPE_TCP		2
487#define WLINTFER_STATS_NSMPLS		4
488typedef struct wl_intfer_event {
489	uint16 version;			/* version */
490	uint16 status;			/* status */
491	uint8 txfail_histo[WLINTFER_STATS_NSMPLS]; /* txfail histo */
492} wl_intfer_event_t;
493
494/* WLC_E_PSTA_PRIMARY_INTF_IND event data */
495typedef struct wl_psta_primary_intf_event {
496	struct ether_addr prim_ea;	/* primary intf ether addr */
497} wl_psta_primary_intf_event_t;
498
499/* This marks the end of a packed structure section. */
500#include <packed_section_end.h>
501
502//#ifdef SMARTMESH
503typedef struct _wlc_mgmt_macevt_info
504{
505	int8 rssi;
506	uint32 rspec;
507	struct ether_addr da;
508	uint8 SSID_len;	/* the length of SSID */
509	uint8 SSID[32];	/* SSID string */
510	bool vht_cap;
511	uint16 vht_rx_mcs_map;
512	uint16 vht_tx_mcs_map;
513	bool ht_cap;
514	uint8 ht_supp_mcs[16];
515	uint16 channel;
516} wlc_mgmt_macevt_info;
517//#endif
518#endif /* _BCMEVENT_H_ */
519