Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Reinette Chatre | 1f44780 | 2010-01-15 13:43:41 -0800 | [diff] [blame] | 3 | * Copyright(c) 2007 - 2010 Intel Corporation. All rights reserved. |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of version 2 of the GNU General Public License as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 12 | * more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along with |
| 15 | * this program; if not, write to the Free Software Foundation, Inc., |
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
| 17 | * |
| 18 | * The full GNU General Public License is included in this distribution in the |
| 19 | * file called LICENSE. |
| 20 | * |
| 21 | * Contact Information: |
| 22 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 23 | * |
| 24 | *****************************************************************************/ |
| 25 | |
| 26 | #include <linux/kernel.h> |
| 27 | #include <linux/module.h> |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 28 | #include <linux/init.h> |
| 29 | #include <linux/pci.h> |
| 30 | #include <linux/dma-mapping.h> |
| 31 | #include <linux/delay.h> |
Alexey Dobriyan | d43c36d | 2009-10-07 17:09:06 +0400 | [diff] [blame] | 32 | #include <linux/sched.h> |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 33 | #include <linux/skbuff.h> |
| 34 | #include <linux/netdevice.h> |
| 35 | #include <linux/wireless.h> |
| 36 | #include <net/mac80211.h> |
| 37 | #include <linux/etherdevice.h> |
| 38 | #include <asm/unaligned.h> |
| 39 | |
| 40 | #include "iwl-eeprom.h" |
Tomas Winkler | 3e0d4cb | 2008-04-24 11:55:38 -0700 | [diff] [blame] | 41 | #include "iwl-dev.h" |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 42 | #include "iwl-core.h" |
| 43 | #include "iwl-io.h" |
Tomas Winkler | e26e47d | 2008-06-12 09:46:56 +0800 | [diff] [blame] | 44 | #include "iwl-sta.h" |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 45 | #include "iwl-helpers.h" |
Johannes Berg | a117512 | 2010-01-21 06:21:10 -0800 | [diff] [blame] | 46 | #include "iwl-agn.h" |
Johannes Berg | e932a60 | 2009-10-02 13:44:03 -0700 | [diff] [blame] | 47 | #include "iwl-agn-led.h" |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 48 | #include "iwl-agn-hw.h" |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 49 | #include "iwl-5000-hw.h" |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 50 | #include "iwl-6000-hw.h" |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 51 | |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 52 | /* Highest firmware API version supported */ |
Jay Sternberg | c9d2fbf | 2009-05-19 14:56:36 -0700 | [diff] [blame] | 53 | #define IWL5000_UCODE_API_MAX 2 |
Jay Sternberg | 39e6d22 | 2009-02-27 16:21:19 -0800 | [diff] [blame] | 54 | #define IWL5150_UCODE_API_MAX 2 |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 55 | |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 56 | /* Lowest firmware API version supported */ |
| 57 | #define IWL5000_UCODE_API_MIN 1 |
| 58 | #define IWL5150_UCODE_API_MIN 1 |
| 59 | |
| 60 | #define IWL5000_FW_PRE "iwlwifi-5000-" |
| 61 | #define _IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode" |
| 62 | #define IWL5000_MODULE_FIRMWARE(api) _IWL5000_MODULE_FIRMWARE(api) |
| 63 | |
| 64 | #define IWL5150_FW_PRE "iwlwifi-5150-" |
| 65 | #define _IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode" |
| 66 | #define IWL5150_MODULE_FIRMWARE(api) _IWL5150_MODULE_FIRMWARE(api) |
Jay Sternberg | 4e062f9 | 2008-10-14 12:32:41 -0700 | [diff] [blame] | 67 | |
Johannes Berg | edc1a3a | 2010-02-24 01:57:19 -0800 | [diff] [blame] | 68 | static const s8 iwl5000_default_queue_to_tx_fifo[] = { |
| 69 | IWL_TX_FIFO_VO, |
| 70 | IWL_TX_FIFO_VI, |
| 71 | IWL_TX_FIFO_BE, |
| 72 | IWL_TX_FIFO_BK, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 73 | IWLAGN_CMD_FIFO_NUM, |
Johannes Berg | edc1a3a | 2010-02-24 01:57:19 -0800 | [diff] [blame] | 74 | IWL_TX_FIFO_UNUSED, |
| 75 | IWL_TX_FIFO_UNUSED, |
| 76 | IWL_TX_FIFO_UNUSED, |
| 77 | IWL_TX_FIFO_UNUSED, |
| 78 | IWL_TX_FIFO_UNUSED, |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 79 | }; |
| 80 | |
Wey-Yi Guy | 9371d4e | 2009-09-11 10:38:10 -0700 | [diff] [blame] | 81 | /* NIC configuration for 5000 series */ |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 82 | void iwl5000_nic_config(struct iwl_priv *priv) |
Tomas Winkler | e86fe9f | 2008-04-24 11:55:36 -0700 | [diff] [blame] | 83 | { |
| 84 | unsigned long flags; |
| 85 | u16 radio_cfg; |
Tomas Winkler | e86fe9f | 2008-04-24 11:55:36 -0700 | [diff] [blame] | 86 | |
| 87 | spin_lock_irqsave(&priv->lock, flags); |
| 88 | |
Tomas Winkler | e86fe9f | 2008-04-24 11:55:36 -0700 | [diff] [blame] | 89 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); |
| 90 | |
| 91 | /* write radio config values to register */ |
Wey-Yi Guy | 9371d4e | 2009-09-11 10:38:10 -0700 | [diff] [blame] | 92 | if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) < EEPROM_RF_CONFIG_TYPE_MAX) |
Tomas Winkler | e86fe9f | 2008-04-24 11:55:36 -0700 | [diff] [blame] | 93 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, |
| 94 | EEPROM_RF_CFG_TYPE_MSK(radio_cfg) | |
| 95 | EEPROM_RF_CFG_STEP_MSK(radio_cfg) | |
| 96 | EEPROM_RF_CFG_DASH_MSK(radio_cfg)); |
| 97 | |
| 98 | /* set CSR_HW_CONFIG_REG for uCode use */ |
| 99 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, |
| 100 | CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI | |
| 101 | CSR_HW_IF_CONFIG_REG_BIT_MAC_SI); |
| 102 | |
Tomas Winkler | 4c43e0d | 2008-08-04 16:00:39 +0800 | [diff] [blame] | 103 | /* W/A : NIC is stuck in a reset state after Early PCIe power off |
| 104 | * (PCIe power is lost before PERST# is asserted), |
| 105 | * causing ME FW to lose ownership and not being able to obtain it back. |
| 106 | */ |
Tomas Winkler | 2d3db67 | 2008-08-04 16:00:47 +0800 | [diff] [blame] | 107 | iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG, |
Tomas Winkler | 4c43e0d | 2008-08-04 16:00:39 +0800 | [diff] [blame] | 108 | APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, |
| 109 | ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); |
| 110 | |
Wey-Yi Guy | 02c06e4 | 2009-07-17 09:30:14 -0700 | [diff] [blame] | 111 | |
Tomas Winkler | e86fe9f | 2008-04-24 11:55:36 -0700 | [diff] [blame] | 112 | spin_unlock_irqrestore(&priv->lock, flags); |
| 113 | } |
| 114 | |
| 115 | |
Tomas Winkler | 25ae398 | 2008-04-24 11:55:27 -0700 | [diff] [blame] | 116 | /* |
| 117 | * EEPROM |
| 118 | */ |
| 119 | static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address) |
| 120 | { |
| 121 | u16 offset = 0; |
| 122 | |
| 123 | if ((address & INDIRECT_ADDRESS) == 0) |
| 124 | return address; |
| 125 | |
| 126 | switch (address & INDIRECT_TYPE_MSK) { |
| 127 | case INDIRECT_HOST: |
| 128 | offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_HOST); |
| 129 | break; |
| 130 | case INDIRECT_GENERAL: |
| 131 | offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_GENERAL); |
| 132 | break; |
| 133 | case INDIRECT_REGULATORY: |
| 134 | offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_REGULATORY); |
| 135 | break; |
| 136 | case INDIRECT_CALIBRATION: |
| 137 | offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_CALIBRATION); |
| 138 | break; |
| 139 | case INDIRECT_PROCESS_ADJST: |
| 140 | offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_PROCESS_ADJST); |
| 141 | break; |
| 142 | case INDIRECT_OTHERS: |
| 143 | offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_OTHERS); |
| 144 | break; |
| 145 | default: |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 146 | IWL_ERR(priv, "illegal indirect type: 0x%X\n", |
Tomas Winkler | 25ae398 | 2008-04-24 11:55:27 -0700 | [diff] [blame] | 147 | address & INDIRECT_TYPE_MSK); |
| 148 | break; |
| 149 | } |
| 150 | |
| 151 | /* translate the offset from words to byte */ |
| 152 | return (address & ADDRESS_MSK) + (offset << 1); |
| 153 | } |
| 154 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 155 | u16 iwl5000_eeprom_calib_version(struct iwl_priv *priv) |
Tomas Winkler | f1f6941 | 2008-04-24 11:55:35 -0700 | [diff] [blame] | 156 | { |
Tomas Winkler | f1f6941 | 2008-04-24 11:55:35 -0700 | [diff] [blame] | 157 | struct iwl_eeprom_calib_hdr { |
| 158 | u8 version; |
| 159 | u8 pa_type; |
| 160 | u16 voltage; |
| 161 | } *hdr; |
| 162 | |
Tomas Winkler | f1f6941 | 2008-04-24 11:55:35 -0700 | [diff] [blame] | 163 | hdr = (struct iwl_eeprom_calib_hdr *)iwl_eeprom_query_addr(priv, |
| 164 | EEPROM_5000_CALIB_ALL); |
Tomas Winkler | 0ef2ca6 | 2008-10-23 23:48:51 -0700 | [diff] [blame] | 165 | return hdr->version; |
Tomas Winkler | f1f6941 | 2008-04-24 11:55:35 -0700 | [diff] [blame] | 166 | |
| 167 | } |
| 168 | |
Emmanuel Grumbach | 33fd503 | 2008-04-24 11:55:30 -0700 | [diff] [blame] | 169 | static struct iwl_sensitivity_ranges iwl5000_sensitivity = { |
| 170 | .min_nrg_cck = 95, |
Wey-Yi Guy | fe6efb4 | 2009-06-12 13:22:54 -0700 | [diff] [blame] | 171 | .max_nrg_cck = 0, /* not used, set to 0 */ |
Emmanuel Grumbach | 33fd503 | 2008-04-24 11:55:30 -0700 | [diff] [blame] | 172 | .auto_corr_min_ofdm = 90, |
| 173 | .auto_corr_min_ofdm_mrc = 170, |
| 174 | .auto_corr_min_ofdm_x1 = 120, |
| 175 | .auto_corr_min_ofdm_mrc_x1 = 240, |
| 176 | |
| 177 | .auto_corr_max_ofdm = 120, |
| 178 | .auto_corr_max_ofdm_mrc = 210, |
Wey-Yi Guy | 9bead76 | 2010-01-20 12:22:53 -0800 | [diff] [blame] | 179 | .auto_corr_max_ofdm_x1 = 120, |
| 180 | .auto_corr_max_ofdm_mrc_x1 = 240, |
Emmanuel Grumbach | 33fd503 | 2008-04-24 11:55:30 -0700 | [diff] [blame] | 181 | |
| 182 | .auto_corr_min_cck = 125, |
| 183 | .auto_corr_max_cck = 200, |
| 184 | .auto_corr_min_cck_mrc = 170, |
| 185 | .auto_corr_max_cck_mrc = 400, |
| 186 | .nrg_th_cck = 95, |
| 187 | .nrg_th_ofdm = 95, |
Wey-Yi Guy | 55036d6 | 2009-10-09 13:20:24 -0700 | [diff] [blame] | 188 | |
| 189 | .barker_corr_th_min = 190, |
| 190 | .barker_corr_th_min_mrc = 390, |
| 191 | .nrg_th_cca = 62, |
Emmanuel Grumbach | 33fd503 | 2008-04-24 11:55:30 -0700 | [diff] [blame] | 192 | }; |
| 193 | |
Wey-Yi Guy | 9d67187 | 2009-06-12 13:22:53 -0700 | [diff] [blame] | 194 | static struct iwl_sensitivity_ranges iwl5150_sensitivity = { |
| 195 | .min_nrg_cck = 95, |
| 196 | .max_nrg_cck = 0, /* not used, set to 0 */ |
| 197 | .auto_corr_min_ofdm = 90, |
| 198 | .auto_corr_min_ofdm_mrc = 170, |
| 199 | .auto_corr_min_ofdm_x1 = 105, |
| 200 | .auto_corr_min_ofdm_mrc_x1 = 220, |
| 201 | |
| 202 | .auto_corr_max_ofdm = 120, |
| 203 | .auto_corr_max_ofdm_mrc = 210, |
| 204 | /* max = min for performance bug in 5150 DSP */ |
| 205 | .auto_corr_max_ofdm_x1 = 105, |
| 206 | .auto_corr_max_ofdm_mrc_x1 = 220, |
| 207 | |
| 208 | .auto_corr_min_cck = 125, |
| 209 | .auto_corr_max_cck = 200, |
| 210 | .auto_corr_min_cck_mrc = 170, |
| 211 | .auto_corr_max_cck_mrc = 400, |
| 212 | .nrg_th_cck = 95, |
| 213 | .nrg_th_ofdm = 95, |
Wey-Yi Guy | 55036d6 | 2009-10-09 13:20:24 -0700 | [diff] [blame] | 214 | |
| 215 | .barker_corr_th_min = 190, |
| 216 | .barker_corr_th_min_mrc = 390, |
| 217 | .nrg_th_cca = 62, |
Wey-Yi Guy | 9d67187 | 2009-06-12 13:22:53 -0700 | [diff] [blame] | 218 | }; |
| 219 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 220 | const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv, |
Tomas Winkler | 25ae398 | 2008-04-24 11:55:27 -0700 | [diff] [blame] | 221 | size_t offset) |
| 222 | { |
| 223 | u32 address = eeprom_indirect_address(priv, offset); |
| 224 | BUG_ON(address >= priv->cfg->eeprom_size); |
| 225 | return &priv->eeprom[address]; |
| 226 | } |
| 227 | |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 228 | static void iwl5150_set_ct_threshold(struct iwl_priv *priv) |
Tomas Winkler | 339afc89 | 2008-12-01 16:32:20 -0800 | [diff] [blame] | 229 | { |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 230 | const s32 volt2temp_coef = IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF; |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 231 | s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY) - |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 232 | iwl_temp_calib_to_offset(priv); |
| 233 | |
| 234 | priv->hw_params.ct_kill_threshold = threshold * volt2temp_coef; |
| 235 | } |
| 236 | |
| 237 | static void iwl5000_set_ct_threshold(struct iwl_priv *priv) |
| 238 | { |
| 239 | /* want Celsius */ |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 240 | priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY; |
Tomas Winkler | 339afc89 | 2008-12-01 16:32:20 -0800 | [diff] [blame] | 241 | } |
| 242 | |
Ron Rindjunsky | dbb983b | 2008-05-15 13:54:12 +0800 | [diff] [blame] | 243 | /* |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 244 | * Calibration |
| 245 | */ |
Tomas Winkler | be5d56e | 2008-10-08 09:37:27 +0800 | [diff] [blame] | 246 | static int iwl5000_set_Xtal_calib(struct iwl_priv *priv) |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 247 | { |
Tomas Winkler | 0d950d8 | 2008-11-25 13:36:01 -0800 | [diff] [blame] | 248 | struct iwl_calib_xtal_freq_cmd cmd; |
Johannes Berg | b7bb175 | 2009-12-14 14:12:09 -0800 | [diff] [blame] | 249 | __le16 *xtal_calib = |
| 250 | (__le16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_XTAL); |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 251 | |
Tomas Winkler | 0d950d8 | 2008-11-25 13:36:01 -0800 | [diff] [blame] | 252 | cmd.hdr.op_code = IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD; |
| 253 | cmd.hdr.first_group = 0; |
| 254 | cmd.hdr.groups_num = 1; |
| 255 | cmd.hdr.data_valid = 1; |
Johannes Berg | b7bb175 | 2009-12-14 14:12:09 -0800 | [diff] [blame] | 256 | cmd.cap_pin1 = le16_to_cpu(xtal_calib[0]); |
| 257 | cmd.cap_pin2 = le16_to_cpu(xtal_calib[1]); |
Tomas Winkler | f69f42a | 2008-10-23 23:48:52 -0700 | [diff] [blame] | 258 | return iwl_calib_set(&priv->calib_results[IWL_CALIB_XTAL], |
Tomas Winkler | 0d950d8 | 2008-11-25 13:36:01 -0800 | [diff] [blame] | 259 | (u8 *)&cmd, sizeof(cmd)); |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 260 | } |
| 261 | |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 262 | static int iwl5000_send_calib_cfg(struct iwl_priv *priv) |
| 263 | { |
Tomas Winkler | f69f42a | 2008-10-23 23:48:52 -0700 | [diff] [blame] | 264 | struct iwl_calib_cfg_cmd calib_cfg_cmd; |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 265 | struct iwl_host_cmd cmd = { |
| 266 | .id = CALIBRATION_CFG_CMD, |
Tomas Winkler | f69f42a | 2008-10-23 23:48:52 -0700 | [diff] [blame] | 267 | .len = sizeof(struct iwl_calib_cfg_cmd), |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 268 | .data = &calib_cfg_cmd, |
| 269 | }; |
| 270 | |
| 271 | memset(&calib_cfg_cmd, 0, sizeof(calib_cfg_cmd)); |
| 272 | calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL; |
| 273 | calib_cfg_cmd.ucd_calib_cfg.once.start = IWL_CALIB_INIT_CFG_ALL; |
| 274 | calib_cfg_cmd.ucd_calib_cfg.once.send_res = IWL_CALIB_INIT_CFG_ALL; |
| 275 | calib_cfg_cmd.ucd_calib_cfg.flags = IWL_CALIB_INIT_CFG_ALL; |
| 276 | |
| 277 | return iwl_send_cmd(priv, &cmd); |
| 278 | } |
| 279 | |
| 280 | static void iwl5000_rx_calib_result(struct iwl_priv *priv, |
| 281 | struct iwl_rx_mem_buffer *rxb) |
| 282 | { |
Zhu Yi | 2f30122 | 2009-10-09 17:19:45 +0800 | [diff] [blame] | 283 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
Tomas Winkler | f69f42a | 2008-10-23 23:48:52 -0700 | [diff] [blame] | 284 | struct iwl_calib_hdr *hdr = (struct iwl_calib_hdr *)pkt->u.raw; |
Daniel C Halperin | 396887a | 2009-08-13 13:31:01 -0700 | [diff] [blame] | 285 | int len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK; |
Tomas Winkler | 6e21f2c | 2008-09-03 11:26:37 +0800 | [diff] [blame] | 286 | int index; |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 287 | |
| 288 | /* reduce the size of the length field itself */ |
| 289 | len -= 4; |
| 290 | |
Tomas Winkler | 6e21f2c | 2008-09-03 11:26:37 +0800 | [diff] [blame] | 291 | /* Define the order in which the results will be sent to the runtime |
| 292 | * uCode. iwl_send_calib_results sends them in a row according to their |
| 293 | * index. We sort them here */ |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 294 | switch (hdr->op_code) { |
Tomas Winkler | 819500c | 2008-12-01 16:32:19 -0800 | [diff] [blame] | 295 | case IWL_PHY_CALIBRATE_DC_CMD: |
| 296 | index = IWL_CALIB_DC; |
| 297 | break; |
Tomas Winkler | f69f42a | 2008-10-23 23:48:52 -0700 | [diff] [blame] | 298 | case IWL_PHY_CALIBRATE_LO_CMD: |
| 299 | index = IWL_CALIB_LO; |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 300 | break; |
Tomas Winkler | f69f42a | 2008-10-23 23:48:52 -0700 | [diff] [blame] | 301 | case IWL_PHY_CALIBRATE_TX_IQ_CMD: |
| 302 | index = IWL_CALIB_TX_IQ; |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 303 | break; |
Tomas Winkler | f69f42a | 2008-10-23 23:48:52 -0700 | [diff] [blame] | 304 | case IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD: |
| 305 | index = IWL_CALIB_TX_IQ_PERD; |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 306 | break; |
Tomas Winkler | 201706a | 2008-11-19 15:32:24 -0800 | [diff] [blame] | 307 | case IWL_PHY_CALIBRATE_BASE_BAND_CMD: |
| 308 | index = IWL_CALIB_BASE_BAND; |
| 309 | break; |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 310 | default: |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 311 | IWL_ERR(priv, "Unknown calibration notification %d\n", |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 312 | hdr->op_code); |
| 313 | return; |
| 314 | } |
Tomas Winkler | 6e21f2c | 2008-09-03 11:26:37 +0800 | [diff] [blame] | 315 | iwl_calib_set(&priv->calib_results[index], pkt->u.raw, len); |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 316 | } |
| 317 | |
| 318 | static void iwl5000_rx_calib_complete(struct iwl_priv *priv, |
| 319 | struct iwl_rx_mem_buffer *rxb) |
| 320 | { |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 321 | IWL_DEBUG_INFO(priv, "Init. calibration is completed, restarting fw.\n"); |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 322 | queue_work(priv->workqueue, &priv->restart); |
| 323 | } |
| 324 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 325 | void iwl5000_init_alive_start(struct iwl_priv *priv) |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 326 | { |
| 327 | int ret = 0; |
| 328 | |
| 329 | /* Check alive response for "valid" sign from uCode */ |
| 330 | if (priv->card_alive_init.is_valid != UCODE_VALID_OK) { |
| 331 | /* We had an error bringing up the hardware, so take it |
| 332 | * all the way back down so we can try again */ |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 333 | IWL_DEBUG_INFO(priv, "Initialize Alive failed.\n"); |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 334 | goto restart; |
| 335 | } |
| 336 | |
| 337 | /* initialize uCode was loaded... verify inst image. |
| 338 | * This is a paranoid check, because we would not have gotten the |
| 339 | * "initialize" alive if code weren't properly loaded. */ |
| 340 | if (iwl_verify_ucode(priv)) { |
| 341 | /* Runtime instruction load was bad; |
| 342 | * take it all the way back down so we can try again */ |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 343 | IWL_DEBUG_INFO(priv, "Bad \"initialize\" uCode load.\n"); |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 344 | goto restart; |
| 345 | } |
| 346 | |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 347 | ret = priv->cfg->ops->lib->alive_notify(priv); |
| 348 | if (ret) { |
Winkler, Tomas | 39aadf8 | 2008-12-19 10:37:32 +0800 | [diff] [blame] | 349 | IWL_WARN(priv, |
| 350 | "Could not complete ALIVE transition: %d\n", ret); |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 351 | goto restart; |
| 352 | } |
| 353 | |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 354 | iwl5000_send_calib_cfg(priv); |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 355 | return; |
| 356 | |
| 357 | restart: |
| 358 | /* real restart (first load init_ucode) */ |
| 359 | queue_work(priv->workqueue, &priv->restart); |
| 360 | } |
| 361 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 362 | int iwl5000_alive_notify(struct iwl_priv *priv) |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 363 | { |
| 364 | u32 a; |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 365 | unsigned long flags; |
Winkler, Tomas | 31a73fe | 2008-11-19 15:32:26 -0800 | [diff] [blame] | 366 | int i, chan; |
Winkler, Tomas | 40fc95d | 2008-11-19 15:32:27 -0800 | [diff] [blame] | 367 | u32 reg_val; |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 368 | |
| 369 | spin_lock_irqsave(&priv->lock, flags); |
| 370 | |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 371 | priv->scd_base_addr = iwl_read_prph(priv, IWL50_SCD_SRAM_BASE_ADDR); |
| 372 | a = priv->scd_base_addr + IWL50_SCD_CONTEXT_DATA_OFFSET; |
| 373 | for (; a < priv->scd_base_addr + IWL50_SCD_TX_STTS_BITMAP_OFFSET; |
| 374 | a += 4) |
| 375 | iwl_write_targ_mem(priv, a, 0); |
| 376 | for (; a < priv->scd_base_addr + IWL50_SCD_TRANSLATE_TBL_OFFSET; |
| 377 | a += 4) |
| 378 | iwl_write_targ_mem(priv, a, 0); |
Huaxu Wan | 39d5e0c | 2009-10-02 13:44:00 -0700 | [diff] [blame] | 379 | for (; a < priv->scd_base_addr + |
| 380 | IWL50_SCD_TRANSLATE_TBL_OFFSET_QUEUE(priv->hw_params.max_txq_num); a += 4) |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 381 | iwl_write_targ_mem(priv, a, 0); |
| 382 | |
| 383 | iwl_write_prph(priv, IWL50_SCD_DRAM_BASE_ADDR, |
Tomas Winkler | 4ddbb7d | 2008-11-07 09:58:40 -0800 | [diff] [blame] | 384 | priv->scd_bc_tbls.dma >> 10); |
Winkler, Tomas | 31a73fe | 2008-11-19 15:32:26 -0800 | [diff] [blame] | 385 | |
| 386 | /* Enable DMA channel */ |
| 387 | for (chan = 0; chan < FH50_TCSR_CHNL_NUM ; chan++) |
| 388 | iwl_write_direct32(priv, FH_TCSR_CHNL_TX_CONFIG_REG(chan), |
| 389 | FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE | |
| 390 | FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE); |
| 391 | |
Winkler, Tomas | 40fc95d | 2008-11-19 15:32:27 -0800 | [diff] [blame] | 392 | /* Update FH chicken bits */ |
| 393 | reg_val = iwl_read_direct32(priv, FH_TX_CHICKEN_BITS_REG); |
| 394 | iwl_write_direct32(priv, FH_TX_CHICKEN_BITS_REG, |
| 395 | reg_val | FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); |
| 396 | |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 397 | iwl_write_prph(priv, IWL50_SCD_QUEUECHAIN_SEL, |
Tomas Winkler | 4ddbb7d | 2008-11-07 09:58:40 -0800 | [diff] [blame] | 398 | IWL50_SCD_QUEUECHAIN_SEL_ALL(priv->hw_params.max_txq_num)); |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 399 | iwl_write_prph(priv, IWL50_SCD_AGGR_SEL, 0); |
| 400 | |
| 401 | /* initiate the queues */ |
| 402 | for (i = 0; i < priv->hw_params.max_txq_num; i++) { |
| 403 | iwl_write_prph(priv, IWL50_SCD_QUEUE_RDPTR(i), 0); |
| 404 | iwl_write_direct32(priv, HBUS_TARG_WRPTR, 0 | (i << 8)); |
| 405 | iwl_write_targ_mem(priv, priv->scd_base_addr + |
| 406 | IWL50_SCD_CONTEXT_QUEUE_OFFSET(i), 0); |
| 407 | iwl_write_targ_mem(priv, priv->scd_base_addr + |
| 408 | IWL50_SCD_CONTEXT_QUEUE_OFFSET(i) + |
| 409 | sizeof(u32), |
| 410 | ((SCD_WIN_SIZE << |
| 411 | IWL50_SCD_QUEUE_CTX_REG2_WIN_SIZE_POS) & |
| 412 | IWL50_SCD_QUEUE_CTX_REG2_WIN_SIZE_MSK) | |
| 413 | ((SCD_FRAME_LIMIT << |
| 414 | IWL50_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) & |
| 415 | IWL50_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK)); |
| 416 | } |
| 417 | |
| 418 | iwl_write_prph(priv, IWL50_SCD_INTERRUPT_MASK, |
Tomas Winkler | da1bc45 | 2008-05-29 16:35:00 +0800 | [diff] [blame] | 419 | IWL_MASK(0, priv->hw_params.max_txq_num)); |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 420 | |
Tomas Winkler | da1bc45 | 2008-05-29 16:35:00 +0800 | [diff] [blame] | 421 | /* Activate all Tx DMA/FIFO channels */ |
| 422 | priv->cfg->ops->lib->txq_set_sched(priv, IWL_MASK(0, 7)); |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 423 | |
Wey-Yi Guy | b305a08 | 2010-03-16 17:41:22 -0700 | [diff] [blame] | 424 | iwlagn_set_wr_ptrs(priv, IWL_CMD_QUEUE_NUM, 0); |
Winkler, Tomas | 9c80c50 | 2008-10-29 14:05:43 -0700 | [diff] [blame] | 425 | |
Wey-Yi Guy | a9e10fb | 2010-02-09 08:14:11 -0800 | [diff] [blame] | 426 | /* make sure all queue are not stopped */ |
| 427 | memset(&priv->queue_stopped[0], 0, sizeof(priv->queue_stopped)); |
| 428 | for (i = 0; i < 4; i++) |
| 429 | atomic_set(&priv->queue_stop_count[i], 0); |
| 430 | |
Wey-Yi Guy | dff010a | 2010-02-02 16:58:34 -0800 | [diff] [blame] | 431 | /* reset to 0 to enable all the queue first */ |
| 432 | priv->txq_ctx_active_msk = 0; |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 433 | /* map qos queues to fifos one-to-one */ |
Johannes Berg | edc1a3a | 2010-02-24 01:57:19 -0800 | [diff] [blame] | 434 | BUILD_BUG_ON(ARRAY_SIZE(iwl5000_default_queue_to_tx_fifo) != 10); |
| 435 | |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 436 | for (i = 0; i < ARRAY_SIZE(iwl5000_default_queue_to_tx_fifo); i++) { |
| 437 | int ac = iwl5000_default_queue_to_tx_fifo[i]; |
Johannes Berg | edc1a3a | 2010-02-24 01:57:19 -0800 | [diff] [blame] | 438 | |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 439 | iwl_txq_ctx_activate(priv, i); |
Johannes Berg | edc1a3a | 2010-02-24 01:57:19 -0800 | [diff] [blame] | 440 | |
| 441 | if (ac == IWL_TX_FIFO_UNUSED) |
| 442 | continue; |
| 443 | |
Wey-Yi Guy | b305a08 | 2010-03-16 17:41:22 -0700 | [diff] [blame] | 444 | iwlagn_tx_queue_set_status(priv, &priv->txq[i], ac, 0); |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 445 | } |
Johannes Berg | a221e6f | 2009-11-06 14:52:50 -0800 | [diff] [blame] | 446 | |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 447 | spin_unlock_irqrestore(&priv->lock, flags); |
| 448 | |
Wey-Yi Guy | 1933ac4 | 2009-10-30 14:36:18 -0700 | [diff] [blame] | 449 | iwl_send_wimax_coex(priv); |
Ron Rindjunsky | 9636e58 | 2008-05-15 13:54:14 +0800 | [diff] [blame] | 450 | |
Tomas Winkler | be5d56e | 2008-10-08 09:37:27 +0800 | [diff] [blame] | 451 | iwl5000_set_Xtal_calib(priv); |
| 452 | iwl_send_calib_results(priv); |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 453 | |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 454 | return 0; |
| 455 | } |
| 456 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 457 | int iwl5000_hw_set_hw_params(struct iwl_priv *priv) |
Tomas Winkler | fdd3e8a | 2008-04-24 11:55:28 -0700 | [diff] [blame] | 458 | { |
Wey-Yi Guy | 88804e2 | 2009-10-09 13:20:28 -0700 | [diff] [blame] | 459 | if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES && |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 460 | priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES) |
Wey-Yi Guy | 88804e2 | 2009-10-09 13:20:28 -0700 | [diff] [blame] | 461 | priv->cfg->num_of_queues = |
| 462 | priv->cfg->mod_params->num_of_queues; |
Tomas Winkler | 25ae398 | 2008-04-24 11:55:27 -0700 | [diff] [blame] | 463 | |
Wey-Yi Guy | 88804e2 | 2009-10-09 13:20:28 -0700 | [diff] [blame] | 464 | priv->hw_params.max_txq_num = priv->cfg->num_of_queues; |
Zhu Yi | f3f911d | 2008-12-02 12:14:04 -0800 | [diff] [blame] | 465 | priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM; |
Tomas Winkler | 4ddbb7d | 2008-11-07 09:58:40 -0800 | [diff] [blame] | 466 | priv->hw_params.scd_bc_tbls_size = |
Wey-Yi Guy | 88804e2 | 2009-10-09 13:20:28 -0700 | [diff] [blame] | 467 | priv->cfg->num_of_queues * |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 468 | sizeof(struct iwlagn_scd_bc_tbl); |
Samuel Ortiz | a8e74e27 | 2009-01-23 13:45:14 -0800 | [diff] [blame] | 469 | priv->hw_params.tfd_size = sizeof(struct iwl_tfd); |
Tomas Winkler | fdd3e8a | 2008-04-24 11:55:28 -0700 | [diff] [blame] | 470 | priv->hw_params.max_stations = IWL5000_STATION_COUNT; |
| 471 | priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID; |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 472 | |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 473 | priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE; |
| 474 | priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE; |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 475 | |
Ron Rindjunsky | da154e30 | 2008-06-30 17:23:20 +0800 | [diff] [blame] | 476 | priv->hw_params.max_bsm_size = 0; |
Wey-Yi Guy | 7aafef1 | 2009-08-07 15:41:38 -0700 | [diff] [blame] | 477 | priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) | |
Tomas Winkler | fdd3e8a | 2008-04-24 11:55:28 -0700 | [diff] [blame] | 478 | BIT(IEEE80211_BAND_5GHZ); |
Winkler, Tomas | 141c43a | 2009-01-08 10:19:53 -0800 | [diff] [blame] | 479 | priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR; |
| 480 | |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 481 | priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant); |
| 482 | priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant); |
| 483 | priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant; |
| 484 | priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant; |
Emmanuel Grumbach | c031bf8 | 2008-04-24 11:55:29 -0700 | [diff] [blame] | 485 | |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 486 | if (priv->cfg->ops->lib->temp_ops.set_ct_kill) |
| 487 | priv->cfg->ops->lib->temp_ops.set_ct_kill(priv); |
Emmanuel Grumbach | c031bf8 | 2008-04-24 11:55:29 -0700 | [diff] [blame] | 488 | |
Wey-Yi Guy | 9d67187 | 2009-06-12 13:22:53 -0700 | [diff] [blame] | 489 | /* Set initial sensitivity parameters */ |
Tomas Winkler | be5d56e | 2008-10-08 09:37:27 +0800 | [diff] [blame] | 490 | /* Set initial calibration set */ |
| 491 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { |
Tomas Winkler | be5d56e | 2008-10-08 09:37:27 +0800 | [diff] [blame] | 492 | case CSR_HW_REV_TYPE_5150: |
Wey-Yi Guy | 9d67187 | 2009-06-12 13:22:53 -0700 | [diff] [blame] | 493 | priv->hw_params.sens = &iwl5150_sensitivity; |
Tomas Winkler | 819500c | 2008-12-01 16:32:19 -0800 | [diff] [blame] | 494 | priv->hw_params.calib_init_cfg = |
Winkler, Tomas | 7470d7f | 2008-12-01 16:32:22 -0800 | [diff] [blame] | 495 | BIT(IWL_CALIB_DC) | |
| 496 | BIT(IWL_CALIB_LO) | |
| 497 | BIT(IWL_CALIB_TX_IQ) | |
| 498 | BIT(IWL_CALIB_BASE_BAND); |
Tomas Winkler | 819500c | 2008-12-01 16:32:19 -0800 | [diff] [blame] | 499 | |
Tomas Winkler | be5d56e | 2008-10-08 09:37:27 +0800 | [diff] [blame] | 500 | break; |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 501 | default: |
Wey-Yi Guy | 9d67187 | 2009-06-12 13:22:53 -0700 | [diff] [blame] | 502 | priv->hw_params.sens = &iwl5000_sensitivity; |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 503 | priv->hw_params.calib_init_cfg = |
| 504 | BIT(IWL_CALIB_XTAL) | |
| 505 | BIT(IWL_CALIB_LO) | |
| 506 | BIT(IWL_CALIB_TX_IQ) | |
| 507 | BIT(IWL_CALIB_TX_IQ_PERD) | |
| 508 | BIT(IWL_CALIB_BASE_BAND); |
| 509 | break; |
Tomas Winkler | be5d56e | 2008-10-08 09:37:27 +0800 | [diff] [blame] | 510 | } |
| 511 | |
Tomas Winkler | fdd3e8a | 2008-04-24 11:55:28 -0700 | [diff] [blame] | 512 | return 0; |
| 513 | } |
Ron Rindjunsky | d4100dd | 2008-04-24 11:55:33 -0700 | [diff] [blame] | 514 | |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 515 | static inline u32 iwl5000_get_scd_ssn(struct iwl5000_tx_resp *tx_resp) |
| 516 | { |
Tomas Winkler | 3ac7f14 | 2008-07-21 02:40:14 +0300 | [diff] [blame] | 517 | return le32_to_cpup((__le32 *)&tx_resp->status + |
Tomas Winkler | 25a6572 | 2008-06-12 09:47:07 +0800 | [diff] [blame] | 518 | tx_resp->frame_count) & MAX_SN; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 519 | } |
| 520 | |
| 521 | static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, |
| 522 | struct iwl_ht_agg *agg, |
| 523 | struct iwl5000_tx_resp *tx_resp, |
Tomas Winkler | 25a6572 | 2008-06-12 09:47:07 +0800 | [diff] [blame] | 524 | int txq_id, u16 start_idx) |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 525 | { |
| 526 | u16 status; |
| 527 | struct agg_tx_status *frame_status = &tx_resp->status; |
| 528 | struct ieee80211_tx_info *info = NULL; |
| 529 | struct ieee80211_hdr *hdr = NULL; |
Tomas Winkler | e7d326ac | 2008-06-12 09:47:11 +0800 | [diff] [blame] | 530 | u32 rate_n_flags = le32_to_cpu(tx_resp->rate_n_flags); |
Tomas Winkler | 25a6572 | 2008-06-12 09:47:07 +0800 | [diff] [blame] | 531 | int i, sh, idx; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 532 | u16 seq; |
| 533 | |
| 534 | if (agg->wait_for_ba) |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 535 | IWL_DEBUG_TX_REPLY(priv, "got tx response w/o block-ack\n"); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 536 | |
| 537 | agg->frame_count = tx_resp->frame_count; |
| 538 | agg->start_idx = start_idx; |
Tomas Winkler | e7d326ac | 2008-06-12 09:47:11 +0800 | [diff] [blame] | 539 | agg->rate_n_flags = rate_n_flags; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 540 | agg->bitmap = 0; |
| 541 | |
| 542 | /* # frames attempted by Tx command */ |
| 543 | if (agg->frame_count == 1) { |
| 544 | /* Only one frame was attempted; no block-ack will arrive */ |
| 545 | status = le16_to_cpu(frame_status[0].status); |
Tomas Winkler | 25a6572 | 2008-06-12 09:47:07 +0800 | [diff] [blame] | 546 | idx = start_idx; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 547 | |
| 548 | /* FIXME: code repetition */ |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 549 | IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n", |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 550 | agg->frame_count, agg->start_idx, idx); |
| 551 | |
| 552 | info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]); |
Johannes Berg | e6a9854 | 2008-10-21 12:40:02 +0200 | [diff] [blame] | 553 | info->status.rates[0].count = tx_resp->failure_frame + 1; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 554 | info->flags &= ~IEEE80211_TX_CTL_AMPDU; |
Johannes Berg | c397bf1 | 2009-11-13 11:56:35 -0800 | [diff] [blame] | 555 | info->flags |= iwl_tx_status_to_mac80211(status); |
Tomas Winkler | e7d326ac | 2008-06-12 09:47:11 +0800 | [diff] [blame] | 556 | iwl_hwrate_to_tx_control(priv, rate_n_flags, info); |
| 557 | |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 558 | /* FIXME: code repetition end */ |
| 559 | |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 560 | IWL_DEBUG_TX_REPLY(priv, "1 Frame 0x%x failure :%d\n", |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 561 | status & 0xff, tx_resp->failure_frame); |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 562 | IWL_DEBUG_TX_REPLY(priv, "Rate Info rate_n_flags=%x\n", rate_n_flags); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 563 | |
| 564 | agg->wait_for_ba = 0; |
| 565 | } else { |
| 566 | /* Two or more frames were attempted; expect block-ack */ |
| 567 | u64 bitmap = 0; |
| 568 | int start = agg->start_idx; |
| 569 | |
| 570 | /* Construct bit-map of pending frames within Tx window */ |
| 571 | for (i = 0; i < agg->frame_count; i++) { |
| 572 | u16 sc; |
| 573 | status = le16_to_cpu(frame_status[i].status); |
| 574 | seq = le16_to_cpu(frame_status[i].sequence); |
| 575 | idx = SEQ_TO_INDEX(seq); |
| 576 | txq_id = SEQ_TO_QUEUE(seq); |
| 577 | |
| 578 | if (status & (AGG_TX_STATE_FEW_BYTES_MSK | |
| 579 | AGG_TX_STATE_ABORT_MSK)) |
| 580 | continue; |
| 581 | |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 582 | IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, txq_id=%d idx=%d\n", |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 583 | agg->frame_count, txq_id, idx); |
| 584 | |
| 585 | hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx); |
Stanislaw Gruszka | 6c6a22e | 2009-09-23 10:51:34 +0200 | [diff] [blame] | 586 | if (!hdr) { |
| 587 | IWL_ERR(priv, |
| 588 | "BUG_ON idx doesn't point to valid skb" |
| 589 | " idx=%d, txq_id=%d\n", idx, txq_id); |
| 590 | return -1; |
| 591 | } |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 592 | |
| 593 | sc = le16_to_cpu(hdr->seq_ctrl); |
| 594 | if (idx != (SEQ_TO_SN(sc) & 0xff)) { |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 595 | IWL_ERR(priv, |
| 596 | "BUG_ON idx doesn't match seq control" |
| 597 | " idx=%d, seq_idx=%d, seq=%d\n", |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 598 | idx, SEQ_TO_SN(sc), |
| 599 | hdr->seq_ctrl); |
| 600 | return -1; |
| 601 | } |
| 602 | |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 603 | IWL_DEBUG_TX_REPLY(priv, "AGG Frame i=%d idx %d seq=%d\n", |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 604 | i, idx, SEQ_TO_SN(sc)); |
| 605 | |
| 606 | sh = idx - start; |
| 607 | if (sh > 64) { |
| 608 | sh = (start - idx) + 0xff; |
| 609 | bitmap = bitmap << sh; |
| 610 | sh = 0; |
| 611 | start = idx; |
| 612 | } else if (sh < -64) |
| 613 | sh = 0xff - (start - idx); |
| 614 | else if (sh < 0) { |
| 615 | sh = start - idx; |
| 616 | start = idx; |
| 617 | bitmap = bitmap << sh; |
| 618 | sh = 0; |
| 619 | } |
Emmanuel Grumbach | 4aa41f1 | 2008-07-18 13:53:09 +0800 | [diff] [blame] | 620 | bitmap |= 1ULL << sh; |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 621 | IWL_DEBUG_TX_REPLY(priv, "start=%d bitmap=0x%llx\n", |
Emmanuel Grumbach | 4aa41f1 | 2008-07-18 13:53:09 +0800 | [diff] [blame] | 622 | start, (unsigned long long)bitmap); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 623 | } |
| 624 | |
| 625 | agg->bitmap = bitmap; |
| 626 | agg->start_idx = start; |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 627 | IWL_DEBUG_TX_REPLY(priv, "Frames %d start_idx=%d bitmap=0x%llx\n", |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 628 | agg->frame_count, agg->start_idx, |
| 629 | (unsigned long long)agg->bitmap); |
| 630 | |
| 631 | if (bitmap) |
| 632 | agg->wait_for_ba = 1; |
| 633 | } |
| 634 | return 0; |
| 635 | } |
| 636 | |
| 637 | static void iwl5000_rx_reply_tx(struct iwl_priv *priv, |
| 638 | struct iwl_rx_mem_buffer *rxb) |
| 639 | { |
Zhu Yi | 2f30122 | 2009-10-09 17:19:45 +0800 | [diff] [blame] | 640 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 641 | u16 sequence = le16_to_cpu(pkt->hdr.sequence); |
| 642 | int txq_id = SEQ_TO_QUEUE(sequence); |
| 643 | int index = SEQ_TO_INDEX(sequence); |
| 644 | struct iwl_tx_queue *txq = &priv->txq[txq_id]; |
| 645 | struct ieee80211_tx_info *info; |
| 646 | struct iwl5000_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; |
| 647 | u32 status = le16_to_cpu(tx_resp->status.status); |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 648 | int tid; |
| 649 | int sta_id; |
| 650 | int freed; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 651 | |
| 652 | if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) { |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 653 | IWL_ERR(priv, "Read index for DMA queue txq_id (%d) index %d " |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 654 | "is out of range [0-%d] %d %d\n", txq_id, |
| 655 | index, txq->q.n_bd, txq->q.write_ptr, |
| 656 | txq->q.read_ptr); |
| 657 | return; |
| 658 | } |
| 659 | |
| 660 | info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]); |
| 661 | memset(&info->status, 0, sizeof(info->status)); |
| 662 | |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 663 | tid = (tx_resp->ra_tid & IWL50_TX_RES_TID_MSK) >> IWL50_TX_RES_TID_POS; |
| 664 | sta_id = (tx_resp->ra_tid & IWL50_TX_RES_RA_MSK) >> IWL50_TX_RES_RA_POS; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 665 | |
| 666 | if (txq->sched_retry) { |
| 667 | const u32 scd_ssn = iwl5000_get_scd_ssn(tx_resp); |
| 668 | struct iwl_ht_agg *agg = NULL; |
| 669 | |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 670 | agg = &priv->stations[sta_id].tid[tid].agg; |
| 671 | |
Tomas Winkler | 25a6572 | 2008-06-12 09:47:07 +0800 | [diff] [blame] | 672 | iwl5000_tx_status_reply_tx(priv, agg, tx_resp, txq_id, index); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 673 | |
Ron Rindjunsky | 3235427 | 2008-07-01 10:44:51 +0300 | [diff] [blame] | 674 | /* check if BAR is needed */ |
| 675 | if ((tx_resp->frame_count == 1) && !iwl_is_tx_success(status)) |
| 676 | info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 677 | |
| 678 | if (txq->q.read_ptr != (scd_ssn & 0xff)) { |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 679 | index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd); |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 680 | IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim " |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 681 | "scd_ssn=%d idx=%d txq=%d swq=%d\n", |
| 682 | scd_ssn , index, txq_id, txq->swq_id); |
| 683 | |
Tomas Winkler | 17b8892 | 2008-05-29 16:35:12 +0800 | [diff] [blame] | 684 | freed = iwl_tx_queue_reclaim(priv, txq_id, index); |
Wey-Yi Guy | a239a8b | 2010-02-19 15:47:32 -0800 | [diff] [blame] | 685 | iwl_free_tfds_in_queue(priv, sta_id, tid, freed); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 686 | |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 687 | if (priv->mac80211_registered && |
| 688 | (iwl_queue_space(&txq->q) > txq->q.low_mark) && |
| 689 | (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA)) { |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 690 | if (agg->state == IWL_AGG_OFF) |
Johannes Berg | e4e72fb | 2009-03-23 17:28:42 +0100 | [diff] [blame] | 691 | iwl_wake_queue(priv, txq_id); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 692 | else |
Johannes Berg | e4e72fb | 2009-03-23 17:28:42 +0100 | [diff] [blame] | 693 | iwl_wake_queue(priv, txq->swq_id); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 694 | } |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 695 | } |
| 696 | } else { |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 697 | BUG_ON(txq_id != txq->swq_id); |
| 698 | |
Johannes Berg | e6a9854 | 2008-10-21 12:40:02 +0200 | [diff] [blame] | 699 | info->status.rates[0].count = tx_resp->failure_frame + 1; |
Johannes Berg | c397bf1 | 2009-11-13 11:56:35 -0800 | [diff] [blame] | 700 | info->flags |= iwl_tx_status_to_mac80211(status); |
Tomas Winkler | e7d326ac | 2008-06-12 09:47:11 +0800 | [diff] [blame] | 701 | iwl_hwrate_to_tx_control(priv, |
Ron Rindjunsky | 4f85f5b | 2008-06-09 22:54:35 +0300 | [diff] [blame] | 702 | le32_to_cpu(tx_resp->rate_n_flags), |
| 703 | info); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 704 | |
Tomas Winkler | e162344 | 2009-01-27 14:27:56 -0800 | [diff] [blame] | 705 | IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x) rate_n_flags " |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 706 | "0x%x retries %d\n", |
| 707 | txq_id, |
| 708 | iwl_get_tx_fail_reason(status), status, |
| 709 | le32_to_cpu(tx_resp->rate_n_flags), |
| 710 | tx_resp->failure_frame); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 711 | |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 712 | freed = iwl_tx_queue_reclaim(priv, txq_id, index); |
Stanislaw Gruszka | a120e91 | 2010-02-19 15:47:33 -0800 | [diff] [blame] | 713 | iwl_free_tfds_in_queue(priv, sta_id, tid, freed); |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 714 | |
| 715 | if (priv->mac80211_registered && |
| 716 | (iwl_queue_space(&txq->q) > txq->q.low_mark)) |
Johannes Berg | e4e72fb | 2009-03-23 17:28:42 +0100 | [diff] [blame] | 717 | iwl_wake_queue(priv, txq_id); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 718 | } |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 719 | |
Stanislaw Gruszka | a120e91 | 2010-02-19 15:47:33 -0800 | [diff] [blame] | 720 | iwl_txq_check_empty(priv, sta_id, tid, txq_id); |
Tomas Winkler | 3fd07a1 | 2008-10-23 23:48:49 -0700 | [diff] [blame] | 721 | |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 722 | if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK)) |
Winkler, Tomas | 15b1687 | 2008-12-19 10:37:33 +0800 | [diff] [blame] | 723 | IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n"); |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 724 | } |
| 725 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 726 | void iwl5000_setup_deferred_work(struct iwl_priv *priv) |
Emmanuel Grumbach | 203566f | 2008-06-12 09:46:54 +0800 | [diff] [blame] | 727 | { |
| 728 | /* in 5000 the tx power calibration is done in uCode */ |
| 729 | priv->disable_tx_power_cal = 1; |
| 730 | } |
| 731 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 732 | void iwl5000_rx_handler_setup(struct iwl_priv *priv) |
Ron Rindjunsky | b600e4e | 2008-05-15 13:54:11 +0800 | [diff] [blame] | 733 | { |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 734 | /* init calibration handlers */ |
| 735 | priv->rx_handlers[CALIBRATION_RES_NOTIFICATION] = |
| 736 | iwl5000_rx_calib_result; |
| 737 | priv->rx_handlers[CALIBRATION_COMPLETE_NOTIFICATION] = |
| 738 | iwl5000_rx_calib_complete; |
Ron Rindjunsky | e532fa0 | 2008-05-29 16:35:09 +0800 | [diff] [blame] | 739 | priv->rx_handlers[REPLY_TX] = iwl5000_rx_reply_tx; |
Ron Rindjunsky | b600e4e | 2008-05-15 13:54:11 +0800 | [diff] [blame] | 740 | } |
| 741 | |
Tomas Winkler | 7c616cb | 2008-05-29 16:35:05 +0800 | [diff] [blame] | 742 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 743 | int iwl5000_hw_valid_rtc_data_addr(u32 addr) |
Ron Rindjunsky | 87283cc | 2008-05-29 16:34:47 +0800 | [diff] [blame] | 744 | { |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 745 | return (addr >= IWLAGN_RTC_DATA_LOWER_BOUND) && |
| 746 | (addr < IWLAGN_RTC_DATA_UPPER_BOUND); |
Ron Rindjunsky | 87283cc | 2008-05-29 16:34:47 +0800 | [diff] [blame] | 747 | } |
| 748 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 749 | int iwl5000_send_tx_power(struct iwl_priv *priv) |
Tomas Winkler | 630fe9b | 2008-06-12 09:47:08 +0800 | [diff] [blame] | 750 | { |
| 751 | struct iwl5000_tx_power_dbm_cmd tx_power_cmd; |
Jay Sternberg | 76a2407 | 2009-01-29 11:09:14 -0800 | [diff] [blame] | 752 | u8 tx_ant_cfg_cmd; |
Tomas Winkler | 630fe9b | 2008-06-12 09:47:08 +0800 | [diff] [blame] | 753 | |
| 754 | /* half dBm need to multiply */ |
| 755 | tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt); |
Wey-Yi Guy | ae16fc3 | 2009-11-13 11:56:30 -0800 | [diff] [blame] | 756 | |
| 757 | if (priv->tx_power_lmt_in_half_dbm && |
| 758 | priv->tx_power_lmt_in_half_dbm < tx_power_cmd.global_lmt) { |
| 759 | /* |
| 760 | * For the newer devices which using enhanced/extend tx power |
| 761 | * table in EEPROM, the format is in half dBm. driver need to |
| 762 | * convert to dBm format before report to mac80211. |
| 763 | * By doing so, there is a possibility of 1/2 dBm resolution |
| 764 | * lost. driver will perform "round-up" operation before |
| 765 | * reporting, but it will cause 1/2 dBm tx power over the |
| 766 | * regulatory limit. Perform the checking here, if the |
| 767 | * "tx_power_user_lmt" is higher than EEPROM value (in |
| 768 | * half-dBm format), lower the tx power based on EEPROM |
| 769 | */ |
| 770 | tx_power_cmd.global_lmt = priv->tx_power_lmt_in_half_dbm; |
| 771 | } |
Gregory Greenman | 853554a | 2008-06-30 17:23:01 +0800 | [diff] [blame] | 772 | tx_power_cmd.flags = IWL50_TX_POWER_NO_CLOSED; |
Tomas Winkler | 630fe9b | 2008-06-12 09:47:08 +0800 | [diff] [blame] | 773 | tx_power_cmd.srv_chan_lmt = IWL50_TX_POWER_AUTO; |
Jay Sternberg | 76a2407 | 2009-01-29 11:09:14 -0800 | [diff] [blame] | 774 | |
| 775 | if (IWL_UCODE_API(priv->ucode_ver) == 1) |
| 776 | tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD_V1; |
| 777 | else |
| 778 | tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD; |
| 779 | |
| 780 | return iwl_send_cmd_pdu_async(priv, tx_ant_cfg_cmd, |
Tomas Winkler | 630fe9b | 2008-06-12 09:47:08 +0800 | [diff] [blame] | 781 | sizeof(tx_power_cmd), &tx_power_cmd, |
| 782 | NULL); |
| 783 | } |
| 784 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 785 | void iwl5000_temperature(struct iwl_priv *priv) |
Emmanuel Grumbach | 8f91aec | 2008-06-30 17:23:07 +0800 | [diff] [blame] | 786 | { |
| 787 | /* store temperature from statistics (in Celsius) */ |
Zhu Yi | 5225640 | 2008-06-30 17:23:31 +0800 | [diff] [blame] | 788 | priv->temperature = le32_to_cpu(priv->statistics.general.temperature); |
Wey-Yi Guy | 39b73fb1 | 2009-07-24 11:13:02 -0700 | [diff] [blame] | 789 | iwl_tt_handler(priv); |
Emmanuel Grumbach | 8f91aec | 2008-06-30 17:23:07 +0800 | [diff] [blame] | 790 | } |
Ron Rindjunsky | fe7a90c | 2008-05-29 16:35:14 +0800 | [diff] [blame] | 791 | |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 792 | static void iwl5150_temperature(struct iwl_priv *priv) |
| 793 | { |
| 794 | u32 vt = 0; |
| 795 | s32 offset = iwl_temp_calib_to_offset(priv); |
| 796 | |
| 797 | vt = le32_to_cpu(priv->statistics.general.temperature); |
| 798 | vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset; |
| 799 | /* now vt hold the temperature in Kelvin */ |
| 800 | priv->temperature = KELVIN_TO_CELSIUS(vt); |
Wey-Yi Guy | 15993e0 | 2009-08-13 13:31:00 -0700 | [diff] [blame] | 801 | iwl_tt_handler(priv); |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 802 | } |
| 803 | |
Wey-Yi Guy | 4a56e96 | 2009-10-23 13:42:29 -0700 | [diff] [blame] | 804 | static int iwl5000_hw_channel_switch(struct iwl_priv *priv, u16 channel) |
| 805 | { |
| 806 | struct iwl5000_channel_switch_cmd cmd; |
| 807 | const struct iwl_channel_info *ch_info; |
| 808 | struct iwl_host_cmd hcmd = { |
| 809 | .id = REPLY_CHANNEL_SWITCH, |
| 810 | .len = sizeof(cmd), |
| 811 | .flags = CMD_SIZE_HUGE, |
| 812 | .data = &cmd, |
| 813 | }; |
| 814 | |
| 815 | IWL_DEBUG_11H(priv, "channel switch from %d to %d\n", |
| 816 | priv->active_rxon.channel, channel); |
| 817 | cmd.band = priv->band == IEEE80211_BAND_2GHZ; |
| 818 | cmd.channel = cpu_to_le16(channel); |
Wey-Yi Guy | 0924e519 | 2009-11-06 14:52:54 -0800 | [diff] [blame] | 819 | cmd.rxon_flags = priv->staging_rxon.flags; |
| 820 | cmd.rxon_filter_flags = priv->staging_rxon.filter_flags; |
Wey-Yi Guy | 4a56e96 | 2009-10-23 13:42:29 -0700 | [diff] [blame] | 821 | cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time); |
| 822 | ch_info = iwl_get_channel_info(priv, priv->band, channel); |
| 823 | if (ch_info) |
| 824 | cmd.expect_beacon = is_channel_radar(ch_info); |
| 825 | else { |
| 826 | IWL_ERR(priv, "invalid channel switch from %u to %u\n", |
| 827 | priv->active_rxon.channel, channel); |
| 828 | return -EFAULT; |
| 829 | } |
Wey-Yi Guy | 0924e519 | 2009-11-06 14:52:54 -0800 | [diff] [blame] | 830 | priv->switch_rxon.channel = cpu_to_le16(channel); |
| 831 | priv->switch_rxon.switch_in_progress = true; |
Wey-Yi Guy | 4a56e96 | 2009-10-23 13:42:29 -0700 | [diff] [blame] | 832 | |
| 833 | return iwl_send_cmd_sync(priv, &hcmd); |
| 834 | } |
| 835 | |
Jay Sternberg | e8c00dc | 2009-01-29 11:09:15 -0800 | [diff] [blame] | 836 | struct iwl_lib_ops iwl5000_lib = { |
Tomas Winkler | fdd3e8a | 2008-04-24 11:55:28 -0700 | [diff] [blame] | 837 | .set_hw_params = iwl5000_hw_set_hw_params, |
Wey-Yi Guy | b305a08 | 2010-03-16 17:41:22 -0700 | [diff] [blame] | 838 | .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, |
| 839 | .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, |
| 840 | .txq_set_sched = iwlagn_txq_set_sched, |
| 841 | .txq_agg_enable = iwlagn_txq_agg_enable, |
| 842 | .txq_agg_disable = iwlagn_txq_agg_disable, |
Samuel Ortiz | 7aaa1d7 | 2009-01-19 15:30:26 -0800 | [diff] [blame] | 843 | .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd, |
| 844 | .txq_free_tfd = iwl_hw_txq_free_tfd, |
Samuel Ortiz | a8e74e27 | 2009-01-23 13:45:14 -0800 | [diff] [blame] | 845 | .txq_init = iwl_hw_tx_queue_init, |
Ron Rindjunsky | b600e4e | 2008-05-15 13:54:11 +0800 | [diff] [blame] | 846 | .rx_handler_setup = iwl5000_rx_handler_setup, |
Emmanuel Grumbach | 203566f | 2008-06-12 09:46:54 +0800 | [diff] [blame] | 847 | .setup_deferred_work = iwl5000_setup_deferred_work, |
Ron Rindjunsky | 87283cc | 2008-05-29 16:34:47 +0800 | [diff] [blame] | 848 | .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr, |
Reinette Chatre | b7a7940 | 2009-09-25 14:24:23 -0700 | [diff] [blame] | 849 | .dump_nic_event_log = iwl_dump_nic_event_log, |
| 850 | .dump_nic_error_log = iwl_dump_nic_error_log, |
Wey-Yi Guy | 696bdee | 2009-12-10 14:37:25 -0800 | [diff] [blame] | 851 | .dump_csr = iwl_dump_csr, |
Wey-Yi Guy | 1b3eb82 | 2010-01-15 13:43:39 -0800 | [diff] [blame] | 852 | .dump_fh = iwl_dump_fh, |
Wey-Yi Guy | 81b8176 | 2010-03-16 10:23:30 -0700 | [diff] [blame] | 853 | .load_ucode = iwlagn_load_ucode, |
Ron Rindjunsky | 99da1b4 | 2008-05-15 13:54:13 +0800 | [diff] [blame] | 854 | .init_alive_start = iwl5000_init_alive_start, |
| 855 | .alive_notify = iwl5000_alive_notify, |
Tomas Winkler | 630fe9b | 2008-06-12 09:47:08 +0800 | [diff] [blame] | 856 | .send_tx_power = iwl5000_send_tx_power, |
Emmanuel Grumbach | 5b9f8cd | 2008-10-29 14:05:46 -0700 | [diff] [blame] | 857 | .update_chain_flags = iwl_update_chain_flags, |
Wey-Yi Guy | 4a56e96 | 2009-10-23 13:42:29 -0700 | [diff] [blame] | 858 | .set_channel_switch = iwl5000_hw_channel_switch, |
Tomas Winkler | 30d5926 | 2008-04-24 11:55:25 -0700 | [diff] [blame] | 859 | .apm_ops = { |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 860 | .init = iwl_apm_init, |
Abhijeet Kolekar | d68b603 | 2009-10-02 13:44:04 -0700 | [diff] [blame] | 861 | .stop = iwl_apm_stop, |
Ron Rindjunsky | 5a83535 | 2008-05-05 10:22:29 +0800 | [diff] [blame] | 862 | .config = iwl5000_nic_config, |
Emmanuel Grumbach | 5b9f8cd | 2008-10-29 14:05:46 -0700 | [diff] [blame] | 863 | .set_pwr_src = iwl_set_pwr_src, |
Tomas Winkler | 30d5926 | 2008-04-24 11:55:25 -0700 | [diff] [blame] | 864 | }, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 865 | .eeprom_ops = { |
Tomas Winkler | 25ae398 | 2008-04-24 11:55:27 -0700 | [diff] [blame] | 866 | .regulatory_bands = { |
| 867 | EEPROM_5000_REG_BAND_1_CHANNELS, |
| 868 | EEPROM_5000_REG_BAND_2_CHANNELS, |
| 869 | EEPROM_5000_REG_BAND_3_CHANNELS, |
| 870 | EEPROM_5000_REG_BAND_4_CHANNELS, |
| 871 | EEPROM_5000_REG_BAND_5_CHANNELS, |
Wey-Yi Guy | 7aafef1 | 2009-08-07 15:41:38 -0700 | [diff] [blame] | 872 | EEPROM_5000_REG_BAND_24_HT40_CHANNELS, |
| 873 | EEPROM_5000_REG_BAND_52_HT40_CHANNELS |
Tomas Winkler | 25ae398 | 2008-04-24 11:55:27 -0700 | [diff] [blame] | 874 | }, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 875 | .verify_signature = iwlcore_eeprom_verify_signature, |
| 876 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, |
| 877 | .release_semaphore = iwlcore_eeprom_release_semaphore, |
Tomas Winkler | 0ef2ca6 | 2008-10-23 23:48:51 -0700 | [diff] [blame] | 878 | .calib_version = iwl5000_eeprom_calib_version, |
Tomas Winkler | 25ae398 | 2008-04-24 11:55:27 -0700 | [diff] [blame] | 879 | .query_addr = iwl5000_eeprom_query_addr, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 880 | }, |
Abhijeet Kolekar | 5bbe233 | 2009-04-08 11:26:35 -0700 | [diff] [blame] | 881 | .post_associate = iwl_post_associate, |
Mohamed Abbas | ef850d7 | 2009-05-22 11:01:50 -0700 | [diff] [blame] | 882 | .isr = iwl_isr_ict, |
Abhijeet Kolekar | 60690a6 | 2009-04-08 11:26:49 -0700 | [diff] [blame] | 883 | .config_ap = iwl_config_ap, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 884 | .temp_ops = { |
| 885 | .temperature = iwl5000_temperature, |
| 886 | .set_ct_kill = iwl5000_set_ct_threshold, |
| 887 | }, |
Reinette Chatre | 3459ab5 | 2010-01-22 14:22:49 -0800 | [diff] [blame] | 888 | .add_bcast_station = iwl_add_bcast_station, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 889 | .recover_from_tx_stall = iwl_bg_monitor_recover, |
Wey-Yi Guy | fa8f130c | 2010-03-05 14:22:46 -0800 | [diff] [blame] | 890 | .check_plcp_health = iwl_good_plcp_health, |
| 891 | .check_ack_health = iwl_good_ack_health, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 892 | }; |
| 893 | |
| 894 | static struct iwl_lib_ops iwl5150_lib = { |
| 895 | .set_hw_params = iwl5000_hw_set_hw_params, |
Wey-Yi Guy | b305a08 | 2010-03-16 17:41:22 -0700 | [diff] [blame] | 896 | .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, |
| 897 | .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, |
| 898 | .txq_set_sched = iwlagn_txq_set_sched, |
| 899 | .txq_agg_enable = iwlagn_txq_agg_enable, |
| 900 | .txq_agg_disable = iwlagn_txq_agg_disable, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 901 | .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd, |
| 902 | .txq_free_tfd = iwl_hw_txq_free_tfd, |
| 903 | .txq_init = iwl_hw_tx_queue_init, |
| 904 | .rx_handler_setup = iwl5000_rx_handler_setup, |
| 905 | .setup_deferred_work = iwl5000_setup_deferred_work, |
| 906 | .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr, |
Reinette Chatre | b7a7940 | 2009-09-25 14:24:23 -0700 | [diff] [blame] | 907 | .dump_nic_event_log = iwl_dump_nic_event_log, |
| 908 | .dump_nic_error_log = iwl_dump_nic_error_log, |
Wey-Yi Guy | 696bdee | 2009-12-10 14:37:25 -0800 | [diff] [blame] | 909 | .dump_csr = iwl_dump_csr, |
Wey-Yi Guy | 81b8176 | 2010-03-16 10:23:30 -0700 | [diff] [blame] | 910 | .load_ucode = iwlagn_load_ucode, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 911 | .init_alive_start = iwl5000_init_alive_start, |
| 912 | .alive_notify = iwl5000_alive_notify, |
| 913 | .send_tx_power = iwl5000_send_tx_power, |
| 914 | .update_chain_flags = iwl_update_chain_flags, |
Wey-Yi Guy | 4a56e96 | 2009-10-23 13:42:29 -0700 | [diff] [blame] | 915 | .set_channel_switch = iwl5000_hw_channel_switch, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 916 | .apm_ops = { |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 917 | .init = iwl_apm_init, |
Abhijeet Kolekar | d68b603 | 2009-10-02 13:44:04 -0700 | [diff] [blame] | 918 | .stop = iwl_apm_stop, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 919 | .config = iwl5000_nic_config, |
| 920 | .set_pwr_src = iwl_set_pwr_src, |
| 921 | }, |
| 922 | .eeprom_ops = { |
| 923 | .regulatory_bands = { |
| 924 | EEPROM_5000_REG_BAND_1_CHANNELS, |
| 925 | EEPROM_5000_REG_BAND_2_CHANNELS, |
| 926 | EEPROM_5000_REG_BAND_3_CHANNELS, |
| 927 | EEPROM_5000_REG_BAND_4_CHANNELS, |
| 928 | EEPROM_5000_REG_BAND_5_CHANNELS, |
Wey-Yi Guy | 7aafef1 | 2009-08-07 15:41:38 -0700 | [diff] [blame] | 929 | EEPROM_5000_REG_BAND_24_HT40_CHANNELS, |
| 930 | EEPROM_5000_REG_BAND_52_HT40_CHANNELS |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 931 | }, |
| 932 | .verify_signature = iwlcore_eeprom_verify_signature, |
| 933 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, |
| 934 | .release_semaphore = iwlcore_eeprom_release_semaphore, |
| 935 | .calib_version = iwl5000_eeprom_calib_version, |
| 936 | .query_addr = iwl5000_eeprom_query_addr, |
| 937 | }, |
| 938 | .post_associate = iwl_post_associate, |
Mohamed Abbas | ef850d7 | 2009-05-22 11:01:50 -0700 | [diff] [blame] | 939 | .isr = iwl_isr_ict, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 940 | .config_ap = iwl_config_ap, |
| 941 | .temp_ops = { |
| 942 | .temperature = iwl5150_temperature, |
| 943 | .set_ct_kill = iwl5150_set_ct_threshold, |
| 944 | }, |
Reinette Chatre | 3459ab5 | 2010-01-22 14:22:49 -0800 | [diff] [blame] | 945 | .add_bcast_station = iwl_add_bcast_station, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 946 | .recover_from_tx_stall = iwl_bg_monitor_recover, |
Wey-Yi Guy | fa8f130c | 2010-03-05 14:22:46 -0800 | [diff] [blame] | 947 | .check_plcp_health = iwl_good_plcp_health, |
| 948 | .check_ack_health = iwl_good_ack_health, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 949 | }; |
| 950 | |
Emese Revfy | 45d5d80 | 2009-12-14 00:59:53 +0100 | [diff] [blame] | 951 | static const struct iwl_ops iwl5000_ops = { |
Wey-Yi Guy | 792bc3c | 2010-03-16 10:23:29 -0700 | [diff] [blame] | 952 | .ucode = &iwlagn_ucode, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 953 | .lib = &iwl5000_lib, |
Wey-Yi Guy | 7dc77db | 2010-03-16 10:23:31 -0700 | [diff] [blame] | 954 | .hcmd = &iwlagn_hcmd, |
| 955 | .utils = &iwlagn_hcmd_utils, |
Johannes Berg | e932a60 | 2009-10-02 13:44:03 -0700 | [diff] [blame] | 956 | .led = &iwlagn_led_ops, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 957 | }; |
| 958 | |
Emese Revfy | 45d5d80 | 2009-12-14 00:59:53 +0100 | [diff] [blame] | 959 | static const struct iwl_ops iwl5150_ops = { |
Wey-Yi Guy | 792bc3c | 2010-03-16 10:23:29 -0700 | [diff] [blame] | 960 | .ucode = &iwlagn_ucode, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 961 | .lib = &iwl5150_lib, |
Wey-Yi Guy | 7dc77db | 2010-03-16 10:23:31 -0700 | [diff] [blame] | 962 | .hcmd = &iwlagn_hcmd, |
| 963 | .utils = &iwlagn_hcmd_utils, |
Johannes Berg | e932a60 | 2009-10-02 13:44:03 -0700 | [diff] [blame] | 964 | .led = &iwlagn_led_ops, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 965 | }; |
| 966 | |
Jay Sternberg | cec2d3f | 2009-01-19 15:30:33 -0800 | [diff] [blame] | 967 | struct iwl_mod_params iwl50_mod_params = { |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 968 | .amsdu_size_8K = 1, |
Ester Kummer | 3a1081e | 2008-05-06 11:05:14 +0800 | [diff] [blame] | 969 | .restart_fw = 1, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 970 | /* the rest are 0 by default */ |
| 971 | }; |
| 972 | |
| 973 | |
| 974 | struct iwl_cfg iwl5300_agn_cfg = { |
Shanyu Zhao | c11362c | 2010-03-05 17:05:20 -0800 | [diff] [blame] | 975 | .name = "Intel(R) Ultimate N WiFi Link 5300 AGN", |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 976 | .fw_name_pre = IWL5000_FW_PRE, |
| 977 | .ucode_api_max = IWL5000_UCODE_API_MAX, |
| 978 | .ucode_api_min = IWL5000_UCODE_API_MIN, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 979 | .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 980 | .ops = &iwl5000_ops, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 981 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, |
Tomas Winkler | 0ef2ca6 | 2008-10-23 23:48:51 -0700 | [diff] [blame] | 982 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 983 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 984 | .num_of_queues = IWLAGN_NUM_QUEUES, |
| 985 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 986 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 987 | .valid_tx_ant = ANT_ABC, |
| 988 | .valid_rx_ant = ANT_ABC, |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 989 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
| 990 | .set_l0s = true, |
| 991 | .use_bsm = false, |
Daniel C Halperin | b261793 | 2009-08-13 13:30:59 -0700 | [diff] [blame] | 992 | .ht_greenfield_support = true, |
Wey-Yi Guy | f2d0d0e | 2009-09-11 10:38:14 -0700 | [diff] [blame] | 993 | .led_compensation = 51, |
Wey-Yi Guy | 1152dcc | 2010-01-15 13:42:58 -0800 | [diff] [blame] | 994 | .use_rts_for_ht = true, /* use rts/cts protection */ |
Wey-Yi Guy | d8c07e7 | 2009-09-25 14:24:26 -0700 | [diff] [blame] | 995 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
Trieu 'Andrew' Nguyen | 3e4fb5f | 2010-01-22 14:22:46 -0800 | [diff] [blame] | 996 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
Ben Cahill | d4fe5ac | 2010-02-05 11:33:46 -0800 | [diff] [blame] | 997 | .chain_noise_scale = 1000, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 998 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 999 | }; |
| 1000 | |
Wey-Yi Guy | ac59257 | 2009-11-20 12:05:03 -0800 | [diff] [blame] | 1001 | struct iwl_cfg iwl5100_bgn_cfg = { |
Shanyu Zhao | c11362c | 2010-03-05 17:05:20 -0800 | [diff] [blame] | 1002 | .name = "Intel(R) WiFi Link 5100 BGN", |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 1003 | .fw_name_pre = IWL5000_FW_PRE, |
| 1004 | .ucode_api_max = IWL5000_UCODE_API_MAX, |
| 1005 | .ucode_api_min = IWL5000_UCODE_API_MIN, |
Wey-Yi Guy | ac59257 | 2009-11-20 12:05:03 -0800 | [diff] [blame] | 1006 | .sku = IWL_SKU_G|IWL_SKU_N, |
Esti Kummer | 4740863 | 2008-07-11 11:53:30 +0800 | [diff] [blame] | 1007 | .ops = &iwl5000_ops, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1008 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, |
Tomas Winkler | 0ef2ca6 | 2008-10-23 23:48:51 -0700 | [diff] [blame] | 1009 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 1010 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1011 | .num_of_queues = IWLAGN_NUM_QUEUES, |
| 1012 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
Esti Kummer | 4740863 | 2008-07-11 11:53:30 +0800 | [diff] [blame] | 1013 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 1014 | .valid_tx_ant = ANT_B, |
| 1015 | .valid_rx_ant = ANT_AB, |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 1016 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
| 1017 | .set_l0s = true, |
| 1018 | .use_bsm = false, |
Daniel C Halperin | b261793 | 2009-08-13 13:30:59 -0700 | [diff] [blame] | 1019 | .ht_greenfield_support = true, |
Wey-Yi Guy | f2d0d0e | 2009-09-11 10:38:14 -0700 | [diff] [blame] | 1020 | .led_compensation = 51, |
Wey-Yi Guy | 1152dcc | 2010-01-15 13:42:58 -0800 | [diff] [blame] | 1021 | .use_rts_for_ht = true, /* use rts/cts protection */ |
Wey-Yi Guy | d8c07e7 | 2009-09-25 14:24:26 -0700 | [diff] [blame] | 1022 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
Trieu 'Andrew' Nguyen | 3e4fb5f | 2010-01-22 14:22:46 -0800 | [diff] [blame] | 1023 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
Ben Cahill | d4fe5ac | 2010-02-05 11:33:46 -0800 | [diff] [blame] | 1024 | .chain_noise_scale = 1000, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 1025 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
Esti Kummer | 4740863 | 2008-07-11 11:53:30 +0800 | [diff] [blame] | 1026 | }; |
| 1027 | |
| 1028 | struct iwl_cfg iwl5100_abg_cfg = { |
Shanyu Zhao | c11362c | 2010-03-05 17:05:20 -0800 | [diff] [blame] | 1029 | .name = "Intel(R) WiFi Link 5100 ABG", |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 1030 | .fw_name_pre = IWL5000_FW_PRE, |
| 1031 | .ucode_api_max = IWL5000_UCODE_API_MAX, |
| 1032 | .ucode_api_min = IWL5000_UCODE_API_MIN, |
Esti Kummer | 4740863 | 2008-07-11 11:53:30 +0800 | [diff] [blame] | 1033 | .sku = IWL_SKU_A|IWL_SKU_G, |
| 1034 | .ops = &iwl5000_ops, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1035 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, |
Tomas Winkler | 0ef2ca6 | 2008-10-23 23:48:51 -0700 | [diff] [blame] | 1036 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 1037 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1038 | .num_of_queues = IWLAGN_NUM_QUEUES, |
| 1039 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
Esti Kummer | 4740863 | 2008-07-11 11:53:30 +0800 | [diff] [blame] | 1040 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 1041 | .valid_tx_ant = ANT_B, |
| 1042 | .valid_rx_ant = ANT_AB, |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 1043 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
| 1044 | .set_l0s = true, |
| 1045 | .use_bsm = false, |
Wey-Yi Guy | f2d0d0e | 2009-09-11 10:38:14 -0700 | [diff] [blame] | 1046 | .led_compensation = 51, |
Wey-Yi Guy | d8c07e7 | 2009-09-25 14:24:26 -0700 | [diff] [blame] | 1047 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
Trieu 'Andrew' Nguyen | 3e4fb5f | 2010-01-22 14:22:46 -0800 | [diff] [blame] | 1048 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
Ben Cahill | d4fe5ac | 2010-02-05 11:33:46 -0800 | [diff] [blame] | 1049 | .chain_noise_scale = 1000, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 1050 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
Esti Kummer | 4740863 | 2008-07-11 11:53:30 +0800 | [diff] [blame] | 1051 | }; |
| 1052 | |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1053 | struct iwl_cfg iwl5100_agn_cfg = { |
Shanyu Zhao | c11362c | 2010-03-05 17:05:20 -0800 | [diff] [blame] | 1054 | .name = "Intel(R) WiFi Link 5100 AGN", |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 1055 | .fw_name_pre = IWL5000_FW_PRE, |
| 1056 | .ucode_api_max = IWL5000_UCODE_API_MAX, |
| 1057 | .ucode_api_min = IWL5000_UCODE_API_MIN, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1058 | .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 1059 | .ops = &iwl5000_ops, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1060 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, |
Tomas Winkler | 0ef2ca6 | 2008-10-23 23:48:51 -0700 | [diff] [blame] | 1061 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
| 1062 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1063 | .num_of_queues = IWLAGN_NUM_QUEUES, |
| 1064 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1065 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 1066 | .valid_tx_ant = ANT_B, |
| 1067 | .valid_rx_ant = ANT_AB, |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 1068 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
| 1069 | .set_l0s = true, |
| 1070 | .use_bsm = false, |
Daniel C Halperin | b261793 | 2009-08-13 13:30:59 -0700 | [diff] [blame] | 1071 | .ht_greenfield_support = true, |
Wey-Yi Guy | f2d0d0e | 2009-09-11 10:38:14 -0700 | [diff] [blame] | 1072 | .led_compensation = 51, |
Wey-Yi Guy | 1152dcc | 2010-01-15 13:42:58 -0800 | [diff] [blame] | 1073 | .use_rts_for_ht = true, /* use rts/cts protection */ |
Wey-Yi Guy | d8c07e7 | 2009-09-25 14:24:26 -0700 | [diff] [blame] | 1074 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
Trieu 'Andrew' Nguyen | 3e4fb5f | 2010-01-22 14:22:46 -0800 | [diff] [blame] | 1075 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
Ben Cahill | d4fe5ac | 2010-02-05 11:33:46 -0800 | [diff] [blame] | 1076 | .chain_noise_scale = 1000, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 1077 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1078 | }; |
| 1079 | |
| 1080 | struct iwl_cfg iwl5350_agn_cfg = { |
Shanyu Zhao | c11362c | 2010-03-05 17:05:20 -0800 | [diff] [blame] | 1081 | .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 1082 | .fw_name_pre = IWL5000_FW_PRE, |
| 1083 | .ucode_api_max = IWL5000_UCODE_API_MAX, |
| 1084 | .ucode_api_min = IWL5000_UCODE_API_MIN, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1085 | .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, |
Tomas Winkler | da8dec2 | 2008-04-24 11:55:24 -0700 | [diff] [blame] | 1086 | .ops = &iwl5000_ops, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1087 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, |
Tomas Winkler | 0ef2ca6 | 2008-10-23 23:48:51 -0700 | [diff] [blame] | 1088 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, |
| 1089 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1090 | .num_of_queues = IWLAGN_NUM_QUEUES, |
| 1091 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1092 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 1093 | .valid_tx_ant = ANT_ABC, |
| 1094 | .valid_rx_ant = ANT_ABC, |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 1095 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
| 1096 | .set_l0s = true, |
| 1097 | .use_bsm = false, |
Daniel C Halperin | b261793 | 2009-08-13 13:30:59 -0700 | [diff] [blame] | 1098 | .ht_greenfield_support = true, |
Wey-Yi Guy | f2d0d0e | 2009-09-11 10:38:14 -0700 | [diff] [blame] | 1099 | .led_compensation = 51, |
Wey-Yi Guy | 1152dcc | 2010-01-15 13:42:58 -0800 | [diff] [blame] | 1100 | .use_rts_for_ht = true, /* use rts/cts protection */ |
Wey-Yi Guy | d8c07e7 | 2009-09-25 14:24:26 -0700 | [diff] [blame] | 1101 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
Trieu 'Andrew' Nguyen | 3e4fb5f | 2010-01-22 14:22:46 -0800 | [diff] [blame] | 1102 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
Ben Cahill | d4fe5ac | 2010-02-05 11:33:46 -0800 | [diff] [blame] | 1103 | .chain_noise_scale = 1000, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 1104 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1105 | }; |
| 1106 | |
Tomas Winkler | 7100e92 | 2008-12-01 16:32:18 -0800 | [diff] [blame] | 1107 | struct iwl_cfg iwl5150_agn_cfg = { |
Shanyu Zhao | c11362c | 2010-03-05 17:05:20 -0800 | [diff] [blame] | 1108 | .name = "Intel(R) WiMAX/WiFi Link 5150 AGN", |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 1109 | .fw_name_pre = IWL5150_FW_PRE, |
| 1110 | .ucode_api_max = IWL5150_UCODE_API_MAX, |
| 1111 | .ucode_api_min = IWL5150_UCODE_API_MIN, |
Tomas Winkler | 7100e92 | 2008-12-01 16:32:18 -0800 | [diff] [blame] | 1112 | .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, |
Wey-Yi Guy | 62161ae | 2009-05-21 13:44:23 -0700 | [diff] [blame] | 1113 | .ops = &iwl5150_ops, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1114 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, |
Tomas Winkler | fd63edb | 2008-12-01 16:32:21 -0800 | [diff] [blame] | 1115 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, |
| 1116 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1117 | .num_of_queues = IWLAGN_NUM_QUEUES, |
| 1118 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
Tomas Winkler | 7100e92 | 2008-12-01 16:32:18 -0800 | [diff] [blame] | 1119 | .mod_params = &iwl50_mod_params, |
Jay Sternberg | c0bac76 | 2009-02-02 16:21:14 -0800 | [diff] [blame] | 1120 | .valid_tx_ant = ANT_A, |
| 1121 | .valid_rx_ant = ANT_AB, |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 1122 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
| 1123 | .set_l0s = true, |
| 1124 | .use_bsm = false, |
Daniel C Halperin | b261793 | 2009-08-13 13:30:59 -0700 | [diff] [blame] | 1125 | .ht_greenfield_support = true, |
Wey-Yi Guy | f2d0d0e | 2009-09-11 10:38:14 -0700 | [diff] [blame] | 1126 | .led_compensation = 51, |
Wey-Yi Guy | 1152dcc | 2010-01-15 13:42:58 -0800 | [diff] [blame] | 1127 | .use_rts_for_ht = true, /* use rts/cts protection */ |
Wey-Yi Guy | d8c07e7 | 2009-09-25 14:24:26 -0700 | [diff] [blame] | 1128 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
Trieu 'Andrew' Nguyen | 3e4fb5f | 2010-01-22 14:22:46 -0800 | [diff] [blame] | 1129 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
Ben Cahill | d4fe5ac | 2010-02-05 11:33:46 -0800 | [diff] [blame] | 1130 | .chain_noise_scale = 1000, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 1131 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
Tomas Winkler | 7100e92 | 2008-12-01 16:32:18 -0800 | [diff] [blame] | 1132 | }; |
| 1133 | |
Wey-Yi Guy | ac59257 | 2009-11-20 12:05:03 -0800 | [diff] [blame] | 1134 | struct iwl_cfg iwl5150_abg_cfg = { |
Shanyu Zhao | c11362c | 2010-03-05 17:05:20 -0800 | [diff] [blame] | 1135 | .name = "Intel(R) WiMAX/WiFi Link 5150 ABG", |
Wey-Yi Guy | ac59257 | 2009-11-20 12:05:03 -0800 | [diff] [blame] | 1136 | .fw_name_pre = IWL5150_FW_PRE, |
| 1137 | .ucode_api_max = IWL5150_UCODE_API_MAX, |
| 1138 | .ucode_api_min = IWL5150_UCODE_API_MIN, |
| 1139 | .sku = IWL_SKU_A|IWL_SKU_G, |
| 1140 | .ops = &iwl5150_ops, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1141 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, |
Wey-Yi Guy | ac59257 | 2009-11-20 12:05:03 -0800 | [diff] [blame] | 1142 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, |
| 1143 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame^] | 1144 | .num_of_queues = IWLAGN_NUM_QUEUES, |
| 1145 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
Wey-Yi Guy | ac59257 | 2009-11-20 12:05:03 -0800 | [diff] [blame] | 1146 | .mod_params = &iwl50_mod_params, |
| 1147 | .valid_tx_ant = ANT_A, |
| 1148 | .valid_rx_ant = ANT_AB, |
| 1149 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
| 1150 | .set_l0s = true, |
| 1151 | .use_bsm = false, |
| 1152 | .led_compensation = 51, |
| 1153 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
Trieu 'Andrew' Nguyen | 3e4fb5f | 2010-01-22 14:22:46 -0800 | [diff] [blame] | 1154 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, |
Ben Cahill | d4fe5ac | 2010-02-05 11:33:46 -0800 | [diff] [blame] | 1155 | .chain_noise_scale = 1000, |
Wey-Yi Guy | b74e31a | 2010-03-01 17:23:50 -0800 | [diff] [blame] | 1156 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1157 | }; |
| 1158 | |
Reinette Chatre | a0987a8 | 2008-12-02 12:14:06 -0800 | [diff] [blame] | 1159 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); |
| 1160 | MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX)); |
Tomas Winkler | c9f79ed | 2008-09-11 11:45:21 +0800 | [diff] [blame] | 1161 | |
Wey-Yi Guy | 4e30cb6 | 2009-09-17 10:43:47 -0700 | [diff] [blame] | 1162 | module_param_named(swcrypto50, iwl50_mod_params.sw_crypto, bool, S_IRUGO); |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1163 | MODULE_PARM_DESC(swcrypto50, |
| 1164 | "using software crypto engine (default 0 [hardware])\n"); |
Wey-Yi Guy | 4e30cb6 | 2009-09-17 10:43:47 -0700 | [diff] [blame] | 1165 | module_param_named(queues_num50, iwl50_mod_params.num_of_queues, int, S_IRUGO); |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1166 | MODULE_PARM_DESC(queues_num50, "number of hw queues in 50xx series"); |
Wey-Yi Guy | 4e30cb6 | 2009-09-17 10:43:47 -0700 | [diff] [blame] | 1167 | module_param_named(11n_disable50, iwl50_mod_params.disable_11n, int, S_IRUGO); |
Ron Rindjunsky | 4977929 | 2008-06-30 17:23:21 +0800 | [diff] [blame] | 1168 | MODULE_PARM_DESC(11n_disable50, "disable 50XX 11n functionality"); |
Wey-Yi Guy | 4e30cb6 | 2009-09-17 10:43:47 -0700 | [diff] [blame] | 1169 | module_param_named(amsdu_size_8K50, iwl50_mod_params.amsdu_size_8K, |
| 1170 | int, S_IRUGO); |
Tomas Winkler | 5a6a256 | 2008-04-24 11:55:23 -0700 | [diff] [blame] | 1171 | MODULE_PARM_DESC(amsdu_size_8K50, "enable 8K amsdu size in 50XX series"); |
Wey-Yi Guy | 4e30cb6 | 2009-09-17 10:43:47 -0700 | [diff] [blame] | 1172 | module_param_named(fw_restart50, iwl50_mod_params.restart_fw, int, S_IRUGO); |
Ester Kummer | 3a1081e | 2008-05-06 11:05:14 +0800 | [diff] [blame] | 1173 | MODULE_PARM_DESC(fw_restart50, "restart firmware in case of error"); |