Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /******************************************************************************
0003  *
0004  * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
0005  * Copyright(c) 2018 - 2020 Intel Corporation
0006  *****************************************************************************/
0007 
0008 #include <linux/module.h>
0009 #include <linux/stringify.h>
0010 #include "iwl-config.h"
0011 #include "iwl-agn-hw.h"
0012 #include "dvm/commands.h" /* needed for BT for now */
0013 
0014 /* Highest firmware API version supported */
0015 #define IWL2030_UCODE_API_MAX 6
0016 #define IWL2000_UCODE_API_MAX 6
0017 #define IWL105_UCODE_API_MAX 6
0018 #define IWL135_UCODE_API_MAX 6
0019 
0020 /* Lowest firmware API version supported */
0021 #define IWL2030_UCODE_API_MIN 5
0022 #define IWL2000_UCODE_API_MIN 5
0023 #define IWL105_UCODE_API_MIN 5
0024 #define IWL135_UCODE_API_MIN 5
0025 
0026 /* EEPROM version */
0027 #define EEPROM_2000_TX_POWER_VERSION    (6)
0028 #define EEPROM_2000_EEPROM_VERSION  (0x805)
0029 
0030 
0031 #define IWL2030_FW_PRE "iwlwifi-2030-"
0032 #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
0033 
0034 #define IWL2000_FW_PRE "iwlwifi-2000-"
0035 #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
0036 
0037 #define IWL105_FW_PRE "iwlwifi-105-"
0038 #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
0039 
0040 #define IWL135_FW_PRE "iwlwifi-135-"
0041 #define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
0042 
0043 static const struct iwl_base_params iwl2000_base_params = {
0044     .eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
0045     .num_of_queues = IWLAGN_NUM_QUEUES,
0046     .max_tfd_queue_size = 256,
0047     .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
0048     .shadow_ram_support = true,
0049     .led_compensation = 51,
0050     .wd_timeout = IWL_DEF_WD_TIMEOUT,
0051     .max_event_log_size = 512,
0052     .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
0053     .scd_chain_ext_wa = true,
0054 };
0055 
0056 
0057 static const struct iwl_base_params iwl2030_base_params = {
0058     .eeprom_size = OTP_LOW_IMAGE_SIZE_2K,
0059     .num_of_queues = IWLAGN_NUM_QUEUES,
0060     .max_tfd_queue_size = 256,
0061     .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
0062     .shadow_ram_support = true,
0063     .led_compensation = 57,
0064     .wd_timeout = IWL_LONG_WD_TIMEOUT,
0065     .max_event_log_size = 512,
0066     .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
0067     .scd_chain_ext_wa = true,
0068 };
0069 
0070 static const struct iwl_ht_params iwl2000_ht_params = {
0071     .ht_greenfield_support = true,
0072     .use_rts_for_aggregation = true, /* use rts/cts protection */
0073     .ht40_bands = BIT(NL80211_BAND_2GHZ),
0074 };
0075 
0076 static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
0077     .regulatory_bands = {
0078         EEPROM_REG_BAND_1_CHANNELS,
0079         EEPROM_REG_BAND_2_CHANNELS,
0080         EEPROM_REG_BAND_3_CHANNELS,
0081         EEPROM_REG_BAND_4_CHANNELS,
0082         EEPROM_REG_BAND_5_CHANNELS,
0083         EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
0084         EEPROM_REGULATORY_BAND_NO_HT40,
0085     },
0086     .enhanced_txpower = true,
0087 };
0088 
0089 #define IWL_DEVICE_2000                     \
0090     .fw_name_pre = IWL2000_FW_PRE,              \
0091     .ucode_api_max = IWL2000_UCODE_API_MAX,         \
0092     .ucode_api_min = IWL2000_UCODE_API_MIN,         \
0093     .trans.device_family = IWL_DEVICE_FAMILY_2000,      \
0094     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0095     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0096     .nvm_ver = EEPROM_2000_EEPROM_VERSION,          \
0097     .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION,      \
0098     .trans.base_params = &iwl2000_base_params,      \
0099     .eeprom_params = &iwl20x0_eeprom_params,        \
0100     .led_mode = IWL_LED_RF_STATE
0101 
0102 
0103 const struct iwl_cfg iwl2000_2bgn_cfg = {
0104     .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
0105     IWL_DEVICE_2000,
0106     .ht_params = &iwl2000_ht_params,
0107 };
0108 
0109 const struct iwl_cfg iwl2000_2bgn_d_cfg = {
0110     .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
0111     IWL_DEVICE_2000,
0112     .ht_params = &iwl2000_ht_params,
0113 };
0114 
0115 #define IWL_DEVICE_2030                     \
0116     .fw_name_pre = IWL2030_FW_PRE,              \
0117     .ucode_api_max = IWL2030_UCODE_API_MAX,         \
0118     .ucode_api_min = IWL2030_UCODE_API_MIN,         \
0119     .trans.device_family = IWL_DEVICE_FAMILY_2030,      \
0120     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0121     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0122     .nvm_ver = EEPROM_2000_EEPROM_VERSION,      \
0123     .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION,  \
0124     .trans.base_params = &iwl2030_base_params,      \
0125     .eeprom_params = &iwl20x0_eeprom_params,        \
0126     .led_mode = IWL_LED_RF_STATE
0127 
0128 const struct iwl_cfg iwl2030_2bgn_cfg = {
0129     .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
0130     IWL_DEVICE_2030,
0131     .ht_params = &iwl2000_ht_params,
0132 };
0133 
0134 #define IWL_DEVICE_105                      \
0135     .fw_name_pre = IWL105_FW_PRE,               \
0136     .ucode_api_max = IWL105_UCODE_API_MAX,          \
0137     .ucode_api_min = IWL105_UCODE_API_MIN,          \
0138     .trans.device_family = IWL_DEVICE_FAMILY_105,       \
0139     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0140     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0141     .nvm_ver = EEPROM_2000_EEPROM_VERSION,      \
0142     .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION,  \
0143     .trans.base_params = &iwl2000_base_params,      \
0144     .eeprom_params = &iwl20x0_eeprom_params,        \
0145     .led_mode = IWL_LED_RF_STATE,               \
0146     .rx_with_siso_diversity = true
0147 
0148 const struct iwl_cfg iwl105_bgn_cfg = {
0149     .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
0150     IWL_DEVICE_105,
0151     .ht_params = &iwl2000_ht_params,
0152 };
0153 
0154 const struct iwl_cfg iwl105_bgn_d_cfg = {
0155     .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
0156     IWL_DEVICE_105,
0157     .ht_params = &iwl2000_ht_params,
0158 };
0159 
0160 #define IWL_DEVICE_135                      \
0161     .fw_name_pre = IWL135_FW_PRE,               \
0162     .ucode_api_max = IWL135_UCODE_API_MAX,          \
0163     .ucode_api_min = IWL135_UCODE_API_MIN,          \
0164     .trans.device_family = IWL_DEVICE_FAMILY_135,       \
0165     .max_inst_size = IWL60_RTC_INST_SIZE,           \
0166     .max_data_size = IWL60_RTC_DATA_SIZE,           \
0167     .nvm_ver = EEPROM_2000_EEPROM_VERSION,      \
0168     .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION,  \
0169     .trans.base_params = &iwl2030_base_params,      \
0170     .eeprom_params = &iwl20x0_eeprom_params,        \
0171     .led_mode = IWL_LED_RF_STATE,               \
0172     .rx_with_siso_diversity = true
0173 
0174 const struct iwl_cfg iwl135_bgn_cfg = {
0175     .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
0176     IWL_DEVICE_135,
0177     .ht_params = &iwl2000_ht_params,
0178 };
0179 
0180 MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX));
0181 MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX));
0182 MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX));
0183 MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX));