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