Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of wl1271 |
| 3 | * |
| 4 | * Copyright (C) 1998-2009 Texas Instruments. All rights reserved. |
| 5 | * Copyright (C) 2008-2009 Nokia Corporation |
| 6 | * |
| 7 | * Contact: Luciano Coelho <luciano.coelho@nokia.com> |
| 8 | * |
| 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. |
| 12 | * |
| 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. |
| 17 | * |
| 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 |
| 21 | * 02110-1301 USA |
| 22 | * |
| 23 | */ |
| 24 | |
Shahar Levi | 00d2010 | 2010-11-08 11:20:10 +0000 | [diff] [blame] | 25 | #ifndef __EVENT_H__ |
| 26 | #define __EVENT_H__ |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 27 | |
| 28 | /* |
| 29 | * Mbox events |
| 30 | * |
| 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 |
| 37 | * free. |
| 38 | */ |
| 39 | |
| 40 | enum { |
Juuso Oikarinen | 00236aed | 2010-04-09 11:07:30 +0300 | [diff] [blame] | 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), |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 49 | MEASUREMENT_START_EVENT_ID = BIT(8), |
| 50 | MEASUREMENT_COMPLETE_EVENT_ID = BIT(9), |
| 51 | SCAN_COMPLETE_EVENT_ID = BIT(10), |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 52 | WFD_DISCOVERY_COMPLETE_EVENT_ID = BIT(11), |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 53 | AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(12), |
Eyal Shapira | d6bf9ad | 2012-01-31 11:57:20 +0200 | [diff] [blame] | 54 | RESERVED1 = BIT(13), |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 55 | PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(14), |
Eliad Peller | 8332f0f | 2012-01-31 11:57:19 +0200 | [diff] [blame] | 56 | ROLE_STOP_COMPLETE_EVENT_ID = BIT(15), |
| 57 | RADAR_DETECTED_EVENT_ID = BIT(16), |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 58 | CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(17), |
| 59 | BSS_LOSE_EVENT_ID = BIT(18), |
| 60 | REGAINED_BSS_EVENT_ID = BIT(19), |
Arik Nemtsov | 3618f30 | 2011-06-26 10:36:03 +0300 | [diff] [blame] | 61 | MAX_TX_RETRY_EVENT_ID = BIT(20), |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 62 | DUMMY_PACKET_EVENT_ID = BIT(21), |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 63 | SOFT_GEMINI_SENSE_EVENT_ID = BIT(22), |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 64 | CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID = BIT(23), |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 65 | SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24), |
| 66 | PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25), |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 67 | INACTIVE_STA_EVENT_ID = BIT(26), |
| 68 | PEER_REMOVE_COMPLETE_EVENT_ID = BIT(27), |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 69 | PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28), |
| 70 | PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29), |
Shahar Levi | 70559a0 | 2011-05-22 16:10:22 +0300 | [diff] [blame] | 71 | BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(30), |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 72 | REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(31), |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 73 | EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff, |
| 74 | }; |
| 75 | |
Juuso Oikarinen | 19ad071 | 2009-11-02 20:22:11 +0200 | [diff] [blame] | 76 | enum { |
| 77 | EVENT_ENTER_POWER_SAVE_FAIL = 0, |
| 78 | EVENT_ENTER_POWER_SAVE_SUCCESS, |
Juuso Oikarinen | 19ad071 | 2009-11-02 20:22:11 +0200 | [diff] [blame] | 79 | }; |
| 80 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 81 | #define NUM_OF_RSSI_SNR_TRIGGERS 8 |
| 82 | |
| 83 | struct event_mailbox { |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 84 | __le32 events_vector; |
| 85 | __le32 events_mask; |
| 86 | __le32 reserved_1; |
| 87 | __le32 reserved_2; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 88 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 89 | u8 number_of_scan_results; |
| 90 | u8 scan_tag; |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 91 | u8 completed_scan_status; |
| 92 | u8 reserved_3; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 93 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 94 | u8 soft_gemini_sense_info; |
| 95 | u8 soft_gemini_protective_info; |
| 96 | s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS]; |
Eliad Peller | 8332f0f | 2012-01-31 11:57:19 +0200 | [diff] [blame] | 97 | u8 change_auto_mode_timeout; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 98 | u8 scheduled_scan_status; |
Eyal Shapira | d6bf9ad | 2012-01-31 11:57:20 +0200 | [diff] [blame] | 99 | u8 reserved4; |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 100 | /* tuned channel (roc) */ |
| 101 | u8 roc_channel; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 102 | |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 103 | __le16 hlid_removed_bitmap; |
Arik Nemtsov | 3618f30 | 2011-06-26 10:36:03 +0300 | [diff] [blame] | 104 | |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 105 | /* bitmap of aged stations (by HLID) */ |
Arik Nemtsov | beb6c88 | 2010-10-16 18:53:48 +0200 | [diff] [blame] | 106 | __le16 sta_aging_status; |
Arik Nemtsov | 3618f30 | 2011-06-26 10:36:03 +0300 | [diff] [blame] | 107 | |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 108 | /* bitmap of stations (by HLID) which exceeded max tx retries */ |
Arik Nemtsov | beb6c88 | 2010-10-16 18:53:48 +0200 | [diff] [blame] | 109 | __le16 sta_tx_retry_exceeded; |
| 110 | |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 111 | /* discovery completed results */ |
| 112 | u8 discovery_tag; |
| 113 | u8 number_of_preq_results; |
| 114 | u8 number_of_prsp_results; |
| 115 | u8 reserved_5; |
Shahar Levi | 70559a0 | 2011-05-22 16:10:22 +0300 | [diff] [blame] | 116 | |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 117 | /* rx ba constraint */ |
| 118 | u8 role_id; /* 0xFF means any role. */ |
| 119 | u8 rx_ba_allowed; |
| 120 | u8 reserved_6[2]; |
| 121 | |
Eliad Peller | 8332f0f | 2012-01-31 11:57:19 +0200 | [diff] [blame] | 122 | /* Channel switch results */ |
| 123 | |
| 124 | u8 channel_switch_role_id; |
| 125 | u8 channel_switch_status; |
| 126 | u8 reserved_7[2]; |
| 127 | |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 128 | u8 ps_poll_delivery_failure_role_ids; |
| 129 | u8 stopped_role_ids; |
| 130 | u8 started_role_ids; |
Eliad Peller | c690ec8 | 2011-08-14 13:17:07 +0300 | [diff] [blame] | 131 | |
Eliad Peller | 8332f0f | 2012-01-31 11:57:19 +0200 | [diff] [blame] | 132 | u8 reserved_8[9]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 133 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 134 | |
| 135 | int wl1271_event_unmask(struct wl1271 *wl); |
| 136 | void wl1271_event_mbox_config(struct wl1271 *wl); |
Juuso Oikarinen | 13f2dc5 | 2009-12-11 15:40:59 +0200 | [diff] [blame] | 137 | int wl1271_event_handle(struct wl1271 *wl, u8 mbox); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 138 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 139 | #endif |