iwl-6000.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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 IWL6000_UCODE_API_MAX 6
  33. #define IWL6050_UCODE_API_MAX 5
  34. #define IWL6000G2_UCODE_API_MAX 6
  35. /* Oldest version we won't warn about */
  36. #define IWL6000_UCODE_API_OK 4
  37. #define IWL6000G2_UCODE_API_OK 5
  38. /* Lowest firmware API version supported */
  39. #define IWL6000_UCODE_API_MIN 4
  40. #define IWL6050_UCODE_API_MIN 4
  41. #define IWL6000G2_UCODE_API_MIN 4
  42. #define IWL6000_FW_PRE "iwlwifi-6000-"
  43. #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
  44. #define IWL6050_FW_PRE "iwlwifi-6050-"
  45. #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
  46. #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
  47. #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
  48. #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
  49. #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
  50. static const struct iwl_base_params iwl6000_base_params = {
  51. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  52. .num_of_queues = IWLAGN_NUM_QUEUES,
  53. .pll_cfg_val = 0,
  54. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  55. .shadow_ram_support = true,
  56. .led_compensation = 51,
  57. .adv_thermal_throttle = true,
  58. .support_ct_kill_exit = true,
  59. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  60. .chain_noise_scale = 1000,
  61. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  62. .max_event_log_size = 512,
  63. .shadow_reg_enable = true,
  64. };
  65. static const struct iwl_base_params iwl6050_base_params = {
  66. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  67. .num_of_queues = IWLAGN_NUM_QUEUES,
  68. .pll_cfg_val = 0,
  69. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  70. .shadow_ram_support = true,
  71. .led_compensation = 51,
  72. .adv_thermal_throttle = true,
  73. .support_ct_kill_exit = true,
  74. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  75. .chain_noise_scale = 1500,
  76. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  77. .max_event_log_size = 1024,
  78. .shadow_reg_enable = true,
  79. };
  80. static const struct iwl_base_params iwl6000_g2_base_params = {
  81. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  82. .num_of_queues = IWLAGN_NUM_QUEUES,
  83. .pll_cfg_val = 0,
  84. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  85. .shadow_ram_support = true,
  86. .led_compensation = 57,
  87. .adv_thermal_throttle = true,
  88. .support_ct_kill_exit = true,
  89. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  90. .chain_noise_scale = 1000,
  91. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  92. .max_event_log_size = 512,
  93. .shadow_reg_enable = true,
  94. };
  95. static const struct iwl_ht_params iwl6000_ht_params = {
  96. .ht_greenfield_support = true,
  97. .use_rts_for_aggregation = true, /* use rts/cts protection */
  98. };
  99. static const struct iwl_bt_params iwl6000_bt_params = {
  100. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  101. .advanced_bt_coexist = true,
  102. .agg_time_limit = BT_AGG_THRESHOLD_DEF,
  103. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  104. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
  105. .bt_sco_disable = true,
  106. };
  107. #define IWL_DEVICE_6005 \
  108. .fw_name_pre = IWL6005_FW_PRE, \
  109. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  110. .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
  111. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  112. .device_family = IWL_DEVICE_FAMILY_6005, \
  113. .max_inst_size = IWL60_RTC_INST_SIZE, \
  114. .max_data_size = IWL60_RTC_DATA_SIZE, \
  115. .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \
  116. .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
  117. .base_params = &iwl6000_g2_base_params, \
  118. .need_temp_offset_calib = true, \
  119. .led_mode = IWL_LED_RF_STATE
  120. const struct iwl_cfg iwl6005_2agn_cfg = {
  121. .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
  122. IWL_DEVICE_6005,
  123. .ht_params = &iwl6000_ht_params,
  124. };
  125. const struct iwl_cfg iwl6005_2abg_cfg = {
  126. .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
  127. IWL_DEVICE_6005,
  128. };
  129. const struct iwl_cfg iwl6005_2bg_cfg = {
  130. .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
  131. IWL_DEVICE_6005,
  132. };
  133. const struct iwl_cfg iwl6005_2agn_sff_cfg = {
  134. .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
  135. IWL_DEVICE_6005,
  136. .ht_params = &iwl6000_ht_params,
  137. };
  138. const struct iwl_cfg iwl6005_2agn_d_cfg = {
  139. .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
  140. IWL_DEVICE_6005,
  141. .ht_params = &iwl6000_ht_params,
  142. };
  143. const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
  144. .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
  145. IWL_DEVICE_6005,
  146. .ht_params = &iwl6000_ht_params,
  147. };
  148. const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
  149. .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
  150. IWL_DEVICE_6005,
  151. .ht_params = &iwl6000_ht_params,
  152. };
  153. #define IWL_DEVICE_6030 \
  154. .fw_name_pre = IWL6030_FW_PRE, \
  155. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  156. .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
  157. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  158. .device_family = IWL_DEVICE_FAMILY_6030, \
  159. .max_inst_size = IWL60_RTC_INST_SIZE, \
  160. .max_data_size = IWL60_RTC_DATA_SIZE, \
  161. .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \
  162. .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  163. .base_params = &iwl6000_g2_base_params, \
  164. .bt_params = &iwl6000_bt_params, \
  165. .need_temp_offset_calib = true, \
  166. .led_mode = IWL_LED_RF_STATE, \
  167. .adv_pm = true \
  168. const struct iwl_cfg iwl6030_2agn_cfg = {
  169. .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
  170. IWL_DEVICE_6030,
  171. .ht_params = &iwl6000_ht_params,
  172. };
  173. const struct iwl_cfg iwl6030_2abg_cfg = {
  174. .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
  175. IWL_DEVICE_6030,
  176. };
  177. const struct iwl_cfg iwl6030_2bgn_cfg = {
  178. .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
  179. IWL_DEVICE_6030,
  180. .ht_params = &iwl6000_ht_params,
  181. };
  182. const struct iwl_cfg iwl6030_2bg_cfg = {
  183. .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
  184. IWL_DEVICE_6030,
  185. };
  186. const struct iwl_cfg iwl6035_2agn_cfg = {
  187. .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
  188. IWL_DEVICE_6030,
  189. .ht_params = &iwl6000_ht_params,
  190. };
  191. const struct iwl_cfg iwl1030_bgn_cfg = {
  192. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  193. IWL_DEVICE_6030,
  194. .ht_params = &iwl6000_ht_params,
  195. };
  196. const struct iwl_cfg iwl1030_bg_cfg = {
  197. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  198. IWL_DEVICE_6030,
  199. };
  200. const struct iwl_cfg iwl130_bgn_cfg = {
  201. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  202. IWL_DEVICE_6030,
  203. .ht_params = &iwl6000_ht_params,
  204. .rx_with_siso_diversity = true,
  205. };
  206. const struct iwl_cfg iwl130_bg_cfg = {
  207. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  208. IWL_DEVICE_6030,
  209. .rx_with_siso_diversity = true,
  210. };
  211. /*
  212. * "i": Internal configuration, use internal Power Amplifier
  213. */
  214. #define IWL_DEVICE_6000i \
  215. .fw_name_pre = IWL6000_FW_PRE, \
  216. .ucode_api_max = IWL6000_UCODE_API_MAX, \
  217. .ucode_api_ok = IWL6000_UCODE_API_OK, \
  218. .ucode_api_min = IWL6000_UCODE_API_MIN, \
  219. .device_family = IWL_DEVICE_FAMILY_6000i, \
  220. .max_inst_size = IWL60_RTC_INST_SIZE, \
  221. .max_data_size = IWL60_RTC_DATA_SIZE, \
  222. .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
  223. .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
  224. .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \
  225. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
  226. .base_params = &iwl6000_base_params, \
  227. .led_mode = IWL_LED_BLINK
  228. const struct iwl_cfg iwl6000i_2agn_cfg = {
  229. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  230. IWL_DEVICE_6000i,
  231. .ht_params = &iwl6000_ht_params,
  232. };
  233. const struct iwl_cfg iwl6000i_2abg_cfg = {
  234. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  235. IWL_DEVICE_6000i,
  236. };
  237. const struct iwl_cfg iwl6000i_2bg_cfg = {
  238. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  239. IWL_DEVICE_6000i,
  240. };
  241. #define IWL_DEVICE_6050 \
  242. .fw_name_pre = IWL6050_FW_PRE, \
  243. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  244. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  245. .device_family = IWL_DEVICE_FAMILY_6050, \
  246. .max_inst_size = IWL60_RTC_INST_SIZE, \
  247. .max_data_size = IWL60_RTC_DATA_SIZE, \
  248. .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
  249. .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
  250. .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \
  251. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
  252. .base_params = &iwl6050_base_params, \
  253. .led_mode = IWL_LED_BLINK, \
  254. .internal_wimax_coex = true
  255. const struct iwl_cfg iwl6050_2agn_cfg = {
  256. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  257. IWL_DEVICE_6050,
  258. .ht_params = &iwl6000_ht_params,
  259. };
  260. const struct iwl_cfg iwl6050_2abg_cfg = {
  261. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  262. IWL_DEVICE_6050,
  263. };
  264. #define IWL_DEVICE_6150 \
  265. .fw_name_pre = IWL6050_FW_PRE, \
  266. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  267. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  268. .device_family = IWL_DEVICE_FAMILY_6150, \
  269. .max_inst_size = IWL60_RTC_INST_SIZE, \
  270. .max_data_size = IWL60_RTC_DATA_SIZE, \
  271. .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \
  272. .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
  273. .base_params = &iwl6050_base_params, \
  274. .led_mode = IWL_LED_BLINK, \
  275. .internal_wimax_coex = true
  276. const struct iwl_cfg iwl6150_bgn_cfg = {
  277. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  278. IWL_DEVICE_6150,
  279. .ht_params = &iwl6000_ht_params,
  280. };
  281. const struct iwl_cfg iwl6150_bg_cfg = {
  282. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
  283. IWL_DEVICE_6150,
  284. };
  285. const struct iwl_cfg iwl6000_3agn_cfg = {
  286. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  287. .fw_name_pre = IWL6000_FW_PRE,
  288. .ucode_api_max = IWL6000_UCODE_API_MAX,
  289. .ucode_api_ok = IWL6000_UCODE_API_OK,
  290. .ucode_api_min = IWL6000_UCODE_API_MIN,
  291. .device_family = IWL_DEVICE_FAMILY_6000,
  292. .max_inst_size = IWL60_RTC_INST_SIZE,
  293. .max_data_size = IWL60_RTC_DATA_SIZE,
  294. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  295. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  296. .base_params = &iwl6000_base_params,
  297. .ht_params = &iwl6000_ht_params,
  298. .led_mode = IWL_LED_BLINK,
  299. };
  300. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
  301. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
  302. MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
  303. MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));