iwl-5000.c 5.8 KB

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