Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * This file is provided under a dual BSD/GPLv2 license. When using or |
| 4 | * redistributing this file, you may do so under either license. |
| 5 | * |
| 6 | * GPL LICENSE SUMMARY |
| 7 | * |
Reinette Chatre | eb7ae89 | 2008-03-11 16:17:17 -0700 | [diff] [blame] | 8 | * Copyright(c) 2005 - 2008 Intel Corporation. All rights reserved. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
Ian Schram | 01ebd06 | 2007-10-25 17:15:22 +0800 | [diff] [blame] | 11 | * it under the terms of version 2 of the GNU General Public License as |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 12 | * published by the Free Software Foundation. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, but |
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | * General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, |
| 22 | * USA |
| 23 | * |
| 24 | * The full GNU General Public License is included in this distribution |
| 25 | * in the file called LICENSE.GPL. |
| 26 | * |
| 27 | * Contact Information: |
Winkler, Tomas | 759ef89 | 2008-12-09 11:28:58 -0800 | [diff] [blame] | 28 | * Intel Linux Wireless <ilw@linux.intel.com> |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 29 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 30 | * |
| 31 | * BSD LICENSE |
| 32 | * |
Reinette Chatre | eb7ae89 | 2008-03-11 16:17:17 -0700 | [diff] [blame] | 33 | * Copyright(c) 2005 - 2008 Intel Corporation. All rights reserved. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 34 | * All rights reserved. |
| 35 | * |
| 36 | * Redistribution and use in source and binary forms, with or without |
| 37 | * modification, are permitted provided that the following conditions |
| 38 | * are met: |
| 39 | * |
| 40 | * * Redistributions of source code must retain the above copyright |
| 41 | * notice, this list of conditions and the following disclaimer. |
| 42 | * * Redistributions in binary form must reproduce the above copyright |
| 43 | * notice, this list of conditions and the following disclaimer in |
| 44 | * the documentation and/or other materials provided with the |
| 45 | * distribution. |
| 46 | * * Neither the name Intel Corporation nor the names of its |
| 47 | * contributors may be used to endorse or promote products derived |
| 48 | * from this software without specific prior written permission. |
| 49 | * |
| 50 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 51 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 52 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 53 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 54 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 55 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 56 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 57 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 58 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 59 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 60 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 61 | * |
| 62 | *****************************************************************************/ |
Ben Cahill | fcd427b | 2007-11-29 11:10:00 +0800 | [diff] [blame] | 63 | /* |
| 64 | * Please use this file (iwl-3945-commands.h) only for uCode API definitions. |
| 65 | * Please use iwl-3945-hw.h for hardware-related definitions. |
| 66 | * Please use iwl-3945.h for driver implementation definitions. |
| 67 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 68 | |
Christoph Hellwig | 5d08cd1 | 2007-10-25 17:15:50 +0800 | [diff] [blame] | 69 | #ifndef __iwl_3945_commands_h__ |
| 70 | #define __iwl_3945_commands_h__ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 71 | |
Chatre, Reinette | c02b3ac | 2008-12-02 12:14:05 -0800 | [diff] [blame] | 72 | /* uCode version contains 4 values: Major/Minor/API/Serial */ |
| 73 | #define IWL_UCODE_MAJOR(ver) (((ver) & 0xFF000000) >> 24) |
| 74 | #define IWL_UCODE_MINOR(ver) (((ver) & 0x00FF0000) >> 16) |
| 75 | #define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8) |
| 76 | #define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF) |
| 77 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 78 | |
Tomas Winkler | 69d00d2 | 2008-12-19 10:37:02 +0800 | [diff] [blame] | 79 | /* Tx rates */ |
| 80 | #define IWL_CCK_RATES 4 |
| 81 | #define IWL_OFDM_RATES 8 |
| 82 | #define IWL_MAX_RATES (IWL_CCK_RATES + IWL_OFDM_RATES) |
| 83 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 84 | /****************************************************************************** |
| 85 | * (0) |
Ben Cahill | 80cc0c3 | 2007-11-29 11:10:09 +0800 | [diff] [blame] | 86 | * Commonly used structures and definitions: |
| 87 | * Command header, txpower |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 88 | * |
| 89 | *****************************************************************************/ |
| 90 | |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 91 | /* iwl3945_cmd_header flags value */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 92 | #define IWL_CMD_FAILED_MSK 0x40 |
| 93 | |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 94 | /** |
| 95 | * struct iwl3945_cmd_header |
| 96 | * |
| 97 | * This header format appears in the beginning of each command sent from the |
| 98 | * driver, and each response/notification received from uCode. |
| 99 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 100 | struct iwl3945_cmd_header { |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 101 | u8 cmd; /* Command ID: REPLY_RXON, etc. */ |
| 102 | u8 flags; /* IWL_CMD_* */ |
| 103 | /* |
Tomas Winkler | a96a27f | 2008-10-23 23:48:56 -0700 | [diff] [blame] | 104 | * The driver sets up the sequence number to values of its choosing. |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 105 | * uCode does not use this value, but passes it back to the driver |
| 106 | * when sending the response to each driver-originated command, so |
| 107 | * the driver can match the response to the command. Since the values |
| 108 | * don't get used by uCode, the driver may set up an arbitrary format. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 109 | * |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 110 | * There is one exception: uCode sets bit 15 when it originates |
| 111 | * the response/notification, i.e. when the response/notification |
| 112 | * is not a direct response to a command sent by the driver. For |
| 113 | * example, uCode issues REPLY_3945_RX when it sends a received frame |
| 114 | * to the driver; it is not a direct response to any driver command. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 115 | * |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 116 | * The Linux driver uses the following format: |
| 117 | * |
| 118 | * 0:7 index/position within Tx queue |
| 119 | * 8:13 Tx queue selection |
| 120 | * 14:14 driver sets this to indicate command is in the 'huge' |
| 121 | * storage at the end of the command buffers, i.e. scan cmd |
| 122 | * 15:15 uCode sets this in uCode-originated response/notification |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 123 | */ |
| 124 | __le16 sequence; |
| 125 | |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 126 | /* command or response/notification data follows immediately */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 127 | u8 data[0]; |
| 128 | } __attribute__ ((packed)); |
| 129 | |
Ben Cahill | 80cc0c3 | 2007-11-29 11:10:09 +0800 | [diff] [blame] | 130 | /** |
| 131 | * struct iwl3945_tx_power |
| 132 | * |
| 133 | * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_SCAN_CMD, REPLY_CHANNEL_SWITCH |
| 134 | * |
| 135 | * Each entry contains two values: |
| 136 | * 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained |
| 137 | * linear value that multiplies the output of the digital signal processor, |
| 138 | * before being sent to the analog radio. |
| 139 | * 2) Radio gain. This sets the analog gain of the radio Tx path. |
| 140 | * It is a coarser setting, and behaves in a logarithmic (dB) fashion. |
| 141 | * |
| 142 | * Driver obtains values from struct iwl3945_tx_power power_gain_table[][]. |
| 143 | */ |
| 144 | struct iwl3945_tx_power { |
| 145 | u8 tx_gain; /* gain for analog radio */ |
| 146 | u8 dsp_atten; /* gain for DSP */ |
| 147 | } __attribute__ ((packed)); |
| 148 | |
| 149 | /** |
| 150 | * struct iwl3945_power_per_rate |
| 151 | * |
| 152 | * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH |
| 153 | */ |
| 154 | struct iwl3945_power_per_rate { |
| 155 | u8 rate; /* plcp */ |
| 156 | struct iwl3945_tx_power tpc; |
| 157 | u8 reserved; |
| 158 | } __attribute__ ((packed)); |
| 159 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 160 | /****************************************************************************** |
| 161 | * (0a) |
| 162 | * Alive and Error Commands & Responses: |
| 163 | * |
| 164 | *****************************************************************************/ |
| 165 | |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 166 | #define UCODE_VALID_OK cpu_to_le32(0x1) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 167 | #define INITIALIZE_SUBTYPE (9) |
| 168 | |
| 169 | /* |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 170 | * ("Initialize") REPLY_ALIVE = 0x1 (response only, not a command) |
| 171 | * |
| 172 | * uCode issues this "initialize alive" notification once the initialization |
| 173 | * uCode image has completed its work, and is ready to load the runtime image. |
| 174 | * This is the *first* "alive" notification that the driver will receive after |
| 175 | * rebooting uCode; the "initialize" alive is indicated by subtype field == 9. |
| 176 | * |
| 177 | * See comments documenting "BSM" (bootstrap state machine). |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 178 | */ |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 179 | struct iwl3945_init_alive_resp { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 180 | u8 ucode_minor; |
| 181 | u8 ucode_major; |
| 182 | __le16 reserved1; |
| 183 | u8 sw_rev[8]; |
| 184 | u8 ver_type; |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 185 | u8 ver_subtype; /* "9" for initialize alive */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 186 | __le16 reserved2; |
| 187 | __le32 log_event_table_ptr; |
| 188 | __le32 error_event_table_ptr; |
| 189 | __le32 timestamp; |
| 190 | __le32 is_valid; |
| 191 | } __attribute__ ((packed)); |
| 192 | |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 193 | |
| 194 | /** |
| 195 | * REPLY_ALIVE = 0x1 (response only, not a command) |
| 196 | * |
| 197 | * uCode issues this "alive" notification once the runtime image is ready |
| 198 | * to receive commands from the driver. This is the *second* "alive" |
| 199 | * notification that the driver will receive after rebooting uCode; |
| 200 | * this "alive" is indicated by subtype field != 9. |
| 201 | * |
| 202 | * See comments documenting "BSM" (bootstrap state machine). |
| 203 | * |
| 204 | * This response includes two pointers to structures within the device's |
| 205 | * data SRAM (access via HBUS_TARG_MEM_* regs) that are useful for debugging: |
| 206 | * |
| 207 | * 1) log_event_table_ptr indicates base of the event log. This traces |
| 208 | * a 256-entry history of uCode execution within a circular buffer. |
| 209 | * |
| 210 | * 2) error_event_table_ptr indicates base of the error log. This contains |
| 211 | * information about any uCode error that occurs. |
| 212 | * |
| 213 | * The Linux driver can print both logs to the system log when a uCode error |
| 214 | * occurs. |
| 215 | */ |
| 216 | struct iwl3945_alive_resp { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 217 | u8 ucode_minor; |
| 218 | u8 ucode_major; |
| 219 | __le16 reserved1; |
| 220 | u8 sw_rev[8]; |
| 221 | u8 ver_type; |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 222 | u8 ver_subtype; /* not "9" for runtime alive */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 223 | __le16 reserved2; |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 224 | __le32 log_event_table_ptr; /* SRAM address for event log */ |
| 225 | __le32 error_event_table_ptr; /* SRAM address for error log */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 226 | __le32 timestamp; |
| 227 | __le32 is_valid; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 228 | } __attribute__ ((packed)); |
| 229 | |
| 230 | union tsf { |
| 231 | u8 byte[8]; |
| 232 | __le16 word[4]; |
| 233 | __le32 dw[2]; |
| 234 | }; |
| 235 | |
| 236 | /* |
| 237 | * REPLY_ERROR = 0x2 (response only, not a command) |
| 238 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 239 | struct iwl3945_error_resp { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 240 | __le32 error_type; |
| 241 | u8 cmd_id; |
| 242 | u8 reserved1; |
| 243 | __le16 bad_cmd_seq_num; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 244 | __le16 reserved2; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 245 | __le32 error_info; |
| 246 | union tsf timestamp; |
| 247 | } __attribute__ ((packed)); |
| 248 | |
| 249 | /****************************************************************************** |
| 250 | * (1) |
| 251 | * RXON Commands & Responses: |
| 252 | * |
| 253 | *****************************************************************************/ |
| 254 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 255 | /* rx_config flags */ |
| 256 | /* band & modulation selection */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 257 | #define RXON_FLG_BAND_24G_MSK cpu_to_le32(1 << 0) |
| 258 | #define RXON_FLG_CCK_MSK cpu_to_le32(1 << 1) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 259 | /* auto detection enable */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 260 | #define RXON_FLG_AUTO_DETECT_MSK cpu_to_le32(1 << 2) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 261 | /* TGg protection when tx */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 262 | #define RXON_FLG_TGG_PROTECT_MSK cpu_to_le32(1 << 3) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 263 | /* cck short slot & preamble */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 264 | #define RXON_FLG_SHORT_SLOT_MSK cpu_to_le32(1 << 4) |
| 265 | #define RXON_FLG_SHORT_PREAMBLE_MSK cpu_to_le32(1 << 5) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 266 | /* antenna selection */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 267 | #define RXON_FLG_DIS_DIV_MSK cpu_to_le32(1 << 7) |
| 268 | #define RXON_FLG_ANT_SEL_MSK cpu_to_le32(0x0f00) |
| 269 | #define RXON_FLG_ANT_A_MSK cpu_to_le32(1 << 8) |
| 270 | #define RXON_FLG_ANT_B_MSK cpu_to_le32(1 << 9) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 271 | /* radar detection enable */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 272 | #define RXON_FLG_RADAR_DETECT_MSK cpu_to_le32(1 << 12) |
| 273 | #define RXON_FLG_TGJ_NARROW_BAND_MSK cpu_to_le32(1 << 13) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 274 | /* rx response to host with 8-byte TSF |
| 275 | * (according to ON_AIR deassertion) */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 276 | #define RXON_FLG_TSF2HOST_MSK cpu_to_le32(1 << 15) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 277 | |
| 278 | /* rx_config filter flags */ |
| 279 | /* accept all data frames */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 280 | #define RXON_FILTER_PROMISC_MSK cpu_to_le32(1 << 0) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 281 | /* pass control & management to host */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 282 | #define RXON_FILTER_CTL2HOST_MSK cpu_to_le32(1 << 1) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 283 | /* accept multi-cast */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 284 | #define RXON_FILTER_ACCEPT_GRP_MSK cpu_to_le32(1 << 2) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 285 | /* don't decrypt uni-cast frames */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 286 | #define RXON_FILTER_DIS_DECRYPT_MSK cpu_to_le32(1 << 3) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 287 | /* don't decrypt multi-cast frames */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 288 | #define RXON_FILTER_DIS_GRP_DECRYPT_MSK cpu_to_le32(1 << 4) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 289 | /* STA is associated */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 290 | #define RXON_FILTER_ASSOC_MSK cpu_to_le32(1 << 5) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 291 | /* transfer to host non bssid beacons in associated state */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 292 | #define RXON_FILTER_BCON_AWARE_MSK cpu_to_le32(1 << 6) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 293 | |
Ben Cahill | 80cc0c3 | 2007-11-29 11:10:09 +0800 | [diff] [blame] | 294 | /** |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 295 | * REPLY_RXON = 0x10 (command, has simple generic response) |
Ben Cahill | 80cc0c3 | 2007-11-29 11:10:09 +0800 | [diff] [blame] | 296 | * |
| 297 | * RXON tunes the radio tuner to a service channel, and sets up a number |
| 298 | * of parameters that are used primarily for Rx, but also for Tx operations. |
| 299 | * |
| 300 | * NOTE: When tuning to a new channel, driver must set the |
| 301 | * RXON_FILTER_ASSOC_MSK to 0. This will clear station-dependent |
| 302 | * info within the device, including the station tables, tx retry |
| 303 | * rate tables, and txpower tables. Driver must build a new station |
| 304 | * table and txpower table before transmitting anything on the RXON |
| 305 | * channel. |
| 306 | * |
| 307 | * NOTE: All RXONs wipe clean the internal txpower table. Driver must |
| 308 | * issue a new REPLY_TX_PWR_TABLE_CMD after each REPLY_RXON (0x10), |
| 309 | * regardless of whether RXON_FILTER_ASSOC_MSK is set. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 310 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 311 | struct iwl3945_rxon_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 312 | u8 node_addr[6]; |
| 313 | __le16 reserved1; |
| 314 | u8 bssid_addr[6]; |
| 315 | __le16 reserved2; |
| 316 | u8 wlap_bssid_addr[6]; |
| 317 | __le16 reserved3; |
| 318 | u8 dev_type; |
| 319 | u8 air_propagation; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 320 | __le16 reserved4; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 321 | u8 ofdm_basic_rates; |
| 322 | u8 cck_basic_rates; |
| 323 | __le16 assoc_id; |
| 324 | __le32 flags; |
| 325 | __le32 filter_flags; |
| 326 | __le16 channel; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 327 | __le16 reserved5; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 328 | } __attribute__ ((packed)); |
| 329 | |
| 330 | /* |
| 331 | * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) |
| 332 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 333 | struct iwl3945_rxon_assoc_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 334 | __le32 flags; |
| 335 | __le32 filter_flags; |
| 336 | u8 ofdm_basic_rates; |
| 337 | u8 cck_basic_rates; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 338 | __le16 reserved; |
| 339 | } __attribute__ ((packed)); |
| 340 | |
| 341 | /* |
| 342 | * REPLY_RXON_TIMING = 0x14 (command, has simple generic response) |
| 343 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 344 | struct iwl3945_rxon_time_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 345 | union tsf timestamp; |
| 346 | __le16 beacon_interval; |
| 347 | __le16 atim_window; |
| 348 | __le32 beacon_init_val; |
| 349 | __le16 listen_interval; |
| 350 | __le16 reserved; |
| 351 | } __attribute__ ((packed)); |
| 352 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 353 | /* |
| 354 | * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) |
| 355 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 356 | struct iwl3945_channel_switch_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 357 | u8 band; |
| 358 | u8 expect_beacon; |
| 359 | __le16 channel; |
| 360 | __le32 rxon_flags; |
| 361 | __le32 rxon_filter_flags; |
| 362 | __le32 switch_time; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 363 | struct iwl3945_power_per_rate power[IWL_MAX_RATES]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 364 | } __attribute__ ((packed)); |
| 365 | |
| 366 | /* |
| 367 | * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command) |
| 368 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 369 | struct iwl3945_csa_notification { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 370 | __le16 band; |
| 371 | __le16 channel; |
| 372 | __le32 status; /* 0 - OK, 1 - fail */ |
| 373 | } __attribute__ ((packed)); |
| 374 | |
| 375 | /****************************************************************************** |
| 376 | * (2) |
| 377 | * Quality-of-Service (QOS) Commands & Responses: |
| 378 | * |
| 379 | *****************************************************************************/ |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 380 | |
| 381 | /** |
| 382 | * struct iwl_ac_qos -- QOS timing params for REPLY_QOS_PARAM |
| 383 | * One for each of 4 EDCA access categories in struct iwl_qosparam_cmd |
| 384 | * |
| 385 | * @cw_min: Contention window, start value in numbers of slots. |
| 386 | * Should be a power-of-2, minus 1. Device's default is 0x0f. |
| 387 | * @cw_max: Contention window, max value in numbers of slots. |
| 388 | * Should be a power-of-2, minus 1. Device's default is 0x3f. |
| 389 | * @aifsn: Number of slots in Arbitration Interframe Space (before |
| 390 | * performing random backoff timing prior to Tx). Device default 1. |
| 391 | * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0. |
| 392 | * |
| 393 | * Device will automatically increase contention window by (2*CW) + 1 for each |
| 394 | * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW |
| 395 | * value, to cap the CW value. |
| 396 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 397 | struct iwl3945_ac_qos { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 398 | __le16 cw_min; |
| 399 | __le16 cw_max; |
| 400 | u8 aifsn; |
| 401 | u8 reserved1; |
| 402 | __le16 edca_txop; |
| 403 | } __attribute__ ((packed)); |
| 404 | |
| 405 | /* QoS flags defines */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 406 | #define QOS_PARAM_FLG_UPDATE_EDCA_MSK cpu_to_le32(0x01) |
| 407 | #define QOS_PARAM_FLG_TGN_MSK cpu_to_le32(0x02) |
| 408 | #define QOS_PARAM_FLG_TXOP_TYPE_MSK cpu_to_le32(0x10) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 409 | |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 410 | /* Number of Access Categories (AC) (EDCA), queues 0..3 */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 411 | #define AC_NUM 4 |
| 412 | |
| 413 | /* |
| 414 | * REPLY_QOS_PARAM = 0x13 (command, has simple generic response) |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 415 | * |
| 416 | * This command sets up timings for each of the 4 prioritized EDCA Tx FIFOs |
| 417 | * 0: Background, 1: Best Effort, 2: Video, 3: Voice. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 418 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 419 | struct iwl3945_qosparam_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 420 | __le32 qos_flags; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 421 | struct iwl3945_ac_qos ac[AC_NUM]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 422 | } __attribute__ ((packed)); |
| 423 | |
| 424 | /****************************************************************************** |
| 425 | * (3) |
| 426 | * Add/Modify Stations Commands & Responses: |
| 427 | * |
| 428 | *****************************************************************************/ |
| 429 | /* |
| 430 | * Multi station support |
| 431 | */ |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 432 | |
| 433 | /* Special, dedicated locations within device's station table */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 434 | #define IWL_AP_ID 0 |
| 435 | #define IWL_MULTICAST_ID 1 |
| 436 | #define IWL_STA_ID 2 |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 437 | #define IWL3945_BROADCAST_ID 24 |
| 438 | #define IWL3945_STATION_COUNT 25 |
| 439 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 440 | #define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/ |
| 441 | #define IWL_INVALID_STATION 255 |
| 442 | |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 443 | #define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2); |
| 444 | #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8); |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 445 | |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 446 | /* Use in mode field. 1: modify existing entry, 0: add new station entry */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 447 | #define STA_CONTROL_MODIFY_MSK 0x01 |
| 448 | |
| 449 | /* key flags __le16*/ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 450 | #define STA_KEY_FLG_ENCRYPT_MSK cpu_to_le16(0x0007) |
| 451 | #define STA_KEY_FLG_NO_ENC cpu_to_le16(0x0000) |
| 452 | #define STA_KEY_FLG_WEP cpu_to_le16(0x0001) |
| 453 | #define STA_KEY_FLG_CCMP cpu_to_le16(0x0002) |
| 454 | #define STA_KEY_FLG_TKIP cpu_to_le16(0x0003) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 455 | |
| 456 | #define STA_KEY_FLG_KEYID_POS 8 |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 457 | #define STA_KEY_FLG_INVALID cpu_to_le16(0x0800) |
Emmanuel Grumbach | eaaf789 | 2008-02-13 11:32:29 -0800 | [diff] [blame] | 458 | /* wep key is either from global key (0) or from station info array (1) */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 459 | #define STA_KEY_FLG_WEP_KEY_MAP_MSK cpu_to_le16(0x0008) |
Emmanuel Grumbach | eaaf789 | 2008-02-13 11:32:29 -0800 | [diff] [blame] | 460 | |
| 461 | /* wep key in STA: 5-bytes (0) or 13-bytes (1) */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 462 | #define STA_KEY_FLG_KEY_SIZE_MSK cpu_to_le16(0x1000) |
| 463 | #define STA_KEY_MULTICAST_MSK cpu_to_le16(0x4000) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 464 | |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 465 | /* Flags indicate whether to modify vs. don't change various station params */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 466 | #define STA_MODIFY_KEY_MASK 0x01 |
| 467 | #define STA_MODIFY_TID_DISABLE_TX 0x02 |
| 468 | #define STA_MODIFY_TX_RATE_MSK 0x04 |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 469 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 470 | struct iwl3945_keyinfo { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 471 | __le16 key_flags; |
| 472 | u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ |
| 473 | u8 reserved1; |
| 474 | __le16 tkip_rx_ttak[5]; /* 10-byte unicast TKIP TTAK */ |
Emmanuel Grumbach | eaaf789 | 2008-02-13 11:32:29 -0800 | [diff] [blame] | 475 | u8 key_offset; |
| 476 | u8 reserved2; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 477 | u8 key[16]; /* 16-byte unicast decryption key */ |
| 478 | } __attribute__ ((packed)); |
| 479 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 480 | /* |
| 481 | * REPLY_ADD_STA = 0x18 (command) |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 482 | * |
| 483 | * The device contains an internal table of per-station information, |
| 484 | * with info on security keys, aggregation parameters, and Tx rates for |
| 485 | * initial Tx attempt and any retries (4965 uses REPLY_TX_LINK_QUALITY_CMD, |
| 486 | * 3945 uses REPLY_RATE_SCALE to set up rate tables). |
| 487 | * |
| 488 | * REPLY_ADD_STA sets up the table entry for one station, either creating |
| 489 | * a new entry, or modifying a pre-existing one. |
| 490 | * |
| 491 | * NOTE: RXON command (without "associated" bit set) wipes the station table |
| 492 | * clean. Moving into RF_KILL state does this also. Driver must set up |
| 493 | * new station table before transmitting anything on the RXON channel |
| 494 | * (except active scans or active measurements; those commands carry |
| 495 | * their own txpower/rate setup data). |
| 496 | * |
| 497 | * When getting started on a new channel, driver must set up the |
| 498 | * IWL_BROADCAST_ID entry (last entry in the table). For a client |
| 499 | * station in a BSS, once an AP is selected, driver sets up the AP STA |
| 500 | * in the IWL_AP_ID entry (1st entry in the table). BROADCAST and AP |
| 501 | * are all that are needed for a BSS client station. If the device is |
| 502 | * used as AP, or in an IBSS network, driver must set up station table |
| 503 | * entries for all STAs in network, starting with index IWL_STA_ID. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 504 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 505 | struct iwl3945_addsta_cmd { |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 506 | u8 mode; /* 1: modify existing, 0: add new station */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 507 | u8 reserved[3]; |
| 508 | struct sta_id_modify sta; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 509 | struct iwl3945_keyinfo key; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 510 | __le32 station_flags; /* STA_FLG_* */ |
| 511 | __le32 station_flags_msk; /* STA_FLG_* */ |
| 512 | |
| 513 | /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID) |
| 514 | * corresponding to bit (e.g. bit 5 controls TID 5). |
| 515 | * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 516 | __le16 tid_disable_tx; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 517 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 518 | __le16 rate_n_flags; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 519 | |
| 520 | /* TID for which to add block-ack support. |
| 521 | * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 522 | u8 add_immediate_ba_tid; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 523 | |
| 524 | /* TID for which to remove block-ack support. |
| 525 | * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 526 | u8 remove_immediate_ba_tid; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 527 | |
| 528 | /* Starting Sequence Number for added block-ack support. |
| 529 | * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 530 | __le16 add_immediate_ba_ssn; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 531 | } __attribute__ ((packed)); |
| 532 | |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 533 | #define ADD_STA_SUCCESS_MSK 0x1 |
| 534 | #define ADD_STA_NO_ROOM_IN_TABLE 0x2 |
| 535 | #define ADD_STA_NO_BLOCK_ACK_RESOURCE 0x4 |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 536 | /* |
| 537 | * REPLY_ADD_STA = 0x18 (response) |
| 538 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 539 | struct iwl3945_add_sta_resp { |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 540 | u8 status; /* ADD_STA_* */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 541 | } __attribute__ ((packed)); |
| 542 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 543 | |
| 544 | /****************************************************************************** |
| 545 | * (4) |
| 546 | * Rx Responses: |
| 547 | * |
| 548 | *****************************************************************************/ |
| 549 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 550 | struct iwl3945_rx_frame_stats { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 551 | u8 phy_count; |
| 552 | u8 id; |
| 553 | u8 rssi; |
| 554 | u8 agc; |
| 555 | __le16 sig_avg; |
| 556 | __le16 noise_diff; |
| 557 | u8 payload[0]; |
| 558 | } __attribute__ ((packed)); |
| 559 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 560 | struct iwl3945_rx_frame_hdr { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 561 | __le16 channel; |
| 562 | __le16 phy_flags; |
| 563 | u8 reserved1; |
| 564 | u8 rate; |
| 565 | __le16 len; |
| 566 | u8 payload[0]; |
| 567 | } __attribute__ ((packed)); |
| 568 | |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 569 | #define RX_RES_STATUS_NO_CRC32_ERROR cpu_to_le32(1 << 0) |
| 570 | #define RX_RES_STATUS_NO_RXE_OVERFLOW cpu_to_le32(1 << 1) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 571 | |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 572 | #define RX_RES_PHY_FLAGS_BAND_24_MSK cpu_to_le16(1 << 0) |
| 573 | #define RX_RES_PHY_FLAGS_MOD_CCK_MSK cpu_to_le16(1 << 1) |
| 574 | #define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK cpu_to_le16(1 << 2) |
| 575 | #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK cpu_to_le16(1 << 3) |
| 576 | #define RX_RES_PHY_FLAGS_ANTENNA_MSK cpu_to_le16(0xf0) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 577 | |
Tomas Winkler | 8211ef7 | 2008-03-02 01:36:04 +0200 | [diff] [blame] | 578 | #define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8) |
| 579 | #define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8) |
| 580 | #define RX_RES_STATUS_SEC_TYPE_WEP (0x1 << 8) |
| 581 | #define RX_RES_STATUS_SEC_TYPE_CCMP (0x2 << 8) |
| 582 | #define RX_RES_STATUS_SEC_TYPE_TKIP (0x3 << 8) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 583 | |
Tomas Winkler | 8211ef7 | 2008-03-02 01:36:04 +0200 | [diff] [blame] | 584 | #define RX_RES_STATUS_DECRYPT_TYPE_MSK (0x3 << 11) |
| 585 | #define RX_RES_STATUS_NOT_DECRYPT (0x0 << 11) |
| 586 | #define RX_RES_STATUS_DECRYPT_OK (0x3 << 11) |
| 587 | #define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11) |
| 588 | #define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 589 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 590 | struct iwl3945_rx_frame_end { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 591 | __le32 status; |
| 592 | __le64 timestamp; |
| 593 | __le32 beacon_timestamp; |
| 594 | } __attribute__ ((packed)); |
| 595 | |
| 596 | /* |
| 597 | * REPLY_3945_RX = 0x1b (response only, not a command) |
| 598 | * |
| 599 | * NOTE: DO NOT dereference from casts to this structure |
| 600 | * It is provided only for calculating minimum data set size. |
| 601 | * The actual offsets of the hdr and end are dynamic based on |
| 602 | * stats.phy_count |
| 603 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 604 | struct iwl3945_rx_frame { |
| 605 | struct iwl3945_rx_frame_stats stats; |
| 606 | struct iwl3945_rx_frame_hdr hdr; |
| 607 | struct iwl3945_rx_frame_end end; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 608 | } __attribute__ ((packed)); |
| 609 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 610 | /****************************************************************************** |
| 611 | * (5) |
| 612 | * Tx Commands & Responses: |
| 613 | * |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 614 | * Driver must place each REPLY_TX command into one of the prioritized Tx |
| 615 | * queues in host DRAM, shared between driver and device. When the device's |
| 616 | * Tx scheduler and uCode are preparing to transmit, the device pulls the |
| 617 | * Tx command over the PCI bus via one of the device's Tx DMA channels, |
| 618 | * to fill an internal FIFO from which data will be transmitted. |
| 619 | * |
| 620 | * uCode handles all timing and protocol related to control frames |
| 621 | * (RTS/CTS/ACK), based on flags in the Tx command. |
| 622 | * |
| 623 | * uCode handles retrying Tx when an ACK is expected but not received. |
| 624 | * This includes trying lower data rates than the one requested in the Tx |
| 625 | * command, as set up by the REPLY_RATE_SCALE (for 3945) or |
| 626 | * REPLY_TX_LINK_QUALITY_CMD (4965). |
| 627 | * |
| 628 | * Driver sets up transmit power for various rates via REPLY_TX_PWR_TABLE_CMD. |
| 629 | * This command must be executed after every RXON command, before Tx can occur. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 630 | *****************************************************************************/ |
| 631 | |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 632 | /* REPLY_TX Tx flags field */ |
| 633 | |
| 634 | /* 1: Use Request-To-Send protocol before this frame. |
| 635 | * Mutually exclusive vs. TX_CMD_FLG_CTS_MSK. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 636 | #define TX_CMD_FLG_RTS_MSK cpu_to_le32(1 << 1) |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 637 | |
| 638 | /* 1: Transmit Clear-To-Send to self before this frame. |
| 639 | * Driver should set this for AUTH/DEAUTH/ASSOC-REQ/REASSOC mgmnt frames. |
| 640 | * Mutually exclusive vs. TX_CMD_FLG_RTS_MSK. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 641 | #define TX_CMD_FLG_CTS_MSK cpu_to_le32(1 << 2) |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 642 | |
| 643 | /* 1: Expect ACK from receiving station |
| 644 | * 0: Don't expect ACK (MAC header's duration field s/b 0) |
| 645 | * Set this for unicast frames, but not broadcast/multicast. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 646 | #define TX_CMD_FLG_ACK_MSK cpu_to_le32(1 << 3) |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 647 | |
| 648 | /* 1: Use rate scale table (see REPLY_TX_LINK_QUALITY_CMD). |
| 649 | * Tx command's initial_rate_index indicates first rate to try; |
| 650 | * uCode walks through table for additional Tx attempts. |
| 651 | * 0: Use Tx rate/MCS from Tx command's rate_n_flags field. |
| 652 | * This rate will be used for all Tx attempts; it will not be scaled. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 653 | #define TX_CMD_FLG_STA_RATE_MSK cpu_to_le32(1 << 4) |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 654 | |
| 655 | /* 1: Expect immediate block-ack. |
| 656 | * Set when Txing a block-ack request frame. Also set TX_CMD_FLG_ACK_MSK. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 657 | #define TX_CMD_FLG_IMM_BA_RSP_MASK cpu_to_le32(1 << 6) |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 658 | |
| 659 | /* 1: Frame requires full Tx-Op protection. |
| 660 | * Set this if either RTS or CTS Tx Flag gets set. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 661 | #define TX_CMD_FLG_FULL_TXOP_PROT_MSK cpu_to_le32(1 << 7) |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 662 | |
| 663 | /* Tx antenna selection field; used only for 3945, reserved (0) for 4965. |
| 664 | * Set field to "0" to allow 3945 uCode to select antenna (normal usage). */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 665 | #define TX_CMD_FLG_ANT_SEL_MSK cpu_to_le32(0xf00) |
| 666 | #define TX_CMD_FLG_ANT_A_MSK cpu_to_le32(1 << 8) |
| 667 | #define TX_CMD_FLG_ANT_B_MSK cpu_to_le32(1 << 9) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 668 | |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 669 | /* 1: Ignore Bluetooth priority for this frame. |
| 670 | * 0: Delay Tx until Bluetooth device is done (normal usage). */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 671 | #define TX_CMD_FLG_BT_DIS_MSK cpu_to_le32(1 << 12) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 672 | |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 673 | /* 1: uCode overrides sequence control field in MAC header. |
| 674 | * 0: Driver provides sequence control field in MAC header. |
| 675 | * Set this for management frames, non-QOS data frames, non-unicast frames, |
| 676 | * and also in Tx command embedded in REPLY_SCAN_CMD for active scans. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 677 | #define TX_CMD_FLG_SEQ_CTL_MSK cpu_to_le32(1 << 13) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 678 | |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 679 | /* 1: This frame is non-last MPDU; more fragments are coming. |
| 680 | * 0: Last fragment, or not using fragmentation. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 681 | #define TX_CMD_FLG_MORE_FRAG_MSK cpu_to_le32(1 << 14) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 682 | |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 683 | /* 1: uCode calculates and inserts Timestamp Function (TSF) in outgoing frame. |
| 684 | * 0: No TSF required in outgoing frame. |
| 685 | * Set this for transmitting beacons and probe responses. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 686 | #define TX_CMD_FLG_TSF_MSK cpu_to_le32(1 << 16) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 687 | |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 688 | /* 1: Driver inserted 2 bytes pad after the MAC header, for (required) dword |
| 689 | * alignment of frame's payload data field. |
| 690 | * 0: No pad |
| 691 | * Set this for MAC headers with 26 or 30 bytes, i.e. those with QOS or ADDR4 |
| 692 | * field (but not both). Driver must align frame data (i.e. data following |
| 693 | * MAC header) to DWORD boundary. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 694 | #define TX_CMD_FLG_MH_PAD_MSK cpu_to_le32(1 << 20) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 695 | |
| 696 | /* HCCA-AP - disable duration overwriting. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 697 | #define TX_CMD_FLG_DUR_MSK cpu_to_le32(1 << 25) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 698 | |
| 699 | /* |
| 700 | * TX command security control |
| 701 | */ |
| 702 | #define TX_CMD_SEC_WEP 0x01 |
| 703 | #define TX_CMD_SEC_CCM 0x02 |
| 704 | #define TX_CMD_SEC_TKIP 0x03 |
| 705 | #define TX_CMD_SEC_MSK 0x03 |
| 706 | #define TX_CMD_SEC_SHIFT 6 |
| 707 | #define TX_CMD_SEC_KEY128 0x08 |
| 708 | |
| 709 | /* |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 710 | * REPLY_TX = 0x1c (command) |
| 711 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 712 | struct iwl3945_tx_cmd { |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 713 | /* |
| 714 | * MPDU byte count: |
| 715 | * MAC header (24/26/30/32 bytes) + 2 bytes pad if 26/30 header size, |
| 716 | * + 8 byte IV for CCM or TKIP (not used for WEP) |
| 717 | * + Data payload |
| 718 | * + 8-byte MIC (not used for CCM/WEP) |
| 719 | * NOTE: Does not include Tx command bytes, post-MAC pad bytes, |
| 720 | * MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.i |
| 721 | * Range: 14-2342 bytes. |
| 722 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 723 | __le16 len; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 724 | |
| 725 | /* |
| 726 | * MPDU or MSDU byte count for next frame. |
| 727 | * Used for fragmentation and bursting, but not 11n aggregation. |
| 728 | * Same as "len", but for next frame. Set to 0 if not applicable. |
| 729 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 730 | __le16 next_frame_len; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 731 | |
| 732 | __le32 tx_flags; /* TX_CMD_FLG_* */ |
| 733 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 734 | u8 rate; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 735 | |
| 736 | /* Index of recipient station in uCode's station table */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 737 | u8 sta_id; |
| 738 | u8 tid_tspec; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 739 | u8 sec_ctl; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 740 | u8 key[16]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 741 | union { |
| 742 | u8 byte[8]; |
| 743 | __le16 word[4]; |
| 744 | __le32 dw[2]; |
| 745 | } tkip_mic; |
| 746 | __le32 next_frame_info; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 747 | union { |
| 748 | __le32 life_time; |
| 749 | __le32 attempt; |
| 750 | } stop_time; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 751 | u8 supp_rates[2]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 752 | u8 rts_retry_limit; /*byte 50 */ |
| 753 | u8 data_retry_limit; /*byte 51 */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 754 | union { |
| 755 | __le16 pm_frame_timeout; |
| 756 | __le16 attempt_duration; |
| 757 | } timeout; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 758 | |
| 759 | /* |
| 760 | * Duration of EDCA burst Tx Opportunity, in 32-usec units. |
| 761 | * Set this if txop time is not specified by HCCA protocol (e.g. by AP). |
| 762 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 763 | __le16 driver_txop; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 764 | |
| 765 | /* |
| 766 | * MAC header goes here, followed by 2 bytes padding if MAC header |
| 767 | * length is 26 or 30 bytes, followed by payload data |
| 768 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 769 | u8 payload[0]; |
| 770 | struct ieee80211_hdr hdr[0]; |
| 771 | } __attribute__ ((packed)); |
| 772 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 773 | /* |
| 774 | * REPLY_TX = 0x1c (response) |
| 775 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 776 | struct iwl3945_tx_resp { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 777 | u8 failure_rts; |
| 778 | u8 failure_frame; |
| 779 | u8 bt_kill_count; |
| 780 | u8 rate; |
| 781 | __le32 wireless_media_time; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 782 | __le32 status; /* TX status */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 783 | } __attribute__ ((packed)); |
| 784 | |
| 785 | /* |
| 786 | * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) |
| 787 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 788 | struct iwl3945_txpowertable_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 789 | u8 band; /* 0: 5 GHz, 1: 2.4 GHz */ |
| 790 | u8 reserved; |
| 791 | __le16 channel; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 792 | struct iwl3945_power_per_rate power[IWL_MAX_RATES]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 793 | } __attribute__ ((packed)); |
| 794 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 795 | struct iwl3945_rate_scaling_info { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 796 | __le16 rate_n_flags; |
| 797 | u8 try_cnt; |
| 798 | u8 next_rate_index; |
| 799 | } __attribute__ ((packed)); |
| 800 | |
| 801 | /** |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 802 | * struct iwl3945_rate_scaling_cmd - Rate Scaling Command & Response |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 803 | * |
| 804 | * REPLY_RATE_SCALE = 0x47 (command, has simple generic response) |
| 805 | * |
| 806 | * NOTE: The table of rates passed to the uCode via the |
| 807 | * RATE_SCALE command sets up the corresponding order of |
| 808 | * rates used for all related commands, including rate |
| 809 | * masks, etc. |
| 810 | * |
| 811 | * For example, if you set 9MB (PLCP 0x0f) as the first |
| 812 | * rate in the rate table, the bit mask for that rate |
| 813 | * when passed through ofdm_basic_rates on the REPLY_RXON |
Reinette Chatre | 8a1b024 | 2008-01-14 17:46:25 -0800 | [diff] [blame] | 814 | * command would be bit 0 (1 << 0) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 815 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 816 | struct iwl3945_rate_scaling_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 817 | u8 table_id; |
| 818 | u8 reserved[3]; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 819 | struct iwl3945_rate_scaling_info table[IWL_MAX_RATES]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 820 | } __attribute__ ((packed)); |
| 821 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 822 | /* |
| 823 | * REPLY_BT_CONFIG = 0x9b (command, has simple generic response) |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 824 | * |
| 825 | * 3945 and 4965 support hardware handshake with Bluetooth device on |
| 826 | * same platform. Bluetooth device alerts wireless device when it will Tx; |
Tomas Winkler | a96a27f | 2008-10-23 23:48:56 -0700 | [diff] [blame] | 827 | * wireless device can delay or kill its own Tx to accommodate. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 828 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 829 | struct iwl3945_bt_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 830 | u8 flags; |
| 831 | u8 lead_time; |
| 832 | u8 max_kill; |
| 833 | u8 reserved; |
| 834 | __le32 kill_ack_mask; |
| 835 | __le32 kill_cts_mask; |
| 836 | } __attribute__ ((packed)); |
| 837 | |
| 838 | /****************************************************************************** |
| 839 | * (6) |
| 840 | * Spectrum Management (802.11h) Commands, Responses, Notifications: |
| 841 | * |
| 842 | *****************************************************************************/ |
| 843 | |
| 844 | /* |
| 845 | * Spectrum Management |
| 846 | */ |
| 847 | #define MEASUREMENT_FILTER_FLAG (RXON_FILTER_PROMISC_MSK | \ |
| 848 | RXON_FILTER_CTL2HOST_MSK | \ |
| 849 | RXON_FILTER_ACCEPT_GRP_MSK | \ |
| 850 | RXON_FILTER_DIS_DECRYPT_MSK | \ |
| 851 | RXON_FILTER_DIS_GRP_DECRYPT_MSK | \ |
| 852 | RXON_FILTER_ASSOC_MSK | \ |
| 853 | RXON_FILTER_BCON_AWARE_MSK) |
| 854 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 855 | struct iwl3945_measure_channel { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 856 | __le32 duration; /* measurement duration in extended beacon |
| 857 | * format */ |
| 858 | u8 channel; /* channel to measure */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 859 | u8 type; /* see enum iwl3945_measure_type */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 860 | __le16 reserved; |
| 861 | } __attribute__ ((packed)); |
| 862 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 863 | |
| 864 | #define HW_CARD_DISABLED 0x01 |
| 865 | #define SW_CARD_DISABLED 0x02 |
| 866 | #define RF_CARD_DISABLED 0x04 |
| 867 | #define RXON_CARD_DISABLED 0x10 |
| 868 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 869 | struct iwl3945_ct_kill_config { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 870 | __le32 reserved; |
| 871 | __le32 critical_temperature_M; |
| 872 | __le32 critical_temperature_R; |
| 873 | } __attribute__ ((packed)); |
| 874 | |
| 875 | /****************************************************************************** |
| 876 | * (8) |
| 877 | * Scan Commands, Responses, Notifications: |
| 878 | * |
| 879 | *****************************************************************************/ |
| 880 | |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 881 | /** |
| 882 | * struct iwl3945_scan_channel - entry in REPLY_SCAN_CMD channel table |
| 883 | * |
| 884 | * One for each channel in the scan list. |
| 885 | * Each channel can independently select: |
| 886 | * 1) SSID for directed active scans |
| 887 | * 2) Txpower setting (for rate specified within Tx command) |
| 888 | * 3) How long to stay on-channel (behavior may be modified by quiet_time, |
| 889 | * quiet_plcp_th, good_CRC_th) |
| 890 | * |
| 891 | * To avoid uCode errors, make sure the following are true (see comments |
| 892 | * under struct iwl3945_scan_cmd about max_out_time and quiet_time): |
| 893 | * 1) If using passive_dwell (i.e. passive_dwell != 0): |
| 894 | * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0) |
| 895 | * 2) quiet_time <= active_dwell |
| 896 | * 3) If restricting off-channel time (i.e. max_out_time !=0): |
| 897 | * passive_dwell < max_out_time |
| 898 | * active_dwell < max_out_time |
| 899 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 900 | struct iwl3945_scan_channel { |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 901 | /* |
| 902 | * type is defined as: |
| 903 | * 0:0 1 = active, 0 = passive |
| 904 | * 1:4 SSID direct bit map; if a bit is set, then corresponding |
| 905 | * SSID IE is transmitted in probe request. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 906 | * 5:7 reserved |
| 907 | */ |
| 908 | u8 type; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 909 | u8 channel; /* band is selected by iwl3945_scan_cmd "flags" field */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 910 | struct iwl3945_tx_power tpc; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 911 | __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */ |
| 912 | __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 913 | } __attribute__ ((packed)); |
| 914 | |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 915 | /** |
| 916 | * struct iwl3945_ssid_ie - directed scan network information element |
| 917 | * |
| 918 | * Up to 4 of these may appear in REPLY_SCAN_CMD, selected by "type" field |
| 919 | * in struct iwl3945_scan_channel; each channel may select different ssids from |
| 920 | * among the 4 entries. SSID IEs get transmitted in reverse order of entry. |
| 921 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 922 | struct iwl3945_ssid_ie { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 923 | u8 id; |
| 924 | u8 len; |
| 925 | u8 ssid[32]; |
| 926 | } __attribute__ ((packed)); |
| 927 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 928 | /* uCode API-1 take 4 probes */ |
| 929 | #define PROBE_OPTION_MAX_API1 0x4 |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 930 | #define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF) |
| 931 | #define IWL_GOOD_CRC_TH cpu_to_le16(1) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 932 | #define IWL_MAX_SCAN_SIZE 1024 |
| 933 | |
| 934 | /* |
| 935 | * REPLY_SCAN_CMD = 0x80 (command) |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 936 | * |
| 937 | * The hardware scan command is very powerful; the driver can set it up to |
| 938 | * maintain (relatively) normal network traffic while doing a scan in the |
| 939 | * background. The max_out_time and suspend_time control the ratio of how |
| 940 | * long the device stays on an associated network channel ("service channel") |
| 941 | * vs. how long it's away from the service channel, tuned to other channels |
| 942 | * for scanning. |
| 943 | * |
| 944 | * max_out_time is the max time off-channel (in usec), and suspend_time |
| 945 | * is how long (in "extended beacon" format) that the scan is "suspended" |
| 946 | * after returning to the service channel. That is, suspend_time is the |
| 947 | * time that we stay on the service channel, doing normal work, between |
| 948 | * scan segments. The driver may set these parameters differently to support |
| 949 | * scanning when associated vs. not associated, and light vs. heavy traffic |
| 950 | * loads when associated. |
| 951 | * |
| 952 | * After receiving this command, the device's scan engine does the following; |
| 953 | * |
| 954 | * 1) Sends SCAN_START notification to driver |
| 955 | * 2) Checks to see if it has time to do scan for one channel |
| 956 | * 3) Sends NULL packet, with power-save (PS) bit set to 1, |
| 957 | * to tell AP that we're going off-channel |
| 958 | * 4) Tunes to first channel in scan list, does active or passive scan |
| 959 | * 5) Sends SCAN_RESULT notification to driver |
| 960 | * 6) Checks to see if it has time to do scan on *next* channel in list |
| 961 | * 7) Repeats 4-6 until it no longer has time to scan the next channel |
| 962 | * before max_out_time expires |
| 963 | * 8) Returns to service channel |
| 964 | * 9) Sends NULL packet with PS=0 to tell AP that we're back |
| 965 | * 10) Stays on service channel until suspend_time expires |
| 966 | * 11) Repeats entire process 2-10 until list is complete |
| 967 | * 12) Sends SCAN_COMPLETE notification |
| 968 | * |
| 969 | * For fast, efficient scans, the scan command also has support for staying on |
| 970 | * a channel for just a short time, if doing active scanning and getting no |
| 971 | * responses to the transmitted probe request. This time is controlled by |
| 972 | * quiet_time, and the number of received packets below which a channel is |
| 973 | * considered "quiet" is controlled by quiet_plcp_threshold. |
| 974 | * |
| 975 | * For active scanning on channels that have regulatory restrictions against |
| 976 | * blindly transmitting, the scan can listen before transmitting, to make sure |
| 977 | * that there is already legitimate activity on the channel. If enough |
| 978 | * packets are cleanly received on the channel (controlled by good_CRC_th, |
| 979 | * typical value 1), the scan engine starts transmitting probe requests. |
| 980 | * |
| 981 | * Driver must use separate scan commands for 2.4 vs. 5 GHz bands. |
| 982 | * |
| 983 | * To avoid uCode errors, see timing restrictions described under |
| 984 | * struct iwl3945_scan_channel. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 985 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 986 | struct iwl3945_scan_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 987 | __le16 len; |
| 988 | u8 reserved0; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 989 | u8 channel_count; /* # channels in channel list */ |
| 990 | __le16 quiet_time; /* dwell only this # millisecs on quiet channel |
| 991 | * (only for active scan) */ |
| 992 | __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */ |
| 993 | __le16 good_CRC_th; /* passive -> active promotion threshold */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 994 | __le16 reserved1; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 995 | __le32 max_out_time; /* max usec to be away from associated (service) |
| 996 | * channel */ |
| 997 | __le32 suspend_time; /* pause scan this long (in "extended beacon |
| 998 | * format") when returning to service channel: |
| 999 | * 3945; 31:24 # beacons, 19:0 additional usec, |
| 1000 | * 4965; 31:22 # beacons, 21:0 additional usec. |
| 1001 | */ |
| 1002 | __le32 flags; /* RXON_FLG_* */ |
| 1003 | __le32 filter_flags; /* RXON_FILTER_* */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1004 | |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 1005 | /* For active scans (set to all-0s for passive scans). |
| 1006 | * Does not include payload. Must specify Tx rate; no rate scaling. */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1007 | struct iwl3945_tx_cmd tx_cmd; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 1008 | |
| 1009 | /* For directed active scans (set to all-0s otherwise) */ |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1010 | struct iwl3945_ssid_ie direct_scan[PROBE_OPTION_MAX_API1]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1011 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1012 | /* |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 1013 | * Probe request frame, followed by channel list. |
| 1014 | * |
| 1015 | * Size of probe request frame is specified by byte count in tx_cmd. |
| 1016 | * Channel list follows immediately after probe request frame. |
| 1017 | * Number of channels in list is specified by channel_count. |
| 1018 | * Each channel in list is of type: |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1019 | * |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1020 | * struct iwl3945_scan_channel channels[0]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1021 | * |
| 1022 | * NOTE: Only one band of channels can be scanned per pass. You |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 1023 | * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait |
| 1024 | * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION) |
| 1025 | * before requesting another scan. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1026 | */ |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 1027 | u8 data[0]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1028 | } __attribute__ ((packed)); |
| 1029 | |
| 1030 | /* Can abort will notify by complete notification with abort status. */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 1031 | #define CAN_ABORT_STATUS cpu_to_le32(0x1) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1032 | /* complete notification statuses */ |
| 1033 | #define ABORT_STATUS 0x2 |
| 1034 | |
| 1035 | /* |
| 1036 | * REPLY_SCAN_CMD = 0x80 (response) |
| 1037 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1038 | struct iwl3945_scanreq_notification { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1039 | __le32 status; /* 1: okay, 2: cannot fulfill request */ |
| 1040 | } __attribute__ ((packed)); |
| 1041 | |
| 1042 | /* |
| 1043 | * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command) |
| 1044 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1045 | struct iwl3945_scanstart_notification { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1046 | __le32 tsf_low; |
| 1047 | __le32 tsf_high; |
| 1048 | __le32 beacon_timer; |
| 1049 | u8 channel; |
| 1050 | u8 band; |
| 1051 | u8 reserved[2]; |
| 1052 | __le32 status; |
| 1053 | } __attribute__ ((packed)); |
| 1054 | |
| 1055 | #define SCAN_OWNER_STATUS 0x1; |
| 1056 | #define MEASURE_OWNER_STATUS 0x2; |
| 1057 | |
| 1058 | #define NUMBER_OF_STATISTICS 1 /* first __le32 is good CRC */ |
| 1059 | /* |
| 1060 | * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command) |
| 1061 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1062 | struct iwl3945_scanresults_notification { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1063 | u8 channel; |
| 1064 | u8 band; |
| 1065 | u8 reserved[2]; |
| 1066 | __le32 tsf_low; |
| 1067 | __le32 tsf_high; |
| 1068 | __le32 statistics[NUMBER_OF_STATISTICS]; |
| 1069 | } __attribute__ ((packed)); |
| 1070 | |
| 1071 | /* |
| 1072 | * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command) |
| 1073 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1074 | struct iwl3945_scancomplete_notification { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1075 | u8 scanned_channels; |
| 1076 | u8 status; |
| 1077 | u8 reserved; |
| 1078 | u8 last_channel; |
| 1079 | __le32 tsf_low; |
| 1080 | __le32 tsf_high; |
| 1081 | } __attribute__ ((packed)); |
| 1082 | |
| 1083 | |
| 1084 | /****************************************************************************** |
| 1085 | * (9) |
| 1086 | * IBSS/AP Commands and Notifications: |
| 1087 | * |
| 1088 | *****************************************************************************/ |
| 1089 | |
| 1090 | /* |
| 1091 | * BEACON_NOTIFICATION = 0x90 (notification only, not a command) |
| 1092 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1093 | struct iwl3945_beacon_notif { |
| 1094 | struct iwl3945_tx_resp beacon_notify_hdr; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1095 | __le32 low_tsf; |
| 1096 | __le32 high_tsf; |
| 1097 | __le32 ibss_mgr_status; |
| 1098 | } __attribute__ ((packed)); |
| 1099 | |
| 1100 | /* |
| 1101 | * REPLY_TX_BEACON = 0x91 (command, has simple generic response) |
| 1102 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1103 | struct iwl3945_tx_beacon_cmd { |
| 1104 | struct iwl3945_tx_cmd tx; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1105 | __le16 tim_idx; |
| 1106 | u8 tim_size; |
| 1107 | u8 reserved1; |
| 1108 | struct ieee80211_hdr frame[0]; /* beacon frame */ |
| 1109 | } __attribute__ ((packed)); |
| 1110 | |
| 1111 | /****************************************************************************** |
| 1112 | * (10) |
| 1113 | * Statistics Commands and Notifications: |
| 1114 | * |
| 1115 | *****************************************************************************/ |
| 1116 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1117 | struct iwl39_statistics_rx_phy { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1118 | __le32 ina_cnt; |
| 1119 | __le32 fina_cnt; |
| 1120 | __le32 plcp_err; |
| 1121 | __le32 crc32_err; |
| 1122 | __le32 overrun_err; |
| 1123 | __le32 early_overrun_err; |
| 1124 | __le32 crc32_good; |
| 1125 | __le32 false_alarm_cnt; |
| 1126 | __le32 fina_sync_err_cnt; |
| 1127 | __le32 sfd_timeout; |
| 1128 | __le32 fina_timeout; |
| 1129 | __le32 unresponded_rts; |
| 1130 | __le32 rxe_frame_limit_overrun; |
| 1131 | __le32 sent_ack_cnt; |
| 1132 | __le32 sent_cts_cnt; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1133 | } __attribute__ ((packed)); |
| 1134 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1135 | struct iwl39_statistics_rx_non_phy { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1136 | __le32 bogus_cts; /* CTS received when not expecting CTS */ |
| 1137 | __le32 bogus_ack; /* ACK received when not expecting ACK */ |
| 1138 | __le32 non_bssid_frames; /* number of frames with BSSID that |
| 1139 | * doesn't belong to the STA BSSID */ |
| 1140 | __le32 filtered_frames; /* count frames that were dumped in the |
| 1141 | * filtering process */ |
| 1142 | __le32 non_channel_beacons; /* beacons with our bss id but not on |
| 1143 | * our serving channel */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1144 | } __attribute__ ((packed)); |
| 1145 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1146 | struct iwl39_statistics_rx { |
| 1147 | struct iwl39_statistics_rx_phy ofdm; |
| 1148 | struct iwl39_statistics_rx_phy cck; |
| 1149 | struct iwl39_statistics_rx_non_phy general; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1150 | } __attribute__ ((packed)); |
| 1151 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1152 | struct iwl39_statistics_tx { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1153 | __le32 preamble_cnt; |
| 1154 | __le32 rx_detected_cnt; |
| 1155 | __le32 bt_prio_defer_cnt; |
| 1156 | __le32 bt_prio_kill_cnt; |
| 1157 | __le32 few_bytes_cnt; |
| 1158 | __le32 cts_timeout; |
| 1159 | __le32 ack_timeout; |
| 1160 | __le32 expected_ack_cnt; |
| 1161 | __le32 actual_ack_cnt; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1162 | } __attribute__ ((packed)); |
| 1163 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1164 | struct iwl39_statistics_div { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1165 | __le32 tx_on_a; |
| 1166 | __le32 tx_on_b; |
| 1167 | __le32 exec_time; |
| 1168 | __le32 probe_time; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1169 | } __attribute__ ((packed)); |
| 1170 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1171 | struct iwl39_statistics_general { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1172 | __le32 temperature; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1173 | struct statistics_dbg dbg; |
| 1174 | __le32 sleep_time; |
| 1175 | __le32 slots_out; |
| 1176 | __le32 slots_idle; |
| 1177 | __le32 ttl_timestamp; |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1178 | struct iwl39_statistics_div div; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1179 | } __attribute__ ((packed)); |
| 1180 | |
| 1181 | /* |
| 1182 | * REPLY_STATISTICS_CMD = 0x9c, |
| 1183 | * 3945 and 4965 identical. |
| 1184 | * |
| 1185 | * This command triggers an immediate response containing uCode statistics. |
| 1186 | * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below. |
| 1187 | * |
| 1188 | * If the CLEAR_STATS configuration flag is set, uCode will clear its |
| 1189 | * internal copy of the statistics (counters) after issuing the response. |
| 1190 | * This flag does not affect STATISTICS_NOTIFICATIONs after beacons (see below). |
| 1191 | * |
| 1192 | * If the DISABLE_NOTIF configuration flag is set, uCode will not issue |
| 1193 | * STATISTICS_NOTIFICATIONs after received beacons (see below). This flag |
| 1194 | * does not affect the response to the REPLY_STATISTICS_CMD 0x9c itself. |
| 1195 | */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 1196 | #define IWL_STATS_CONF_CLEAR_STATS cpu_to_le32(0x1) /* see above */ |
| 1197 | #define IWL_STATS_CONF_DISABLE_NOTIF cpu_to_le32(0x2)/* see above */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1198 | struct iwl3945_statistics_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1199 | __le32 configuration_flags; /* IWL_STATS_CONF_* */ |
| 1200 | } __attribute__ ((packed)); |
| 1201 | |
| 1202 | /* |
| 1203 | * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command) |
| 1204 | * |
| 1205 | * By default, uCode issues this notification after receiving a beacon |
| 1206 | * while associated. To disable this behavior, set DISABLE_NOTIF flag in the |
| 1207 | * REPLY_STATISTICS_CMD 0x9c, above. |
| 1208 | * |
| 1209 | * Statistics counters continue to increment beacon after beacon, but are |
| 1210 | * cleared when changing channels or when driver issues REPLY_STATISTICS_CMD |
| 1211 | * 0x9c with CLEAR_STATS bit set (see above). |
| 1212 | * |
| 1213 | * uCode also issues this notification during scans. uCode clears statistics |
| 1214 | * appropriately so that each notification contains statistics for only the |
| 1215 | * one channel that has just been scanned. |
| 1216 | */ |
Harvey Harrison | 51e9bf5 | 2008-11-26 13:12:52 -0800 | [diff] [blame] | 1217 | #define STATISTICS_REPLY_FLG_BAND_24G_MSK cpu_to_le32(0x2) |
| 1218 | #define STATISTICS_REPLY_FLG_FAT_MODE_MSK cpu_to_le32(0x8) |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1219 | struct iwl3945_notif_statistics { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1220 | __le32 flag; |
| 1221 | struct statistics_rx rx; |
| 1222 | struct statistics_tx tx; |
| 1223 | struct statistics_general general; |
| 1224 | } __attribute__ ((packed)); |
| 1225 | |
| 1226 | |
| 1227 | /* |
| 1228 | * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command) |
| 1229 | */ |
| 1230 | /* if ucode missed CONSECUTIVE_MISSED_BCONS_TH beacons in a row, |
| 1231 | * then this notification will be sent. */ |
| 1232 | #define CONSECUTIVE_MISSED_BCONS_TH 20 |
| 1233 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1234 | struct iwl3945_missed_beacon_notif { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1235 | __le32 consequtive_missed_beacons; |
| 1236 | __le32 total_missed_becons; |
| 1237 | __le32 num_expected_beacons; |
| 1238 | __le32 num_recvd_beacons; |
| 1239 | } __attribute__ ((packed)); |
| 1240 | |
| 1241 | /****************************************************************************** |
| 1242 | * (11) |
| 1243 | * Rx Calibration Commands: |
| 1244 | * |
| 1245 | *****************************************************************************/ |
| 1246 | |
| 1247 | #define PHY_CALIBRATE_DIFF_GAIN_CMD (7) |
| 1248 | #define HD_TABLE_SIZE (11) |
| 1249 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1250 | struct iwl3945_sensitivity_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1251 | __le16 control; |
| 1252 | __le16 table[HD_TABLE_SIZE]; |
| 1253 | } __attribute__ ((packed)); |
| 1254 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1255 | struct iwl3945_calibration_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1256 | u8 opCode; |
| 1257 | u8 flags; |
| 1258 | __le16 reserved; |
| 1259 | s8 diff_gain_a; |
| 1260 | s8 diff_gain_b; |
| 1261 | s8 diff_gain_c; |
| 1262 | u8 reserved1; |
| 1263 | } __attribute__ ((packed)); |
| 1264 | |
| 1265 | /****************************************************************************** |
| 1266 | * (12) |
| 1267 | * Miscellaneous Commands: |
| 1268 | * |
| 1269 | *****************************************************************************/ |
| 1270 | |
| 1271 | /* |
| 1272 | * LEDs Command & Response |
| 1273 | * REPLY_LEDS_CMD = 0x48 (command, has simple generic response) |
| 1274 | * |
| 1275 | * For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field), |
| 1276 | * this command turns it on or off, or sets up a periodic blinking cycle. |
| 1277 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1278 | struct iwl3945_led_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1279 | __le32 interval; /* "interval" in uSec */ |
| 1280 | u8 id; /* 1: Activity, 2: Link, 3: Tech */ |
| 1281 | u8 off; /* # intervals off while blinking; |
| 1282 | * "0", with >0 "on" value, turns LED on */ |
| 1283 | u8 on; /* # intervals on while blinking; |
| 1284 | * "0", regardless of "off", turns LED off */ |
| 1285 | u8 reserved; |
| 1286 | } __attribute__ ((packed)); |
| 1287 | |
| 1288 | /****************************************************************************** |
| 1289 | * (13) |
| 1290 | * Union of all expected notifications/responses: |
| 1291 | * |
| 1292 | *****************************************************************************/ |
| 1293 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1294 | struct iwl3945_rx_packet { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1295 | __le32 len; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1296 | struct iwl3945_cmd_header hdr; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1297 | union { |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1298 | struct iwl3945_alive_resp alive_frame; |
| 1299 | struct iwl3945_rx_frame rx_frame; |
| 1300 | struct iwl3945_tx_resp tx_resp; |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1301 | struct iwl_spectrum_notification spectrum_notif; |
| 1302 | struct iwl_csa_notification csa_notif; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1303 | struct iwl3945_error_resp err_resp; |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1304 | struct iwl_card_state_notif card_state_notif; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1305 | struct iwl3945_beacon_notif beacon_status; |
| 1306 | struct iwl3945_add_sta_resp add_sta; |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame^] | 1307 | struct iwl_sleep_notification sleep_notif; |
| 1308 | struct iwl_spectrum_resp spectrum; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1309 | struct iwl3945_notif_statistics stats; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1310 | __le32 status; |
| 1311 | u8 raw[0]; |
| 1312 | } u; |
| 1313 | } __attribute__ ((packed)); |
| 1314 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1315 | #define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl3945_rx_frame)) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 1316 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 1317 | #endif /* __iwl3945_3945_commands_h__ */ |