1 // SPDX-License-Identifier: GPL-2.0-only 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 5 * Copyright(c) 2018 - 2020, 2023, 2025 Intel Corporation 6 *****************************************************************************/ 7 8 #include <linux/module.h> 9 #include <linux/stringify.h> 10 #include "iwl-config.h" 11 #include "iwl-agn-hw.h" 12 13 /* Highest firmware API version supported */ 14 #define IWL5000_UCODE_API_MAX 5 15 #define IWL5150_UCODE_API_MAX 2 16 17 /* Lowest firmware API version supported */ 18 #define IWL5000_UCODE_API_MIN 1 19 #define IWL5150_UCODE_API_MIN 1 20 21 /* EEPROM versions */ 22 #define EEPROM_5000_TX_POWER_VERSION (4) 23 #define EEPROM_5000_EEPROM_VERSION (0x11A) 24 #define EEPROM_5050_TX_POWER_VERSION (4) 25 #define EEPROM_5050_EEPROM_VERSION (0x21E) 26 27 #define IWL5000_FW_PRE "iwlwifi-5000" 28 #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE "-" __stringify(api) ".ucode" 29 30 #define IWL5150_FW_PRE "iwlwifi-5150" 31 #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE "-" __stringify(api) ".ucode" 32 33 static const struct iwl_base_params iwl5000_base_params = { 34 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, 35 .num_of_queues = IWLAGN_NUM_QUEUES, 36 .max_tfd_queue_size = 256, 37 .pll_cfg = true, 38 .led_compensation = 51, 39 .wd_timeout = IWL_WATCHDOG_DISABLED, 40 .max_event_log_size = 512, 41 .scd_chain_ext_wa = true, 42 }; 43 44 static const struct iwl_ht_params iwl5000_ht_params = { 45 .ht_greenfield_support = true, 46 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ), 47 }; 48 49 static const struct iwl_eeprom_params iwl5000_eeprom_params = { 50 .regulatory_bands = { 51 EEPROM_REG_BAND_1_CHANNELS, 52 EEPROM_REG_BAND_2_CHANNELS, 53 EEPROM_REG_BAND_3_CHANNELS, 54 EEPROM_REG_BAND_4_CHANNELS, 55 EEPROM_REG_BAND_5_CHANNELS, 56 EEPROM_REG_BAND_24_HT40_CHANNELS, 57 EEPROM_REG_BAND_52_HT40_CHANNELS 58 }, 59 }; 60 61 const struct iwl_cfg_trans_params iwl5000_trans_cfg = { 62 .device_family = IWL_DEVICE_FAMILY_5000, 63 .base_params = &iwl5000_base_params, 64 }; 65 66 #define IWL_DEVICE_5000 \ 67 .fw_name_pre = IWL5000_FW_PRE, \ 68 .ucode_api_max = IWL5000_UCODE_API_MAX, \ 69 .ucode_api_min = IWL5000_UCODE_API_MIN, \ 70 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 71 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 72 .nvm_ver = EEPROM_5000_EEPROM_VERSION, \ 73 .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \ 74 .eeprom_params = &iwl5000_eeprom_params, \ 75 .led_mode = IWL_LED_BLINK 76 77 const struct iwl_cfg iwl5300_agn_cfg = { 78 IWL_DEVICE_5000, 79 /* at least EEPROM 0x11A has wrong info */ 80 .valid_tx_ant = ANT_ABC, /* .cfg overwrite */ 81 .valid_rx_ant = ANT_ABC, /* .cfg overwrite */ 82 .ht_params = &iwl5000_ht_params, 83 }; 84 85 const char iwl5300_agn_name[] = "Intel(R) Ultimate N WiFi Link 5300 AGN"; 86 87 const struct iwl_cfg iwl5100_n_cfg = { 88 IWL_DEVICE_5000, 89 .valid_tx_ant = ANT_B, /* .cfg overwrite */ 90 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ 91 .ht_params = &iwl5000_ht_params, 92 }; 93 94 const char iwl5100_bgn_name[] = "Intel(R) WiFi Link 5100 BGN"; 95 96 const struct iwl_cfg iwl5100_abg_cfg = { 97 IWL_DEVICE_5000, 98 .valid_tx_ant = ANT_B, /* .cfg overwrite */ 99 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ 100 }; 101 102 const char iwl5100_abg_name[] = "Intel(R) WiFi Link 5100 ABG"; 103 const char iwl5100_agn_name[] = "Intel(R) WiFi Link 5100 AGN"; 104 105 const struct iwl_cfg iwl5350_agn_cfg = { 106 .fw_name_pre = IWL5000_FW_PRE, 107 .ucode_api_max = IWL5000_UCODE_API_MAX, 108 .ucode_api_min = IWL5000_UCODE_API_MIN, 109 .max_inst_size = IWLAGN_RTC_INST_SIZE, 110 .max_data_size = IWLAGN_RTC_DATA_SIZE, 111 .nvm_ver = EEPROM_5050_EEPROM_VERSION, 112 .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, 113 .eeprom_params = &iwl5000_eeprom_params, 114 .ht_params = &iwl5000_ht_params, 115 .led_mode = IWL_LED_BLINK, 116 .internal_wimax_coex = true, 117 }; 118 119 const char iwl5350_agn_name[] = "Intel(R) WiMAX/WiFi Link 5350 AGN"; 120 121 const struct iwl_cfg_trans_params iwl5150_trans_cfg = { 122 .device_family = IWL_DEVICE_FAMILY_5150, 123 .base_params = &iwl5000_base_params, 124 }; 125 126 #define IWL_DEVICE_5150 \ 127 .fw_name_pre = IWL5150_FW_PRE, \ 128 .ucode_api_max = IWL5150_UCODE_API_MAX, \ 129 .ucode_api_min = IWL5150_UCODE_API_MIN, \ 130 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 131 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 132 .nvm_ver = EEPROM_5050_EEPROM_VERSION, \ 133 .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \ 134 .eeprom_params = &iwl5000_eeprom_params, \ 135 .led_mode = IWL_LED_BLINK, \ 136 .internal_wimax_coex = true 137 138 const struct iwl_cfg iwl5150_agn_cfg = { 139 IWL_DEVICE_5150, 140 .ht_params = &iwl5000_ht_params, 141 142 }; 143 144 const char iwl5150_agn_name[] = "Intel(R) WiMAX/WiFi Link 5150 AGN"; 145 146 const struct iwl_cfg iwl5150_abg_cfg = { 147 IWL_DEVICE_5150, 148 }; 149 150 const char iwl5150_abg_name[] = "Intel(R) WiMAX/WiFi Link 5150 ABG"; 151 152 MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); 153 MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX)); 154