event.h 4.1 KB
Newer Older
L
Luciano Coelho 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
/*
 * 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
 *
 */

S
Shahar Levi 已提交
25 26
#ifndef __EVENT_H__
#define __EVENT_H__
L
Luciano Coelho 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40

/*
 * 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 {
41 42 43 44 45 46 47 48
	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),
L
Luciano Coelho 已提交
49 50 51
	MEASUREMENT_START_EVENT_ID		 = BIT(8),
	MEASUREMENT_COMPLETE_EVENT_ID		 = BIT(9),
	SCAN_COMPLETE_EVENT_ID			 = BIT(10),
E
Eliad Peller 已提交
52
	WFD_DISCOVERY_COMPLETE_EVENT_ID		 = BIT(11),
L
Luciano Coelho 已提交
53
	AP_DISCOVERY_COMPLETE_EVENT_ID		 = BIT(12),
E
Eyal Shapira 已提交
54
	RESERVED1			         = BIT(13),
L
Luciano Coelho 已提交
55
	PSPOLL_DELIVERY_FAILURE_EVENT_ID	 = BIT(14),
56 57
	ROLE_STOP_COMPLETE_EVENT_ID		 = BIT(15),
	RADAR_DETECTED_EVENT_ID                  = BIT(16),
L
Luciano Coelho 已提交
58 59 60
	CHANNEL_SWITCH_COMPLETE_EVENT_ID	 = BIT(17),
	BSS_LOSE_EVENT_ID			 = BIT(18),
	REGAINED_BSS_EVENT_ID			 = BIT(19),
61
	MAX_TX_RETRY_EVENT_ID			 = BIT(20),
E
Eliad Peller 已提交
62
	DUMMY_PACKET_EVENT_ID			 = BIT(21),
L
Luciano Coelho 已提交
63
	SOFT_GEMINI_SENSE_EVENT_ID		 = BIT(22),
E
Eliad Peller 已提交
64
	CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID	 = BIT(23),
L
Luciano Coelho 已提交
65 66
	SOFT_GEMINI_AVALANCHE_EVENT_ID		 = BIT(24),
	PLT_RX_CALIBRATION_COMPLETE_EVENT_ID	 = BIT(25),
E
Eliad Peller 已提交
67 68
	INACTIVE_STA_EVENT_ID			 = BIT(26),
	PEER_REMOVE_COMPLETE_EVENT_ID		 = BIT(27),
L
Luciano Coelho 已提交
69 70
	PERIODIC_SCAN_COMPLETE_EVENT_ID		 = BIT(28),
	PERIODIC_SCAN_REPORT_EVENT_ID		 = BIT(29),
71
	BA_SESSION_RX_CONSTRAINT_EVENT_ID	 = BIT(30),
E
Eliad Peller 已提交
72
	REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID	 = BIT(31),
L
Luciano Coelho 已提交
73 74 75
	EVENT_MBOX_ALL_EVENT_ID			 = 0x7fffffff,
};

76 77 78 79 80
enum {
	EVENT_ENTER_POWER_SAVE_FAIL = 0,
	EVENT_ENTER_POWER_SAVE_SUCCESS,
};

L
Luciano Coelho 已提交
81 82 83
#define NUM_OF_RSSI_SNR_TRIGGERS 8

struct event_mailbox {
L
Luciano Coelho 已提交
84 85 86 87
	__le32 events_vector;
	__le32 events_mask;
	__le32 reserved_1;
	__le32 reserved_2;
L
Luciano Coelho 已提交
88 89 90

	u8 number_of_scan_results;
	u8 scan_tag;
E
Eliad Peller 已提交
91 92
	u8 completed_scan_status;
	u8 reserved_3;
L
Luciano Coelho 已提交
93 94 95 96

	u8 soft_gemini_sense_info;
	u8 soft_gemini_protective_info;
	s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
97
	u8 change_auto_mode_timeout;
L
Luciano Coelho 已提交
98
	u8 scheduled_scan_status;
E
Eyal Shapira 已提交
99
	u8 reserved4;
E
Eliad Peller 已提交
100 101
	/* tuned channel (roc) */
	u8 roc_channel;
L
Luciano Coelho 已提交
102

E
Eliad Peller 已提交
103
	__le16 hlid_removed_bitmap;
104

E
Eliad Peller 已提交
105
	/* bitmap of aged stations (by HLID) */
106
	__le16 sta_aging_status;
107

E
Eliad Peller 已提交
108
	/* bitmap of stations (by HLID) which exceeded max tx retries */
109 110
	__le16 sta_tx_retry_exceeded;

E
Eliad Peller 已提交
111 112 113 114 115 116 117 118 119 120 121
	/* discovery completed results */
	u8 discovery_tag;
	u8 number_of_preq_results;
	u8 number_of_prsp_results;
	u8 reserved_5;

	/* rx ba constraint */
	u8 role_id; /* 0xFF means any role. */
	u8 rx_ba_allowed;
	u8 reserved_6[2];

122 123 124 125 126 127
	/* Channel switch results */

	u8 channel_switch_role_id;
	u8 channel_switch_status;
	u8 reserved_7[2];

E
Eliad Peller 已提交
128 129 130 131
	u8 ps_poll_delivery_failure_role_ids;
	u8 stopped_role_ids;
	u8 started_role_ids;

132
	u8 reserved_8[9];
133
} __packed;
L
Luciano Coelho 已提交
134

135 136
struct wl1271;

L
Luciano Coelho 已提交
137 138
int wl1271_event_unmask(struct wl1271 *wl);
void wl1271_event_mbox_config(struct wl1271 *wl);
139
int wl1271_event_handle(struct wl1271 *wl, u8 mbox);
L
Luciano Coelho 已提交
140 141

#endif