2009-08-06 21:25:28 +08:00
|
|
|
/*
|
|
|
|
* This file is part of wl1271
|
|
|
|
*
|
|
|
|
* Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
|
|
|
|
* Copyright (C) 2008-2009 Nokia Corporation
|
|
|
|
*
|
|
|
|
* Contact: Luciano Coelho <luciano.coelho@nokia.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* version 2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
|
|
* 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-11-08 19:20:10 +08:00
|
|
|
#ifndef __EVENT_H__
|
|
|
|
#define __EVENT_H__
|
2009-08-06 21:25:28 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Mbox events
|
|
|
|
*
|
|
|
|
* The event mechanism is based on a pair of event buffers (buffers A and
|
|
|
|
* B) at fixed locations in the target's memory. The host processes one
|
|
|
|
* buffer while the other buffer continues to collect events. If the host
|
|
|
|
* is not processing events, an interrupt is issued to signal that a buffer
|
|
|
|
* is ready. Once the host is done with processing events from one buffer,
|
|
|
|
* it signals the target (with an ACK interrupt) that the event buffer is
|
|
|
|
* free.
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum {
|
2010-04-09 16:07:30 +08:00
|
|
|
RSSI_SNR_TRIGGER_0_EVENT_ID = BIT(0),
|
|
|
|
RSSI_SNR_TRIGGER_1_EVENT_ID = BIT(1),
|
|
|
|
RSSI_SNR_TRIGGER_2_EVENT_ID = BIT(2),
|
|
|
|
RSSI_SNR_TRIGGER_3_EVENT_ID = BIT(3),
|
|
|
|
RSSI_SNR_TRIGGER_4_EVENT_ID = BIT(4),
|
|
|
|
RSSI_SNR_TRIGGER_5_EVENT_ID = BIT(5),
|
|
|
|
RSSI_SNR_TRIGGER_6_EVENT_ID = BIT(6),
|
|
|
|
RSSI_SNR_TRIGGER_7_EVENT_ID = BIT(7),
|
2009-08-06 21:25:28 +08:00
|
|
|
MEASUREMENT_START_EVENT_ID = BIT(8),
|
|
|
|
MEASUREMENT_COMPLETE_EVENT_ID = BIT(9),
|
|
|
|
SCAN_COMPLETE_EVENT_ID = BIT(10),
|
|
|
|
SCHEDULED_SCAN_COMPLETE_EVENT_ID = BIT(11),
|
|
|
|
AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(12),
|
|
|
|
PS_REPORT_EVENT_ID = BIT(13),
|
|
|
|
PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(14),
|
|
|
|
DISCONNECT_EVENT_COMPLETE_ID = BIT(15),
|
|
|
|
JOIN_EVENT_COMPLETE_ID = BIT(16),
|
|
|
|
CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(17),
|
|
|
|
BSS_LOSE_EVENT_ID = BIT(18),
|
|
|
|
REGAINED_BSS_EVENT_ID = BIT(19),
|
2011-06-26 15:36:03 +08:00
|
|
|
MAX_TX_RETRY_EVENT_ID = BIT(20),
|
2011-03-06 22:32:14 +08:00
|
|
|
/* STA: dummy paket for dynamic mem blocks */
|
|
|
|
DUMMY_PACKET_EVENT_ID = BIT(21),
|
|
|
|
/* AP: STA remove complete */
|
|
|
|
STA_REMOVE_COMPLETE_EVENT_ID = BIT(21),
|
2009-08-06 21:25:28 +08:00
|
|
|
SOFT_GEMINI_SENSE_EVENT_ID = BIT(22),
|
2011-06-26 15:36:03 +08:00
|
|
|
/* STA: SG prediction */
|
2009-08-06 21:25:28 +08:00
|
|
|
SOFT_GEMINI_PREDICTION_EVENT_ID = BIT(23),
|
2011-06-26 15:36:03 +08:00
|
|
|
/* AP: Inactive STA */
|
|
|
|
INACTIVE_STA_EVENT_ID = BIT(23),
|
2009-08-06 21:25:28 +08:00
|
|
|
SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24),
|
|
|
|
PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25),
|
|
|
|
DBG_EVENT_ID = BIT(26),
|
|
|
|
HEALTH_CHECK_REPLY_EVENT_ID = BIT(27),
|
|
|
|
PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28),
|
|
|
|
PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29),
|
2011-05-22 21:10:22 +08:00
|
|
|
BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(30),
|
2009-08-06 21:25:28 +08:00
|
|
|
EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff,
|
|
|
|
};
|
|
|
|
|
2009-11-03 02:22:11 +08:00
|
|
|
enum {
|
|
|
|
EVENT_ENTER_POWER_SAVE_FAIL = 0,
|
|
|
|
EVENT_ENTER_POWER_SAVE_SUCCESS,
|
|
|
|
};
|
|
|
|
|
2009-08-06 21:25:28 +08:00
|
|
|
struct event_debug_report {
|
|
|
|
u8 debug_event_id;
|
|
|
|
u8 num_params;
|
2009-10-15 15:33:29 +08:00
|
|
|
__le16 pad;
|
|
|
|
__le32 report_1;
|
|
|
|
__le32 report_2;
|
|
|
|
__le32 report_3;
|
2010-06-03 02:10:09 +08:00
|
|
|
} __packed;
|
2009-08-06 21:25:28 +08:00
|
|
|
|
|
|
|
#define NUM_OF_RSSI_SNR_TRIGGERS 8
|
|
|
|
|
|
|
|
struct event_mailbox {
|
2009-10-15 15:33:29 +08:00
|
|
|
__le32 events_vector;
|
|
|
|
__le32 events_mask;
|
|
|
|
__le32 reserved_1;
|
|
|
|
__le32 reserved_2;
|
2009-08-06 21:25:28 +08:00
|
|
|
|
|
|
|
u8 dbg_event_id;
|
|
|
|
u8 num_relevant_params;
|
2009-10-15 15:33:29 +08:00
|
|
|
__le16 reserved_3;
|
|
|
|
__le32 event_report_p1;
|
|
|
|
__le32 event_report_p2;
|
|
|
|
__le32 event_report_p3;
|
2009-08-06 21:25:28 +08:00
|
|
|
|
|
|
|
u8 number_of_scan_results;
|
|
|
|
u8 scan_tag;
|
|
|
|
u8 reserved_4[2];
|
2009-10-15 15:33:29 +08:00
|
|
|
__le32 compl_scheduled_scan_status;
|
2009-08-06 21:25:28 +08:00
|
|
|
|
2009-10-15 15:33:29 +08:00
|
|
|
__le16 scheduled_scan_attended_channels;
|
2009-08-06 21:25:28 +08:00
|
|
|
u8 soft_gemini_sense_info;
|
|
|
|
u8 soft_gemini_protective_info;
|
|
|
|
s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
|
|
|
|
u8 channel_switch_status;
|
|
|
|
u8 scheduled_scan_status;
|
|
|
|
u8 ps_status;
|
|
|
|
|
2010-10-17 00:53:48 +08:00
|
|
|
/* AP FW only */
|
|
|
|
u8 hlid_removed;
|
2011-06-26 15:36:03 +08:00
|
|
|
|
|
|
|
/* a bitmap of hlids for stations that have been inactive too long */
|
2010-10-17 00:53:48 +08:00
|
|
|
__le16 sta_aging_status;
|
2011-06-26 15:36:03 +08:00
|
|
|
|
|
|
|
/* a bitmap of hlids for stations which didn't respond to TX */
|
2010-10-17 00:53:48 +08:00
|
|
|
__le16 sta_tx_retry_exceeded;
|
|
|
|
|
2011-05-22 21:10:22 +08:00
|
|
|
/*
|
|
|
|
* Bitmap, Each bit set represents the Role ID for which this constraint
|
|
|
|
* is set. Range: 0 - FF, FF means ANY role
|
|
|
|
*/
|
|
|
|
u8 ba_role_id;
|
|
|
|
/*
|
|
|
|
* Bitmap, Each bit set represents the Link ID for which this constraint
|
|
|
|
* is set. Not applicable if ba_role_id is set to ANY role (FF).
|
|
|
|
* Range: 0 - FFFF, FFFF means ANY link in that role
|
|
|
|
*/
|
|
|
|
u8 ba_link_id;
|
|
|
|
u8 ba_allowed;
|
|
|
|
|
|
|
|
u8 reserved_5[21];
|
2010-06-03 02:10:09 +08:00
|
|
|
} __packed;
|
2009-08-06 21:25:28 +08:00
|
|
|
|
|
|
|
int wl1271_event_unmask(struct wl1271 *wl);
|
|
|
|
void wl1271_event_mbox_config(struct wl1271 *wl);
|
2009-12-11 21:40:59 +08:00
|
|
|
int wl1271_event_handle(struct wl1271 *wl, u8 mbox);
|
2010-07-08 22:50:00 +08:00
|
|
|
void wl1271_pspoll_work(struct work_struct *work);
|
2009-08-06 21:25:28 +08:00
|
|
|
|
2011-06-26 15:36:03 +08:00
|
|
|
/* Functions from main.c */
|
|
|
|
bool wl1271_is_active_sta(struct wl1271 *wl, u8 hlid);
|
|
|
|
|
2009-08-06 21:25:28 +08:00
|
|
|
#endif
|