1/*
2 * Broadcom Event  protocol definitions
3 *
4 * Copyright 2007, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11 *
12 *
13 * Dependencies: proto/bcmeth.h
14 *
15 * $Id: bcmevent.h,v 1.1.1.1 2008/10/15 03:25:54 james26_jang Exp $
16 *
17 */
18
19/*
20 * Broadcom Ethernet Events protocol defines
21 *
22 */
23
24#ifndef _BCMEVENT_H_
25#define _BCMEVENT_H_
26
27/* enable structure packing */
28#if defined(__GNUC__)
29#define	PACKED	__attribute__((packed))
30#else
31#pragma pack(1)
32#define	PACKED
33#endif /* defined(__GNUC__) */
34
35#define BCM_EVENT_MSG_VERSION		1	/* wl_event_msg_t struct version */
36#define BCM_MSG_IFNAME_MAX		16	/* max length of interface name */
37
38/* flags */
39#define WLC_EVENT_MSG_LINK		0x01	/* link is up */
40#define WLC_EVENT_MSG_FLUSHTXQ		0x02	/* flush tx queue on MIC error */
41#define WLC_EVENT_MSG_GROUP		0x04	/* group MIC error */
42
43/* these fields are stored in network order */
44typedef struct
45{
46	uint16	version;
47	uint16	flags;			/* see flags below */
48	uint32	event_type;		/* Message (see below) */
49	uint32	status;			/* Status code (see below) */
50	uint32	reason;			/* Reason code (if applicable) */
51	uint32	auth_type;		/* WLC_E_AUTH */
52	uint32	datalen;		/* data buf */
53	struct ether_addr	addr;	/* Station address (if applicable) */
54	char	ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
55} PACKED wl_event_msg_t;
56
57/* used by driver msgs */
58typedef struct bcm_event {
59	struct ether_header eth;
60	bcmeth_hdr_t		bcm_hdr;
61	wl_event_msg_t		event;
62	/* data portion follows */
63} PACKED bcm_event_t;
64
65#define BCM_MSG_LEN	(sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
66
67/* Event messages */
68#define WLC_E_SET_SSID		0	/* indicates status of set SSID */
69#define WLC_E_JOIN		1	/* differentiates join IBSS from found (WLC_E_START) IBSS */
70#define WLC_E_START		2	/* STA founded an IBSS or AP started a BSS */
71#define WLC_E_AUTH		3	/* 802.11 AUTH request */
72#define WLC_E_AUTH_IND		4	/* 802.11 AUTH indication */
73#define WLC_E_DEAUTH		5	/* 802.11 DEAUTH request */
74#define WLC_E_DEAUTH_IND	6	/* 802.11 DEAUTH indication */
75#define WLC_E_ASSOC		7	/* 802.11 ASSOC request */
76#define WLC_E_ASSOC_IND		8	/* 802.11 ASSOC indication */
77#define WLC_E_REASSOC		9	/* 802.11 REASSOC request */
78#define WLC_E_REASSOC_IND	10	/* 802.11 REASSOC indication */
79#define WLC_E_DISASSOC		11	/* 802.11 DISASSOC request */
80#define WLC_E_DISASSOC_IND	12	/* 802.11 DISASSOC indication */
81#define WLC_E_QUIET_START	13	/* 802.11h Quiet period started */
82#define WLC_E_QUIET_END		14	/* 802.11h Quiet period ended */
83#define WLC_E_BEACON_RX		15	/* BEACONS received/lost indication */
84#define WLC_E_LINK		16	/* generic link indication */
85#define WLC_E_MIC_ERROR		17	/* TKIP MIC error occurred */
86#define WLC_E_NDIS_LINK		18	/* NDIS style link indication */
87#define WLC_E_ROAM		19	/* roam attempt occurred: indicate status & reason */
88#define WLC_E_TXFAIL		20	/* change in dot11FailedCount (txfail) */
89#define WLC_E_PMKID_CACHE	21	/* WPA2 pmkid cache indication */
90#define WLC_E_RETROGRADE_TSF	22	/* current AP's TSF value went backward */
91#define WLC_E_PRUNE		23	/* AP was pruned from join list for reason */
92#define WLC_E_AUTOAUTH		24	/* report AutoAuth table entry match for join attempt */
93#define WLC_E_EAPOL_MSG		25	/* Event encapsulating an EAPOL message */
94#define WLC_E_SCAN_COMPLETE	26	/* Scan results are ready or scan was aborted */
95#define WLC_E_ADDTS_IND		27	/* indicate to host addts fail/success */
96#define WLC_E_DELTS_IND		28	/* indicate to host delts fail/success */
97#define WLC_E_BCNSENT_IND	29	/* indicate to host of beacon transmit */
98#define WLC_E_BCNRX_MSG		30	/* Send the received beacon up to the host */
99#define WLC_E_BCNLOST_MSG	31	/* indicate to host loss of beacon */
100#define WLC_E_ROAM_PREP		32	/* before attempting to roam */
101#define WLC_E_PFN_NET_FOUND	33	/* PFN network found event */
102#define WLC_E_PFN_NET_LOST	34	/* PFN network lost event */
103#define WLC_E_RESET_COMPLETE	35
104#define WLC_E_JOIN_START	36
105#define WLC_E_ROAM_START	37
106#define WLC_E_ASSOC_START	38
107#define WLC_E_IBSS_ASSOC	39
108#define WLC_E_RADIO		40
109#define WLC_E_PROBREQ_MSG	41
110#define WLC_E_LAST		42	/* highest val + 1 for range checking */
111
112/* Event status codes */
113#define WLC_E_STATUS_SUCCESS		0	/* operation was successful */
114#define WLC_E_STATUS_FAIL		1	/* operation failed */
115#define WLC_E_STATUS_TIMEOUT		2	/* operation timed out */
116#define WLC_E_STATUS_NO_NETWORKS	3	/* failed due to no matching network found */
117#define WLC_E_STATUS_ABORT		4	/* operation was aborted */
118#define WLC_E_STATUS_NO_ACK		5	/* protocol failure: packet not ack'd */
119#define WLC_E_STATUS_UNSOLICITED	6	/* AUTH or ASSOC packet was unsolicited */
120#define WLC_E_STATUS_ATTEMPT		7	/* attempt to assoc to an auto auth configuration */
121#define WLC_E_STATUS_PARTIAL		8	/* scan results are incomplete */
122#define WLC_E_STATUS_NEWSCAN	9	/* scan aborted by another scan */
123#define WLC_E_STATUS_NEWASSOC	10	/* scan aborted due to assoc in progress */
124#define WLC_E_STATUS_11HQUIET	11	/* 802.11h quiet period started */
125#define WLC_E_STATUS_SUPPRESS	12	/* user disabled scanning (WLC_SET_SCANSUPPRESS) */
126#define WLC_E_STATUS_NOCHANS	13	/* no allowable channels to scan */
127#define WLC_E_STATUS_CCXFASTRM	14	/* scan aborted due to CCX fast roam */
128
129/* roam reason codes */
130#define WLC_E_REASON_INITIAL_ASSOC	0	/* initial assoc */
131#define WLC_E_REASON_LOW_RSSI		1	/* roamed due to low RSSI */
132#define WLC_E_REASON_DEAUTH		2	/* roamed due to DEAUTH indication */
133#define WLC_E_REASON_DISASSOC		3	/* roamed due to DISASSOC indication */
134#define WLC_E_REASON_BCNS_LOST		4	/* roamed due to lost beacons */
135#define WLC_E_REASON_FAST_ROAM_FAILED	5	/* roamed due to fast roam failure */
136#define WLC_E_REASON_DIRECTED_ROAM	6	/* roamed due to request by AP */
137#define WLC_E_REASON_TSPEC_REJECTED	7	/* roamed due to TSPEC rejection */
138#define WLC_E_REASON_BETTER_AP		8	/* roamed due to finding better AP */
139
140/* prune reason codes */
141#define WLC_E_PRUNE_ENCR_MISMATCH	1	/* encryption mismatch */
142#define WLC_E_PRUNE_BCAST_BSSID		2	/* AP uses a broadcast BSSID */
143#define WLC_E_PRUNE_MAC_DENY		3	/* STA's MAC addr is in AP's MAC deny list */
144#define WLC_E_PRUNE_MAC_NA		4	/* STA's MAC addr is not in AP's MAC allow list */
145#define WLC_E_PRUNE_REG_PASSV		5	/* AP not allowed due to regulatory restriction */
146#define WLC_E_PRUNE_SPCT_MGMT		6	/* AP does not support STA locale spectrum mgmt */
147#define WLC_E_PRUNE_RADAR		7	/* AP is on a radar channel of STA locale */
148#define WLC_E_RSN_MISMATCH		8	/* STA does not support AP's RSN */
149#define WLC_E_PRUNE_NO_COMMON_RATES	9	/* No rates in common with AP */
150#define WLC_E_PRUNE_BASIC_RATES		10	/* STA does not support all basic rates of BSS */
151#define WLC_E_PRUNE_CIPHER_NA		12	/* BSS's cipher not supported */
152#define WLC_E_PRUNE_KNOWN_STA		13	/* AP is already known to us as a STA */
153#define WLC_E_PRUNE_WDS_PEER		15	/* AP is already known to us as a WDS peer */
154#define WLC_E_PRUNE_QBSS_LOAD		16	/* QBSS LOAD - AAC is too low */
155#define WLC_E_PRUNE_HOME_AP		17	/* prune home AP */
156
157#undef PACKED
158#if !defined(__GNUC__)
159#pragma pack()
160#endif /* PACKED */
161
162#endif /* _BCMEVENT_H_ */
163