Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Wey-Yi Guy | 4e31826 | 2011-12-27 11:21:32 -0800 | [diff] [blame] | 3 | * Copyright(c) 2008 - 2012 Intel Corporation. All rights reserved. |
Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -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: |
| 22 | * Intel Linux Wireless <ilw@linux.intel.com> |
| 23 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 24 | * |
| 25 | *****************************************************************************/ |
| 26 | |
Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -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-csr.h" |
| 31 | #include "iwl-agn-hw.h" |
Johannes Berg | 6468a01 | 2012-05-16 19:13:54 +0200 | [diff] [blame] | 32 | #include "cfg.h" |
Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -0800 | [diff] [blame] | 33 | |
| 34 | /* Highest firmware API version supported */ |
Meenakshi Venkataraman | 78cbcf2 | 2012-04-22 07:55:27 -0700 | [diff] [blame] | 35 | #define IWL1000_UCODE_API_MAX 5 |
| 36 | #define IWL100_UCODE_API_MAX 5 |
Johannes Berg | ca9a460 | 2011-07-23 10:24:45 -0700 | [diff] [blame] | 37 | |
| 38 | /* Oldest version we won't warn about */ |
| 39 | #define IWL1000_UCODE_API_OK 5 |
| 40 | #define IWL100_UCODE_API_OK 5 |
Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -0800 | [diff] [blame] | 41 | |
| 42 | /* Lowest firmware API version supported */ |
Jay Sternberg | 77dcb6a | 2009-03-06 13:52:55 -0800 | [diff] [blame] | 43 | #define IWL1000_UCODE_API_MIN 1 |
Jay Sternberg | 1de19ec | 2010-09-14 15:21:20 -0700 | [diff] [blame] | 44 | #define IWL100_UCODE_API_MIN 5 |
Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -0800 | [diff] [blame] | 45 | |
Johannes Berg | 586aed9 | 2012-04-03 20:41:07 +0200 | [diff] [blame] | 46 | /* EEPROM version */ |
| 47 | #define EEPROM_1000_TX_POWER_VERSION (4) |
| 48 | #define EEPROM_1000_EEPROM_VERSION (0x15C) |
| 49 | |
Jay Sternberg | 77dcb6a | 2009-03-06 13:52:55 -0800 | [diff] [blame] | 50 | #define IWL1000_FW_PRE "iwlwifi-1000-" |
Evgeni Golov | 8fcbd4dc | 2011-06-12 05:34:31 -0700 | [diff] [blame] | 51 | #define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE __stringify(api) ".ucode" |
Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -0800 | [diff] [blame] | 52 | |
Jay Sternberg | 1de19ec | 2010-09-14 15:21:20 -0700 | [diff] [blame] | 53 | #define IWL100_FW_PRE "iwlwifi-100-" |
Evgeni Golov | 8fcbd4dc | 2011-06-12 05:34:31 -0700 | [diff] [blame] | 54 | #define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE __stringify(api) ".ucode" |
Jay Sternberg | 1de19ec | 2010-09-14 15:21:20 -0700 | [diff] [blame] | 55 | |
Wey-Yi Guy | 672639d | 2009-07-24 11:13:01 -0700 | [diff] [blame] | 56 | |
Johannes Berg | 6794f3e | 2012-03-06 13:30:56 -0800 | [diff] [blame] | 57 | static const struct iwl_base_params iwl1000_base_params = { |
Wey-Yi Guy | 19e6cda | 2010-03-16 17:41:23 -0700 | [diff] [blame] | 58 | .num_of_queues = IWLAGN_NUM_QUEUES, |
Wey-Yi Guy | 7cb1b08 | 2010-10-06 08:10:00 -0700 | [diff] [blame] | 59 | .eeprom_size = OTP_LOW_IMAGE_SIZE, |
Ben Cahill | fadb358 | 2009-10-23 13:42:21 -0700 | [diff] [blame] | 60 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
Wey-Yi Guy | 415e499 | 2009-08-13 13:30:54 -0700 | [diff] [blame] | 61 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, |
| 62 | .shadow_ram_support = false, |
Wey-Yi Guy | f2d0d0e | 2009-09-11 10:38:14 -0700 | [diff] [blame] | 63 | .led_compensation = 51, |
Wey-Yi Guy | 480e840 | 2009-10-23 13:42:28 -0700 | [diff] [blame] | 64 | .support_ct_kill_exit = true, |
Trieu 'Andrew' Nguyen | 6c3872e | 2010-02-08 13:53:05 -0800 | [diff] [blame] | 65 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, |
Ben Cahill | d4fe5ac | 2010-02-05 11:33:46 -0800 | [diff] [blame] | 66 | .chain_noise_scale = 1000, |
Paul Bolle | 6de4902 | 2012-05-30 09:14:41 +0200 | [diff] [blame^] | 67 | .wd_timeout = IWL_WATCHDOG_DISABLED, |
Wey-Yi Guy | 678b385 | 2010-03-26 12:54:37 -0700 | [diff] [blame] | 68 | .max_event_log_size = 128, |
Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -0800 | [diff] [blame] | 69 | }; |
Johannes Berg | 6794f3e | 2012-03-06 13:30:56 -0800 | [diff] [blame] | 70 | |
| 71 | static const struct iwl_ht_params iwl1000_ht_params = { |
Wey-Yi Guy | 7cb1b08 | 2010-10-06 08:10:00 -0700 | [diff] [blame] | 72 | .ht_greenfield_support = true, |
| 73 | .use_rts_for_aggregation = true, /* use rts/cts protection */ |
Johannes Berg | d370493 | 2012-05-21 20:03:01 +0200 | [diff] [blame] | 74 | .ht40_bands = BIT(IEEE80211_BAND_2GHZ), |
Wey-Yi Guy | 7cb1b08 | 2010-10-06 08:10:00 -0700 | [diff] [blame] | 75 | }; |
| 76 | |
Johannes Berg | 26a7ca9 | 2012-05-21 11:55:54 +0200 | [diff] [blame] | 77 | static const struct iwl_eeprom_params iwl1000_eeprom_params = { |
| 78 | .regulatory_bands = { |
| 79 | EEPROM_REG_BAND_1_CHANNELS, |
| 80 | EEPROM_REG_BAND_2_CHANNELS, |
| 81 | EEPROM_REG_BAND_3_CHANNELS, |
| 82 | EEPROM_REG_BAND_4_CHANNELS, |
| 83 | EEPROM_REG_BAND_5_CHANNELS, |
| 84 | EEPROM_REG_BAND_24_HT40_CHANNELS, |
| 85 | EEPROM_REGULATORY_BAND_NO_HT40, |
| 86 | } |
| 87 | }; |
| 88 | |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 89 | #define IWL_DEVICE_1000 \ |
| 90 | .fw_name_pre = IWL1000_FW_PRE, \ |
| 91 | .ucode_api_max = IWL1000_UCODE_API_MAX, \ |
Johannes Berg | ca9a460 | 2011-07-23 10:24:45 -0700 | [diff] [blame] | 92 | .ucode_api_ok = IWL1000_UCODE_API_OK, \ |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 93 | .ucode_api_min = IWL1000_UCODE_API_MIN, \ |
Johannes Berg | 2d771cb | 2012-04-09 17:47:00 -0700 | [diff] [blame] | 94 | .device_family = IWL_DEVICE_FAMILY_1000, \ |
Emmanuel Grumbach | dae66d0 | 2012-02-07 12:56:26 +0200 | [diff] [blame] | 95 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ |
| 96 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 97 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \ |
| 98 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 99 | .base_params = &iwl1000_base_params, \ |
Johannes Berg | 26a7ca9 | 2012-05-21 11:55:54 +0200 | [diff] [blame] | 100 | .eeprom_params = &iwl1000_eeprom_params, \ |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 101 | .led_mode = IWL_LED_BLINK |
| 102 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 103 | const struct iwl_cfg iwl1000_bgn_cfg = { |
Wey-Yi Guy | 7cb1b08 | 2010-10-06 08:10:00 -0700 | [diff] [blame] | 104 | .name = "Intel(R) Centrino(R) Wireless-N 1000 BGN", |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 105 | IWL_DEVICE_1000, |
Wey-Yi Guy | 7cb1b08 | 2010-10-06 08:10:00 -0700 | [diff] [blame] | 106 | .ht_params = &iwl1000_ht_params, |
| 107 | }; |
Jay Sternberg | c5d0569 | 2009-01-19 15:30:35 -0800 | [diff] [blame] | 108 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 109 | const struct iwl_cfg iwl1000_bg_cfg = { |
Shanyu Zhao | c11362c | 2010-03-05 17:05:20 -0800 | [diff] [blame] | 110 | .name = "Intel(R) Centrino(R) Wireless-N 1000 BG", |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 111 | IWL_DEVICE_1000, |
Wey-Yi Guy | 4bd0914f | 2009-09-17 10:43:52 -0700 | [diff] [blame] | 112 | }; |
| 113 | |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 114 | #define IWL_DEVICE_100 \ |
| 115 | .fw_name_pre = IWL100_FW_PRE, \ |
| 116 | .ucode_api_max = IWL100_UCODE_API_MAX, \ |
Johannes Berg | ca9a460 | 2011-07-23 10:24:45 -0700 | [diff] [blame] | 117 | .ucode_api_ok = IWL100_UCODE_API_OK, \ |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 118 | .ucode_api_min = IWL100_UCODE_API_MIN, \ |
Johannes Berg | 2d771cb | 2012-04-09 17:47:00 -0700 | [diff] [blame] | 119 | .device_family = IWL_DEVICE_FAMILY_100, \ |
Emmanuel Grumbach | dae66d0 | 2012-02-07 12:56:26 +0200 | [diff] [blame] | 120 | .max_inst_size = IWLAGN_RTC_INST_SIZE, \ |
| 121 | .max_data_size = IWLAGN_RTC_DATA_SIZE, \ |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 122 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \ |
| 123 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 124 | .base_params = &iwl1000_base_params, \ |
Johannes Berg | 26a7ca9 | 2012-05-21 11:55:54 +0200 | [diff] [blame] | 125 | .eeprom_params = &iwl1000_eeprom_params, \ |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 126 | .led_mode = IWL_LED_RF_STATE, \ |
| 127 | .rx_with_siso_diversity = true |
| 128 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 129 | const struct iwl_cfg iwl100_bgn_cfg = { |
Wey-Yi Guy | 638514f | 2010-11-17 12:13:55 -0800 | [diff] [blame] | 130 | .name = "Intel(R) Centrino(R) Wireless-N 100 BGN", |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 131 | IWL_DEVICE_100, |
Wey-Yi Guy | 7cb1b08 | 2010-10-06 08:10:00 -0700 | [diff] [blame] | 132 | .ht_params = &iwl1000_ht_params, |
Jay Sternberg | 1de19ec | 2010-09-14 15:21:20 -0700 | [diff] [blame] | 133 | }; |
| 134 | |
Johannes Berg | 706c4ff | 2012-03-05 11:24:33 -0800 | [diff] [blame] | 135 | const struct iwl_cfg iwl100_bg_cfg = { |
Wey-Yi Guy | 638514f | 2010-11-17 12:13:55 -0800 | [diff] [blame] | 136 | .name = "Intel(R) Centrino(R) Wireless-N 100 BG", |
Wey-Yi Guy | 65af8de | 2010-12-08 07:51:50 -0800 | [diff] [blame] | 137 | IWL_DEVICE_100, |
Jay Sternberg | 1de19ec | 2010-09-14 15:21:20 -0700 | [diff] [blame] | 138 | }; |
| 139 | |
Meenakshi Venkataraman | 78cbcf2 | 2012-04-22 07:55:27 -0700 | [diff] [blame] | 140 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK)); |
| 141 | MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK)); |