Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Emmanuel Grumbach | 51368bf | 2013-12-30 13:15:54 +0200 | [diff] [blame] | 3 | * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [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: |
Emmanuel Grumbach | d01c536 | 2015-11-17 15:39:56 +0200 | [diff] [blame] | 22 | * Intel Linux Wireless <linuxwifi@intel.com> |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 24 | * |
| 25 | *****************************************************************************/ |
| 26 | |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 27 | #include <linux/module.h> |
Evgeni Golov | 8fcbd4dc | 2011-06-12 05:34:31 -0700 | [diff] [blame] | 28 | #include <linux/stringify.h> |
Johannes Berg | e967669 | 2012-04-10 14:10:28 -0700 | [diff] [blame] | 29 | #include "iwl-config.h" |
Johannes Berg | 0db19cd | 2012-04-03 20:57:59 +0200 | [diff] [blame] | 30 | #include "iwl-agn-hw.h" |
Johannes Berg | 1023fdc | 2012-05-15 12:16:34 +0200 | [diff] [blame] | 31 | #include "dvm/commands.h" /* needed for BT for now */ |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 32 | |
| 33 | /* Highest firmware API version supported */ |
Johannes Berg | ca9a460 | 2011-07-23 10:24:45 -0700 | [diff] [blame] | 34 | #define IWL2030_UCODE_API_MAX 6 |
| 35 | #define IWL2000_UCODE_API_MAX 6 |
| 36 | #define IWL105_UCODE_API_MAX 6 |
| 37 | #define IWL135_UCODE_API_MAX 6 |
| 38 | |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 39 | /* Lowest firmware API version supported */ |
| 40 | #define IWL2030_UCODE_API_MIN 5 |
| 41 | #define IWL2000_UCODE_API_MIN 5 |
Wey-Yi Guy | b4ed221 | 2011-04-30 08:55:16 -0700 | [diff] [blame] | 42 | #define IWL105_UCODE_API_MIN 5 |
Wey-Yi Guy | 54e9c40 | 2011-07-01 07:47:59 -0700 | [diff] [blame] | 43 | #define IWL135_UCODE_API_MIN 5 |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 44 | |
Johannes Berg | 586aed9 | 2012-04-03 20:41:07 +0200 | [diff] [blame] | 45 | /* EEPROM version */ |
| 46 | #define EEPROM_2000_TX_POWER_VERSION (6) |
| 47 | #define EEPROM_2000_EEPROM_VERSION (0x805) |
| 48 | |
| 49 | |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 50 | #define IWL2030_FW_PRE "iwlwifi-2030-" |
Evgeni Golov | 8fcbd4dc | 2011-06-12 05:34:31 -0700 | [diff] [blame] | 51 | #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode" |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 52 | |
| 53 | #define IWL2000_FW_PRE "iwlwifi-2000-" |
Evgeni Golov | 8fcbd4dc | 2011-06-12 05:34:31 -0700 | [diff] [blame] | 54 | #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode" |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 55 | |
Wey-Yi Guy | b4ed221 | 2011-04-30 08:55:16 -0700 | [diff] [blame] | 56 | #define IWL105_FW_PRE "iwlwifi-105-" |
Evgeni Golov | 8fcbd4dc | 2011-06-12 05:34:31 -0700 | [diff] [blame] | 57 | #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode" |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 58 | |
Wey-Yi Guy | 54e9c40 | 2011-07-01 07:47:59 -0700 | [diff] [blame] | 59 | #define IWL135_FW_PRE "iwlwifi-135-" |
Fry, Donald H | 5092e47 | 2011-09-15 11:46:37 -0700 | [diff] [blame] | 60 | #define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode" |
Wey-Yi Guy | 54e9c40 | 2011-07-01 07:47:59 -0700 | [diff] [blame] | 61 | |
Johannes Berg | 6794f3e | 2012-03-06 13:30:56 -0800 | [diff] [blame] | 62 | static const struct iwl_base_params iwl2000_base_params = { |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 63 | .eeprom_size = OTP_LOW_IMAGE_SIZE, |
| 64 | .num_of_queues = IWLAGN_NUM_QUEUES, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 65 | .max_ll_items = OTP_MAX_LL_ITEMS_2x00, |
| 66 | .shadow_ram_support = true, |
| 67 | .led_compensation = 51, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 68 | .wd_timeout = IWL_DEF_WD_TIMEOUT, |
| 69 | .max_event_log_size = 512, |
Meenakshi Venkataraman | 66a7707 | 2012-05-16 22:35:59 +0200 | [diff] [blame] | 70 | .shadow_reg_enable = false, /* TODO: fix bugs using this feature */ |
Emmanuel Grumbach | e03bbb6 | 2014-04-13 10:49:16 +0300 | [diff] [blame] | 71 | .scd_chain_ext_wa = true, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 72 | }; |
| 73 | |
| 74 | |
Johannes Berg | 6794f3e | 2012-03-06 13:30:56 -0800 | [diff] [blame] | 75 | static const struct iwl_base_params iwl2030_base_params = { |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 76 | .eeprom_size = OTP_LOW_IMAGE_SIZE, |
| 77 | .num_of_queues = IWLAGN_NUM_QUEUES, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 78 | .max_ll_items = OTP_MAX_LL_ITEMS_2x00, |
| 79 | .shadow_ram_support = true, |
| 80 | .led_compensation = 57, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 81 | .wd_timeout = IWL_LONG_WD_TIMEOUT, |
| 82 | .max_event_log_size = 512, |
Meenakshi Venkataraman | 66a7707 | 2012-05-16 22:35:59 +0200 | [diff] [blame] | 83 | .shadow_reg_enable = false, /* TODO: fix bugs using this feature */ |
Emmanuel Grumbach | e03bbb6 | 2014-04-13 10:49:16 +0300 | [diff] [blame] | 84 | .scd_chain_ext_wa = true, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 85 | }; |
| 86 | |
Johannes Berg | 6794f3e | 2012-03-06 13:30:56 -0800 | [diff] [blame] | 87 | static const struct iwl_ht_params iwl2000_ht_params = { |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 88 | .ht_greenfield_support = true, |
| 89 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
Johannes Berg | 57fbcce | 2016-04-12 15:56:15 +0200 | [diff] [blame] | 90 | .ht40_bands = BIT(NL80211_BAND_2GHZ), |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 91 | }; |
| 92 | |
Johannes Berg | 26a7ca9 | 2012-05-21 11:55:54 +0200 | [diff] [blame] | 93 | static const struct iwl_eeprom_params iwl20x0_eeprom_params = { |
| 94 | .regulatory_bands = { |
| 95 | EEPROM_REG_BAND_1_CHANNELS, |
| 96 | EEPROM_REG_BAND_2_CHANNELS, |
| 97 | EEPROM_REG_BAND_3_CHANNELS, |
| 98 | EEPROM_REG_BAND_4_CHANNELS, |
| 99 | EEPROM_REG_BAND_5_CHANNELS, |
| 100 | EEPROM_6000_REG_BAND_24_HT40_CHANNELS, |
| 101 | EEPROM_REGULATORY_BAND_NO_HT40, |
| 102 | }, |
| 103 | .enhanced_txpower = true, |
| 104 | }; |
| 105 | |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 106 | #define IWL_DEVICE_2000 \ |
| 107 | .fw_name_pre = IWL2000_FW_PRE, \ |
| 108 | .ucode_api_max = IWL2000_UCODE_API_MAX, \ |
| 109 | .ucode_api_min = IWL2000_UCODE_API_MIN, \ |
Johannes Berg | 2d771cb | 2012-04-09 17:47:00 -0700 | [diff] [blame] | 110 | .device_family = IWL_DEVICE_FAMILY_2000, \ |
Emmanuel Grumbach | dae66d0 | 2012-02-07 12:56:26 +0200 | [diff] [blame] | 111 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
| 112 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
Johannes Berg | 0d8877a | 2013-05-17 10:36:29 +0200 | [diff] [blame] | 113 | .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ |
| 114 | .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 115 | .base_params = &iwl2000_base_params, \ |
Johannes Berg | 26a7ca9 | 2012-05-21 11:55:54 +0200 | [diff] [blame] | 116 | .eeprom_params = &iwl20x0_eeprom_params, \ |
Emmanuel Grumbach | 540623c | 2015-02-23 02:40:07 +0200 | [diff] [blame] | 117 | .led_mode = IWL_LED_RF_STATE, \ |
| 118 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K |
| 119 | |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 120 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 121 | const struct iwl_cfg iwl2000_2bgn_cfg = { |
Don Fry | 6195d13 | 2011-12-06 10:42:41 -0800 | [diff] [blame] | 122 | .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN", |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 123 | IWL_DEVICE_2000, |
| 124 | .ht_params = &iwl2000_ht_params, |
| 125 | }; |
| 126 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 127 | const struct iwl_cfg iwl2000_2bgn_d_cfg = { |
Don Fry | 6195d13 | 2011-12-06 10:42:41 -0800 | [diff] [blame] | 128 | .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN", |
Wey-Yi Guy | 1603dd4 | 2011-08-25 23:11:17 -0700 | [diff] [blame] | 129 | IWL_DEVICE_2000, |
Wey-Yi Guy | ec8f734 | 2011-09-06 09:31:23 -0700 | [diff] [blame] | 130 | .ht_params = &iwl2000_ht_params, |
Wey-Yi Guy | 1603dd4 | 2011-08-25 23:11:17 -0700 | [diff] [blame] | 131 | }; |
| 132 | |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 133 | #define IWL_DEVICE_2030 \ |
| 134 | .fw_name_pre = IWL2030_FW_PRE, \ |
| 135 | .ucode_api_max = IWL2030_UCODE_API_MAX, \ |
| 136 | .ucode_api_min = IWL2030_UCODE_API_MIN, \ |
Johannes Berg | 2d771cb | 2012-04-09 17:47:00 -0700 | [diff] [blame] | 137 | .device_family = IWL_DEVICE_FAMILY_2030, \ |
Emmanuel Grumbach | dae66d0 | 2012-02-07 12:56:26 +0200 | [diff] [blame] | 138 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
| 139 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
Eytan Lifshitz | b7998c8 | 2012-12-01 20:59:49 +0200 | [diff] [blame] | 140 | .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ |
| 141 | .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 142 | .base_params = &iwl2030_base_params, \ |
Johannes Berg | 26a7ca9 | 2012-05-21 11:55:54 +0200 | [diff] [blame] | 143 | .eeprom_params = &iwl20x0_eeprom_params, \ |
Emmanuel Grumbach | 540623c | 2015-02-23 02:40:07 +0200 | [diff] [blame] | 144 | .led_mode = IWL_LED_RF_STATE, \ |
| 145 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 146 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 147 | const struct iwl_cfg iwl2030_2bgn_cfg = { |
Don Fry | 6195d13 | 2011-12-06 10:42:41 -0800 | [diff] [blame] | 148 | .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN", |
Wey-Yi Guy | 96234cc | 2011-01-24 11:44:42 -0800 | [diff] [blame] | 149 | IWL_DEVICE_2030, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 150 | .ht_params = &iwl2000_ht_params, |
| 151 | }; |
| 152 | |
Wey-Yi Guy | b4ed221 | 2011-04-30 08:55:16 -0700 | [diff] [blame] | 153 | #define IWL_DEVICE_105 \ |
| 154 | .fw_name_pre = IWL105_FW_PRE, \ |
| 155 | .ucode_api_max = IWL105_UCODE_API_MAX, \ |
| 156 | .ucode_api_min = IWL105_UCODE_API_MIN, \ |
Johannes Berg | 2d771cb | 2012-04-09 17:47:00 -0700 | [diff] [blame] | 157 | .device_family = IWL_DEVICE_FAMILY_105, \ |
Emmanuel Grumbach | dae66d0 | 2012-02-07 12:56:26 +0200 | [diff] [blame] | 158 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
| 159 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
Eytan Lifshitz | b7998c8 | 2012-12-01 20:59:49 +0200 | [diff] [blame] | 160 | .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ |
| 161 | .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 162 | .base_params = &iwl2000_base_params, \ |
Johannes Berg | 26a7ca9 | 2012-05-21 11:55:54 +0200 | [diff] [blame] | 163 | .eeprom_params = &iwl20x0_eeprom_params, \ |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 164 | .led_mode = IWL_LED_RF_STATE, \ |
Emmanuel Grumbach | 540623c | 2015-02-23 02:40:07 +0200 | [diff] [blame] | 165 | .rx_with_siso_diversity = true, \ |
| 166 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 167 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 168 | const struct iwl_cfg iwl105_bgn_cfg = { |
Don Fry | 6195d13 | 2011-12-06 10:42:41 -0800 | [diff] [blame] | 169 | .name = "Intel(R) Centrino(R) Wireless-N 105 BGN", |
Wey-Yi Guy | b4ed221 | 2011-04-30 08:55:16 -0700 | [diff] [blame] | 170 | IWL_DEVICE_105, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 171 | .ht_params = &iwl2000_ht_params, |
| 172 | }; |
| 173 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 174 | const struct iwl_cfg iwl105_bgn_d_cfg = { |
Don Fry | 6195d13 | 2011-12-06 10:42:41 -0800 | [diff] [blame] | 175 | .name = "Intel(R) Centrino(R) Wireless-N 105D BGN", |
Wey-Yi Guy | b319d3e | 2011-10-10 07:27:01 -0700 | [diff] [blame] | 176 | IWL_DEVICE_105, |
| 177 | .ht_params = &iwl2000_ht_params, |
| 178 | }; |
| 179 | |
Wey-Yi Guy | b4ed221 | 2011-04-30 08:55:16 -0700 | [diff] [blame] | 180 | #define IWL_DEVICE_135 \ |
Wey-Yi Guy | 54e9c40 | 2011-07-01 07:47:59 -0700 | [diff] [blame] | 181 | .fw_name_pre = IWL135_FW_PRE, \ |
| 182 | .ucode_api_max = IWL135_UCODE_API_MAX, \ |
| 183 | .ucode_api_min = IWL135_UCODE_API_MIN, \ |
Johannes Berg | 2d771cb | 2012-04-09 17:47:00 -0700 | [diff] [blame] | 184 | .device_family = IWL_DEVICE_FAMILY_135, \ |
Emmanuel Grumbach | dae66d0 | 2012-02-07 12:56:26 +0200 | [diff] [blame] | 185 | .max_inst_size = IWL60_RTC_INST_SIZE, \ |
| 186 | .max_data_size = IWL60_RTC_DATA_SIZE, \ |
Eytan Lifshitz | b7998c8 | 2012-12-01 20:59:49 +0200 | [diff] [blame] | 187 | .nvm_ver = EEPROM_2000_EEPROM_VERSION, \ |
| 188 | .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 189 | .base_params = &iwl2030_base_params, \ |
Johannes Berg | 26a7ca9 | 2012-05-21 11:55:54 +0200 | [diff] [blame] | 190 | .eeprom_params = &iwl20x0_eeprom_params, \ |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 191 | .led_mode = IWL_LED_RF_STATE, \ |
Emmanuel Grumbach | 540623c | 2015-02-23 02:40:07 +0200 | [diff] [blame] | 192 | .rx_with_siso_diversity = true, \ |
| 193 | .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 194 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 195 | const struct iwl_cfg iwl135_bgn_cfg = { |
Don Fry | 6195d13 | 2011-12-06 10:42:41 -0800 | [diff] [blame] | 196 | .name = "Intel(R) Centrino(R) Wireless-N 135 BGN", |
Wey-Yi Guy | b4ed221 | 2011-04-30 08:55:16 -0700 | [diff] [blame] | 197 | IWL_DEVICE_135, |
Wey-Yi Guy | c5a5e18 | 2011-01-21 15:47:21 -0800 | [diff] [blame] | 198 | .ht_params = &iwl2000_ht_params, |
| 199 | }; |
| 200 | |
Emmanuel Grumbach | 9d9b21d | 2016-03-24 08:44:57 +0200 | [diff] [blame] | 201 | MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX)); |
| 202 | MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX)); |
| 203 | MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX)); |
| 204 | MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX)); |