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