5000.c 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2012 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. #include "cfg.h"
  32. /* Highest firmware API version supported */
  33. #define IWL5000_UCODE_API_MAX 5
  34. #define IWL5150_UCODE_API_MAX 2
  35. /* Oldest version we won't warn about */
  36. #define IWL5000_UCODE_API_OK 5
  37. #define IWL5150_UCODE_API_OK 2
  38. /* Lowest firmware API version supported */
  39. #define IWL5000_UCODE_API_MIN 1
  40. #define IWL5150_UCODE_API_MIN 1
  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. #define IWL5000_FW_PRE "iwlwifi-5000-"
  47. #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
  48. #define IWL5150_FW_PRE "iwlwifi-5150-"
  49. #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
  50. static const struct iwl_base_params iwl5000_base_params = {
  51. .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
  52. .num_of_queues = IWLAGN_NUM_QUEUES,
  53. .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
  54. .led_compensation = 51,
  55. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
  56. .chain_noise_scale = 1000,
  57. .wd_timeout = IWL_WATCHHDOG_DISABLED,
  58. .max_event_log_size = 512,
  59. .no_idle_support = true,
  60. };
  61. static const struct iwl_ht_params iwl5000_ht_params = {
  62. .ht_greenfield_support = true,
  63. .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
  64. };
  65. #define IWL_DEVICE_5000 \
  66. .fw_name_pre = IWL5000_FW_PRE, \
  67. .ucode_api_max = IWL5000_UCODE_API_MAX, \
  68. .ucode_api_ok = IWL5000_UCODE_API_OK, \
  69. .ucode_api_min = IWL5000_UCODE_API_MIN, \
  70. .device_family = IWL_DEVICE_FAMILY_5000, \
  71. .max_inst_size = IWLAGN_RTC_INST_SIZE, \
  72. .max_data_size = IWLAGN_RTC_DATA_SIZE, \
  73. .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \
  74. .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
  75. .base_params = &iwl5000_base_params, \
  76. .led_mode = IWL_LED_BLINK
  77. const struct iwl_cfg iwl5300_agn_cfg = {
  78. .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
  79. IWL_DEVICE_5000,
  80. /* at least EEPROM 0x11A has wrong info */
  81. .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
  82. .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
  83. .ht_params = &iwl5000_ht_params,
  84. };
  85. const struct iwl_cfg iwl5100_bgn_cfg = {
  86. .name = "Intel(R) WiFi Link 5100 BGN",
  87. IWL_DEVICE_5000,
  88. .valid_tx_ant = ANT_B, /* .cfg overwrite */
  89. .valid_rx_ant = ANT_AB, /* .cfg overwrite */
  90. .ht_params = &iwl5000_ht_params,
  91. };
  92. const struct iwl_cfg iwl5100_abg_cfg = {
  93. .name = "Intel(R) WiFi Link 5100 ABG",
  94. IWL_DEVICE_5000,
  95. .valid_tx_ant = ANT_B, /* .cfg overwrite */
  96. .valid_rx_ant = ANT_AB, /* .cfg overwrite */
  97. };
  98. const struct iwl_cfg iwl5100_agn_cfg = {
  99. .name = "Intel(R) WiFi Link 5100 AGN",
  100. IWL_DEVICE_5000,
  101. .valid_tx_ant = ANT_B, /* .cfg overwrite */
  102. .valid_rx_ant = ANT_AB, /* .cfg overwrite */
  103. .ht_params = &iwl5000_ht_params,
  104. };
  105. const struct iwl_cfg iwl5350_agn_cfg = {
  106. .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
  107. .fw_name_pre = IWL5000_FW_PRE,
  108. .ucode_api_max = IWL5000_UCODE_API_MAX,
  109. .ucode_api_ok = IWL5000_UCODE_API_OK,
  110. .ucode_api_min = IWL5000_UCODE_API_MIN,
  111. .device_family = IWL_DEVICE_FAMILY_5000,
  112. .max_inst_size = IWLAGN_RTC_INST_SIZE,
  113. .max_data_size = IWLAGN_RTC_DATA_SIZE,
  114. .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
  115. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
  116. .base_params = &iwl5000_base_params,
  117. .ht_params = &iwl5000_ht_params,
  118. .led_mode = IWL_LED_BLINK,
  119. .internal_wimax_coex = true,
  120. };
  121. #define IWL_DEVICE_5150 \
  122. .fw_name_pre = IWL5150_FW_PRE, \
  123. .ucode_api_max = IWL5150_UCODE_API_MAX, \
  124. .ucode_api_ok = IWL5150_UCODE_API_OK, \
  125. .ucode_api_min = IWL5150_UCODE_API_MIN, \
  126. .device_family = IWL_DEVICE_FAMILY_5150, \
  127. .max_inst_size = IWLAGN_RTC_INST_SIZE, \
  128. .max_data_size = IWLAGN_RTC_DATA_SIZE, \
  129. .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \
  130. .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
  131. .base_params = &iwl5000_base_params, \
  132. .no_xtal_calib = true, \
  133. .led_mode = IWL_LED_BLINK, \
  134. .internal_wimax_coex = true
  135. const struct iwl_cfg iwl5150_agn_cfg = {
  136. .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
  137. IWL_DEVICE_5150,
  138. .ht_params = &iwl5000_ht_params,
  139. };
  140. const struct iwl_cfg iwl5150_abg_cfg = {
  141. .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
  142. IWL_DEVICE_5150,
  143. };
  144. MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK));
  145. MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK));