iwl-6000.c 11 KB

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