iwl-2000.c 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 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 <linuxwifi@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 "dvm/commands.h" /* needed for BT for now */
  31. /* Highest firmware API version supported */
  32. #define IWL2030_UCODE_API_MAX 6
  33. #define IWL2000_UCODE_API_MAX 6
  34. #define IWL105_UCODE_API_MAX 6
  35. #define IWL135_UCODE_API_MAX 6
  36. /* Lowest firmware API version supported */
  37. #define IWL2030_UCODE_API_MIN 5
  38. #define IWL2000_UCODE_API_MIN 5
  39. #define IWL105_UCODE_API_MIN 5
  40. #define IWL135_UCODE_API_MIN 5
  41. /* EEPROM version */
  42. #define EEPROM_2000_TX_POWER_VERSION (6)
  43. #define EEPROM_2000_EEPROM_VERSION (0x805)
  44. #define IWL2030_FW_PRE "iwlwifi-2030-"
  45. #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
  46. #define IWL2000_FW_PRE "iwlwifi-2000-"
  47. #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
  48. #define IWL105_FW_PRE "iwlwifi-105-"
  49. #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
  50. #define IWL135_FW_PRE "iwlwifi-135-"
  51. #define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
  52. static const struct iwl_base_params iwl2000_base_params = {
  53. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  54. .num_of_queues = IWLAGN_NUM_QUEUES,
  55. .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
  56. .shadow_ram_support = true,
  57. .led_compensation = 51,
  58. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  59. .max_event_log_size = 512,
  60. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  61. .scd_chain_ext_wa = true,
  62. };
  63. static const struct iwl_base_params iwl2030_base_params = {
  64. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  65. .num_of_queues = IWLAGN_NUM_QUEUES,
  66. .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
  67. .shadow_ram_support = true,
  68. .led_compensation = 57,
  69. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  70. .max_event_log_size = 512,
  71. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  72. .scd_chain_ext_wa = true,
  73. };
  74. static const struct iwl_ht_params iwl2000_ht_params = {
  75. .ht_greenfield_support = true,
  76. .use_rts_for_aggregation = true, /* use rts/cts protection */
  77. .ht40_bands = BIT(NL80211_BAND_2GHZ),
  78. };
  79. static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
  80. .regulatory_bands = {
  81. EEPROM_REG_BAND_1_CHANNELS,
  82. EEPROM_REG_BAND_2_CHANNELS,
  83. EEPROM_REG_BAND_3_CHANNELS,
  84. EEPROM_REG_BAND_4_CHANNELS,
  85. EEPROM_REG_BAND_5_CHANNELS,
  86. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  87. EEPROM_REGULATORY_BAND_NO_HT40,
  88. },
  89. .enhanced_txpower = true,
  90. };
  91. #define IWL_DEVICE_2000 \
  92. .fw_name_pre = IWL2000_FW_PRE, \
  93. .ucode_api_max = IWL2000_UCODE_API_MAX, \
  94. .ucode_api_min = IWL2000_UCODE_API_MIN, \
  95. .device_family = IWL_DEVICE_FAMILY_2000, \
  96. .max_inst_size = IWL60_RTC_INST_SIZE, \
  97. .max_data_size = IWL60_RTC_DATA_SIZE, \
  98. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  99. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  100. .base_params = &iwl2000_base_params, \
  101. .eeprom_params = &iwl20x0_eeprom_params, \
  102. .led_mode = IWL_LED_RF_STATE, \
  103. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  104. const struct iwl_cfg iwl2000_2bgn_cfg = {
  105. .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
  106. IWL_DEVICE_2000,
  107. .ht_params = &iwl2000_ht_params,
  108. };
  109. const struct iwl_cfg iwl2000_2bgn_d_cfg = {
  110. .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
  111. IWL_DEVICE_2000,
  112. .ht_params = &iwl2000_ht_params,
  113. };
  114. #define IWL_DEVICE_2030 \
  115. .fw_name_pre = IWL2030_FW_PRE, \
  116. .ucode_api_max = IWL2030_UCODE_API_MAX, \
  117. .ucode_api_min = IWL2030_UCODE_API_MIN, \
  118. .device_family = IWL_DEVICE_FAMILY_2030, \
  119. .max_inst_size = IWL60_RTC_INST_SIZE, \
  120. .max_data_size = IWL60_RTC_DATA_SIZE, \
  121. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  122. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  123. .base_params = &iwl2030_base_params, \
  124. .eeprom_params = &iwl20x0_eeprom_params, \
  125. .led_mode = IWL_LED_RF_STATE, \
  126. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  127. const struct iwl_cfg iwl2030_2bgn_cfg = {
  128. .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
  129. IWL_DEVICE_2030,
  130. .ht_params = &iwl2000_ht_params,
  131. };
  132. #define IWL_DEVICE_105 \
  133. .fw_name_pre = IWL105_FW_PRE, \
  134. .ucode_api_max = IWL105_UCODE_API_MAX, \
  135. .ucode_api_min = IWL105_UCODE_API_MIN, \
  136. .device_family = IWL_DEVICE_FAMILY_105, \
  137. .max_inst_size = IWL60_RTC_INST_SIZE, \
  138. .max_data_size = IWL60_RTC_DATA_SIZE, \
  139. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  140. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  141. .base_params = &iwl2000_base_params, \
  142. .eeprom_params = &iwl20x0_eeprom_params, \
  143. .led_mode = IWL_LED_RF_STATE, \
  144. .rx_with_siso_diversity = true, \
  145. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  146. const struct iwl_cfg iwl105_bgn_cfg = {
  147. .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
  148. IWL_DEVICE_105,
  149. .ht_params = &iwl2000_ht_params,
  150. };
  151. const struct iwl_cfg iwl105_bgn_d_cfg = {
  152. .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
  153. IWL_DEVICE_105,
  154. .ht_params = &iwl2000_ht_params,
  155. };
  156. #define IWL_DEVICE_135 \
  157. .fw_name_pre = IWL135_FW_PRE, \
  158. .ucode_api_max = IWL135_UCODE_API_MAX, \
  159. .ucode_api_min = IWL135_UCODE_API_MIN, \
  160. .device_family = IWL_DEVICE_FAMILY_135, \
  161. .max_inst_size = IWL60_RTC_INST_SIZE, \
  162. .max_data_size = IWL60_RTC_DATA_SIZE, \
  163. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  164. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  165. .base_params = &iwl2030_base_params, \
  166. .eeprom_params = &iwl20x0_eeprom_params, \
  167. .led_mode = IWL_LED_RF_STATE, \
  168. .rx_with_siso_diversity = true, \
  169. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  170. const struct iwl_cfg iwl135_bgn_cfg = {
  171. .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
  172. IWL_DEVICE_135,
  173. .ht_params = &iwl2000_ht_params,
  174. };
  175. MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX));
  176. MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX));
  177. MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX));
  178. MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX));