iwl-6000.c 13 KB

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