1
2
3
4
5
6
7
8
9 #ifndef __WL1251_EVENT_H__
10 #define __WL1251_EVENT_H__
11
12
13
14
15
16
17
18
19
20
21
22
23
24 enum {
25 RESERVED1_EVENT_ID = BIT(0),
26 RESERVED2_EVENT_ID = BIT(1),
27 MEASUREMENT_START_EVENT_ID = BIT(2),
28 SCAN_COMPLETE_EVENT_ID = BIT(3),
29 CALIBRATION_COMPLETE_EVENT_ID = BIT(4),
30 ROAMING_TRIGGER_LOW_RSSI_EVENT_ID = BIT(5),
31 PS_REPORT_EVENT_ID = BIT(6),
32 SYNCHRONIZATION_TIMEOUT_EVENT_ID = BIT(7),
33 HEALTH_REPORT_EVENT_ID = BIT(8),
34 ACI_DETECTION_EVENT_ID = BIT(9),
35 DEBUG_REPORT_EVENT_ID = BIT(10),
36 MAC_STATUS_EVENT_ID = BIT(11),
37 DISCONNECT_EVENT_COMPLETE_ID = BIT(12),
38 JOIN_EVENT_COMPLETE_ID = BIT(13),
39 CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(14),
40 BSS_LOSE_EVENT_ID = BIT(15),
41 ROAMING_TRIGGER_MAX_TX_RETRY_EVENT_ID = BIT(16),
42 MEASUREMENT_COMPLETE_EVENT_ID = BIT(17),
43 AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(18),
44 SCHEDULED_SCAN_COMPLETE_EVENT_ID = BIT(19),
45 PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(20),
46 RESET_BSS_EVENT_ID = BIT(21),
47 REGAINED_BSS_EVENT_ID = BIT(22),
48 ROAMING_TRIGGER_REGAINED_RSSI_EVENT_ID = BIT(23),
49 ROAMING_TRIGGER_LOW_SNR_EVENT_ID = BIT(24),
50 ROAMING_TRIGGER_REGAINED_SNR_EVENT_ID = BIT(25),
51
52 DBG_EVENT_ID = BIT(26),
53 BT_PTA_SENSE_EVENT_ID = BIT(27),
54 BT_PTA_PREDICTION_EVENT_ID = BIT(28),
55 BT_PTA_AVALANCHE_EVENT_ID = BIT(29),
56
57 PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(30),
58
59 EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff,
60 };
61
62 struct event_debug_report {
63 u8 debug_event_id;
64 u8 num_params;
65 u16 pad;
66 u32 report_1;
67 u32 report_2;
68 u32 report_3;
69 } __packed;
70
71 struct event_mailbox {
72 u32 events_vector;
73 u32 events_mask;
74 u32 reserved_1;
75 u32 reserved_2;
76
77 char average_rssi_level;
78 u8 ps_status;
79 u8 channel_switch_status;
80 u8 scheduled_scan_status;
81
82
83 u16 scheduled_scan_channels;
84
85
86 u16 health_report;
87 u16 bad_fft_counter;
88 u8 bt_pta_sense_info;
89 u8 bt_pta_protective_info;
90 u32 reserved;
91 u32 debug_report[2];
92
93
94 u32 fcs_err_counter;
95
96 struct event_debug_report report;
97 u8 average_snr_level;
98 u8 padding[19];
99 } __packed;
100
101 enum {
102 EVENT_ENTER_POWER_SAVE_FAIL = 0,
103 EVENT_ENTER_POWER_SAVE_SUCCESS,
104 EVENT_EXIT_POWER_SAVE_FAIL,
105 EVENT_EXIT_POWER_SAVE_SUCCESS,
106 };
107
108 int wl1251_event_unmask(struct wl1251 *wl);
109 void wl1251_event_mbox_config(struct wl1251 *wl);
110 int wl1251_event_handle(struct wl1251 *wl, u8 mbox);
111 int wl1251_event_wait(struct wl1251 *wl, u32 mask, int timeout_ms);
112
113 #endif