• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are
5  * met:
6  *     * Redistributions of source code must retain the above copyright
7  *       notice, this list of conditions and the following disclaimer.
8  *     * Redistributions in binary form must reproduce the above
9  *       copyright notice, this list of conditions and the following
10  *       disclaimer in the documentation and/or other materials provided
11  *       with the distribution.
12  *     * Neither the name of The Linux Foundation nor the names of its
13  *       contributors may be used to endorse or promote products derived
14  *       from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef WIFILOGGER_EVENT_DEFS_H
30 #define WIFILOGGER_EVENT_DEFS_H
31 
32 typedef enum {
33     EVENT_DROP_ID = 0,
34 
35     EVENT_WLAN_PE = 0x67A, /* 16 byte payload */
36 
37     /* Events between 0x67b to 0x67f are not used */
38 
39     EVENT_WLAN_ADD_BLOCK_ACK_SUCCESS = 0x67B,        /* 11 byte payload */
40     EVENT_WLAN_ADD_BLOCK_ACK_FAILED = 0x67C,         /* 9 byte payload */
41 
42     EVENT_WLAN_EXTSCAN_FEATURE_STARTED =   0xA8E, /* 240 byte payload */
43     EVENT_WLAN_EXTSCAN_FEATURE_CHANNEL_CONFIG = 0xA8F, /* 243 byte payload */
44     EVENT_WLAN_EXTSCAN_CYCLE_STARTED = 0xA90, /* 12 byte payload */
45     EVENT_WLAN_EXTSCAN_CYCLE_COMPLETED = 0xA91, /* 12 byte payload */
46     EVENT_WLAN_EXTSCAN_BUCKET_STARTED = 0xA92, /* 1 byte payload */
47     EVENT_WLAN_EXTSCAN_BUCKET_COMPLETED = 0xA93, /* 4 byte payload */
48     EVENT_WLAN_ROAM_SCAN_STARTED = 0xA94, /* 128 byte payload */
49 
50 
51     EVENT_WLAN_ROAM_SCAN_COMPLETE = 0xA95,
52     EVENT_WLAN_ROAM_CANDIDATE_FOUND = 0xA96,
53     EVENT_WLAN_ROAM_SCAN_CONFIG = 0xA97,
54     EVENT_WLAN_BT_COEX_BT_SCO_START = 0xA98,
55     EVENT_WLAN_BT_COEX_BT_SCO_STOP = 0xA99,
56     EVENT_WLAN_BT_COEX_BT_SCAN_START = 0xA9A,
57     EVENT_WLAN_BT_COEX_BT_SCAN_STOP = 0xA9B,
58     EVENT_WLAN_BT_COEX_BT_HID_START = 0xA9C,
59     EVENT_WLAN_BT_COEX_BT_HID_STOP = 0xA9D,
60     EVENT_WLAN_WAKE_LOCK = 0xAA2, /* 96 bytes payload */
61     EVENT_WLAN_EAPOL = 0xA8D, /* 96 bytes payload */
62     EVENT_WLAN_EXTSCAN_FEATURE_STOP = 0xAA3,
63     EVENT_WLAN_EXTSCAN_RESULTS_AVAILABLE = 0xAA4,
64     EVENT_WLAN_LOG_COMPLETE = 0xAA7,
65 
66     EVENT_MAX_ID = 0x0FFF
67 } event_id_enum_type;
68 
69 typedef enum {
70     LOG_DROP_ID = 0,
71     LOG_WLAN_EXTSCAN_CAPABILITIES = 0x18F1,
72     LOG_WLAN_EXTSCAN_FEATURE_STARTED = 0x18F2,
73 } log_id_enum_type;
74 
75 typedef enum
76 {
77     WLAN_PE_DIAG_SCAN_REQ_EVENT = 0,
78     WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT,
79     WLAN_PE_DIAG_SCAN_RSP_EVENT,
80     WLAN_PE_DIAG_JOIN_REQ_EVENT,
81     WLAN_PE_DIAG_JOIN_RSP_EVENT,
82     WLAN_PE_DIAG_SETCONTEXT_REQ_EVENT,
83     WLAN_PE_DIAG_SETCONTEXT_RSP_EVENT,
84     WLAN_PE_DIAG_REASSOC_REQ_EVENT,
85     WLAN_PE_DIAG_REASSOC_RSP_EVENT,
86     WLAN_PE_DIAG_AUTH_REQ_EVENT,
87     WLAN_PE_DIAG_AUTH_RSP_EVENT = 10,
88     WLAN_PE_DIAG_DISASSOC_REQ_EVENT,
89     WLAN_PE_DIAG_DISASSOC_RSP_EVENT,
90     WLAN_PE_DIAG_DISASSOC_IND_EVENT,
91     WLAN_PE_DIAG_DISASSOC_CNF_EVENT,
92     WLAN_PE_DIAG_DEAUTH_REQ_EVENT,
93     WLAN_PE_DIAG_DEAUTH_RSP_EVENT,
94     WLAN_PE_DIAG_DEAUTH_IND_EVENT,
95     WLAN_PE_DIAG_START_BSS_REQ_EVENT,
96     WLAN_PE_DIAG_START_BSS_RSP_EVENT,
97     WLAN_PE_DIAG_AUTH_IND_EVENT = 20,
98     WLAN_PE_DIAG_ASSOC_IND_EVENT,
99     WLAN_PE_DIAG_ASSOC_CNF_EVENT,
100     WLAN_PE_DIAG_REASSOC_IND_EVENT,
101     WLAN_PE_DIAG_SWITCH_CHL_REQ_EVENT,
102     WLAN_PE_DIAG_SWITCH_CHL_RSP_EVENT,
103     WLAN_PE_DIAG_STOP_BSS_REQ_EVENT,
104     WLAN_PE_DIAG_STOP_BSS_RSP_EVENT,
105     WLAN_PE_DIAG_DEAUTH_CNF_EVENT,
106     WLAN_PE_DIAG_ADDTS_REQ_EVENT,
107     WLAN_PE_DIAG_ADDTS_RSP_EVENT = 30,
108     WLAN_PE_DIAG_DELTS_REQ_EVENT,
109     WLAN_PE_DIAG_DELTS_RSP_EVENT,
110     WLAN_PE_DIAG_DELTS_IND_EVENT,
111     WLAN_PE_DIAG_ENTER_BMPS_REQ_EVENT,
112     WLAN_PE_DIAG_ENTER_BMPS_RSP_EVENT,
113     WLAN_PE_DIAG_EXIT_BMPS_REQ_EVENT,
114     WLAN_PE_DIAG_EXIT_BMPS_RSP_EVENT,
115     WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT,
116     WLAN_PE_DIAG_ENTER_IMPS_REQ_EVENT,
117     WLAN_PE_DIAG_ENTER_IMPS_RSP_EVENT = 40,
118     WLAN_PE_DIAG_EXIT_IMPS_REQ_EVENT,
119     WLAN_PE_DIAG_EXIT_IMPS_RSP_EVENT,
120     WLAN_PE_DIAG_ENTER_UAPSD_REQ_EVENT,
121     WLAN_PE_DIAG_ENTER_UAPSD_RSP_EVENT,
122     WLAN_PE_DIAG_EXIT_UAPSD_REQ_EVENT,
123     WLAN_PE_DIAG_EXIT_UAPSD_RSP_EVENT,
124     WLAN_PE_DIAG_WOWL_ADD_BCAST_PTRN_EVENT,
125     WLAN_PE_DIAG_WOWL_DEL_BCAST_PTRN_EVENT,
126     WLAN_PE_DIAG_ENTER_WOWL_REQ_EVENT,
127     WLAN_PE_DIAG_ENTER_WOWL_RSP_EVENT = 50,
128     WLAN_PE_DIAG_EXIT_WOWL_REQ_EVENT,
129     WLAN_PE_DIAG_EXIT_WOWL_RSP_EVENT,
130     WLAN_PE_DIAG_HAL_ADDBA_REQ_EVENT,
131     WLAN_PE_DIAG_HAL_ADDBA_RSP_EVENT,
132     WLAN_PE_DIAG_HAL_DELBA_IND_EVENT,
133     WLAN_PE_DIAG_HB_FAILURE_TIMEOUT,
134     WLAN_PE_DIAG_PRE_AUTH_REQ_EVENT,
135     WLAN_PE_DIAG_PRE_AUTH_RSP_EVENT,
136     WLAN_PE_DIAG_PREAUTH_DONE,
137     WLAN_PE_DIAG_REASSOCIATING = 60,
138     WLAN_PE_DIAG_CONNECTED,
139     WLAN_PE_DIAG_ASSOC_REQ_EVENT,
140     WLAN_PE_DIAG_AUTH_COMP_EVENT,
141     WLAN_PE_DIAG_ASSOC_COMP_EVENT,
142     WLAN_PE_DIAG_AUTH_START_EVENT,
143     WLAN_PE_DIAG_ASSOC_START_EVENT,
144     WLAN_PE_DIAG_REASSOC_START_EVENT,
145     WLAN_PE_DIAG_ROAM_AUTH_START_EVENT,
146     WLAN_PE_DIAG_ROAM_AUTH_COMP_EVENT,
147     WLAN_PE_DIAG_ROAM_ASSOC_START_EVENT = 70,
148     WLAN_PE_DIAG_ROAM_ASSOC_COMP_EVENT,
149     WLAN_PE_DIAG_SCAN_COMP_EVENT,
150     WLAN_PE_DIAG_SCAN_RES_FOUND_EVENT,
151 } wlan_host_diag_event_type;
152 
153 typedef struct wlan_pe_event {
154     char bssid[6];
155     u16 event_type;
156     u16 sme_state;
157     u16 mlm_state;
158     u16 status;
159     u16 reason_code;
160 } __attribute__((packed)) wlan_pe_event_t;
161 
162 typedef enum {
163     WLAN_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED = 0,
164     WLAN_DRIVER_EAPOL_FRAME_RECEIVED,
165 } wlan_eapol_event_type;
166 
167 #define EAPOL_MASK 0x8013
168 #define EAPOL_M1_MASK 0x8000
169 #define EAPOL_M2_MASK 0x0001
170 #define EAPOL_M3_MASK 0x8013
171 #define EAPOL_M4_MASK 0x0003
172 
173 typedef struct wlan_eapol_event {
174     u8 event_sub_type;
175     u8 eapol_packet_type;
176     u16 eapol_key_info;
177     u16 eapol_rate;
178     u8 dest_addr[6];
179     u8 src_addr[6];
180 } __attribute__((packed)) wlan_eapol_event_t;
181 
182 /*EVENT_WLAN_EXTSCAN_FEATURE_STARTED */
183 typedef struct wlan_ext_bucket {
184     u8 bucket_id;
185     u8 base_period_multiplier;
186     u16 min_dwell_time_active;
187     u16 max_dwell_time_active;
188     u16 min_dwell_time_passive;
189     u16 max_dwell_time_passive;
190     u8 num_channels;
191     u8 channel_offset;
192     u8 forwarding_flags;
193     u8 channel_band;
194     u32 notify_extscan_events;
195 } __attribute__((packed)) wlan_ext_bucket_t;
196 
197 typedef struct {
198     u32 base_period;
199     u32 max_iterations;
200     u32 forwarding_flags;
201     u32 configuration_flags;
202     u32 notify_extscan_events;
203     u32 scan_priority;
204     u32 max_bssids_per_scan_cycle;
205     u32 min_rssi;
206     u32 max_table_usage;
207     u32 min_dwell_time_active;
208     u32 max_dwell_time_active;
209     u32 min_dwell_time_passive;
210     u32 max_dwell_time_passive;
211     u32 min_rest_time;
212     u32 max_rest_time;
213     u32 n_probes;
214     u32 repeat_probe_time;
215     u32 probe_spacing_time;
216     u32 idle_time;
217     u32 max_scan_time;
218     u32 probe_delay;
219     u32 scan_ctrl_flags;
220     u32 burst_duration;
221     u32 num_buckets;
222     wlan_ext_bucket bucket_list[8];
223 } __attribute__((packed)) wlan_ext_scan_feature_started_payload_type;
224 /*End EVENT_WLAN_EXTSCAN_FEATURE_STARTED*/
225 
226 /*EVENT_WLAN_EXTSCAN_FEATURE_CHANNEL_CONFIG*/
227 typedef struct {
228     u8 bucket_id;
229     u16 scan_channels[40];
230 } __attribute__((packed)) wlan_ext_bucket_channels;
231 
232 typedef struct {
233     wlan_ext_bucket_channels bucket_list[3];
234 } __attribute__((packed)) wlan_ext_bucket_channel_config_payload_type;
235 
236 /*End EVENT_WLAN_EXTSCAN_FEATURE_CHANNEL_CONFIG*/
237 
238 /*EVENT_WLAN_EXTSCAN_CYCLE_STARTED*/
239 typedef struct {
240     u32 scan_id;
241     u32 timer_tick;
242     u32 scheduled_bucket_mask;
243     u32 scan_cycle_count;
244 } __attribute__((packed)) wlan_ext_scan_cycle_started_payload_type;
245 /*End EVENT_WLAN_EXTSCAN_CYCLE_STARTED*/
246 
247 /*EVENT_WLAN_EXTSCAN_CYCLE_COMPLETED*/
248 typedef struct {
249     u32 scan_id;
250     u32 timer_tick;
251     u32 scheduled_bucket_mask;
252     u32 scan_cycle_count;
253 } __attribute__((packed)) wlan_ext_scan_cycle_completed_payload_type;
254 /*End EVENT_WLAN_EXTSCAN_CYCLE_COMPLETED*/
255 
256 /*EVENT_WLAN_EXTSCAN_BUCKET_STARTED*/
257 typedef struct {
258     u8 bucket_id;
259 } __attribute__((packed)) wlan_ext_scan_bucket_started_payload_type;
260 /*End EVENT_WLAN_EXTSCAN_BUCKET_STARTED*/
261 
262 /*EVENT_WLAN_EXTSCAN_BUCKET_COMPLETED*/
263 typedef struct {
264     u8 bucket_id;
265 } __attribute__((packed))  wlan_ext_scan_bucket_completed_payload_type;
266 /*End EVENT_WLAN_EXTSCAN_BUCKET_COMPLETED*/
267 
268 /*EVENT_WLAN_ROAM_SCAN_STARTED*/
269 typedef struct {
270     u32 scan_id;
271     u32 roam_scan_flags;
272     u32 cur_rssi;
273     u16 scan_params[18];
274     u16 scan_channels[40]; // first 40 channels only
275 } __attribute__((packed)) wlan_roam_scan_started_payload_type;
276 /*End EVENT_WLAN_ROAM_SCAN_STARTED*/
277 
278 /*EVENT_WLAN_ROAM_SCAN_COMPLETE*/
279 typedef struct {
280     u32 scan_id;
281     u32 reason;
282     u32 completion_flags;
283     u32 num_candidate;
284     u32 flags;
285 } __attribute__((packed)) wlan_roam_scan_complete_payload_type;
286 /*End EVENT_WLAN_ROAM_SCAN_COMPLETE*/
287 
288 /*EVENT_WLAN_ROAM_CANDIDATE_FOUND*/
289 typedef struct {
290     u8 channel;
291     u8 rssi;
292     u8 bssid[6];
293     u8 ssid[33];
294     u8 auth_mode;
295     u8 ucast_cipher;
296     u8 mcast_cipher;
297 } __attribute__((packed)) wlan_roam_candidate_found_payload_type;
298 /*End EVENT_WLAN_ROAM_CANDIDATE_FOUND*/
299 
300 /*EVENT_WLAN_ROAM_SCAN_CONFIG*/
301 typedef struct {
302     u32 flags;
303     u32 roam_scan_config[8];
304 } __attribute__((packed)) wlan_roam_scan_config_payload_type;
305 /*End EVENT_WLAN_ROAM_SCAN_CONFIG*/
306 
307 /* EVENT_WLAN_BT_COEX_BT_SCO_START */
308 typedef struct {
309     u8 link_id;
310     u8 link_state;
311     u8 link_role;
312     u8 link_type;
313     u16 Tsco;
314     u8 Rsco;
315 } __attribute__((packed)) wlan_bt_coex_bt_sco_start_payload_type;
316 /* End EVENT_WLAN_BT_COEX_BT_SCO_START */
317 
318 /* EVENT_WLAN_BT_COEX_BT_SCO_STOP */
319 typedef struct {
320     u8 link_id;
321     u8 link_state;
322     u8 link_role;
323     u8 link_type;
324     u16 Tsco;
325     u8 Rsco;
326 } __attribute__((packed)) wlan_bt_coex_bt_sco_stop_payload_type;
327 /* End EVENT_WLAN_BT_COEX_BT_SCO_STOP */
328 
329 /* EVENT_WLAN_BT_COEX_BT_SCAN_START */
330 typedef struct {
331     u8 scan_type;
332     u8 scan_bitmap;
333 } __attribute__((packed)) wlan_bt_coex_bt_scan_start_payload_type;
334 
335 /* End EVENT_WLAN_BT_COEX_BT_SCAN_START */
336 
337 /* EVENT_WLAN_BT_COEX_BT_SCAN_STOP */
338 typedef struct {
339     u8 scan_type;
340     u8 scan_bitmap;
341 } __attribute__((packed)) wlan_bt_coex_bt_scan_stop_payload_type;
342 /* End EVENT_WLAN_BT_COEX_BT_SCAN_STOP */
343 
344 /* EVENT_WIFI_BT_COEX_BT_HID_START */
345 typedef struct {
346     u8 link_id;
347     u8 link_state;
348     u8 link_role;
349     u8 Tsniff;
350     u8 attempts;
351 } __attribute__((packed)) wlan_bt_coex_bt_hid_start_payload_type;
352 /* End EVENT_WIFI_BT_COEX_BT_HID_START */
353 
354 /* EVENT_WIFI_BT_COEX_BT_HID_STOP */
355 typedef struct {
356     u8 link_id;
357     u8 link_state;
358     u8 link_role;
359     u8 Tsniff;
360     u8 attempts;
361 } __attribute__((packed)) wlan_bt_coex_bt_hid_stop_payload_type;
362 /* End EVENT_WIFI_BT_COEX_BT_HID_STOP */
363 
364 /* EVENT_WLAN_EXTSCAN_FEATURE_STOP */
365 typedef struct {
366     u32 request_id;
367 } __attribute__((packed)) wlan_ext_scan_feature_stop_payload_type;
368 /* End EVENT_WLAN_EXTSCAN_FEATURE_STOP */
369 
370 /* EVENT_WLAN_EXTSCAN_RESULTS_AVAILABLE */
371 typedef struct {
372     u32 request_id;
373     u32 table_type;
374     u32 entries_in_use;
375     u32 maximum_entries;
376     u32 scan_count_after_getResults;
377     u8 threshold_num_scans;
378 } __attribute__((packed)) wlan_ext_scan_results_available_payload_type;
379 /* End EVENT_WLAN_EXTSCAN_RESULTS_AVAILABLE */
380 
381 /* Log LOG_WLAN_EXTSCAN_CAPABILITIES */
382 typedef struct {
383     u32 header;
384     u32 request_id;
385     u32 requestor_id;
386     u32 vdev_id;
387     u32 num_extscan_cache_tables;
388     u32 num_wlan_change_monitor_tables;
389     u32 num_hotlist_monitor_tables;
390     u32 rtt_one_sided_supported;
391     u32 rtt_11v_supported;
392     u32 rtt_ftm_supported;
393     u32 num_extscan_cache_capabilities;
394     u32 num_extscan_wlan_change_capabilities;
395     u32 num_extscan_hotlist_capabilities;
396     u32 num_roam_ssid_whitelist;
397     u32 num_roam_bssid_blacklist;
398     u32 num_roam_bssid_preferred_list;
399     u32 num_extscan_hotlist_ssid;
400     u32 num_epno_networks;
401 } __attribute__((packed)) wlan_extscan_capabilities_event_fixed_param;
402 
403 typedef struct {
404     u32 header;
405     u32 table_id;
406     u32 scan_cache_entry_size;
407     u32 max_scan_cache_entries;
408     u32 max_buckets;
409     u32 max_bssid_per_scan;
410     u32 max_table_usage_threshold;
411 } __attribute__((packed)) wlan_extscan_cache_capabilities;
412 
413 typedef struct {
414     u32 tlv_header;
415     u32 table_id;
416     u32 wlan_hotlist_entry_size;
417     u32 max_hotlist_entries;
418 } __attribute__((packed)) wlan_extscan_hotlist_monitor_capabilities;
419 
420 typedef struct {
421     u32 request_id;
422     wlan_extscan_capabilities_event_fixed_param extscan_capabilities;
423     wlan_extscan_cache_capabilities extscan_cache_capabilities;
424     wlan_extscan_hotlist_monitor_capabilities extscan_hotlist_monitor_capabilities;
425 } __attribute__((packed)) wlan_ext_scan_capabilities_payload_type;
426 /* End LOG_WLAN_EXTSCAN_CAPABILITIES */
427 
428 /* EVENT_WLAN_BEACON_RECEIVED */
429 typedef struct {
430     u32 beacon_rssi;
431 } __attribute__((packed)) wlan_beacon_received_payload_type;
432 /* End EVENT_WLAN_BEACON_RECEIVED */
433 
434 typedef struct {
435     u8 ucBaPeerMac[6];
436     u8 ucBaTid;
437     u8 ucBaBufferSize;
438     u16 ucBaSSN;
439     u8 fInitiator;
440 } __attribute__((packed)) wlan_add_block_ack_success_payload_type;
441 
442 /* EVENT_WLAN_ADD_BLOCK_ACK_FAILED */
443 typedef struct {
444     u8 ucBaPeerMac[6];
445     u8 ucBaTid;
446     u8 ucReasonCode;
447     u8 fInitiator;
448 } __attribute__((packed)) wlan_add_block_ack_failed_payload_type;
449 
450 #endif /* WIFILOGGER_EVENT_DEFS_H */
451