2 * This file is part of wl1271
4 * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
5 * Copyright (C) 2008-2009 Nokia Corporation
7 * Contact: Luciano Coelho <luciano.coelho@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
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 RSSI_SNR_TRIGGER_0_EVENT_ID
= BIT(0),
42 RSSI_SNR_TRIGGER_1_EVENT_ID
= BIT(1),
43 RSSI_SNR_TRIGGER_2_EVENT_ID
= BIT(2),
44 RSSI_SNR_TRIGGER_3_EVENT_ID
= BIT(3),
45 RSSI_SNR_TRIGGER_4_EVENT_ID
= BIT(4),
46 RSSI_SNR_TRIGGER_5_EVENT_ID
= BIT(5),
47 RSSI_SNR_TRIGGER_6_EVENT_ID
= BIT(6),
48 RSSI_SNR_TRIGGER_7_EVENT_ID
= BIT(7),
49 MEASUREMENT_START_EVENT_ID
= BIT(8),
50 MEASUREMENT_COMPLETE_EVENT_ID
= BIT(9),
51 SCAN_COMPLETE_EVENT_ID
= BIT(10),
52 SCHEDULED_SCAN_COMPLETE_EVENT_ID
= BIT(11),
53 AP_DISCOVERY_COMPLETE_EVENT_ID
= BIT(12),
54 PS_REPORT_EVENT_ID
= BIT(13),
55 PSPOLL_DELIVERY_FAILURE_EVENT_ID
= BIT(14),
56 DISCONNECT_EVENT_COMPLETE_ID
= BIT(15),
57 JOIN_EVENT_COMPLETE_ID
= BIT(16),
58 CHANNEL_SWITCH_COMPLETE_EVENT_ID
= BIT(17),
59 BSS_LOSE_EVENT_ID
= BIT(18),
60 REGAINED_BSS_EVENT_ID
= BIT(19),
61 ROAMING_TRIGGER_MAX_TX_RETRY_EVENT_ID
= BIT(20),
62 STA_REMOVE_COMPLETE_EVENT_ID
= BIT(21), /* AP */
63 SOFT_GEMINI_SENSE_EVENT_ID
= BIT(22),
64 SOFT_GEMINI_PREDICTION_EVENT_ID
= BIT(23),
65 SOFT_GEMINI_AVALANCHE_EVENT_ID
= BIT(24),
66 PLT_RX_CALIBRATION_COMPLETE_EVENT_ID
= BIT(25),
67 DBG_EVENT_ID
= BIT(26),
68 HEALTH_CHECK_REPLY_EVENT_ID
= BIT(27),
69 PERIODIC_SCAN_COMPLETE_EVENT_ID
= BIT(28),
70 PERIODIC_SCAN_REPORT_EVENT_ID
= BIT(29),
71 BA_SESSION_TEAR_DOWN_EVENT_ID
= BIT(30),
72 EVENT_MBOX_ALL_EVENT_ID
= 0x7fffffff,
76 EVENT_ENTER_POWER_SAVE_FAIL
= 0,
77 EVENT_ENTER_POWER_SAVE_SUCCESS
,
78 EVENT_EXIT_POWER_SAVE_FAIL
,
79 EVENT_EXIT_POWER_SAVE_SUCCESS
,
82 struct event_debug_report
{
91 #define NUM_OF_RSSI_SNR_TRIGGERS 8
93 struct event_mailbox
{
100 u8 num_relevant_params
;
102 __le32 event_report_p1
;
103 __le32 event_report_p2
;
104 __le32 event_report_p3
;
106 u8 number_of_scan_results
;
109 __le32 compl_scheduled_scan_status
;
111 __le16 scheduled_scan_attended_channels
;
112 u8 soft_gemini_sense_info
;
113 u8 soft_gemini_protective_info
;
114 s8 rssi_snr_trigger_metric
[NUM_OF_RSSI_SNR_TRIGGERS
];
115 u8 channel_switch_status
;
116 u8 scheduled_scan_status
;
121 __le16 sta_aging_status
;
122 __le16 sta_tx_retry_exceeded
;
127 int wl1271_event_unmask(struct wl1271
*wl
);
128 void wl1271_event_mbox_config(struct wl1271
*wl
);
129 int wl1271_event_handle(struct wl1271
*wl
, u8 mbox
);
130 void wl1271_pspoll_work(struct work_struct
*work
);