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 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 72 | /****************************************************************************** |
| 73 | * (0) |
Ben Cahill | 80cc0c3 | 2007-11-29 11:10:09 +0800 | [diff] [blame] | 74 | * Commonly used structures and definitions: |
| 75 | * Command header, txpower |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 76 | * |
| 77 | *****************************************************************************/ |
Ben Cahill | 80cc0c3 | 2007-11-29 11:10:09 +0800 | [diff] [blame] | 78 | /** |
| 79 | * struct iwl3945_tx_power |
| 80 | * |
| 81 | * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_SCAN_CMD, REPLY_CHANNEL_SWITCH |
| 82 | * |
| 83 | * Each entry contains two values: |
| 84 | * 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained |
| 85 | * linear value that multiplies the output of the digital signal processor, |
| 86 | * before being sent to the analog radio. |
| 87 | * 2) Radio gain. This sets the analog gain of the radio Tx path. |
| 88 | * It is a coarser setting, and behaves in a logarithmic (dB) fashion. |
| 89 | * |
| 90 | * Driver obtains values from struct iwl3945_tx_power power_gain_table[][]. |
| 91 | */ |
| 92 | struct iwl3945_tx_power { |
| 93 | u8 tx_gain; /* gain for analog radio */ |
| 94 | u8 dsp_atten; /* gain for DSP */ |
| 95 | } __attribute__ ((packed)); |
| 96 | |
| 97 | /** |
| 98 | * struct iwl3945_power_per_rate |
| 99 | * |
| 100 | * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH |
| 101 | */ |
| 102 | struct iwl3945_power_per_rate { |
| 103 | u8 rate; /* plcp */ |
| 104 | struct iwl3945_tx_power tpc; |
| 105 | u8 reserved; |
| 106 | } __attribute__ ((packed)); |
| 107 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 108 | /****************************************************************************** |
| 109 | * (0a) |
| 110 | * Alive and Error Commands & Responses: |
| 111 | * |
| 112 | *****************************************************************************/ |
| 113 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 114 | |
| 115 | /* |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 116 | * ("Initialize") REPLY_ALIVE = 0x1 (response only, not a command) |
| 117 | * |
| 118 | * uCode issues this "initialize alive" notification once the initialization |
| 119 | * uCode image has completed its work, and is ready to load the runtime image. |
| 120 | * This is the *first* "alive" notification that the driver will receive after |
| 121 | * rebooting uCode; the "initialize" alive is indicated by subtype field == 9. |
| 122 | * |
| 123 | * See comments documenting "BSM" (bootstrap state machine). |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 124 | */ |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 125 | struct iwl3945_init_alive_resp { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 126 | u8 ucode_minor; |
| 127 | u8 ucode_major; |
| 128 | __le16 reserved1; |
| 129 | u8 sw_rev[8]; |
| 130 | u8 ver_type; |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 131 | u8 ver_subtype; /* "9" for initialize alive */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 132 | __le16 reserved2; |
| 133 | __le32 log_event_table_ptr; |
| 134 | __le32 error_event_table_ptr; |
| 135 | __le32 timestamp; |
| 136 | __le32 is_valid; |
| 137 | } __attribute__ ((packed)); |
| 138 | |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 139 | |
| 140 | /** |
| 141 | * REPLY_ALIVE = 0x1 (response only, not a command) |
| 142 | * |
| 143 | * uCode issues this "alive" notification once the runtime image is ready |
| 144 | * to receive commands from the driver. This is the *second* "alive" |
| 145 | * notification that the driver will receive after rebooting uCode; |
| 146 | * this "alive" is indicated by subtype field != 9. |
| 147 | * |
| 148 | * See comments documenting "BSM" (bootstrap state machine). |
| 149 | * |
| 150 | * This response includes two pointers to structures within the device's |
| 151 | * data SRAM (access via HBUS_TARG_MEM_* regs) that are useful for debugging: |
| 152 | * |
| 153 | * 1) log_event_table_ptr indicates base of the event log. This traces |
| 154 | * a 256-entry history of uCode execution within a circular buffer. |
| 155 | * |
| 156 | * 2) error_event_table_ptr indicates base of the error log. This contains |
| 157 | * information about any uCode error that occurs. |
| 158 | * |
| 159 | * The Linux driver can print both logs to the system log when a uCode error |
| 160 | * occurs. |
| 161 | */ |
| 162 | struct iwl3945_alive_resp { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 163 | u8 ucode_minor; |
| 164 | u8 ucode_major; |
| 165 | __le16 reserved1; |
| 166 | u8 sw_rev[8]; |
| 167 | u8 ver_type; |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 168 | u8 ver_subtype; /* not "9" for runtime alive */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 169 | __le16 reserved2; |
Ben Cahill | 075416c | 2007-11-29 11:10:08 +0800 | [diff] [blame] | 170 | __le32 log_event_table_ptr; /* SRAM address for event log */ |
| 171 | __le32 error_event_table_ptr; /* SRAM address for error log */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 172 | __le32 timestamp; |
| 173 | __le32 is_valid; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 174 | } __attribute__ ((packed)); |
| 175 | |
| 176 | union tsf { |
| 177 | u8 byte[8]; |
| 178 | __le16 word[4]; |
| 179 | __le32 dw[2]; |
| 180 | }; |
| 181 | |
| 182 | /* |
| 183 | * REPLY_ERROR = 0x2 (response only, not a command) |
| 184 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 185 | struct iwl3945_error_resp { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 186 | __le32 error_type; |
| 187 | u8 cmd_id; |
| 188 | u8 reserved1; |
| 189 | __le16 bad_cmd_seq_num; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 190 | __le16 reserved2; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 191 | __le32 error_info; |
| 192 | union tsf timestamp; |
| 193 | } __attribute__ ((packed)); |
| 194 | |
| 195 | /****************************************************************************** |
| 196 | * (1) |
| 197 | * RXON Commands & Responses: |
| 198 | * |
| 199 | *****************************************************************************/ |
| 200 | |
Ben Cahill | 80cc0c3 | 2007-11-29 11:10:09 +0800 | [diff] [blame] | 201 | /** |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 202 | * REPLY_RXON = 0x10 (command, has simple generic response) |
Ben Cahill | 80cc0c3 | 2007-11-29 11:10:09 +0800 | [diff] [blame] | 203 | * |
| 204 | * RXON tunes the radio tuner to a service channel, and sets up a number |
| 205 | * of parameters that are used primarily for Rx, but also for Tx operations. |
| 206 | * |
| 207 | * NOTE: When tuning to a new channel, driver must set the |
| 208 | * RXON_FILTER_ASSOC_MSK to 0. This will clear station-dependent |
| 209 | * info within the device, including the station tables, tx retry |
| 210 | * rate tables, and txpower tables. Driver must build a new station |
| 211 | * table and txpower table before transmitting anything on the RXON |
| 212 | * channel. |
| 213 | * |
| 214 | * NOTE: All RXONs wipe clean the internal txpower table. Driver must |
| 215 | * issue a new REPLY_TX_PWR_TABLE_CMD after each REPLY_RXON (0x10), |
| 216 | * regardless of whether RXON_FILTER_ASSOC_MSK is set. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 217 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 218 | struct iwl3945_rxon_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 219 | u8 node_addr[6]; |
| 220 | __le16 reserved1; |
| 221 | u8 bssid_addr[6]; |
| 222 | __le16 reserved2; |
| 223 | u8 wlap_bssid_addr[6]; |
| 224 | __le16 reserved3; |
| 225 | u8 dev_type; |
| 226 | u8 air_propagation; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 227 | __le16 reserved4; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 228 | u8 ofdm_basic_rates; |
| 229 | u8 cck_basic_rates; |
| 230 | __le16 assoc_id; |
| 231 | __le32 flags; |
| 232 | __le32 filter_flags; |
| 233 | __le16 channel; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 234 | __le16 reserved5; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 235 | } __attribute__ ((packed)); |
| 236 | |
| 237 | /* |
| 238 | * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) |
| 239 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 240 | struct iwl3945_rxon_assoc_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 241 | __le32 flags; |
| 242 | __le32 filter_flags; |
| 243 | u8 ofdm_basic_rates; |
| 244 | u8 cck_basic_rates; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 245 | __le16 reserved; |
| 246 | } __attribute__ ((packed)); |
| 247 | |
| 248 | /* |
| 249 | * REPLY_RXON_TIMING = 0x14 (command, has simple generic response) |
| 250 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 251 | struct iwl3945_rxon_time_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 252 | union tsf timestamp; |
| 253 | __le16 beacon_interval; |
| 254 | __le16 atim_window; |
| 255 | __le32 beacon_init_val; |
| 256 | __le16 listen_interval; |
| 257 | __le16 reserved; |
| 258 | } __attribute__ ((packed)); |
| 259 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 260 | /* |
| 261 | * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) |
| 262 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 263 | struct iwl3945_channel_switch_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 264 | u8 band; |
| 265 | u8 expect_beacon; |
| 266 | __le16 channel; |
| 267 | __le32 rxon_flags; |
| 268 | __le32 rxon_filter_flags; |
| 269 | __le32 switch_time; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 270 | struct iwl3945_power_per_rate power[IWL_MAX_RATES]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 271 | } __attribute__ ((packed)); |
| 272 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 273 | /****************************************************************************** |
| 274 | * (3) |
| 275 | * Add/Modify Stations Commands & Responses: |
| 276 | * |
| 277 | *****************************************************************************/ |
| 278 | /* |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 279 | * REPLY_ADD_STA = 0x18 (command) |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 280 | * |
| 281 | * The device contains an internal table of per-station information, |
| 282 | * with info on security keys, aggregation parameters, and Tx rates for |
| 283 | * initial Tx attempt and any retries (4965 uses REPLY_TX_LINK_QUALITY_CMD, |
| 284 | * 3945 uses REPLY_RATE_SCALE to set up rate tables). |
| 285 | * |
| 286 | * REPLY_ADD_STA sets up the table entry for one station, either creating |
| 287 | * a new entry, or modifying a pre-existing one. |
| 288 | * |
| 289 | * NOTE: RXON command (without "associated" bit set) wipes the station table |
| 290 | * clean. Moving into RF_KILL state does this also. Driver must set up |
| 291 | * new station table before transmitting anything on the RXON channel |
| 292 | * (except active scans or active measurements; those commands carry |
| 293 | * their own txpower/rate setup data). |
| 294 | * |
| 295 | * When getting started on a new channel, driver must set up the |
| 296 | * IWL_BROADCAST_ID entry (last entry in the table). For a client |
| 297 | * station in a BSS, once an AP is selected, driver sets up the AP STA |
| 298 | * in the IWL_AP_ID entry (1st entry in the table). BROADCAST and AP |
| 299 | * are all that are needed for a BSS client station. If the device is |
| 300 | * used as AP, or in an IBSS network, driver must set up station table |
| 301 | * entries for all STAs in network, starting with index IWL_STA_ID. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 302 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 303 | struct iwl3945_addsta_cmd { |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 304 | u8 mode; /* 1: modify existing, 0: add new station */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 305 | u8 reserved[3]; |
| 306 | struct sta_id_modify sta; |
Tomas Winkler | 4c89725 | 2008-12-19 10:37:05 +0800 | [diff] [blame^] | 307 | struct iwl4965_keyinfo key; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 308 | __le32 station_flags; /* STA_FLG_* */ |
| 309 | __le32 station_flags_msk; /* STA_FLG_* */ |
| 310 | |
| 311 | /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID) |
| 312 | * corresponding to bit (e.g. bit 5 controls TID 5). |
| 313 | * 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] | 314 | __le16 tid_disable_tx; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 315 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 316 | __le16 rate_n_flags; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 317 | |
| 318 | /* TID for which to add block-ack support. |
| 319 | * 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] | 320 | u8 add_immediate_ba_tid; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 321 | |
| 322 | /* TID for which to remove block-ack support. |
| 323 | * 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] | 324 | u8 remove_immediate_ba_tid; |
Ben Cahill | 2054a00 | 2007-11-29 11:10:10 +0800 | [diff] [blame] | 325 | |
| 326 | /* Starting Sequence Number for added block-ack support. |
| 327 | * 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] | 328 | __le16 add_immediate_ba_ssn; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 329 | } __attribute__ ((packed)); |
| 330 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 331 | |
| 332 | /****************************************************************************** |
| 333 | * (4) |
| 334 | * Rx Responses: |
| 335 | * |
| 336 | *****************************************************************************/ |
| 337 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 338 | struct iwl3945_rx_frame_stats { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 339 | u8 phy_count; |
| 340 | u8 id; |
| 341 | u8 rssi; |
| 342 | u8 agc; |
| 343 | __le16 sig_avg; |
| 344 | __le16 noise_diff; |
| 345 | u8 payload[0]; |
| 346 | } __attribute__ ((packed)); |
| 347 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 348 | struct iwl3945_rx_frame_hdr { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 349 | __le16 channel; |
| 350 | __le16 phy_flags; |
| 351 | u8 reserved1; |
| 352 | u8 rate; |
| 353 | __le16 len; |
| 354 | u8 payload[0]; |
| 355 | } __attribute__ ((packed)); |
| 356 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 357 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 358 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 359 | struct iwl3945_rx_frame_end { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 360 | __le32 status; |
| 361 | __le64 timestamp; |
| 362 | __le32 beacon_timestamp; |
| 363 | } __attribute__ ((packed)); |
| 364 | |
| 365 | /* |
| 366 | * REPLY_3945_RX = 0x1b (response only, not a command) |
| 367 | * |
| 368 | * NOTE: DO NOT dereference from casts to this structure |
| 369 | * It is provided only for calculating minimum data set size. |
| 370 | * The actual offsets of the hdr and end are dynamic based on |
| 371 | * stats.phy_count |
| 372 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 373 | struct iwl3945_rx_frame { |
| 374 | struct iwl3945_rx_frame_stats stats; |
| 375 | struct iwl3945_rx_frame_hdr hdr; |
| 376 | struct iwl3945_rx_frame_end end; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 377 | } __attribute__ ((packed)); |
| 378 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 379 | /****************************************************************************** |
| 380 | * (5) |
| 381 | * Tx Commands & Responses: |
| 382 | * |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 383 | * Driver must place each REPLY_TX command into one of the prioritized Tx |
| 384 | * queues in host DRAM, shared between driver and device. When the device's |
| 385 | * Tx scheduler and uCode are preparing to transmit, the device pulls the |
| 386 | * Tx command over the PCI bus via one of the device's Tx DMA channels, |
| 387 | * to fill an internal FIFO from which data will be transmitted. |
| 388 | * |
| 389 | * uCode handles all timing and protocol related to control frames |
| 390 | * (RTS/CTS/ACK), based on flags in the Tx command. |
| 391 | * |
| 392 | * uCode handles retrying Tx when an ACK is expected but not received. |
| 393 | * This includes trying lower data rates than the one requested in the Tx |
| 394 | * command, as set up by the REPLY_RATE_SCALE (for 3945) or |
| 395 | * REPLY_TX_LINK_QUALITY_CMD (4965). |
| 396 | * |
| 397 | * Driver sets up transmit power for various rates via REPLY_TX_PWR_TABLE_CMD. |
| 398 | * 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] | 399 | *****************************************************************************/ |
| 400 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 401 | /* |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 402 | * REPLY_TX = 0x1c (command) |
| 403 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 404 | struct iwl3945_tx_cmd { |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 405 | /* |
| 406 | * MPDU byte count: |
| 407 | * MAC header (24/26/30/32 bytes) + 2 bytes pad if 26/30 header size, |
| 408 | * + 8 byte IV for CCM or TKIP (not used for WEP) |
| 409 | * + Data payload |
| 410 | * + 8-byte MIC (not used for CCM/WEP) |
| 411 | * NOTE: Does not include Tx command bytes, post-MAC pad bytes, |
| 412 | * MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.i |
| 413 | * Range: 14-2342 bytes. |
| 414 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 415 | __le16 len; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 416 | |
| 417 | /* |
| 418 | * MPDU or MSDU byte count for next frame. |
| 419 | * Used for fragmentation and bursting, but not 11n aggregation. |
| 420 | * Same as "len", but for next frame. Set to 0 if not applicable. |
| 421 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 422 | __le16 next_frame_len; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 423 | |
| 424 | __le32 tx_flags; /* TX_CMD_FLG_* */ |
| 425 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 426 | u8 rate; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 427 | |
| 428 | /* Index of recipient station in uCode's station table */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 429 | u8 sta_id; |
| 430 | u8 tid_tspec; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 431 | u8 sec_ctl; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 432 | u8 key[16]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 433 | union { |
| 434 | u8 byte[8]; |
| 435 | __le16 word[4]; |
| 436 | __le32 dw[2]; |
| 437 | } tkip_mic; |
| 438 | __le32 next_frame_info; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 439 | union { |
| 440 | __le32 life_time; |
| 441 | __le32 attempt; |
| 442 | } stop_time; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 443 | u8 supp_rates[2]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 444 | u8 rts_retry_limit; /*byte 50 */ |
| 445 | u8 data_retry_limit; /*byte 51 */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 446 | union { |
| 447 | __le16 pm_frame_timeout; |
| 448 | __le16 attempt_duration; |
| 449 | } timeout; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 450 | |
| 451 | /* |
| 452 | * Duration of EDCA burst Tx Opportunity, in 32-usec units. |
| 453 | * Set this if txop time is not specified by HCCA protocol (e.g. by AP). |
| 454 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 455 | __le16 driver_txop; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 456 | |
| 457 | /* |
| 458 | * MAC header goes here, followed by 2 bytes padding if MAC header |
| 459 | * length is 26 or 30 bytes, followed by payload data |
| 460 | */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 461 | u8 payload[0]; |
| 462 | struct ieee80211_hdr hdr[0]; |
| 463 | } __attribute__ ((packed)); |
| 464 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 465 | /* |
| 466 | * REPLY_TX = 0x1c (response) |
| 467 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 468 | struct iwl3945_tx_resp { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 469 | u8 failure_rts; |
| 470 | u8 failure_frame; |
| 471 | u8 bt_kill_count; |
| 472 | u8 rate; |
| 473 | __le32 wireless_media_time; |
Ben Cahill | 5296998 | 2007-11-29 11:10:11 +0800 | [diff] [blame] | 474 | __le32 status; /* TX status */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 475 | } __attribute__ ((packed)); |
| 476 | |
| 477 | /* |
| 478 | * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) |
| 479 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 480 | struct iwl3945_txpowertable_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 481 | u8 band; /* 0: 5 GHz, 1: 2.4 GHz */ |
| 482 | u8 reserved; |
| 483 | __le16 channel; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 484 | struct iwl3945_power_per_rate power[IWL_MAX_RATES]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 485 | } __attribute__ ((packed)); |
| 486 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 487 | struct iwl3945_rate_scaling_info { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 488 | __le16 rate_n_flags; |
| 489 | u8 try_cnt; |
| 490 | u8 next_rate_index; |
| 491 | } __attribute__ ((packed)); |
| 492 | |
| 493 | /** |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 494 | * struct iwl3945_rate_scaling_cmd - Rate Scaling Command & Response |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 495 | * |
| 496 | * REPLY_RATE_SCALE = 0x47 (command, has simple generic response) |
| 497 | * |
| 498 | * NOTE: The table of rates passed to the uCode via the |
| 499 | * RATE_SCALE command sets up the corresponding order of |
| 500 | * rates used for all related commands, including rate |
| 501 | * masks, etc. |
| 502 | * |
| 503 | * For example, if you set 9MB (PLCP 0x0f) as the first |
| 504 | * rate in the rate table, the bit mask for that rate |
| 505 | * when passed through ofdm_basic_rates on the REPLY_RXON |
Reinette Chatre | 8a1b024 | 2008-01-14 17:46:25 -0800 | [diff] [blame] | 506 | * command would be bit 0 (1 << 0) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 507 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 508 | struct iwl3945_rate_scaling_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 509 | u8 table_id; |
| 510 | u8 reserved[3]; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 511 | struct iwl3945_rate_scaling_info table[IWL_MAX_RATES]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 512 | } __attribute__ ((packed)); |
| 513 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 514 | /****************************************************************************** |
| 515 | * (8) |
| 516 | * Scan Commands, Responses, Notifications: |
| 517 | * |
| 518 | *****************************************************************************/ |
| 519 | |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 520 | /** |
| 521 | * struct iwl3945_scan_channel - entry in REPLY_SCAN_CMD channel table |
| 522 | * |
| 523 | * One for each channel in the scan list. |
| 524 | * Each channel can independently select: |
| 525 | * 1) SSID for directed active scans |
| 526 | * 2) Txpower setting (for rate specified within Tx command) |
| 527 | * 3) How long to stay on-channel (behavior may be modified by quiet_time, |
| 528 | * quiet_plcp_th, good_CRC_th) |
| 529 | * |
| 530 | * To avoid uCode errors, make sure the following are true (see comments |
| 531 | * under struct iwl3945_scan_cmd about max_out_time and quiet_time): |
| 532 | * 1) If using passive_dwell (i.e. passive_dwell != 0): |
| 533 | * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0) |
| 534 | * 2) quiet_time <= active_dwell |
| 535 | * 3) If restricting off-channel time (i.e. max_out_time !=0): |
| 536 | * passive_dwell < max_out_time |
| 537 | * active_dwell < max_out_time |
| 538 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 539 | struct iwl3945_scan_channel { |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 540 | /* |
| 541 | * type is defined as: |
| 542 | * 0:0 1 = active, 0 = passive |
| 543 | * 1:4 SSID direct bit map; if a bit is set, then corresponding |
| 544 | * SSID IE is transmitted in probe request. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 545 | * 5:7 reserved |
| 546 | */ |
| 547 | u8 type; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 548 | u8 channel; /* band is selected by iwl3945_scan_cmd "flags" field */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 549 | struct iwl3945_tx_power tpc; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 550 | __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */ |
| 551 | __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 552 | } __attribute__ ((packed)); |
| 553 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 554 | |
| 555 | /* |
| 556 | * REPLY_SCAN_CMD = 0x80 (command) |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 557 | * |
| 558 | * The hardware scan command is very powerful; the driver can set it up to |
| 559 | * maintain (relatively) normal network traffic while doing a scan in the |
| 560 | * background. The max_out_time and suspend_time control the ratio of how |
| 561 | * long the device stays on an associated network channel ("service channel") |
| 562 | * vs. how long it's away from the service channel, tuned to other channels |
| 563 | * for scanning. |
| 564 | * |
| 565 | * max_out_time is the max time off-channel (in usec), and suspend_time |
| 566 | * is how long (in "extended beacon" format) that the scan is "suspended" |
| 567 | * after returning to the service channel. That is, suspend_time is the |
| 568 | * time that we stay on the service channel, doing normal work, between |
| 569 | * scan segments. The driver may set these parameters differently to support |
| 570 | * scanning when associated vs. not associated, and light vs. heavy traffic |
| 571 | * loads when associated. |
| 572 | * |
| 573 | * After receiving this command, the device's scan engine does the following; |
| 574 | * |
| 575 | * 1) Sends SCAN_START notification to driver |
| 576 | * 2) Checks to see if it has time to do scan for one channel |
| 577 | * 3) Sends NULL packet, with power-save (PS) bit set to 1, |
| 578 | * to tell AP that we're going off-channel |
| 579 | * 4) Tunes to first channel in scan list, does active or passive scan |
| 580 | * 5) Sends SCAN_RESULT notification to driver |
| 581 | * 6) Checks to see if it has time to do scan on *next* channel in list |
| 582 | * 7) Repeats 4-6 until it no longer has time to scan the next channel |
| 583 | * before max_out_time expires |
| 584 | * 8) Returns to service channel |
| 585 | * 9) Sends NULL packet with PS=0 to tell AP that we're back |
| 586 | * 10) Stays on service channel until suspend_time expires |
| 587 | * 11) Repeats entire process 2-10 until list is complete |
| 588 | * 12) Sends SCAN_COMPLETE notification |
| 589 | * |
| 590 | * For fast, efficient scans, the scan command also has support for staying on |
| 591 | * a channel for just a short time, if doing active scanning and getting no |
| 592 | * responses to the transmitted probe request. This time is controlled by |
| 593 | * quiet_time, and the number of received packets below which a channel is |
| 594 | * considered "quiet" is controlled by quiet_plcp_threshold. |
| 595 | * |
| 596 | * For active scanning on channels that have regulatory restrictions against |
| 597 | * blindly transmitting, the scan can listen before transmitting, to make sure |
| 598 | * that there is already legitimate activity on the channel. If enough |
| 599 | * packets are cleanly received on the channel (controlled by good_CRC_th, |
| 600 | * typical value 1), the scan engine starts transmitting probe requests. |
| 601 | * |
| 602 | * Driver must use separate scan commands for 2.4 vs. 5 GHz bands. |
| 603 | * |
| 604 | * To avoid uCode errors, see timing restrictions described under |
| 605 | * struct iwl3945_scan_channel. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 606 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 607 | struct iwl3945_scan_cmd { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 608 | __le16 len; |
| 609 | u8 reserved0; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 610 | u8 channel_count; /* # channels in channel list */ |
| 611 | __le16 quiet_time; /* dwell only this # millisecs on quiet channel |
| 612 | * (only for active scan) */ |
| 613 | __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */ |
| 614 | __le16 good_CRC_th; /* passive -> active promotion threshold */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 615 | __le16 reserved1; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 616 | __le32 max_out_time; /* max usec to be away from associated (service) |
| 617 | * channel */ |
| 618 | __le32 suspend_time; /* pause scan this long (in "extended beacon |
| 619 | * format") when returning to service channel: |
| 620 | * 3945; 31:24 # beacons, 19:0 additional usec, |
| 621 | * 4965; 31:22 # beacons, 21:0 additional usec. |
| 622 | */ |
| 623 | __le32 flags; /* RXON_FLG_* */ |
| 624 | __le32 filter_flags; /* RXON_FILTER_* */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 625 | |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 626 | /* For active scans (set to all-0s for passive scans). |
| 627 | * Does not include payload. Must specify Tx rate; no rate scaling. */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 628 | struct iwl3945_tx_cmd tx_cmd; |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 629 | |
| 630 | /* For directed active scans (set to all-0s otherwise) */ |
Tomas Winkler | 4c89725 | 2008-12-19 10:37:05 +0800 | [diff] [blame^] | 631 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX_API1]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 632 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 633 | /* |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 634 | * Probe request frame, followed by channel list. |
| 635 | * |
| 636 | * Size of probe request frame is specified by byte count in tx_cmd. |
| 637 | * Channel list follows immediately after probe request frame. |
| 638 | * Number of channels in list is specified by channel_count. |
| 639 | * Each channel in list is of type: |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 640 | * |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 641 | * struct iwl3945_scan_channel channels[0]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 642 | * |
| 643 | * NOTE: Only one band of channels can be scanned per pass. You |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 644 | * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait |
| 645 | * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION) |
| 646 | * before requesting another scan. |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 647 | */ |
Ben Cahill | 3058f02 | 2008-01-14 17:46:17 -0800 | [diff] [blame] | 648 | u8 data[0]; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 649 | } __attribute__ ((packed)); |
| 650 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 651 | /****************************************************************************** |
| 652 | * (9) |
| 653 | * IBSS/AP Commands and Notifications: |
| 654 | * |
| 655 | *****************************************************************************/ |
| 656 | |
| 657 | /* |
| 658 | * BEACON_NOTIFICATION = 0x90 (notification only, not a command) |
| 659 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 660 | struct iwl3945_beacon_notif { |
| 661 | struct iwl3945_tx_resp beacon_notify_hdr; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 662 | __le32 low_tsf; |
| 663 | __le32 high_tsf; |
| 664 | __le32 ibss_mgr_status; |
| 665 | } __attribute__ ((packed)); |
| 666 | |
| 667 | /* |
| 668 | * REPLY_TX_BEACON = 0x91 (command, has simple generic response) |
| 669 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 670 | struct iwl3945_tx_beacon_cmd { |
| 671 | struct iwl3945_tx_cmd tx; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 672 | __le16 tim_idx; |
| 673 | u8 tim_size; |
| 674 | u8 reserved1; |
| 675 | struct ieee80211_hdr frame[0]; /* beacon frame */ |
| 676 | } __attribute__ ((packed)); |
| 677 | |
| 678 | /****************************************************************************** |
| 679 | * (10) |
| 680 | * Statistics Commands and Notifications: |
| 681 | * |
| 682 | *****************************************************************************/ |
| 683 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 684 | struct iwl39_statistics_rx_phy { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 685 | __le32 ina_cnt; |
| 686 | __le32 fina_cnt; |
| 687 | __le32 plcp_err; |
| 688 | __le32 crc32_err; |
| 689 | __le32 overrun_err; |
| 690 | __le32 early_overrun_err; |
| 691 | __le32 crc32_good; |
| 692 | __le32 false_alarm_cnt; |
| 693 | __le32 fina_sync_err_cnt; |
| 694 | __le32 sfd_timeout; |
| 695 | __le32 fina_timeout; |
| 696 | __le32 unresponded_rts; |
| 697 | __le32 rxe_frame_limit_overrun; |
| 698 | __le32 sent_ack_cnt; |
| 699 | __le32 sent_cts_cnt; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 700 | } __attribute__ ((packed)); |
| 701 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 702 | struct iwl39_statistics_rx_non_phy { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 703 | __le32 bogus_cts; /* CTS received when not expecting CTS */ |
| 704 | __le32 bogus_ack; /* ACK received when not expecting ACK */ |
| 705 | __le32 non_bssid_frames; /* number of frames with BSSID that |
| 706 | * doesn't belong to the STA BSSID */ |
| 707 | __le32 filtered_frames; /* count frames that were dumped in the |
| 708 | * filtering process */ |
| 709 | __le32 non_channel_beacons; /* beacons with our bss id but not on |
| 710 | * our serving channel */ |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 711 | } __attribute__ ((packed)); |
| 712 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 713 | struct iwl39_statistics_rx { |
| 714 | struct iwl39_statistics_rx_phy ofdm; |
| 715 | struct iwl39_statistics_rx_phy cck; |
| 716 | struct iwl39_statistics_rx_non_phy general; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 717 | } __attribute__ ((packed)); |
| 718 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 719 | struct iwl39_statistics_tx { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 720 | __le32 preamble_cnt; |
| 721 | __le32 rx_detected_cnt; |
| 722 | __le32 bt_prio_defer_cnt; |
| 723 | __le32 bt_prio_kill_cnt; |
| 724 | __le32 few_bytes_cnt; |
| 725 | __le32 cts_timeout; |
| 726 | __le32 ack_timeout; |
| 727 | __le32 expected_ack_cnt; |
| 728 | __le32 actual_ack_cnt; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 729 | } __attribute__ ((packed)); |
| 730 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 731 | struct iwl39_statistics_div { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 732 | __le32 tx_on_a; |
| 733 | __le32 tx_on_b; |
| 734 | __le32 exec_time; |
| 735 | __le32 probe_time; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 736 | } __attribute__ ((packed)); |
| 737 | |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 738 | struct iwl39_statistics_general { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 739 | __le32 temperature; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 740 | struct statistics_dbg dbg; |
| 741 | __le32 sleep_time; |
| 742 | __le32 slots_out; |
| 743 | __le32 slots_idle; |
| 744 | __le32 ttl_timestamp; |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 745 | struct iwl39_statistics_div div; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 746 | } __attribute__ ((packed)); |
| 747 | |
| 748 | /* |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 749 | * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command) |
| 750 | * |
| 751 | * By default, uCode issues this notification after receiving a beacon |
| 752 | * while associated. To disable this behavior, set DISABLE_NOTIF flag in the |
| 753 | * REPLY_STATISTICS_CMD 0x9c, above. |
| 754 | * |
| 755 | * Statistics counters continue to increment beacon after beacon, but are |
| 756 | * cleared when changing channels or when driver issues REPLY_STATISTICS_CMD |
| 757 | * 0x9c with CLEAR_STATS bit set (see above). |
| 758 | * |
| 759 | * uCode also issues this notification during scans. uCode clears statistics |
| 760 | * appropriately so that each notification contains statistics for only the |
| 761 | * one channel that has just been scanned. |
| 762 | */ |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 763 | struct iwl3945_notif_statistics { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 764 | __le32 flag; |
| 765 | struct statistics_rx rx; |
| 766 | struct statistics_tx tx; |
| 767 | struct statistics_general general; |
| 768 | } __attribute__ ((packed)); |
| 769 | |
| 770 | |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 771 | /****************************************************************************** |
| 772 | * (13) |
| 773 | * Union of all expected notifications/responses: |
| 774 | * |
| 775 | *****************************************************************************/ |
| 776 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 777 | struct iwl3945_rx_packet { |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 778 | __le32 len; |
Tomas Winkler | 4c89725 | 2008-12-19 10:37:05 +0800 | [diff] [blame^] | 779 | struct iwl_cmd_header hdr; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 780 | union { |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 781 | struct iwl3945_alive_resp alive_frame; |
| 782 | struct iwl3945_rx_frame rx_frame; |
| 783 | struct iwl3945_tx_resp tx_resp; |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 784 | struct iwl_spectrum_notification spectrum_notif; |
| 785 | struct iwl_csa_notification csa_notif; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 786 | struct iwl3945_error_resp err_resp; |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 787 | struct iwl_card_state_notif card_state_notif; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 788 | struct iwl3945_beacon_notif beacon_status; |
Tomas Winkler | 4c89725 | 2008-12-19 10:37:05 +0800 | [diff] [blame^] | 789 | struct iwl_add_sta_resp add_sta; |
Tomas Winkler | 600c0e1 | 2008-12-19 10:37:04 +0800 | [diff] [blame] | 790 | struct iwl_sleep_notification sleep_notif; |
| 791 | struct iwl_spectrum_resp spectrum; |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 792 | struct iwl3945_notif_statistics stats; |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 793 | __le32 status; |
| 794 | u8 raw[0]; |
| 795 | } u; |
| 796 | } __attribute__ ((packed)); |
| 797 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 798 | #define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl3945_rx_frame)) |
Zhu Yi | b481de9 | 2007-09-25 17:54:57 -0700 | [diff] [blame] | 799 | |
Christoph Hellwig | bb8c093 | 2008-01-27 16:41:47 -0800 | [diff] [blame] | 800 | #endif /* __iwl3945_3945_commands_h__ */ |