iwl-2000.c 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 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-dev.h" /* still needed */
  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 5
  38. #define IWL2000_UCODE_API_OK 5
  39. #define IWL105_UCODE_API_OK 5
  40. #define IWL135_UCODE_API_OK 5
  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. #define IWL2030_FW_PRE "iwlwifi-2030-"
  47. #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
  48. #define IWL2000_FW_PRE "iwlwifi-2000-"
  49. #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
  50. #define IWL105_FW_PRE "iwlwifi-105-"
  51. #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
  52. #define IWL135_FW_PRE "iwlwifi-135-"
  53. #define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
  54. static const struct iwl_base_params iwl2000_base_params = {
  55. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  56. .num_of_queues = IWLAGN_NUM_QUEUES,
  57. .pll_cfg_val = 0,
  58. .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
  59. .shadow_ram_support = true,
  60. .led_compensation = 51,
  61. .adv_thermal_throttle = true,
  62. .support_ct_kill_exit = true,
  63. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  64. .chain_noise_scale = 1000,
  65. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  66. .max_event_log_size = 512,
  67. .shadow_reg_enable = true,
  68. .hd_v2 = true,
  69. };
  70. static const struct iwl_base_params iwl2030_base_params = {
  71. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  72. .num_of_queues = IWLAGN_NUM_QUEUES,
  73. .pll_cfg_val = 0,
  74. .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
  75. .shadow_ram_support = true,
  76. .led_compensation = 57,
  77. .adv_thermal_throttle = true,
  78. .support_ct_kill_exit = true,
  79. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  80. .chain_noise_scale = 1000,
  81. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  82. .max_event_log_size = 512,
  83. .shadow_reg_enable = true,
  84. .hd_v2 = true,
  85. };
  86. static const struct iwl_ht_params iwl2000_ht_params = {
  87. .ht_greenfield_support = true,
  88. .use_rts_for_aggregation = true, /* use rts/cts protection */
  89. };
  90. static const struct iwl_bt_params iwl2030_bt_params = {
  91. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  92. .advanced_bt_coexist = true,
  93. .agg_time_limit = BT_AGG_THRESHOLD_DEF,
  94. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  95. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
  96. .bt_sco_disable = true,
  97. .bt_session_2 = true,
  98. };
  99. #define IWL_DEVICE_2000 \
  100. .fw_name_pre = IWL2000_FW_PRE, \
  101. .ucode_api_max = IWL2000_UCODE_API_MAX, \
  102. .ucode_api_ok = IWL2000_UCODE_API_OK, \
  103. .ucode_api_min = IWL2000_UCODE_API_MIN, \
  104. .device_family = IWL_DEVICE_FAMILY_2000, \
  105. .max_inst_size = IWL60_RTC_INST_SIZE, \
  106. .max_data_size = IWL60_RTC_DATA_SIZE, \
  107. .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
  108. .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  109. .base_params = &iwl2000_base_params, \
  110. .need_temp_offset_calib = true, \
  111. .temp_offset_v2 = true, \
  112. .led_mode = IWL_LED_RF_STATE
  113. const struct iwl_cfg iwl2000_2bgn_cfg = {
  114. .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
  115. IWL_DEVICE_2000,
  116. .ht_params = &iwl2000_ht_params,
  117. };
  118. const struct iwl_cfg iwl2000_2bgn_d_cfg = {
  119. .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
  120. IWL_DEVICE_2000,
  121. .ht_params = &iwl2000_ht_params,
  122. };
  123. #define IWL_DEVICE_2030 \
  124. .fw_name_pre = IWL2030_FW_PRE, \
  125. .ucode_api_max = IWL2030_UCODE_API_MAX, \
  126. .ucode_api_ok = IWL2030_UCODE_API_OK, \
  127. .ucode_api_min = IWL2030_UCODE_API_MIN, \
  128. .device_family = IWL_DEVICE_FAMILY_2030, \
  129. .max_inst_size = IWL60_RTC_INST_SIZE, \
  130. .max_data_size = IWL60_RTC_DATA_SIZE, \
  131. .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
  132. .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  133. .base_params = &iwl2030_base_params, \
  134. .bt_params = &iwl2030_bt_params, \
  135. .need_temp_offset_calib = true, \
  136. .temp_offset_v2 = true, \
  137. .led_mode = IWL_LED_RF_STATE, \
  138. .adv_pm = true
  139. const struct iwl_cfg iwl2030_2bgn_cfg = {
  140. .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
  141. IWL_DEVICE_2030,
  142. .ht_params = &iwl2000_ht_params,
  143. };
  144. #define IWL_DEVICE_105 \
  145. .fw_name_pre = IWL105_FW_PRE, \
  146. .ucode_api_max = IWL105_UCODE_API_MAX, \
  147. .ucode_api_ok = IWL105_UCODE_API_OK, \
  148. .ucode_api_min = IWL105_UCODE_API_MIN, \
  149. .device_family = IWL_DEVICE_FAMILY_105, \
  150. .max_inst_size = IWL60_RTC_INST_SIZE, \
  151. .max_data_size = IWL60_RTC_DATA_SIZE, \
  152. .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
  153. .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  154. .base_params = &iwl2000_base_params, \
  155. .need_temp_offset_calib = true, \
  156. .temp_offset_v2 = true, \
  157. .led_mode = IWL_LED_RF_STATE, \
  158. .adv_pm = true, \
  159. .rx_with_siso_diversity = true
  160. const struct iwl_cfg iwl105_bgn_cfg = {
  161. .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
  162. IWL_DEVICE_105,
  163. .ht_params = &iwl2000_ht_params,
  164. };
  165. const struct iwl_cfg iwl105_bgn_d_cfg = {
  166. .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
  167. IWL_DEVICE_105,
  168. .ht_params = &iwl2000_ht_params,
  169. };
  170. #define IWL_DEVICE_135 \
  171. .fw_name_pre = IWL135_FW_PRE, \
  172. .ucode_api_max = IWL135_UCODE_API_MAX, \
  173. .ucode_api_ok = IWL135_UCODE_API_OK, \
  174. .ucode_api_min = IWL135_UCODE_API_MIN, \
  175. .device_family = IWL_DEVICE_FAMILY_135, \
  176. .max_inst_size = IWL60_RTC_INST_SIZE, \
  177. .max_data_size = IWL60_RTC_DATA_SIZE, \
  178. .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
  179. .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  180. .base_params = &iwl2030_base_params, \
  181. .bt_params = &iwl2030_bt_params, \
  182. .need_temp_offset_calib = true, \
  183. .temp_offset_v2 = true, \
  184. .led_mode = IWL_LED_RF_STATE, \
  185. .adv_pm = true, \
  186. .rx_with_siso_diversity = true
  187. const struct iwl_cfg iwl135_bgn_cfg = {
  188. .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
  189. IWL_DEVICE_135,
  190. .ht_params = &iwl2000_ht_params,
  191. };
  192. MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX));
  193. MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX));
  194. MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX));
  195. MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX));