iwl-6000.c 12 KB

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