2000.c 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 2013 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 "cfg.h"
  31. #include "dvm/commands.h" /* needed for BT for now */
  32. /* Highest firmware API version supported */
  33. #define IWL2030_UCODE_API_MAX 6
  34. #define IWL2000_UCODE_API_MAX 6
  35. #define IWL105_UCODE_API_MAX 6
  36. #define IWL135_UCODE_API_MAX 6
  37. /* Oldest version we won't warn about */
  38. #define IWL2030_UCODE_API_OK 6
  39. #define IWL2000_UCODE_API_OK 6
  40. #define IWL105_UCODE_API_OK 6
  41. #define IWL135_UCODE_API_OK 6
  42. /* Lowest firmware API version supported */
  43. #define IWL2030_UCODE_API_MIN 5
  44. #define IWL2000_UCODE_API_MIN 5
  45. #define IWL105_UCODE_API_MIN 5
  46. #define IWL135_UCODE_API_MIN 5
  47. /* EEPROM version */
  48. #define EEPROM_2000_TX_POWER_VERSION (6)
  49. #define EEPROM_2000_EEPROM_VERSION (0x805)
  50. #define IWL2030_FW_PRE "iwlwifi-2030-"
  51. #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
  52. #define IWL2000_FW_PRE "iwlwifi-2000-"
  53. #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
  54. #define IWL105_FW_PRE "iwlwifi-105-"
  55. #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
  56. #define IWL135_FW_PRE "iwlwifi-135-"
  57. #define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
  58. static const struct iwl_base_params iwl2000_base_params = {
  59. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  60. .num_of_queues = IWLAGN_NUM_QUEUES,
  61. .pll_cfg_val = 0,
  62. .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
  63. .shadow_ram_support = true,
  64. .led_compensation = 51,
  65. .adv_thermal_throttle = true,
  66. .support_ct_kill_exit = true,
  67. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  68. .chain_noise_scale = 1000,
  69. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  70. .max_event_log_size = 512,
  71. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  72. .hd_v2 = true,
  73. };
  74. static const struct iwl_base_params iwl2030_base_params = {
  75. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  76. .num_of_queues = IWLAGN_NUM_QUEUES,
  77. .pll_cfg_val = 0,
  78. .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
  79. .shadow_ram_support = true,
  80. .led_compensation = 57,
  81. .adv_thermal_throttle = true,
  82. .support_ct_kill_exit = true,
  83. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  84. .chain_noise_scale = 1000,
  85. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  86. .max_event_log_size = 512,
  87. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  88. .hd_v2 = true,
  89. };
  90. static const struct iwl_ht_params iwl2000_ht_params = {
  91. .ht_greenfield_support = true,
  92. .use_rts_for_aggregation = true, /* use rts/cts protection */
  93. .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
  94. };
  95. static const struct iwl_bt_params iwl2030_bt_params = {
  96. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  97. .advanced_bt_coexist = true,
  98. .agg_time_limit = BT_AGG_THRESHOLD_DEF,
  99. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  100. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT32,
  101. .bt_sco_disable = true,
  102. .bt_session_2 = true,
  103. };
  104. static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
  105. .regulatory_bands = {
  106. EEPROM_REG_BAND_1_CHANNELS,
  107. EEPROM_REG_BAND_2_CHANNELS,
  108. EEPROM_REG_BAND_3_CHANNELS,
  109. EEPROM_REG_BAND_4_CHANNELS,
  110. EEPROM_REG_BAND_5_CHANNELS,
  111. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  112. EEPROM_REGULATORY_BAND_NO_HT40,
  113. },
  114. .enhanced_txpower = true,
  115. };
  116. #define IWL_DEVICE_2000 \
  117. .fw_name_pre = IWL2000_FW_PRE, \
  118. .ucode_api_max = IWL2000_UCODE_API_MAX, \
  119. .ucode_api_ok = IWL2000_UCODE_API_OK, \
  120. .ucode_api_min = IWL2000_UCODE_API_MIN, \
  121. .device_family = IWL_DEVICE_FAMILY_2000, \
  122. .max_inst_size = IWL60_RTC_INST_SIZE, \
  123. .max_data_size = IWL60_RTC_DATA_SIZE, \
  124. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  125. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  126. .base_params = &iwl2000_base_params, \
  127. .eeprom_params = &iwl20x0_eeprom_params, \
  128. .need_temp_offset_calib = true, \
  129. .temp_offset_v2 = true, \
  130. .led_mode = IWL_LED_RF_STATE
  131. const struct iwl_cfg iwl2000_2bgn_cfg = {
  132. .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
  133. IWL_DEVICE_2000,
  134. .ht_params = &iwl2000_ht_params,
  135. };
  136. const struct iwl_cfg iwl2000_2bgn_d_cfg = {
  137. .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
  138. IWL_DEVICE_2000,
  139. .ht_params = &iwl2000_ht_params,
  140. };
  141. #define IWL_DEVICE_2030 \
  142. .fw_name_pre = IWL2030_FW_PRE, \
  143. .ucode_api_max = IWL2030_UCODE_API_MAX, \
  144. .ucode_api_ok = IWL2030_UCODE_API_OK, \
  145. .ucode_api_min = IWL2030_UCODE_API_MIN, \
  146. .device_family = IWL_DEVICE_FAMILY_2030, \
  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 = &iwl2030_base_params, \
  152. .bt_params = &iwl2030_bt_params, \
  153. .eeprom_params = &iwl20x0_eeprom_params, \
  154. .need_temp_offset_calib = true, \
  155. .temp_offset_v2 = true, \
  156. .led_mode = IWL_LED_RF_STATE, \
  157. .adv_pm = true
  158. const struct iwl_cfg iwl2030_2bgn_cfg = {
  159. .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
  160. IWL_DEVICE_2030,
  161. .ht_params = &iwl2000_ht_params,
  162. };
  163. #define IWL_DEVICE_105 \
  164. .fw_name_pre = IWL105_FW_PRE, \
  165. .ucode_api_max = IWL105_UCODE_API_MAX, \
  166. .ucode_api_ok = IWL105_UCODE_API_OK, \
  167. .ucode_api_min = IWL105_UCODE_API_MIN, \
  168. .device_family = IWL_DEVICE_FAMILY_105, \
  169. .max_inst_size = IWL60_RTC_INST_SIZE, \
  170. .max_data_size = IWL60_RTC_DATA_SIZE, \
  171. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  172. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  173. .base_params = &iwl2000_base_params, \
  174. .eeprom_params = &iwl20x0_eeprom_params, \
  175. .need_temp_offset_calib = true, \
  176. .temp_offset_v2 = true, \
  177. .led_mode = IWL_LED_RF_STATE, \
  178. .adv_pm = true, \
  179. .rx_with_siso_diversity = true
  180. const struct iwl_cfg iwl105_bgn_cfg = {
  181. .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
  182. IWL_DEVICE_105,
  183. .ht_params = &iwl2000_ht_params,
  184. };
  185. const struct iwl_cfg iwl105_bgn_d_cfg = {
  186. .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
  187. IWL_DEVICE_105,
  188. .ht_params = &iwl2000_ht_params,
  189. };
  190. #define IWL_DEVICE_135 \
  191. .fw_name_pre = IWL135_FW_PRE, \
  192. .ucode_api_max = IWL135_UCODE_API_MAX, \
  193. .ucode_api_ok = IWL135_UCODE_API_OK, \
  194. .ucode_api_min = IWL135_UCODE_API_MIN, \
  195. .device_family = IWL_DEVICE_FAMILY_135, \
  196. .max_inst_size = IWL60_RTC_INST_SIZE, \
  197. .max_data_size = IWL60_RTC_DATA_SIZE, \
  198. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  199. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  200. .base_params = &iwl2030_base_params, \
  201. .bt_params = &iwl2030_bt_params, \
  202. .eeprom_params = &iwl20x0_eeprom_params, \
  203. .need_temp_offset_calib = true, \
  204. .temp_offset_v2 = true, \
  205. .led_mode = IWL_LED_RF_STATE, \
  206. .adv_pm = true, \
  207. .rx_with_siso_diversity = true
  208. const struct iwl_cfg iwl135_bgn_cfg = {
  209. .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
  210. IWL_DEVICE_135,
  211. .ht_params = &iwl2000_ht_params,
  212. };
  213. MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
  214. MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
  215. MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
  216. MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));