iwl-6000.c 11 KB

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