iwl-2000.c 7.2 KB

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