5000.c 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. #include <linux/module.h>
  28. #include <linux/stringify.h>
  29. #include "iwl-config.h"
  30. #include "iwl-agn-hw.h"
  31. /* Highest firmware API version supported */
  32. #define IWL5000_UCODE_API_MAX 5
  33. #define IWL5150_UCODE_API_MAX 2
  34. /* Lowest firmware API version supported */
  35. #define IWL5000_UCODE_API_MIN 1
  36. #define IWL5150_UCODE_API_MIN 1
  37. /* EEPROM versions */
  38. #define EEPROM_5000_TX_POWER_VERSION (4)
  39. #define EEPROM_5000_EEPROM_VERSION (0x11A)
  40. #define EEPROM_5050_TX_POWER_VERSION (4)
  41. #define EEPROM_5050_EEPROM_VERSION (0x21E)
  42. #define IWL5000_FW_PRE "iwlwifi-5000-"
  43. #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
  44. #define IWL5150_FW_PRE "iwlwifi-5150-"
  45. #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
  46. static const struct iwl_base_params iwl5000_base_params = {
  47. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  48. .num_of_queues = IWLAGN_NUM_QUEUES,
  49. .pll_cfg = true,
  50. .led_compensation = 51,
  51. .wd_timeout = IWL_WATCHDOG_DISABLED,
  52. .max_event_log_size = 512,
  53. .scd_chain_ext_wa = true,
  54. };
  55. static const struct iwl_ht_params iwl5000_ht_params = {
  56. .ht_greenfield_support = true,
  57. .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
  58. };
  59. static const struct iwl_eeprom_params iwl5000_eeprom_params = {
  60. .regulatory_bands = {
  61. EEPROM_REG_BAND_1_CHANNELS,
  62. EEPROM_REG_BAND_2_CHANNELS,
  63. EEPROM_REG_BAND_3_CHANNELS,
  64. EEPROM_REG_BAND_4_CHANNELS,
  65. EEPROM_REG_BAND_5_CHANNELS,
  66. EEPROM_REG_BAND_24_HT40_CHANNELS,
  67. EEPROM_REG_BAND_52_HT40_CHANNELS
  68. },
  69. };
  70. #define IWL_DEVICE_5000 \
  71. .fw_name_pre = IWL5000_FW_PRE, \
  72. .ucode_api_max = IWL5000_UCODE_API_MAX, \
  73. .ucode_api_min = IWL5000_UCODE_API_MIN, \
  74. .device_family = IWL_DEVICE_FAMILY_5000, \
  75. .max_inst_size = IWLAGN_RTC_INST_SIZE, \
  76. .max_data_size = IWLAGN_RTC_DATA_SIZE, \
  77. .nvm_ver = EEPROM_5000_EEPROM_VERSION, \
  78. .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
  79. .base_params = &iwl5000_base_params, \
  80. .eeprom_params = &iwl5000_eeprom_params, \
  81. .led_mode = IWL_LED_BLINK, \
  82. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  83. .csr = &iwl_csr_v1
  84. const struct iwl_cfg iwl5300_agn_cfg = {
  85. .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
  86. IWL_DEVICE_5000,
  87. /* at least EEPROM 0x11A has wrong info */
  88. .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
  89. .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
  90. .ht_params = &iwl5000_ht_params,
  91. };
  92. const struct iwl_cfg iwl5100_bgn_cfg = {
  93. .name = "Intel(R) WiFi Link 5100 BGN",
  94. IWL_DEVICE_5000,
  95. .valid_tx_ant = ANT_B, /* .cfg overwrite */
  96. .valid_rx_ant = ANT_AB, /* .cfg overwrite */
  97. .ht_params = &iwl5000_ht_params,
  98. };
  99. const struct iwl_cfg iwl5100_abg_cfg = {
  100. .name = "Intel(R) WiFi Link 5100 ABG",
  101. IWL_DEVICE_5000,
  102. .valid_tx_ant = ANT_B, /* .cfg overwrite */
  103. .valid_rx_ant = ANT_AB, /* .cfg overwrite */
  104. };
  105. const struct iwl_cfg iwl5100_agn_cfg = {
  106. .name = "Intel(R) WiFi Link 5100 AGN",
  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. const struct iwl_cfg iwl5350_agn_cfg = {
  113. .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
  114. .fw_name_pre = IWL5000_FW_PRE,
  115. .ucode_api_max = IWL5000_UCODE_API_MAX,
  116. .ucode_api_min = IWL5000_UCODE_API_MIN,
  117. .device_family = IWL_DEVICE_FAMILY_5000,
  118. .max_inst_size = IWLAGN_RTC_INST_SIZE,
  119. .max_data_size = IWLAGN_RTC_DATA_SIZE,
  120. .nvm_ver = EEPROM_5050_EEPROM_VERSION,
  121. .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  122. .base_params = &iwl5000_base_params,
  123. .eeprom_params = &iwl5000_eeprom_params,
  124. .ht_params = &iwl5000_ht_params,
  125. .led_mode = IWL_LED_BLINK,
  126. .internal_wimax_coex = true,
  127. };
  128. #define IWL_DEVICE_5150 \
  129. .fw_name_pre = IWL5150_FW_PRE, \
  130. .ucode_api_max = IWL5150_UCODE_API_MAX, \
  131. .ucode_api_min = IWL5150_UCODE_API_MIN, \
  132. .device_family = IWL_DEVICE_FAMILY_5150, \
  133. .max_inst_size = IWLAGN_RTC_INST_SIZE, \
  134. .max_data_size = IWLAGN_RTC_DATA_SIZE, \
  135. .nvm_ver = EEPROM_5050_EEPROM_VERSION, \
  136. .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
  137. .base_params = &iwl5000_base_params, \
  138. .eeprom_params = &iwl5000_eeprom_params, \
  139. .led_mode = IWL_LED_BLINK, \
  140. .internal_wimax_coex = true, \
  141. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  142. .csr = &iwl_csr_v1
  143. const struct iwl_cfg iwl5150_agn_cfg = {
  144. .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
  145. IWL_DEVICE_5150,
  146. .ht_params = &iwl5000_ht_params,
  147. };
  148. const struct iwl_cfg iwl5150_abg_cfg = {
  149. .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
  150. IWL_DEVICE_5150,
  151. };
  152. MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
  153. MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));