iwl-2000.c 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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-agn-hw.h"
  31. #include "iwl-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. };
  94. static const struct iwl_bt_params iwl2030_bt_params = {
  95. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  96. .advanced_bt_coexist = true,
  97. .agg_time_limit = BT_AGG_THRESHOLD_DEF,
  98. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  99. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
  100. .bt_sco_disable = true,
  101. .bt_session_2 = true,
  102. };
  103. #define IWL_DEVICE_2000 \
  104. .fw_name_pre = IWL2000_FW_PRE, \
  105. .ucode_api_max = IWL2000_UCODE_API_MAX, \
  106. .ucode_api_ok = IWL2000_UCODE_API_OK, \
  107. .ucode_api_min = IWL2000_UCODE_API_MIN, \
  108. .device_family = IWL_DEVICE_FAMILY_2000, \
  109. .max_inst_size = IWL60_RTC_INST_SIZE, \
  110. .max_data_size = IWL60_RTC_DATA_SIZE, \
  111. .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
  112. .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  113. .base_params = &iwl2000_base_params, \
  114. .need_temp_offset_calib = true, \
  115. .temp_offset_v2 = true, \
  116. .led_mode = IWL_LED_RF_STATE
  117. const struct iwl_cfg iwl2000_2bgn_cfg = {
  118. .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
  119. IWL_DEVICE_2000,
  120. .ht_params = &iwl2000_ht_params,
  121. };
  122. const struct iwl_cfg iwl2000_2bgn_d_cfg = {
  123. .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
  124. IWL_DEVICE_2000,
  125. .ht_params = &iwl2000_ht_params,
  126. };
  127. #define IWL_DEVICE_2030 \
  128. .fw_name_pre = IWL2030_FW_PRE, \
  129. .ucode_api_max = IWL2030_UCODE_API_MAX, \
  130. .ucode_api_ok = IWL2030_UCODE_API_OK, \
  131. .ucode_api_min = IWL2030_UCODE_API_MIN, \
  132. .device_family = IWL_DEVICE_FAMILY_2030, \
  133. .max_inst_size = IWL60_RTC_INST_SIZE, \
  134. .max_data_size = IWL60_RTC_DATA_SIZE, \
  135. .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
  136. .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  137. .base_params = &iwl2030_base_params, \
  138. .bt_params = &iwl2030_bt_params, \
  139. .need_temp_offset_calib = true, \
  140. .temp_offset_v2 = true, \
  141. .led_mode = IWL_LED_RF_STATE, \
  142. .adv_pm = true
  143. const struct iwl_cfg iwl2030_2bgn_cfg = {
  144. .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
  145. IWL_DEVICE_2030,
  146. .ht_params = &iwl2000_ht_params,
  147. };
  148. #define IWL_DEVICE_105 \
  149. .fw_name_pre = IWL105_FW_PRE, \
  150. .ucode_api_max = IWL105_UCODE_API_MAX, \
  151. .ucode_api_ok = IWL105_UCODE_API_OK, \
  152. .ucode_api_min = IWL105_UCODE_API_MIN, \
  153. .device_family = IWL_DEVICE_FAMILY_105, \
  154. .max_inst_size = IWL60_RTC_INST_SIZE, \
  155. .max_data_size = IWL60_RTC_DATA_SIZE, \
  156. .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
  157. .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  158. .base_params = &iwl2000_base_params, \
  159. .need_temp_offset_calib = true, \
  160. .temp_offset_v2 = true, \
  161. .led_mode = IWL_LED_RF_STATE, \
  162. .adv_pm = true, \
  163. .rx_with_siso_diversity = true
  164. const struct iwl_cfg iwl105_bgn_cfg = {
  165. .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
  166. IWL_DEVICE_105,
  167. .ht_params = &iwl2000_ht_params,
  168. };
  169. const struct iwl_cfg iwl105_bgn_d_cfg = {
  170. .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
  171. IWL_DEVICE_105,
  172. .ht_params = &iwl2000_ht_params,
  173. };
  174. #define IWL_DEVICE_135 \
  175. .fw_name_pre = IWL135_FW_PRE, \
  176. .ucode_api_max = IWL135_UCODE_API_MAX, \
  177. .ucode_api_ok = IWL135_UCODE_API_OK, \
  178. .ucode_api_min = IWL135_UCODE_API_MIN, \
  179. .device_family = IWL_DEVICE_FAMILY_135, \
  180. .max_inst_size = IWL60_RTC_INST_SIZE, \
  181. .max_data_size = IWL60_RTC_DATA_SIZE, \
  182. .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
  183. .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  184. .base_params = &iwl2030_base_params, \
  185. .bt_params = &iwl2030_bt_params, \
  186. .need_temp_offset_calib = true, \
  187. .temp_offset_v2 = true, \
  188. .led_mode = IWL_LED_RF_STATE, \
  189. .adv_pm = true, \
  190. .rx_with_siso_diversity = true
  191. const struct iwl_cfg iwl135_bgn_cfg = {
  192. .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
  193. IWL_DEVICE_135,
  194. .ht_params = &iwl2000_ht_params,
  195. };
  196. MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
  197. MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
  198. MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
  199. MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));