iwl-5000.c 5.2 KB

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