iwl-2000.c 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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 "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. .adv_thermal_throttle = true,
  65. .support_ct_kill_exit = true,
  66. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  67. .chain_noise_scale = 1000,
  68. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  69. .max_event_log_size = 512,
  70. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  71. .hd_v2 = true,
  72. };
  73. static const struct iwl_base_params iwl2030_base_params = {
  74. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  75. .num_of_queues = IWLAGN_NUM_QUEUES,
  76. .pll_cfg_val = 0,
  77. .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
  78. .shadow_ram_support = true,
  79. .led_compensation = 57,
  80. .adv_thermal_throttle = true,
  81. .support_ct_kill_exit = true,
  82. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  83. .chain_noise_scale = 1000,
  84. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  85. .max_event_log_size = 512,
  86. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  87. .hd_v2 = true,
  88. };
  89. static const struct iwl_ht_params iwl2000_ht_params = {
  90. .ht_greenfield_support = true,
  91. .use_rts_for_aggregation = true, /* use rts/cts protection */
  92. .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
  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_DEFAULT32,
  100. .bt_sco_disable = true,
  101. .bt_session_2 = true,
  102. };
  103. static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
  104. .regulatory_bands = {
  105. EEPROM_REG_BAND_1_CHANNELS,
  106. EEPROM_REG_BAND_2_CHANNELS,
  107. EEPROM_REG_BAND_3_CHANNELS,
  108. EEPROM_REG_BAND_4_CHANNELS,
  109. EEPROM_REG_BAND_5_CHANNELS,
  110. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  111. EEPROM_REGULATORY_BAND_NO_HT40,
  112. },
  113. .enhanced_txpower = true,
  114. };
  115. #define IWL_DEVICE_2000 \
  116. .fw_name_pre = IWL2000_FW_PRE, \
  117. .ucode_api_max = IWL2000_UCODE_API_MAX, \
  118. .ucode_api_ok = IWL2000_UCODE_API_OK, \
  119. .ucode_api_min = IWL2000_UCODE_API_MIN, \
  120. .device_family = IWL_DEVICE_FAMILY_2000, \
  121. .max_inst_size = IWL60_RTC_INST_SIZE, \
  122. .max_data_size = IWL60_RTC_DATA_SIZE, \
  123. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  124. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  125. .base_params = &iwl2000_base_params, \
  126. .eeprom_params = &iwl20x0_eeprom_params, \
  127. .need_temp_offset_calib = true, \
  128. .temp_offset_v2 = true, \
  129. .led_mode = IWL_LED_RF_STATE
  130. const struct iwl_cfg iwl2000_2bgn_cfg = {
  131. .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
  132. IWL_DEVICE_2000,
  133. .ht_params = &iwl2000_ht_params,
  134. };
  135. const struct iwl_cfg iwl2000_2bgn_d_cfg = {
  136. .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
  137. IWL_DEVICE_2000,
  138. .ht_params = &iwl2000_ht_params,
  139. };
  140. #define IWL_DEVICE_2030 \
  141. .fw_name_pre = IWL2030_FW_PRE, \
  142. .ucode_api_max = IWL2030_UCODE_API_MAX, \
  143. .ucode_api_ok = IWL2030_UCODE_API_OK, \
  144. .ucode_api_min = IWL2030_UCODE_API_MIN, \
  145. .device_family = IWL_DEVICE_FAMILY_2030, \
  146. .max_inst_size = IWL60_RTC_INST_SIZE, \
  147. .max_data_size = IWL60_RTC_DATA_SIZE, \
  148. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  149. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  150. .base_params = &iwl2030_base_params, \
  151. .bt_params = &iwl2030_bt_params, \
  152. .eeprom_params = &iwl20x0_eeprom_params, \
  153. .need_temp_offset_calib = true, \
  154. .temp_offset_v2 = true, \
  155. .led_mode = IWL_LED_RF_STATE, \
  156. .adv_pm = true
  157. const struct iwl_cfg iwl2030_2bgn_cfg = {
  158. .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
  159. IWL_DEVICE_2030,
  160. .ht_params = &iwl2000_ht_params,
  161. };
  162. #define IWL_DEVICE_105 \
  163. .fw_name_pre = IWL105_FW_PRE, \
  164. .ucode_api_max = IWL105_UCODE_API_MAX, \
  165. .ucode_api_ok = IWL105_UCODE_API_OK, \
  166. .ucode_api_min = IWL105_UCODE_API_MIN, \
  167. .device_family = IWL_DEVICE_FAMILY_105, \
  168. .max_inst_size = IWL60_RTC_INST_SIZE, \
  169. .max_data_size = IWL60_RTC_DATA_SIZE, \
  170. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  171. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  172. .base_params = &iwl2000_base_params, \
  173. .eeprom_params = &iwl20x0_eeprom_params, \
  174. .need_temp_offset_calib = true, \
  175. .temp_offset_v2 = true, \
  176. .led_mode = IWL_LED_RF_STATE, \
  177. .adv_pm = true, \
  178. .rx_with_siso_diversity = true
  179. const struct iwl_cfg iwl105_bgn_cfg = {
  180. .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
  181. IWL_DEVICE_105,
  182. .ht_params = &iwl2000_ht_params,
  183. };
  184. const struct iwl_cfg iwl105_bgn_d_cfg = {
  185. .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
  186. IWL_DEVICE_105,
  187. .ht_params = &iwl2000_ht_params,
  188. };
  189. #define IWL_DEVICE_135 \
  190. .fw_name_pre = IWL135_FW_PRE, \
  191. .ucode_api_max = IWL135_UCODE_API_MAX, \
  192. .ucode_api_ok = IWL135_UCODE_API_OK, \
  193. .ucode_api_min = IWL135_UCODE_API_MIN, \
  194. .device_family = IWL_DEVICE_FAMILY_135, \
  195. .max_inst_size = IWL60_RTC_INST_SIZE, \
  196. .max_data_size = IWL60_RTC_DATA_SIZE, \
  197. .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
  198. .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
  199. .base_params = &iwl2030_base_params, \
  200. .bt_params = &iwl2030_bt_params, \
  201. .eeprom_params = &iwl20x0_eeprom_params, \
  202. .need_temp_offset_calib = true, \
  203. .temp_offset_v2 = true, \
  204. .led_mode = IWL_LED_RF_STATE, \
  205. .adv_pm = true, \
  206. .rx_with_siso_diversity = true
  207. const struct iwl_cfg iwl135_bgn_cfg = {
  208. .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
  209. IWL_DEVICE_135,
  210. .ht_params = &iwl2000_ht_params,
  211. };
  212. MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
  213. MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
  214. MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
  215. MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));