194aa27d37d72e1f4e82754578b288e1d162358c
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / drivers / net / wireless / bcmdhd4361 / include / bcmevent.h
1 /*
2 * Broadcom Event protocol definitions
3 *
4 * Dependencies: bcmeth.h
5 *
6 * Copyright (C) 1999-2019, 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 * Notwithstanding the above, under no circumstances may you combine this
23 * software in any way with any other Broadcom software provided under a license
24 * other than the GPL, without Broadcom's express prior written consent.
25 *
26 *
27 * <<Broadcom-WL-IPTag/Open:>>
28 *
29 * $Id: bcmevent.h 759112 2018-04-24 01:34:08Z $
30 *
31 */
32
33 /*
34 * Broadcom Ethernet Events protocol defines
35 *
36 */
37
38 #ifndef _BCMEVENT_H_
39 #define _BCMEVENT_H_
40
41 #include <typedefs.h>
42 /* #include <ethernet.h> -- TODO: req., excluded to overwhelming coupling (break up ethernet.h) */
43 #include <bcmeth.h>
44 #if defined(DNGL_EVENT_SUPPORT)
45 #include <dnglevent.h>
46 #endif // endif
47
48 /* This marks the start of a packed structure section. */
49 #include <packed_section_start.h>
50
51 #define BCM_EVENT_MSG_VERSION 2 /* wl_event_msg_t struct version */
52 #define BCM_MSG_IFNAME_MAX 16 /* max length of interface name */
53
54 /* flags */
55 #define WLC_EVENT_MSG_LINK 0x01 /* link is up */
56 #define WLC_EVENT_MSG_FLUSHTXQ 0x02 /* flush tx queue on MIC error */
57 #define WLC_EVENT_MSG_GROUP 0x04 /* group MIC error */
58 #define WLC_EVENT_MSG_UNKBSS 0x08 /* unknown source bsscfg */
59 #define WLC_EVENT_MSG_UNKIF 0x10 /* unknown source OS i/f */
60
61 /* these fields are stored in network order */
62
63 /* version 1 */
64 typedef BWL_PRE_PACKED_STRUCT struct
65 {
66 uint16 version;
67 uint16 flags; /* see flags below */
68 uint32 event_type; /* Message (see below) */
69 uint32 status; /* Status code (see below) */
70 uint32 reason; /* Reason code (if applicable) */
71 uint32 auth_type; /* WLC_E_AUTH */
72 uint32 datalen; /* data buf */
73 struct ether_addr addr; /* Station address (if applicable) */
74 char ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
75 } BWL_POST_PACKED_STRUCT wl_event_msg_v1_t;
76
77 /* the current version */
78 typedef BWL_PRE_PACKED_STRUCT struct
79 {
80 uint16 version;
81 uint16 flags; /* see flags below */
82 uint32 event_type; /* Message (see below) */
83 uint32 status; /* Status code (see below) */
84 uint32 reason; /* Reason code (if applicable) */
85 uint32 auth_type; /* WLC_E_AUTH */
86 uint32 datalen; /* data buf */
87 struct ether_addr addr; /* Station address (if applicable) */
88 char ifname[BCM_MSG_IFNAME_MAX]; /* name of the packet incoming interface */
89 uint8 ifidx; /* destination OS i/f index */
90 uint8 bsscfgidx; /* source bsscfg index */
91 } BWL_POST_PACKED_STRUCT wl_event_msg_t;
92
93 /* used by driver msgs */
94 typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
95 struct ether_header eth;
96 bcmeth_hdr_t bcm_hdr;
97 wl_event_msg_t event;
98 /* data portion follows */
99 } BWL_POST_PACKED_STRUCT bcm_event_t;
100
101 /*
102 * used by host event
103 * note: if additional event types are added, it should go with is_wlc_event_frame() as well.
104 */
105 typedef union bcm_event_msg_u {
106 wl_event_msg_t event;
107 #if defined(DNGL_EVENT_SUPPORT)
108 bcm_dngl_event_msg_t dngl_event;
109 #endif // endif
110
111 /* add new event here */
112 } bcm_event_msg_u_t;
113
114 #define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - sizeof(struct ether_header))
115
116 /* Event messages */
117 #define WLC_E_SET_SSID 0 /* indicates status of set SSID */
118 #define WLC_E_JOIN 1 /* differentiates join IBSS from found (WLC_E_START) IBSS */
119 #define WLC_E_START 2 /* STA founded an IBSS or AP started a BSS */
120 #define WLC_E_AUTH 3 /* 802.11 AUTH request */
121 #define WLC_E_AUTH_IND 4 /* 802.11 AUTH indication */
122 #define WLC_E_DEAUTH 5 /* 802.11 DEAUTH request */
123 #define WLC_E_DEAUTH_IND 6 /* 802.11 DEAUTH indication */
124 #define WLC_E_ASSOC 7 /* 802.11 ASSOC request */
125 #define WLC_E_ASSOC_IND 8 /* 802.11 ASSOC indication */
126 #define WLC_E_REASSOC 9 /* 802.11 REASSOC request */
127 #define WLC_E_REASSOC_IND 10 /* 802.11 REASSOC indication */
128 #define WLC_E_DISASSOC 11 /* 802.11 DISASSOC request */
129 #define WLC_E_DISASSOC_IND 12 /* 802.11 DISASSOC indication */
130 #define WLC_E_QUIET_START 13 /* 802.11h Quiet period started */
131 #define WLC_E_QUIET_END 14 /* 802.11h Quiet period ended */
132 #define WLC_E_BEACON_RX 15 /* BEACONS received/lost indication */
133 #define WLC_E_LINK 16 /* generic link indication */
134 #define WLC_E_MIC_ERROR 17 /* TKIP MIC error occurred */
135 #define WLC_E_NDIS_LINK 18 /* NDIS style link indication */
136 #define WLC_E_ROAM 19 /* roam complete: indicate status & reason */
137 #define WLC_E_TXFAIL 20 /* change in dot11FailedCount (txfail) */
138 #define WLC_E_PMKID_CACHE 21 /* WPA2 pmkid cache indication */
139 #define WLC_E_RETROGRADE_TSF 22 /* current AP's TSF value went backward */
140 #define WLC_E_PRUNE 23 /* AP was pruned from join list for reason */
141 #define WLC_E_AUTOAUTH 24 /* report AutoAuth table entry match for join attempt */
142 #define WLC_E_EAPOL_MSG 25 /* Event encapsulating an EAPOL message */
143 #define WLC_E_SCAN_COMPLETE 26 /* Scan results are ready or scan was aborted */
144 #define WLC_E_ADDTS_IND 27 /* indicate to host addts fail/success */
145 #define WLC_E_DELTS_IND 28 /* indicate to host delts fail/success */
146 #define WLC_E_BCNSENT_IND 29 /* indicate to host of beacon transmit */
147 #define WLC_E_BCNRX_MSG 30 /* Send the received beacon up to the host */
148 #define WLC_E_BCNLOST_MSG 31 /* indicate to host loss of beacon */
149 #define WLC_E_ROAM_PREP 32 /* before attempting to roam association */
150 #define WLC_E_PFN_NET_FOUND 33 /* PFN network found event */
151 #define WLC_E_PFN_NET_LOST 34 /* PFN network lost event */
152 #define WLC_E_RESET_COMPLETE 35
153 #define WLC_E_JOIN_START 36
154 #define WLC_E_ROAM_START 37 /* roam attempt started: indicate reason */
155 #define WLC_E_ASSOC_START 38
156 #define WLC_E_IBSS_ASSOC 39
157 #define WLC_E_RADIO 40
158 #define WLC_E_PSM_WATCHDOG 41 /* PSM microcode watchdog fired */
159
160 #define WLC_E_PROBREQ_MSG 44 /* probe request received */
161 #define WLC_E_SCAN_CONFIRM_IND 45
162 #define WLC_E_PSK_SUP 46 /* WPA Handshake fail */
163 #define WLC_E_COUNTRY_CODE_CHANGED 47
164 #define WLC_E_EXCEEDED_MEDIUM_TIME 48 /* WMMAC excedded medium time */
165 #define WLC_E_ICV_ERROR 49 /* WEP ICV error occurred */
166 #define WLC_E_UNICAST_DECODE_ERROR 50 /* Unsupported unicast encrypted frame */
167 #define WLC_E_MULTICAST_DECODE_ERROR 51 /* Unsupported multicast encrypted frame */
168 #define WLC_E_TRACE 52
169 #define WLC_E_IF 54 /* I/F change (for dongle host notification) */
170 #define WLC_E_P2P_DISC_LISTEN_COMPLETE 55 /* listen state expires */
171 #define WLC_E_RSSI 56 /* indicate RSSI change based on configured levels */
172 #define WLC_E_PFN_BEST_BATCHING 57 /* PFN best network batching event */
173 #define WLC_E_EXTLOG_MSG 58
174 #define WLC_E_ACTION_FRAME 59 /* Action frame Rx */
175 #define WLC_E_ACTION_FRAME_COMPLETE 60 /* Action frame Tx complete */
176 #define WLC_E_PRE_ASSOC_IND 61 /* assoc request received */
177 #define WLC_E_PRE_REASSOC_IND 62 /* re-assoc request received */
178 #define WLC_E_CHANNEL_ADOPTED 63
179 #define WLC_E_AP_STARTED 64 /* AP started */
180 #define WLC_E_DFS_AP_STOP 65 /* AP stopped due to DFS */
181 #define WLC_E_DFS_AP_RESUME 66 /* AP resumed due to DFS */
182 #define WLC_E_WAI_STA_EVENT 67 /* WAI stations event */
183 #define WLC_E_WAI_MSG 68 /* event encapsulating an WAI message */
184 #define WLC_E_ESCAN_RESULT 69 /* escan result event */
185 #define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70 /* action frame off channel complete */
186 #define WLC_E_PROBRESP_MSG 71 /* probe response received */
187 #define WLC_E_P2P_PROBREQ_MSG 72 /* P2P Probe request received */
188 #define WLC_E_DCS_REQUEST 73
189 #define WLC_E_FIFO_CREDIT_MAP 74 /* credits for D11 FIFOs. [AC0,AC1,AC2,AC3,BC_MC,ATIM] */
190 #define WLC_E_ACTION_FRAME_RX 75 /* Received action frame event WITH
191 * wl_event_rx_frame_data_t header
192 */
193 #define WLC_E_WAKE_EVENT 76 /* Wake Event timer fired, used for wake WLAN test mode */
194 #define WLC_E_RM_COMPLETE 77 /* Radio measurement complete */
195 #define WLC_E_HTSFSYNC 78 /* Synchronize TSF with the host */
196 #define WLC_E_OVERLAY_REQ 79 /* request an overlay IOCTL/iovar from the host */
197 #define WLC_E_CSA_COMPLETE_IND 80 /* 802.11 CHANNEL SWITCH ACTION completed */
198 #define WLC_E_EXCESS_PM_WAKE_EVENT 81 /* excess PM Wake Event to inform host */
199 #define WLC_E_PFN_SCAN_NONE 82 /* no PFN networks around */
200 /* PFN BSSID network found event, conflict/share with WLC_E_PFN_SCAN_NONE */
201 #define WLC_E_PFN_BSSID_NET_FOUND 82
202 #define WLC_E_PFN_SCAN_ALLGONE 83 /* last found PFN network gets lost */
203 /* PFN BSSID network lost event, conflict/share with WLC_E_PFN_SCAN_ALLGONE */
204 #define WLC_E_PFN_BSSID_NET_LOST 83
205 #define WLC_E_GTK_PLUMBED 84
206 #define WLC_E_ASSOC_IND_NDIS 85 /* 802.11 ASSOC indication for NDIS only */
207 #define WLC_E_REASSOC_IND_NDIS 86 /* 802.11 REASSOC indication for NDIS only */
208 #define WLC_E_ASSOC_REQ_IE 87
209 #define WLC_E_ASSOC_RESP_IE 88
210 #define WLC_E_ASSOC_RECREATED 89 /* association recreated on resume */
211 #define WLC_E_ACTION_FRAME_RX_NDIS 90 /* rx action frame event for NDIS only */
212 #define WLC_E_AUTH_REQ 91 /* authentication request received */
213 #define WLC_E_TDLS_PEER_EVENT 92 /* discovered peer, connected/disconnected peer */
214 #define WLC_E_SPEEDY_RECREATE_FAIL 93 /* fast assoc recreation failed */
215 #define WLC_E_NATIVE 94 /* port-specific event and payload (e.g. NDIS) */
216 #define WLC_E_PKTDELAY_IND 95 /* event for tx pkt delay suddently jump */
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
280 * tx/rxchain
281 */
282 #define WLC_E_FBT 166 /* FBT event */
283 #define WLC_E_PFN_SCAN_BACKOFF 167 /* PFN SCAN Backoff event */
284 #define WLC_E_PFN_BSSID_SCAN_BACKOFF 168 /* PFN BSSID SCAN BAckoff event */
285 #define WLC_E_AGGR_EVENT 169 /* Aggregated event */
286 #define WLC_E_TVPM_MITIGATION 171 /* Change in mitigation applied by TVPM */
287 #define WLC_E_SCAN_START 172 /* Deprecated */
288 #define WLC_E_SCAN 172 /* Scan event */
289 #define WLC_E_MBO 173 /* MBO event */
290 #define WLC_E_PHY_CAL 174 /* Phy calibration start indication to host */
291 #define WLC_E_RPSNOA 175 /* Radio power save start/end indication to host */
292 #define WLC_E_ADPS 176 /* ADPS event */
293 #define WLC_E_SLOTTED_BSS_PEER_OP 177 /* Per peer SCB delete */
294 #define WLC_E_HWA 178 /* HWA events */
295 #define WLC_E_LAST 179 /* highest val + 1 for range checking */
296 #if (WLC_E_LAST > 179)
297 #error "WLC_E_LAST: Invalid value for last event; must be <= 178."
298 #endif /* WLC_E_LAST */
299
300 /* define an API for getting the string name of an event */
301 extern const char *bcmevent_get_name(uint event_type);
302 extern void wl_event_to_host_order(wl_event_msg_t * evt);
303 extern void wl_event_to_network_order(wl_event_msg_t * evt);
304
305 /* validate if the event is proper and if valid copy event header to event */
306 extern int is_wlc_event_frame(void *pktdata, uint pktlen, uint16 exp_usr_subtype,
307 bcm_event_msg_u_t *out_event);
308
309 /* conversion between host and network order for events */
310 void wl_event_to_host_order(wl_event_msg_t * evt);
311 void wl_event_to_network_order(wl_event_msg_t * evt);
312
313 /* Event status codes */
314 #define WLC_E_STATUS_SUCCESS 0 /* operation was successful */
315 #define WLC_E_STATUS_FAIL 1 /* operation failed */
316 #define WLC_E_STATUS_TIMEOUT 2 /* operation timed out */
317 #define WLC_E_STATUS_NO_NETWORKS 3 /* failed due to no matching network found */
318 #define WLC_E_STATUS_ABORT 4 /* operation was aborted */
319 #define WLC_E_STATUS_NO_ACK 5 /* protocol failure: packet not ack'd */
320 #define WLC_E_STATUS_UNSOLICITED 6 /* AUTH or ASSOC packet was unsolicited */
321 #define WLC_E_STATUS_ATTEMPT 7 /* attempt to assoc to an auto auth configuration */
322 #define WLC_E_STATUS_PARTIAL 8 /* scan results are incomplete */
323 #define WLC_E_STATUS_NEWSCAN 9 /* scan aborted by another scan */
324 #define WLC_E_STATUS_NEWASSOC 10 /* scan aborted due to assoc in progress */
325 #define WLC_E_STATUS_11HQUIET 11 /* 802.11h quiet period started */
326 #define WLC_E_STATUS_SUPPRESS 12 /* user disabled scanning (WLC_SET_SCANSUPPRESS) */
327 #define WLC_E_STATUS_NOCHANS 13 /* no allowable channels to scan */
328 #ifdef BCMCCX
329 #define WLC_E_STATUS_CCXFASTRM 14 /* scan aborted due to CCX fast roam */
330 #endif /* BCMCCX */
331 #define WLC_E_STATUS_CS_ABORT 15 /* abort channel select */
332 #define WLC_E_STATUS_ERROR 16 /* request failed due to error */
333 #define WLC_E_STATUS_SLOTTED_PEER_ADD 17 /* Slotted scb for peer addition status */
334 #define WLC_E_STATUS_SLOTTED_PEER_DEL 18 /* Slotted scb for peer deletion status */
335 #define WLC_E_STATUS_INVALID 0xff /* Invalid status code to init variables. */
336
337 /* 4-way handshake event type */
338 #define WLC_E_PSK_AUTH_SUB_EAPOL_START 1 /* EAPOL start */
339 #define WLC_E_PSK_AUTH_SUB_EAPOL_DONE 2 /* EAPOL end */
340 /* GTK event type */
341 #define WLC_E_PSK_AUTH_SUB_GTK_DONE 3 /* GTK end */
342
343 /* 4-way handshake event status code */
344 #define WLC_E_STATUS_PSK_AUTH_WPA_TIMOUT 1 /* operation timed out */
345 #define WLC_E_STATUS_PSK_AUTH_MIC_WPA_ERR 2 /* MIC error */
346 #define WLC_E_STATUS_PSK_AUTH_IE_MISMATCH_ERR 3 /* IE Missmatch error */
347 #define WLC_E_STATUS_PSK_AUTH_REPLAY_COUNT_ERR 4
348 #define WLC_E_STATUS_PSK_AUTH_PEER_BLACKISTED 5 /* Blaclisted peer */
349 #define WLC_E_STATUS_PSK_AUTH_GTK_REKEY_FAIL 6 /* GTK event status code */
350
351 /* SDB transition status code */
352 #define WLC_E_STATUS_SDB_START 1
353 #define WLC_E_STATUS_SDB_COMPLETE 2
354 /* Slice-swap status code */
355 #define WLC_E_STATUS_SLICE_SWAP_START 3
356 #define WLC_E_STATUS_SLICE_SWAP_COMPLETE 4
357
358 /* SDB transition reason code */
359 #define WLC_E_REASON_HOST_DIRECT 0
360 #define WLC_E_REASON_INFRA_ASSOC 1
361 #define WLC_E_REASON_INFRA_ROAM 2
362 #define WLC_E_REASON_INFRA_DISASSOC 3
363 #define WLC_E_REASON_NO_MODE_CHANGE_NEEDED 4
364 #define WLC_E_REASON_AWDL_ENABLE 5
365 #define WLC_E_REASON_AWDL_DISABLE 6
366
367 /* WLC_E_SDB_TRANSITION event data */
368 #define WL_MAX_BSSCFG 4
369 #define WL_EVENT_SDB_TRANSITION_VER 1
370 typedef struct wl_event_sdb_data {
371 uint8 wlunit; /* Core index */
372 uint8 is_iftype; /* Interface Type(Station, SoftAP, P2P_GO, P2P_GC */
373 uint16 chanspec; /* Interface Channel/Chanspec */
374 char ssidbuf[(4 * 32) + 1]; /* SSID_FMT_BUF_LEN: ((4 * DOT11_MAX_SSID_LEN) + 1) */
375 } wl_event_sdb_data_t;
376
377 typedef struct wl_event_sdb_trans {
378 uint8 version; /* Event Data Version */
379 uint8 rsdb_mode;
380 uint8 enable_bsscfg;
381 uint8 reserved;
382 struct wl_event_sdb_data values[WL_MAX_BSSCFG];
383 } wl_event_sdb_trans_t;
384
385 /* roam reason codes */
386 #define WLC_E_REASON_INITIAL_ASSOC 0 /* initial assoc */
387 #define WLC_E_REASON_LOW_RSSI 1 /* roamed due to low RSSI */
388 #define WLC_E_REASON_DEAUTH 2 /* roamed due to DEAUTH indication */
389 #define WLC_E_REASON_DISASSOC 3 /* roamed due to DISASSOC indication */
390 #define WLC_E_REASON_BCNS_LOST 4 /* roamed due to lost beacons */
391
392 #define WLC_E_REASON_FAST_ROAM_FAILED 5 /* roamed due to fast roam failure */
393 #define WLC_E_REASON_DIRECTED_ROAM 6 /* roamed due to request by AP */
394 #define WLC_E_REASON_TSPEC_REJECTED 7 /* roamed due to TSPEC rejection */
395 #define WLC_E_REASON_BETTER_AP 8 /* roamed due to finding better AP */
396 #define WLC_E_REASON_MINTXRATE 9 /* roamed because at mintxrate for too long */
397 #define WLC_E_REASON_TXFAIL 10 /* We can hear AP, but AP can't hear us */
398 /* retained for precommit auto-merging errors; remove once all branches are synced */
399 #define WLC_E_REASON_REQUESTED_ROAM 11
400 #define WLC_E_REASON_BSSTRANS_REQ 11 /* roamed due to BSS Transition request by AP */
401 #define WLC_E_REASON_LOW_RSSI_CU 12 /* roamed due to low RSSI and Channel Usage */
402 #define WLC_E_REASON_RADAR_DETECTED 13 /* roamed due to radar detection by STA */
403 #define WLC_E_REASON_CSA 14 /* roamed due to CSA from AP */
404 #define WLC_E_REASON_ESTM_LOW 15 /* roamed due to ESTM low tput */
405 #define WLC_E_REASON_LAST 16 /* NOTE: increment this as you add reasons above */
406
407 /* prune reason codes */
408 #define WLC_E_PRUNE_ENCR_MISMATCH 1 /* encryption mismatch */
409 #define WLC_E_PRUNE_BCAST_BSSID 2 /* AP uses a broadcast BSSID */
410 #define WLC_E_PRUNE_MAC_DENY 3 /* STA's MAC addr is in AP's MAC deny list */
411 #define WLC_E_PRUNE_MAC_NA 4 /* STA's MAC addr is not in AP's MAC allow list */
412 #define WLC_E_PRUNE_REG_PASSV 5 /* AP not allowed due to regulatory restriction */
413 #define WLC_E_PRUNE_SPCT_MGMT 6 /* AP does not support STA locale spectrum mgmt */
414 #define WLC_E_PRUNE_RADAR 7 /* AP is on a radar channel of STA locale */
415 #define WLC_E_RSN_MISMATCH 8 /* STA does not support AP's RSN */
416 #define WLC_E_PRUNE_NO_COMMON_RATES 9 /* No rates in common with AP */
417 #define WLC_E_PRUNE_BASIC_RATES 10 /* STA does not support all basic rates of BSS */
418 #ifdef BCMCCX
419 #define WLC_E_PRUNE_CCXFAST_PREVAP 11 /* CCX FAST ROAM: prune previous AP */
420 #endif /* def BCMCCX */
421 #define WLC_E_PRUNE_CIPHER_NA 12 /* BSS's cipher not supported */
422 #define WLC_E_PRUNE_KNOWN_STA 13 /* AP is already known to us as a STA */
423 #ifdef BCMCCX
424 #define WLC_E_PRUNE_CCXFAST_DROAM 14 /* CCX FAST ROAM: prune unqualified AP */
425 #endif /* def BCMCCX */
426 #define WLC_E_PRUNE_WDS_PEER 15 /* AP is already known to us as a WDS peer */
427 #define WLC_E_PRUNE_QBSS_LOAD 16 /* QBSS LOAD - AAC is too low */
428 #define WLC_E_PRUNE_HOME_AP 17 /* prune home AP */
429 #ifdef BCMCCX
430 #define WLC_E_PRUNE_AP_BLOCKED 18 /* prune blocked AP */
431 #define WLC_E_PRUNE_NO_DIAG_SUPPORT 19 /* prune due to diagnostic mode not supported */
432 #endif /* BCMCCX */
433 #define WLC_E_PRUNE_AUTH_RESP_MAC 20 /* suppress auth resp by MAC filter */
434
435 /* WPA failure reason codes carried in the WLC_E_PSK_SUP event */
436 #define WLC_E_SUP_OTHER 0 /* Other reason */
437 #define WLC_E_SUP_DECRYPT_KEY_DATA 1 /* Decryption of key data failed */
438 #define WLC_E_SUP_BAD_UCAST_WEP128 2 /* Illegal use of ucast WEP128 */
439 #define WLC_E_SUP_BAD_UCAST_WEP40 3 /* Illegal use of ucast WEP40 */
440 #define WLC_E_SUP_UNSUP_KEY_LEN 4 /* Unsupported key length */
441 #define WLC_E_SUP_PW_KEY_CIPHER 5 /* Unicast cipher mismatch in pairwise key */
442 #define WLC_E_SUP_MSG3_TOO_MANY_IE 6 /* WPA IE contains > 1 RSN IE in key msg 3 */
443 #define WLC_E_SUP_MSG3_IE_MISMATCH 7 /* WPA IE mismatch in key message 3 */
444 #define WLC_E_SUP_NO_INSTALL_FLAG 8 /* INSTALL flag unset in 4-way msg */
445 #define WLC_E_SUP_MSG3_NO_GTK 9 /* encapsulated GTK missing from msg 3 */
446 #define WLC_E_SUP_GRP_KEY_CIPHER 10 /* Multicast cipher mismatch in group key */
447 #define WLC_E_SUP_GRP_MSG1_NO_GTK 11 /* encapsulated GTK missing from group msg 1 */
448 #define WLC_E_SUP_GTK_DECRYPT_FAIL 12 /* GTK decrypt failure */
449 #define WLC_E_SUP_SEND_FAIL 13 /* message send failure */
450 #define WLC_E_SUP_DEAUTH 14 /* received FC_DEAUTH */
451 #define WLC_E_SUP_WPA_PSK_TMO 15 /* WPA PSK 4-way handshake timeout */
452 #define WLC_E_SUP_WPA_PSK_M1_TMO 16 /* WPA PSK 4-way handshake M1 timeout */
453 #define WLC_E_SUP_WPA_PSK_M3_TMO 17 /* WPA PSK 4-way handshake M3 timeout */
454
455 /* Ucode reason codes carried in the WLC_E_MACDBG event */
456 #define WLC_E_MACDBG_LIST_PSM 0 /* Dump list update for PSM registers */
457 #define WLC_E_MACDBG_LIST_PSMX 1 /* Dump list update for PSMx registers */
458 #define WLC_E_MACDBG_REGALL 2 /* Dump all registers */
459
460 /* Event data for events that include frames received over the air */
461 /* WLC_E_PROBRESP_MSG
462 * WLC_E_P2P_PROBREQ_MSG
463 * WLC_E_ACTION_FRAME_RX
464 */
465
466 #define MAX_PHY_CORE_NUM 4u
467
468 #define BCM_RX_FRAME_DATA_VERSION_2 2u
469
470 typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data_v2 {
471 uint16 version;
472 uint16 len;
473 uint16 channel; /* Matches chanspec_t format from bcmwifi_channels.h */
474 uint16 pad;
475 int32 rssi;
476 uint32 mactime;
477 uint32 rate;
478 int8 per_core_rssi[MAX_PHY_CORE_NUM];
479 } BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_v2_t;
480
481 typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data_v1 {
482 uint16 version;
483 uint16 channel; /* Matches chanspec_t format from bcmwifi_channels.h */
484 int32 rssi;
485 uint32 mactime;
486 uint32 rate;
487 } BWL_POST_PACKED_STRUCT wl_event_rx_frame_data_v1_t;
488
489 #define BCM_RX_FRAME_DATA_VERSION_1 1u
490
491 #ifndef WL_EVENT_RX_FRAME_DATA_ALIAS
492 #define BCM_RX_FRAME_DATA_VERSION BCM_RX_FRAME_DATA_VERSION_1
493 typedef wl_event_rx_frame_data_v1_t wl_event_rx_frame_data_t;
494 #endif // endif
495
496 /* WLC_E_IF event data */
497 typedef struct wl_event_data_if {
498 uint8 ifidx; /* RTE virtual device index (for dongle) */
499 uint8 opcode; /* see I/F opcode */
500 uint8 reserved; /* bit mask (WLC_E_IF_FLAGS_XXX ) */
501 uint8 bssidx; /* bsscfg index */
502 uint8 role; /* see I/F role */
503 } wl_event_data_if_t;
504
505 /* WLC_E_NATOE event data */
506 typedef struct wl_event_data_natoe {
507 uint32 natoe_active;
508 uint32 sta_ip;
509 uint16 start_port;
510 uint16 end_port;
511 } wl_event_data_natoe_t;
512
513 /* opcode in WLC_E_IF event */
514 #define WLC_E_IF_ADD 1 /* bsscfg add */
515 #define WLC_E_IF_DEL 2 /* bsscfg delete */
516 #define WLC_E_IF_CHANGE 3 /* bsscfg role change */
517
518 /* I/F role code in WLC_E_IF event */
519 #define WLC_E_IF_ROLE_STA 0 /* Infra STA */
520 #define WLC_E_IF_ROLE_AP 1 /* Access Point */
521 #define WLC_E_IF_ROLE_WDS 2 /* WDS link */
522 #define WLC_E_IF_ROLE_P2P_GO 3 /* P2P Group Owner */
523 #define WLC_E_IF_ROLE_P2P_CLIENT 4 /* P2P Client */
524 #define WLC_E_IF_ROLE_IBSS 8 /* IBSS */
525 #define WLC_E_IF_ROLE_NAN 9 /* NAN */
526
527 /* WLC_E_RSSI event data */
528 typedef struct wl_event_data_rssi {
529 int32 rssi;
530 int32 snr;
531 int32 noise;
532 } wl_event_data_rssi_t;
533
534 /* WLC_E_IF flag */
535 #define WLC_E_IF_FLAGS_BSSCFG_NOIF 0x1 /* no host I/F creation needed */
536
537 /* Reason codes for LINK */
538 #define WLC_E_LINK_BCN_LOSS 1 /* Link down because of beacon loss */
539 #define WLC_E_LINK_DISASSOC 2 /* Link down because of disassoc */
540 #define WLC_E_LINK_ASSOC_REC 3 /* Link down because assoc recreate failed */
541 #define WLC_E_LINK_BSSCFG_DIS 4 /* Link down due to bsscfg down */
542
543 /* WLC_E_NDIS_LINK event data */
544 typedef BWL_PRE_PACKED_STRUCT struct ndis_link_parms {
545 struct ether_addr peer_mac; /* 6 bytes */
546 uint16 chanspec; /* 2 bytes */
547 uint32 link_speed; /* current datarate in units of 500 Kbit/s */
548 uint32 max_link_speed; /* max possible datarate for link in units of 500 Kbit/s */
549 int32 rssi; /* average rssi */
550 } BWL_POST_PACKED_STRUCT ndis_link_parms_t;
551
552 /* reason codes for WLC_E_OVERLAY_REQ event */
553 #define WLC_E_OVL_DOWNLOAD 0 /* overlay download request */
554 #define WLC_E_OVL_UPDATE_IND 1 /* device indication of host overlay update */
555
556 /* reason codes for WLC_E_TDLS_PEER_EVENT event */
557 #define WLC_E_TDLS_PEER_DISCOVERED 0 /* peer is ready to establish TDLS */
558 #define WLC_E_TDLS_PEER_CONNECTED 1
559 #define WLC_E_TDLS_PEER_DISCONNECTED 2
560
561 /* reason codes for WLC_E_RMC_EVENT event */
562 #define WLC_E_REASON_RMC_NONE 0
563 #define WLC_E_REASON_RMC_AR_LOST 1
564 #define WLC_E_REASON_RMC_AR_NO_ACK 2
565
566 #ifdef WLTDLS
567 /* TDLS Action Category code */
568 #define TDLS_AF_CATEGORY 12
569 /* Wi-Fi Display (WFD) Vendor Specific Category */
570 /* used for WFD Tunneled Probe Request and Response */
571 #define TDLS_VENDOR_SPECIFIC 127
572 /* TDLS Action Field Values */
573 #define TDLS_ACTION_SETUP_REQ 0
574 #define TDLS_ACTION_SETUP_RESP 1
575 #define TDLS_ACTION_SETUP_CONFIRM 2
576 #define TDLS_ACTION_TEARDOWN 3
577 #define WLAN_TDLS_SET_PROBE_WFD_IE 11
578 #define WLAN_TDLS_SET_SETUP_WFD_IE 12
579 #define WLAN_TDLS_SET_WFD_ENABLED 13
580 #define WLAN_TDLS_SET_WFD_DISABLED 14
581 #endif // endif
582
583 /* WLC_E_RANGING_EVENT subtypes */
584 #define WLC_E_RANGING_RESULTS 0
585
586 #define PHY_CAL_EVT_VERSION 1
587 typedef struct wlc_phy_cal_info {
588 uint16 version; /* structure version */
589 uint16 length; /* length of the rest of the structure - pad */
590 uint16 chanspec;
591 uint8 start;
592 uint8 phase;
593 int16 temp;
594 uint8 reason;
595 uint8 pad;
596 } wlc_phy_cal_info_t;
597
598 /* GAS event data */
599 typedef BWL_PRE_PACKED_STRUCT struct wl_event_gas {
600 uint16 channel; /* channel of GAS protocol */
601 uint8 dialog_token; /* GAS dialog token */
602 uint8 fragment_id; /* fragment id */
603 uint16 status_code; /* status code on GAS completion */
604 uint16 data_len; /* length of data to follow */
605 uint8 data[1]; /* variable length specified by data_len */
606 } BWL_POST_PACKED_STRUCT wl_event_gas_t;
607
608 /* service discovery TLV */
609 typedef BWL_PRE_PACKED_STRUCT struct wl_sd_tlv {
610 uint16 length; /* length of response_data */
611 uint8 protocol; /* service protocol type */
612 uint8 transaction_id; /* service transaction id */
613 uint8 status_code; /* status code */
614 uint8 data[1]; /* response data */
615 } BWL_POST_PACKED_STRUCT wl_sd_tlv_t;
616
617 /* service discovery event data */
618 typedef BWL_PRE_PACKED_STRUCT struct wl_event_sd {
619 uint16 channel; /* channel */
620 uint8 count; /* number of tlvs */
621 wl_sd_tlv_t tlv[1]; /* service discovery TLV */
622 } BWL_POST_PACKED_STRUCT wl_event_sd_t;
623
624 /* WLC_E_PKT_FILTER event sub-classification codes */
625 #define WLC_E_PKT_FILTER_TIMEOUT 1 /* Matching packet not received in last timeout seconds */
626
627 /* Note: proxd has a new API (ver 3.0) deprecates the following */
628
629 /* Reason codes for WLC_E_PROXD */
630 #define WLC_E_PROXD_FOUND 1 /* Found a proximity device */
631 #define WLC_E_PROXD_GONE 2 /* Lost a proximity device */
632 #define WLC_E_PROXD_START 3 /* used by: target */
633 #define WLC_E_PROXD_STOP 4 /* used by: target */
634 #define WLC_E_PROXD_COMPLETED 5 /* used by: initiator completed */
635 #define WLC_E_PROXD_ERROR 6 /* used by both initiator and target */
636 #define WLC_E_PROXD_COLLECT_START 7 /* used by: target & initiator */
637 #define WLC_E_PROXD_COLLECT_STOP 8 /* used by: target */
638 #define WLC_E_PROXD_COLLECT_COMPLETED 9 /* used by: initiator completed */
639 #define WLC_E_PROXD_COLLECT_ERROR 10 /* used by both initiator and target */
640 #define WLC_E_PROXD_NAN_EVENT 11 /* used by both initiator and target */
641 #define WLC_E_PROXD_TS_RESULTS 12 /* used by: initiator completed */
642
643 /* proxd_event data */
644 typedef struct ftm_sample {
645 uint32 value; /* RTT in ns */
646 int8 rssi; /* RSSI */
647 } ftm_sample_t;
648
649 typedef struct ts_sample {
650 uint32 t1;
651 uint32 t2;
652 uint32 t3;
653 uint32 t4;
654 } ts_sample_t;
655
656 typedef BWL_PRE_PACKED_STRUCT struct proxd_event_data {
657 uint16 ver; /* version */
658 uint16 mode; /* mode: target/initiator */
659 uint16 method; /* method: rssi/TOF/AOA */
660 uint8 err_code; /* error classification */
661 uint8 TOF_type; /* one way or two way TOF */
662 uint8 OFDM_frame_type; /* legacy or VHT */
663 uint8 bandwidth; /* Bandwidth is 20, 40,80, MHZ */
664 struct ether_addr peer_mac; /* (e.g for tgt:initiator's */
665 uint32 distance; /* dst to tgt, units meter */
666 uint32 meanrtt; /* mean delta */
667 uint32 modertt; /* Mode delta */
668 uint32 medianrtt; /* median RTT */
669 uint32 sdrtt; /* Standard deviation of RTT */
670 int32 gdcalcresult; /* Software or Hardware Kind of redundant, but if */
671 /* frame type is VHT, then we should do it by hardware */
672 int16 avg_rssi; /* avg rssi accroos the ftm frames */
673 int16 validfrmcnt; /* Firmware's valid frame counts */
674 int32 peer_router_info; /* Peer router information if available in TLV, */
675 /* We will add this field later */
676 int32 var1; /* average of group delay */
677 int32 var2; /* average of threshold crossing */
678 int32 var3; /* difference between group delay and threshold crossing */
679 /* raw Fine Time Measurements (ftm) data */
680 uint16 ftm_unit; /* ftm cnt resolution in picoseconds , 6250ps - default */
681 uint16 ftm_cnt; /* num of rtd measurments/length in the ftm buffer */
682 ftm_sample_t ftm_buff[1]; /* 1 ... ftm_cnt */
683 } BWL_POST_PACKED_STRUCT wl_proxd_event_data_t;
684
685 typedef BWL_PRE_PACKED_STRUCT struct proxd_event_ts_results {
686 uint16 ver; /* version */
687 uint16 mode; /* mode: target/initiator */
688 uint16 method; /* method: rssi/TOF/AOA */
689 uint8 err_code; /* error classification */
690 uint8 TOF_type; /* one way or two way TOF */
691 uint16 ts_cnt; /* number of timestamp measurements */
692 ts_sample_t ts_buff[1]; /* Timestamps */
693 } BWL_POST_PACKED_STRUCT wl_proxd_event_ts_results_t;
694
695 /* Video Traffic Interference Monitor Event */
696 #define INTFER_EVENT_VERSION 1
697 #define INTFER_STREAM_TYPE_NONTCP 1
698 #define INTFER_STREAM_TYPE_TCP 2
699 #define WLINTFER_STATS_NSMPLS 4
700 typedef struct wl_intfer_event {
701 uint16 version; /* version */
702 uint16 status; /* status */
703 uint8 txfail_histo[WLINTFER_STATS_NSMPLS]; /* txfail histo */
704 } wl_intfer_event_t;
705
706 #define RRM_EVENT_VERSION 0
707 typedef struct wl_rrm_event {
708 int16 version;
709 int16 len;
710 int16 cat; /* Category */
711 int16 subevent;
712 char payload[1]; /* Measurement payload */
713 } wl_rrm_event_t;
714
715 /* WLC_E_PSTA_PRIMARY_INTF_IND event data */
716 typedef struct wl_psta_primary_intf_event {
717 struct ether_addr prim_ea; /* primary intf ether addr */
718 } wl_psta_primary_intf_event_t;
719
720 /* WLC_E_DPSTA_INTF_IND event data */
721 typedef enum {
722 WL_INTF_PSTA = 1,
723 WL_INTF_DWDS = 2
724 } wl_dpsta_intf_type;
725
726 typedef struct wl_dpsta_intf_event {
727 wl_dpsta_intf_type intf_type; /* dwds/psta intf register */
728 } wl_dpsta_intf_event_t;
729
730 /* ********** NAN protocol events/subevents ********** */
731 #ifndef NAN_EVENT_BUFFER_SIZE
732 #define NAN_EVENT_BUFFER_SIZE 512 /* max size */
733 #endif /* NAN_EVENT_BUFFER_SIZE */
734 /* NAN Events sent by firmware */
735
736 /*
737 * If you make changes to this enum, dont forget to update the mask (if need be).
738 */
739 typedef enum wl_nan_events {
740 WL_NAN_EVENT_START = 1, /* NAN cluster started */
741 WL_NAN_EVENT_JOIN = 2, /* To be deprecated */
742 WL_NAN_EVENT_ROLE = 3, /* Role changed */
743 WL_NAN_EVENT_SCAN_COMPLETE = 4, /* To be deprecated */
744 WL_NAN_EVENT_DISCOVERY_RESULT = 5, /* Subscribe Received */
745 WL_NAN_EVENT_REPLIED = 6, /* Publish Sent */
746 WL_NAN_EVENT_TERMINATED = 7, /* sub / pub is terminated */
747 WL_NAN_EVENT_RECEIVE = 8, /* Follow up Received */
748 WL_NAN_EVENT_STATUS_CHG = 9, /* change in nan_mac status */
749 WL_NAN_EVENT_MERGE = 10, /* Merged to a NAN cluster */
750 WL_NAN_EVENT_STOP = 11, /* To be deprecated */
751 WL_NAN_EVENT_P2P = 12, /* Unused */
752 WL_NAN_EVENT_WINDOW_BEGIN_P2P = 13, /* Unused */
753 WL_NAN_EVENT_WINDOW_BEGIN_MESH = 14, /* Unused */
754 WL_NAN_EVENT_WINDOW_BEGIN_IBSS = 15, /* Unused */
755 WL_NAN_EVENT_WINDOW_BEGIN_RANGING = 16, /* Unused */
756 WL_NAN_EVENT_POST_DISC = 17, /* Event for post discovery data */
757 WL_NAN_EVENT_DATA_IF_ADD = 18, /* Unused */
758 WL_NAN_EVENT_DATA_PEER_ADD = 19, /* Event for peer add */
759 /* nan 2.0 */
760 WL_NAN_EVENT_PEER_DATAPATH_IND = 20, /* Incoming DP req */
761 WL_NAN_EVENT_DATAPATH_ESTB = 21, /* DP Established */
762 WL_NAN_EVENT_SDF_RX = 22, /* SDF payload */
763 WL_NAN_EVENT_DATAPATH_END = 23, /* DP Terminate recvd */
764 WL_NAN_EVENT_BCN_RX = 24, /* received beacon payload */
765 WL_NAN_EVENT_PEER_DATAPATH_RESP = 25, /* Peer's DP response */
766 WL_NAN_EVENT_PEER_DATAPATH_CONF = 26, /* Peer's DP confirm */
767 WL_NAN_EVENT_RNG_REQ_IND = 27, /* Range Request */
768 WL_NAN_EVENT_RNG_RPT_IND = 28, /* Range Report */
769 WL_NAN_EVENT_RNG_TERM_IND = 29, /* Range Termination */
770 WL_NAN_EVENT_PEER_DATAPATH_SEC_INST = 30, /* Peer's DP sec install */
771 WL_NAN_EVENT_TXS = 31, /* for tx status of follow-up and SDFs */
772 WL_NAN_EVENT_DW_START = 32, /* dw start */
773 WL_NAN_EVENT_DW_END = 33, /* dw end */
774 WL_NAN_EVENT_CHAN_BOUNDARY = 34, /* channel switch event */
775 WL_NAN_EVENT_MR_CHANGED = 35, /* AMR or IMR changed event during DW */
776 WL_NAN_EVENT_RNG_RESP_IND = 36, /* Range Response Rx */
777 WL_NAN_EVENT_PEER_SCHED_UPD_NOTIF = 37, /* Peer's schedule update notification */
778 WL_NAN_EVENT_PEER_SCHED_REQ = 38, /* Peer's schedule request */
779 WL_NAN_EVENT_PEER_SCHED_RESP = 39, /* Peer's schedule response */
780 WL_NAN_EVENT_PEER_SCHED_CONF = 40, /* Peer's schedule confirm */
781 WL_NAN_EVENT_SENT_DATAPATH_END = 41, /* Sent DP terminate frame */
782 WL_NAN_EVENT_SLOT_START = 42, /* SLOT_START event */
783 WL_NAN_EVENT_SLOT_END = 43, /* SLOT_END event */
784 WL_NAN_EVENT_HOST_ASSIST_REQ = 44, /* Requesting host assist */
785 WL_NAN_EVENT_RX_MGMT_FRM = 45, /* NAN management frame received */
786
787 WL_NAN_EVENT_INVALID /* delimiter for max value */
788 } nan_app_events_e;
789
790 #define NAN_EV_MASK(ev) (1 << (ev - 1))
791 #define IS_NAN_EVT_ON(var, evt) ((var & (1 << (evt-1))) != 0)
792
793 #define NAN_EV_MASK_SET(var, evt) \
794 ((evt < WL_NAN_EVMASK_EXTN_LEN * 8) ? \
795 ((*((uint8 *)var + ((evt - 1)/8))) |= (1 << ((evt - 1) %8))) : 0)
796 #define IS_NAN_EVENT_ON(var, evt) \
797 ((evt < WL_NAN_EVMASK_EXTN_LEN * 8) && \
798 (((*((uint8 *)var + ((evt - 1)/8))) & (1 << ((evt - 1) %8))) != 0))
799
800 /* ******************* end of NAN section *************** */
801
802 typedef enum wl_scan_events {
803 WL_SCAN_START = 1,
804 WL_SCAN_END = 2
805 } wl_scan_events;
806
807 /* WLC_E_ULP event data */
808 #define WL_ULP_EVENT_VERSION 1
809 #define WL_ULP_DISABLE_CONSOLE 1 /* Disable console message on ULP entry */
810 #define WL_ULP_UCODE_DOWNLOAD 2 /* Download ULP ucode file */
811
812 typedef struct wl_ulp_event {
813 uint16 version;
814 uint16 ulp_dongle_action;
815 } wl_ulp_event_t;
816
817 /* TCP keepalive event data */
818 typedef BWL_PRE_PACKED_STRUCT struct wl_event_tko {
819 uint8 index; /* TCP connection index, 0 to max-1 */
820 uint8 pad[3]; /* 4-byte struct alignment */
821 } BWL_POST_PACKED_STRUCT wl_event_tko_t;
822
823 typedef struct {
824 uint8 radar_type; /* one of RADAR_TYPE_XXX */
825 uint16 min_pw; /* minimum pulse-width (usec * 20) */
826 uint16 max_pw; /* maximum pulse-width (usec * 20) */
827 uint16 min_pri; /* minimum pulse repetition interval (usec) */
828 uint16 max_pri; /* maximum pulse repetition interval (usec) */
829 uint16 subband; /* subband/frequency */
830 } radar_detected_event_info_t;
831 typedef struct wl_event_radar_detect_data {
832
833 uint32 version;
834 uint16 current_chanspec; /* chanspec on which the radar is recieved */
835 uint16 target_chanspec; /* Target chanspec after detection of radar on current_chanspec */
836 radar_detected_event_info_t radar_info[2];
837 } wl_event_radar_detect_data_t;
838
839 #define WL_EVENT_MODESW_VER_1 1
840 #define WL_EVENT_MODESW_VER_CURRENT WL_EVENT_MODESW_VER_1
841
842 #define WL_E_MODESW_FLAG_MASK_DEVICE 0x01u /* mask of device: belongs to local or peer */
843 #define WL_E_MODESW_FLAG_MASK_FROM 0x02u /* mask of origin: firmware or user */
844 #define WL_E_MODESW_FLAG_MASK_STATE 0x0Cu /* mask of state: modesw progress state */
845
846 #define WL_E_MODESW_FLAG_DEVICE_LOCAL 0x00u /* flag - device: info is about self/local */
847 #define WL_E_MODESW_FLAG_DEVICE_PEER 0x01u /* flag - device: info is about peer */
848
849 #define WL_E_MODESW_FLAG_FROM_FIRMWARE 0x00u /* flag - from: request is from firmware */
850 #define WL_E_MODESW_FLAG_FROM_USER 0x02u /* flag - from: request is from user/iov */
851
852 #define WL_E_MODESW_FLAG_STATE_REQUESTED 0x00u /* flag - state: mode switch request */
853 #define WL_E_MODESW_FLAG_STATE_INITIATED 0x04u /* flag - state: switch initiated */
854 #define WL_E_MODESW_FLAG_STATE_COMPLETE 0x08u /* flag - state: switch completed/success */
855 #define WL_E_MODESW_FLAG_STATE_FAILURE 0x0Cu /* flag - state: failed to switch */
856
857 /* Get sizeof *X including variable data's length where X is pointer to wl_event_mode_switch_t */
858 #define WL_E_MODESW_SIZE(X) (sizeof(*(X)) + (X)->length)
859
860 /* Get variable data's length where X is pointer to wl_event_mode_switch_t */
861 #define WL_E_MODESW_DATA_SIZE(X) (((X)->length > sizeof(*(X))) ? ((X)->length - sizeof(*(X))) : 0)
862
863 #define WL_E_MODESW_REASON_UNKNOWN 0u /* reason: UNKNOWN */
864 #define WL_E_MODESW_REASON_ACSD 1u /* reason: ACSD (based on events from FW */
865 #define WL_E_MODESW_REASON_OBSS_DBS 2u /* reason: OBSS DBS (eg. on interference) */
866 #define WL_E_MODESW_REASON_DFS 3u /* reason: DFS (eg. on subband radar) */
867 #define WL_E_MODESW_REASON_DYN160 4u /* reason: DYN160 (160/2x2 - 80/4x4) */
868
869 /* event structure for WLC_E_MODE_SWITCH */
870 typedef struct {
871 uint16 version;
872 uint16 length; /* size including 'data' field */
873 uint16 opmode_from;
874 uint16 opmode_to;
875 uint32 flags; /* bit 0: peer(/local==0);
876 * bit 1: user(/firmware==0);
877 * bits 3,2: 00==requested, 01==initiated,
878 * 10==complete, 11==failure;
879 * rest: reserved
880 */
881 uint16 reason; /* value 0: unknown, 1: ACSD, 2: OBSS_DBS,
882 * 3: DFS, 4: DYN160, rest: reserved
883 */
884 uint16 data_offset; /* offset to 'data' from beginning of this struct.
885 * fields may be added between data_offset and data
886 */
887 /* ADD NEW FIELDS HERE */
888 uint8 data[]; /* reason specific data; could be empty */
889 } wl_event_mode_switch_t;
890
891 /* when reason in WLC_E_MODE_SWITCH is DYN160, data will carry the following structure */
892 typedef struct {
893 uint16 trigger; /* value 0: MU to SU, 1: SU to MU, 2: metric_dyn160, 3:re-/assoc,
894 * 4: disassoc, 5: rssi, 6: traffic, 7: interference,
895 * 8: chanim_stats
896 */
897 struct ether_addr sta_addr; /* causal STA's MAC address when known */
898 uint16 metric_160_80; /* latest dyn160 metric */
899 uint8 nss; /* NSS of the STA */
900 uint8 bw; /* BW of the STA */
901 int8 rssi; /* RSSI of the STA */
902 uint8 traffic; /* internal metric of traffic */
903 } wl_event_mode_switch_dyn160;
904
905 #define WL_EVENT_FBT_VER_1 1
906
907 #define WL_E_FBT_TYPE_FBT_OTD_AUTH 1
908 #define WL_E_FBT_TYPE_FBT_OTA_AUTH 2
909
910 /* event structure for WLC_E_FBT */
911 typedef struct {
912 uint16 version;
913 uint16 length; /* size including 'data' field */
914 uint16 type; /* value 0: unknown, 1: FBT OTD Auth Req */
915 uint16 data_offset; /* offset to 'data' from beginning of this struct.
916 * fields may be added between data_offset and data
917 */
918 /* ADD NEW FIELDS HERE */
919 uint8 data[]; /* type specific data; could be empty */
920 } wl_event_fbt_t;
921
922 /* TWT Setup Completion is designed to notify the user of TWT Setup process
923 * status. When 'status' field is value of BCME_OK, the user must check the
924 * 'setup_cmd' field value in 'wl_twt_sdesc_t' structure that at the end of
925 * the event data to see the response from the TWT Responding STA; when
926 * 'status' field is value of BCME_ERROR or non BCME_OK, user must not use
927 * anything from 'wl_twt_sdesc_t' structure as it is the TWT Requesting STA's
928 * own TWT parameter.
929 */
930
931 #define WL_TWT_SETUP_CPLT_VER 0
932
933 /* TWT Setup Completion event data */
934 typedef struct wl_twt_setup_cplt {
935 uint16 version;
936 uint16 length; /* the byte count of fields from 'dialog' onwards */
937 uint8 dialog; /* the dialog token user supplied to the TWT setup API */
938 uint8 pad[3];
939 int32 status;
940 /* wl_twt_sdesc_t desc; - defined in wlioctl.h */
941 } wl_twt_setup_cplt_t;
942
943 #define WL_INVALID_IE_EVENT_VERSION 0
944
945 /* Invalid IE Event data */
946 typedef struct wl_invalid_ie_event {
947 uint16 version;
948 uint16 len; /* Length of the invalid IE copy */
949 uint16 type; /* Type/subtype of the frame which contains the invalid IE */
950 uint16 error; /* error code of the wrong IE, defined in ie_error_code_t */
951 uint8 ie[]; /* Variable length buffer for the invalid IE copy */
952 } wl_invalid_ie_event_t;
953
954 /* Fixed header portion of Invalid IE Event */
955 typedef struct wl_invalid_ie_event_hdr {
956 uint16 version;
957 uint16 len; /* Length of the invalid IE copy */
958 uint16 type; /* Type/subtype of the frame which contains the invalid IE */
959 uint16 error; /* error code of the wrong IE, defined in ie_error_code_t */
960 /* var length IE data follows */
961 } wl_invalid_ie_event_hdr_t;
962
963 typedef enum ie_error_code {
964 IE_ERROR_OUT_OF_RANGE = 0x01
965 } ie_error_code_t;
966
967 /* This marks the end of a packed structure section. */
968 #include <packed_section_end.h>
969
970 /* reason of channel switch */
971 typedef enum {
972 CHANSW_DFS = 10, /* channel switch due to DFS module */
973 CHANSW_HOMECH_REQ = 14, /* channel switch due to HOME Channel Request */
974 CHANSW_STA = 15, /* channel switch due to STA */
975 CHANSW_SOFTAP = 16, /* channel switch due to SodtAP */
976 CHANSW_AIBSS = 17, /* channel switch due to AIBSS */
977 CHANSW_NAN = 18, /* channel switch due to NAN */
978 CHANSW_NAN_DISC = 19, /* channel switch due to NAN Disc */
979 CHANSW_NAN_SCHED = 20, /* channel switch due to NAN Sched */
980 CHANSW_AWDL_AW = 21, /* channel switch due to AWDL aw */
981 CHANSW_AWDL_SYNC = 22, /* channel switch due to AWDL sync */
982 CHANSW_AWDL_CAL = 23, /* channel switch due to AWDL Cal */
983 CHANSW_AWDL_PSF = 24, /* channel switch due to AWDL PSF */
984 CHANSW_AWDL_OOB_AF = 25, /* channel switch due to AWDL OOB action frame */
985 CHANSW_TDLS = 26, /* channel switch due to TDLS */
986 CHANSW_PROXD = 27, /* channel switch due to PROXD */
987 CHANSW_SLOTTED_BSS = 28, /* channel switch due to slotted bss */
988 CHANSW_SLOTTED_CMN_SYNC = 29, /* channel switch due to Common Sync Layer */
989 CHANSW_SLOTTED_BSS_CAL = 30, /* channel switch due to Cal request from slotted bss */
990 CHANSW_MAX_NUMBER = 31 /* max channel switch reason */
991 } wl_chansw_reason_t;
992
993 #define CHANSW_REASON(reason) (1 << reason)
994
995 #define EVENT_AGGR_DATA_HDR_LEN 8
996
997 typedef struct event_aggr_data {
998 uint16 num_events; /* No of events aggregated */
999 uint16 len; /* length of the aggregated events, excludes padding */
1000 uint8 pad[4]; /* Padding to make aggr event packet header aligned
1001 * on 64-bit boundary, for a 64-bit host system.
1002 */
1003 uint8 data[]; /* Aggregate buffer containing Events */
1004 } event_aggr_data_t;
1005
1006 /* WLC_E_TVPM_MITIGATION event structure version */
1007 #define WL_TVPM_MITIGATION_VERSION 1
1008
1009 /* TVPM mitigation on/off status bits */
1010 #define WL_TVPM_MITIGATION_TXDC 0x1
1011 #define WL_TVPM_MITIGATION_TXPOWER 0x2
1012 #define WL_TVPM_MITIGATION_TXCHAINS 0x4
1013
1014 /* Event structure for WLC_E_TVPM_MITIGATION */
1015 typedef struct wl_event_tvpm_mitigation {
1016 uint16 version; /* structure version */
1017 uint16 length; /* length of this structure */
1018 uint32 timestamp_ms; /* millisecond timestamp */
1019 uint8 slice; /* slice number */
1020 uint8 pad;
1021 uint16 on_off; /* mitigation status bits */
1022 } wl_event_tvpm_mitigation_t;
1023
1024 /* Event structures for sub health checks of PHY */
1025
1026 #define WL_PHY_HC_DESENSE_STATS_VER (1)
1027 typedef struct wl_hc_desense_stats {
1028 uint16 version;
1029 uint16 chanspec;
1030 int8 allowed_weakest_rssi; /* based on weakest link RSSI */
1031 uint8 ofdm_desense; /* Desense requested for OFDM */
1032 uint8 bphy_desense; /* Desense requested for bphy */
1033 int8 glitch_upd_wait; /* wait post ACI mitigation */
1034 } wl_hc_desense_stats_v1_t;
1035
1036 #define WL_PHY_HC_TEMP_STATS_VER (1)
1037 typedef struct wl_hc_temp_stats {
1038 uint16 version;
1039 uint16 chanspec;
1040 int16 curtemp; /* Temperature */
1041 uint8 temp_disthresh; /* Threshold to reduce tx chain */
1042 uint8 temp_enthresh; /* Threshold to increase tx chains */
1043 uint tempsense_period; /* Temperature check period */
1044 bool heatedup; /* 1: temp throttling on */
1045 uint8 bitmap; /* Indicating rx and tx chains */
1046 uint8 pad[2];
1047 } wl_hc_temp_stats_v1_t;
1048
1049 #define WL_PHY_HC_TEMP_STATS_VER_2 (2)
1050 typedef struct {
1051 uint16 version;
1052 uint16 chanspec;
1053 int16 curtemp; /* Temperature */
1054 uint8 pad[2];
1055 } wl_hc_temp_stats_v2_t;
1056
1057 #define WL_PHY_HC_VCOCAL_STATS_VER (1)
1058 typedef struct wl_hc_vcocal_stats {
1059 uint16 version;
1060 uint16 chanspec;
1061 int16 curtemp; /* Temperature */
1062 /* Ring buffer - Maintains history of previous 16 wake/sleep cycles */
1063 uint16 vcocal_status_wake;
1064 uint16 vcocal_status_sleep;
1065 uint16 plllock_status_wake;
1066 uint16 plllock_status_sleep;
1067 /* Cal Codes */
1068 uint16 cc_maincap;
1069 uint16 cc_secondcap;
1070 uint16 cc_auxcap;
1071 } wl_hc_vcocal_stats_v1_t;
1072
1073 #define WL_PHY_HC_TXPWR_STATS_VER (1)
1074 typedef struct wl_hc_tx_stats {
1075 uint16 version;
1076 uint16 chanspec;
1077 int8 tgt_pwr[MAX_PHY_CORE_NUM]; /* Target pwr (qdBm) */
1078 int8 estPwr[MAX_PHY_CORE_NUM]; /* Rate corrected (qdBm) */
1079 int8 estPwr_adj[MAX_PHY_CORE_NUM]; /* Max power (qdBm) */
1080 uint8 baseindex[MAX_PHY_CORE_NUM]; /* Tx base index */
1081 int16 temp; /* Temperature */
1082 uint16 TxCtrlWrd[3]; /* 6 PHY ctrl bytes */
1083 int8 min_txpower; /* min tx power per ant */
1084 uint8 pad[3];
1085 } wl_hc_txpwr_stats_v1_t;
1086
1087 #define WL_PHY_HC_TXPWR_STATS_VER_2 (2)
1088 typedef struct {
1089 uint16 version;
1090 uint16 chanspec;
1091 int8 tgt_pwr[MAX_PHY_CORE_NUM]; /* Target pwr (qdBm) */
1092 uint8 estPwr[MAX_PHY_CORE_NUM]; /* Rate corrected (qdBm) */
1093 uint8 estPwr_adj[MAX_PHY_CORE_NUM]; /* Max power (qdBm) */
1094 uint8 baseindex[MAX_PHY_CORE_NUM]; /* Tx base index */
1095 int16 temp; /* Temperature */
1096 uint16 TxCtrlWrd[3]; /* 6 PHY ctrl bytes */
1097 int8 min_txpower; /* min tx power per ant */
1098 uint8 pad[3];
1099 } wl_hc_txpwr_stats_v2_t;
1100
1101 typedef enum wl_mbo_event_type {
1102 WL_MBO_E_CELLULAR_NW_SWITCH = 1,
1103 /* ADD before this */
1104 WL_MBO_E_LAST = 2, /* highest val + 1 for range checking */
1105 } wl_mbo_event_type_t;
1106
1107 /* WLC_E_MBO event structure version */
1108 #define WL_MBO_EVT_VER 1
1109
1110 struct wl_event_mbo {
1111 uint16 version; /* structure version */
1112 uint16 length; /* length of the rest of the structure from type */
1113 wl_mbo_event_type_t type; /* Event type */
1114 uint8 data[]; /* Variable length data */
1115 };
1116
1117 /* WLC_E_MBO_CELLULAR_NW_SWITCH event structure version */
1118 #define WL_MBO_CELLULAR_NW_SWITCH_VER 1
1119
1120 /* WLC_E_MBO_CELLULAR_NW_SWITCH event data */
1121 struct wl_event_mbo_cell_nw_switch {
1122 uint16 version; /* structure version */
1123 uint16 length; /* length of the rest of the structure from reason */
1124 /* Reason of switch as per MBO Tech spec */
1125 uint8 reason;
1126 /* pad */
1127 uint8 pad;
1128 /* delay after which re-association can be tried to current BSS (seconds) */
1129 uint16 reassoc_delay;
1130 /* How long current association will be there (milli seconds).
1131 * This is zero if not known or value is overflowing.
1132 */
1133 uint32 assoc_time_remain;
1134 };
1135
1136 /* WLC_E_HWA Event structure */
1137 typedef struct wl_event_hwa {
1138 uint16 version; /* structure version */
1139 uint16 length; /* length of structure */
1140 uint32 sub_type; /* Sub event type */
1141 uint8 data[0]; /* variable length data */
1142 } wl_event_hwa_t;
1143
1144 #define WL_HWA_EVENT_VER 1
1145
1146 typedef enum wl_event_hwa_subtype {
1147 WL_HWA_EVENT_SUBTYPE_ERROR = 1,
1148 WL_HWA_EVENT_SUBTYPE_LAST = 2
1149 } wl_event_hwa_subtype_t;
1150
1151 /* WLC_E_ADPS status */
1152 enum {
1153 WL_E_STATUS_ADPS_DEAUTH = 0,
1154 WL_E_STATUS_ADPS_MAX
1155 };
1156
1157 /* WLC_E_ADPS event data */
1158 #define WL_EVENT_ADPS_VER_1 1
1159
1160 /* WLC_E_ADPS event type */
1161 #define WL_E_TYPE_ADPS_BAD_AP 1
1162
1163 typedef struct wl_event_adps_bad_ap {
1164 uint32 status;
1165 uint32 reason;
1166 struct ether_addr ea; /* bssid */
1167 } wl_event_adps_bad_ap_t;
1168
1169 typedef struct wl_event_adps {
1170 uint16 version; /* structure version */
1171 uint16 length; /* length of structure */
1172 uint32 type; /* event type */
1173 uint8 data[]; /* variable length data */
1174 } wl_event_adps_v1_t;
1175
1176 typedef wl_event_adps_v1_t wl_event_adps_t;
1177 #endif /* _BCMEVENT_H_ */