1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * This file is part of wl1251
5 * Copyright (c) 1998-2007 Texas Instruments Incorporated
6 * Copyright (C) 2008 Nokia Corporation
9 #ifndef __WL1251_EVENT_H__
10 #define __WL1251_EVENT_H__
15 * The event mechanism is based on a pair of event buffers (buffers A and
16 * B) at fixed locations in the target's memory. The host processes one
17 * buffer while the other buffer continues to collect events. If the host
18 * is not processing events, an interrupt is issued to signal that a buffer
19 * is ready. Once the host is done with processing events from one buffer,
20 * it signals the target (with an ACK interrupt) that the event buffer is
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),
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),
57 PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(30),
59 EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff,
62 struct event_debug_report {
71 struct event_mailbox {
77 char average_rssi_level;
79 u8 channel_switch_status;
80 u8 scheduled_scan_status;
82 /* Channels scanned by the scheduled scan */
83 u16 scheduled_scan_channels;
85 /* If bit 0 is set -> target's fatal error */
89 u8 bt_pta_protective_info;
93 /* Number of FCS errors since last event */
96 struct event_debug_report report;
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,
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);