1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 4 * Copyright(c) 2018 Intel Corporation 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of version 2 of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 * You should have received a copy of the GNU General Public License along with 16 * this program; if not, write to the Free Software Foundation, Inc., 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 18 * 19 * The full GNU General Public License is included in this distribution in the 20 * file called LICENSE. 21 * 22 * Contact Information: 23 * Intel Linux Wireless <linuxwifi@intel.com> 24 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 25 * 26 *****************************************************************************/ 27 28 #include <linux/module.h> 29 #include <linux/stringify.h> 30 #include "iwl-config.h" 31 #include "iwl-agn-hw.h" 32 33 /* Highest firmware API version supported */ 34 #define IWL5000_UCODE_API_MAX 5 35 #define IWL5150_UCODE_API_MAX 2 36 37 /* Lowest firmware API version supported */ 38 #define IWL5000_UCODE_API_MIN 1 39 #define IWL5150_UCODE_API_MIN 1 40 41 /* EEPROM versions */ 42 #define EEPROM_5000_TX_POWER_VERSION (4) 43 #define EEPROM_5000_EEPROM_VERSION (0x11A) 44 #define EEPROM_5050_TX_POWER_VERSION (4) 45 #define EEPROM_5050_EEPROM_VERSION (0x21E) 46 47 #define IWL5000_FW_PRE "iwlwifi-5000-" 48 #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode" 49 50 #define IWL5150_FW_PRE "iwlwifi-5150-" 51 #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode" 52 53 static const struct iwl_base_params iwl5000_base_params = { 54 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, 55 .num_of_queues = IWLAGN_NUM_QUEUES, 56 .max_tfd_queue_size = 256, 57 .pll_cfg = true, 58 .led_compensation = 51, 59 .wd_timeout = IWL_WATCHDOG_DISABLED, 60 .max_event_log_size = 512, 61 .scd_chain_ext_wa = true, 62 }; 63 64 static const struct iwl_ht_params iwl5000_ht_params = { 65 .ht_greenfield_support = true, 66 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ), 67 }; 68 69 static const struct iwl_eeprom_params iwl5000_eeprom_params = { 70 .regulatory_bands = { 71 EEPROM_REG_BAND_1_CHANNELS, 72 EEPROM_REG_BAND_2_CHANNELS, 73 EEPROM_REG_BAND_3_CHANNELS, 74 EEPROM_REG_BAND_4_CHANNELS, 75 EEPROM_REG_BAND_5_CHANNELS, 76 EEPROM_REG_BAND_24_HT40_CHANNELS, 77 EEPROM_REG_BAND_52_HT40_CHANNELS 78 }, 79 }; 80 81 #define IWL_DEVICE_5000 \ 82 .fw_name_pre = IWL5000_FW_PRE, \ 83 .ucode_api_max = IWL5000_UCODE_API_MAX, \ 84 .ucode_api_min = IWL5000_UCODE_API_MIN, \ 85 .device_family = IWL_DEVICE_FAMILY_5000, \ 86 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 87 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 88 .nvm_ver = EEPROM_5000_EEPROM_VERSION, \ 89 .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \ 90 .base_params = &iwl5000_base_params, \ 91 .eeprom_params = &iwl5000_eeprom_params, \ 92 .led_mode = IWL_LED_BLINK, \ 93 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ 94 .csr = &iwl_csr_v1 95 96 const struct iwl_cfg iwl5300_agn_cfg = { 97 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN", 98 IWL_DEVICE_5000, 99 /* at least EEPROM 0x11A has wrong info */ 100 .valid_tx_ant = ANT_ABC, /* .cfg overwrite */ 101 .valid_rx_ant = ANT_ABC, /* .cfg overwrite */ 102 .ht_params = &iwl5000_ht_params, 103 }; 104 105 const struct iwl_cfg iwl5100_bgn_cfg = { 106 .name = "Intel(R) WiFi Link 5100 BGN", 107 IWL_DEVICE_5000, 108 .valid_tx_ant = ANT_B, /* .cfg overwrite */ 109 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ 110 .ht_params = &iwl5000_ht_params, 111 }; 112 113 const struct iwl_cfg iwl5100_abg_cfg = { 114 .name = "Intel(R) WiFi Link 5100 ABG", 115 IWL_DEVICE_5000, 116 .valid_tx_ant = ANT_B, /* .cfg overwrite */ 117 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ 118 }; 119 120 const struct iwl_cfg iwl5100_agn_cfg = { 121 .name = "Intel(R) WiFi Link 5100 AGN", 122 IWL_DEVICE_5000, 123 .valid_tx_ant = ANT_B, /* .cfg overwrite */ 124 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ 125 .ht_params = &iwl5000_ht_params, 126 }; 127 128 const struct iwl_cfg iwl5350_agn_cfg = { 129 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", 130 .fw_name_pre = IWL5000_FW_PRE, 131 .ucode_api_max = IWL5000_UCODE_API_MAX, 132 .ucode_api_min = IWL5000_UCODE_API_MIN, 133 .device_family = IWL_DEVICE_FAMILY_5000, 134 .max_inst_size = IWLAGN_RTC_INST_SIZE, 135 .max_data_size = IWLAGN_RTC_DATA_SIZE, 136 .nvm_ver = EEPROM_5050_EEPROM_VERSION, 137 .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, 138 .base_params = &iwl5000_base_params, 139 .eeprom_params = &iwl5000_eeprom_params, 140 .ht_params = &iwl5000_ht_params, 141 .led_mode = IWL_LED_BLINK, 142 .internal_wimax_coex = true, 143 }; 144 145 #define IWL_DEVICE_5150 \ 146 .fw_name_pre = IWL5150_FW_PRE, \ 147 .ucode_api_max = IWL5150_UCODE_API_MAX, \ 148 .ucode_api_min = IWL5150_UCODE_API_MIN, \ 149 .device_family = IWL_DEVICE_FAMILY_5150, \ 150 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 151 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 152 .nvm_ver = EEPROM_5050_EEPROM_VERSION, \ 153 .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \ 154 .base_params = &iwl5000_base_params, \ 155 .eeprom_params = &iwl5000_eeprom_params, \ 156 .led_mode = IWL_LED_BLINK, \ 157 .internal_wimax_coex = true, \ 158 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ 159 .csr = &iwl_csr_v1 160 161 const struct iwl_cfg iwl5150_agn_cfg = { 162 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN", 163 IWL_DEVICE_5150, 164 .ht_params = &iwl5000_ht_params, 165 166 }; 167 168 const struct iwl_cfg iwl5150_abg_cfg = { 169 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG", 170 IWL_DEVICE_5150, 171 }; 172 173 MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); 174 MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX)); 175