2 * This file is part of wl1251
4 * Copyright (c) 1998-2007 Texas Instruments Incorporated
5 * Copyright (C) 2008 Nokia Corporation
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 #ifndef __WL1251_EVENT_H__
24 #define __WL1251_EVENT_H__
29 * The event mechanism is based on a pair of event buffers (buffers A and
30 * B) at fixed locations in the target's memory. The host processes one
31 * buffer while the other buffer continues to collect events. If the host
32 * is not processing events, an interrupt is issued to signal that a buffer
33 * is ready. Once the host is done with processing events from one buffer,
34 * it signals the target (with an ACK interrupt) that the event buffer is
39 RESERVED1_EVENT_ID
= BIT(0),
40 RESERVED2_EVENT_ID
= BIT(1),
41 MEASUREMENT_START_EVENT_ID
= BIT(2),
42 SCAN_COMPLETE_EVENT_ID
= BIT(3),
43 CALIBRATION_COMPLETE_EVENT_ID
= BIT(4),
44 ROAMING_TRIGGER_LOW_RSSI_EVENT_ID
= BIT(5),
45 PS_REPORT_EVENT_ID
= BIT(6),
46 SYNCHRONIZATION_TIMEOUT_EVENT_ID
= BIT(7),
47 HEALTH_REPORT_EVENT_ID
= BIT(8),
48 ACI_DETECTION_EVENT_ID
= BIT(9),
49 DEBUG_REPORT_EVENT_ID
= BIT(10),
50 MAC_STATUS_EVENT_ID
= BIT(11),
51 DISCONNECT_EVENT_COMPLETE_ID
= BIT(12),
52 JOIN_EVENT_COMPLETE_ID
= BIT(13),
53 CHANNEL_SWITCH_COMPLETE_EVENT_ID
= BIT(14),
54 BSS_LOSE_EVENT_ID
= BIT(15),
55 ROAMING_TRIGGER_MAX_TX_RETRY_EVENT_ID
= BIT(16),
56 MEASUREMENT_COMPLETE_EVENT_ID
= BIT(17),
57 AP_DISCOVERY_COMPLETE_EVENT_ID
= BIT(18),
58 SCHEDULED_SCAN_COMPLETE_EVENT_ID
= BIT(19),
59 PSPOLL_DELIVERY_FAILURE_EVENT_ID
= BIT(20),
60 RESET_BSS_EVENT_ID
= BIT(21),
61 REGAINED_BSS_EVENT_ID
= BIT(22),
62 ROAMING_TRIGGER_REGAINED_RSSI_EVENT_ID
= BIT(23),
63 ROAMING_TRIGGER_LOW_SNR_EVENT_ID
= BIT(24),
64 ROAMING_TRIGGER_REGAINED_SNR_EVENT_ID
= BIT(25),
66 DBG_EVENT_ID
= BIT(26),
67 BT_PTA_SENSE_EVENT_ID
= BIT(27),
68 BT_PTA_PREDICTION_EVENT_ID
= BIT(28),
69 BT_PTA_AVALANCHE_EVENT_ID
= BIT(29),
71 PLT_RX_CALIBRATION_COMPLETE_EVENT_ID
= BIT(30),
73 EVENT_MBOX_ALL_EVENT_ID
= 0x7fffffff,
76 struct event_debug_report
{
85 struct event_mailbox
{
91 char average_rssi_level
;
93 u8 channel_switch_status
;
94 u8 scheduled_scan_status
;
96 /* Channels scanned by the scheduled scan */
97 u16 scheduled_scan_channels
;
99 /* If bit 0 is set -> target's fatal error */
102 u8 bt_pta_sense_info
;
103 u8 bt_pta_protective_info
;
107 /* Number of FCS errors since last event */
110 struct event_debug_report report
;
111 u8 average_snr_level
;
115 int wl1251_event_unmask(struct wl1251
*wl
);
116 void wl1251_event_mbox_config(struct wl1251
*wl
);
117 int wl1251_event_handle(struct wl1251
*wl
, u8 mbox
);
118 int wl1251_event_wait(struct wl1251
*wl
, u32 mask
, int timeout_ms
);