3d93f441b9ddf7a29964b39e73757670504b9583
[openwrt.git] / package / wificonf / include / proto / bcmevent.h
1 /*
2  * Broadcom Event  protocol definitions
3  *
4  * Copyright 2005, 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  */
16
17 /*
18  * Broadcom Ethernet Events protocol defines 
19  *
20  */
21
22 #ifndef _BCMEVENT_H_
23 #define _BCMEVENT_H_
24
25 /* enable structure packing */
26 #if defined(__GNUC__)
27 #define PACKED  __attribute__((packed))
28 #else
29 #pragma pack(1)
30 #define PACKED
31 #endif
32
33
34
35 #define BCM_EVENT_MSG_VERSION   1
36 #define BCM_MSG_IFNAME_MAX              16
37
38
39 /* flags */
40 #define WLC_EVENT_MSG_LINK              0x01
41 #define WLC_EVENT_MSG_FLUSHTXQ  0x02
42 #define WLC_EVENT_MSG_GROUP             0x04
43
44
45
46 /* theses fields are stored in network order */
47 typedef struct  
48 {
49         uint16  version;
50         uint16  flags;                  /* see flags below */
51         uint32  event_type;             /* Message (see below) */
52         uint32  status;                 /* Status code (see below) */
53         uint32  reason;                 /* Reason code (if applicable) */
54         uint32  auth_type;              /* WLC_E_AUTH */
55         uint32  datalen;                /* data buf */
56         struct ether_addr       addr;   /* Station address (if applicable) */
57         char    ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface*/
58 } PACKED wl_event_msg_t;
59
60 /* used by driver msgs */
61 typedef struct bcm_event {
62         struct ether_header eth;
63         bcmeth_hdr_t            bcm_hdr; 
64         wl_event_msg_t          event;
65         /* data portion follows */
66 } PACKED bcm_event_t;
67
68 #define BCM_MSG_LEN     (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
69
70
71
72 /* Event messages */
73 #define WLC_E_SET_SSID                  0       /* indicates status of set SSID */
74 #define WLC_E_JOIN                      1       /* differentiates join IBSS from found (WLC_E_START) IBSS */
75 #define WLC_E_START                     2       /* STA founded an IBSS or AP started a BSS */
76 #define WLC_E_AUTH                      3       /* 802.11 AUTH request */
77 #define WLC_E_AUTH_IND                  4       /* 802.11 AUTH indication */
78 #define WLC_E_DEAUTH                    5       /* 802.11 DEAUTH request */
79 #define WLC_E_DEAUTH_IND                6       /* 802.11 DEAUTH indication */
80 #define WLC_E_ASSOC                     7       /* 802.11 ASSOC request */
81 #define WLC_E_ASSOC_IND                 8       /* 802.11 ASSOC indication */
82 #define WLC_E_REASSOC                   9       /* 802.11 REASSOC request */
83 #define WLC_E_REASSOC_IND               10      /* 802.11 REASSOC indication */
84 #define WLC_E_DISASSOC                  11      /* 802.11 DISASSOC request */
85 #define WLC_E_DISASSOC_IND              12      /* 802.11 DISASSOC indication */
86 #define WLC_E_QUIET_START               13      /* 802.11h Quiet period started */
87 #define WLC_E_QUIET_END                 14      /* 802.11h Quiet period ended */
88 #define WLC_E_GOT_BEACONS               15      /* internal use: IBSS mode: saw another STA's BEACONS */
89 #define WLC_E_LINK                      16      /* generic link indication */
90 #define WLC_E_MIC_ERROR                 17      /* TKIP MIC error occurred */
91 #define WLC_E_NDIS_LINK                 18      /* NDIS style link indication */
92 #define WLC_E_ROAM                      19      /* roam attempt occurred: indicate status & reason for roam */
93 #define WLC_E_TXFAIL                    20      /* change in dot11FailedCount (txfail) */
94 #define WLC_E_PMKID_CACHE               21      /* WPA2 pmkid cache indication */
95 #define WLC_E_RETROGRADE_TSF            22      /* current AP's TSF value went backward */
96 #define WLC_E_PRUNE                             23      /* AP was pruned from join list for reason */
97 #define WLC_E_AUTOAUTH                  24      /* report AutoAuth table entry match for join attempt */
98 #define WLC_E_EAPOL_MSG                 25      /* Event encapsulating an EAPOL message */
99 #define WLC_E_LAST                      26
100
101 /* Event status codes */
102 #define WLC_E_STATUS_SUCCESS            0
103 #define WLC_E_STATUS_FAIL               1
104 #define WLC_E_STATUS_TIMEOUT            2
105 #define WLC_E_STATUS_NO_NETWORKS        3
106 #define WLC_E_STATUS_ABORT              4
107 #define WLC_E_STATUS_NO_ACK             5
108 #define WLC_E_STATUS_UNSOLICITED        6
109 #define WLC_E_STATUS_ATTEMPT            7
110
111 /* roam reason codes */
112 #define WLC_E_REASON_LOW_RSSI                   1
113 #define WLC_E_REASON_DEAUTH                             2
114 #define WLC_E_REASON_DISASSOC                   3
115 #define WLC_E_REASON_BCNS_LOST                  4
116 #define WLC_E_REASON_FAST_ROAM_FAILED   5
117
118 /* prune reason codes */
119 #define WLC_E_PRUNE_ENCR_MISMATCH               1       /* ecryption mismatch */
120 #define WLC_E_PRUNE_BCAST_BSSID                 2       /* AP uses a broadcast BSSID */
121 #define WLC_E_PRUNE_MAC_DENY                    3       /* STA's MAC addr is in AP's MAC deny list */
122 #define WLC_E_PRUNE_MAC_NA                      4       /* STA's MAC addr is not in AP's MAC allow list */
123 #define WLC_E_PRUNE_REG_PASSV                   5       /* AP not allowed due to regulatory restriction */
124 #define WLC_E_PRUNE_SPCT_MGMT                   6       /* AP does not support STA locale spectrum mgmt */
125 #define WLC_E_PRUNE_RADAR                       7       /* AP is on a radar channel of STA locale */
126 #define WLC_E_RSN_MISMATCH                      8       /* STA does not support AP's RSN */
127 #define WLC_E_PRUNE_NO_COMMON_RATES             9       /* No rates in common with AP */
128 #define WLC_E_PRUNE_BASIC_RATES                 10      /* STA does not support all basic rates of BSS */
129 #define WLC_E_PRUNE_CCXFAST_PREVAP              11      /* CCX FAST ROAM: prune previous AP */
130 #define WLC_E_PRUNE_CIPHER_NA                   12      /* BSS's cipher not supported */
131 #define WLC_E_PRUNE_KNOWN_STA                   13      /* AP is already known to us as a STA */
132
133 /* WLC_SET_CALLBACK data type */
134 typedef struct wlc_event_cb {
135         void (*fn)(void *, bcm_event_t *);      /* Callback function */
136         void *context;                          /* Passed to callback function */
137 } wlc_event_cb_t;
138
139
140
141
142 #undef PACKED
143 #if !defined(__GNUC__)
144 #pragma pack()
145 #endif
146
147 #endif