iwl-6000.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 2014 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. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  76. .max_event_log_size = 512,
  77. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  78. .scd_chain_ext_wa = true,
  79. };
  80. static const struct iwl_base_params iwl6050_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_6x50,
  85. .shadow_ram_support = true,
  86. .led_compensation = 51,
  87. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  88. .max_event_log_size = 1024,
  89. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  90. .scd_chain_ext_wa = true,
  91. };
  92. static const struct iwl_base_params iwl6000_g2_base_params = {
  93. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  94. .num_of_queues = IWLAGN_NUM_QUEUES,
  95. .pll_cfg_val = 0,
  96. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  97. .shadow_ram_support = true,
  98. .led_compensation = 57,
  99. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  100. .max_event_log_size = 512,
  101. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  102. .scd_chain_ext_wa = true,
  103. };
  104. static const struct iwl_ht_params iwl6000_ht_params = {
  105. .ht_greenfield_support = true,
  106. .use_rts_for_aggregation = true, /* use rts/cts protection */
  107. .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
  108. };
  109. static const struct iwl_eeprom_params iwl6000_eeprom_params = {
  110. .regulatory_bands = {
  111. EEPROM_REG_BAND_1_CHANNELS,
  112. EEPROM_REG_BAND_2_CHANNELS,
  113. EEPROM_REG_BAND_3_CHANNELS,
  114. EEPROM_REG_BAND_4_CHANNELS,
  115. EEPROM_REG_BAND_5_CHANNELS,
  116. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  117. EEPROM_REG_BAND_52_HT40_CHANNELS
  118. },
  119. .enhanced_txpower = 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. .nvm_ver = EEPROM_6005_EEPROM_VERSION, \
  130. .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
  131. .base_params = &iwl6000_g2_base_params, \
  132. .eeprom_params = &iwl6000_eeprom_params, \
  133. .led_mode = IWL_LED_RF_STATE, \
  134. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  135. const struct iwl_cfg iwl6005_2agn_cfg = {
  136. .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
  137. IWL_DEVICE_6005,
  138. .ht_params = &iwl6000_ht_params,
  139. };
  140. const struct iwl_cfg iwl6005_2abg_cfg = {
  141. .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
  142. IWL_DEVICE_6005,
  143. };
  144. const struct iwl_cfg iwl6005_2bg_cfg = {
  145. .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
  146. IWL_DEVICE_6005,
  147. };
  148. const struct iwl_cfg iwl6005_2agn_sff_cfg = {
  149. .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
  150. IWL_DEVICE_6005,
  151. .ht_params = &iwl6000_ht_params,
  152. };
  153. const struct iwl_cfg iwl6005_2agn_d_cfg = {
  154. .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
  155. IWL_DEVICE_6005,
  156. .ht_params = &iwl6000_ht_params,
  157. };
  158. const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
  159. .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
  160. IWL_DEVICE_6005,
  161. .ht_params = &iwl6000_ht_params,
  162. };
  163. const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
  164. .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
  165. IWL_DEVICE_6005,
  166. .ht_params = &iwl6000_ht_params,
  167. };
  168. #define IWL_DEVICE_6030 \
  169. .fw_name_pre = IWL6030_FW_PRE, \
  170. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  171. .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \
  172. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  173. .device_family = IWL_DEVICE_FAMILY_6030, \
  174. .max_inst_size = IWL60_RTC_INST_SIZE, \
  175. .max_data_size = IWL60_RTC_DATA_SIZE, \
  176. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  177. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  178. .base_params = &iwl6000_g2_base_params, \
  179. .eeprom_params = &iwl6000_eeprom_params, \
  180. .led_mode = IWL_LED_RF_STATE, \
  181. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  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. #define IWL_DEVICE_6035 \
  201. .fw_name_pre = IWL6030_FW_PRE, \
  202. .ucode_api_max = IWL6035_UCODE_API_MAX, \
  203. .ucode_api_ok = IWL6035_UCODE_API_OK, \
  204. .ucode_api_min = IWL6035_UCODE_API_MIN, \
  205. .device_family = IWL_DEVICE_FAMILY_6030, \
  206. .max_inst_size = IWL60_RTC_INST_SIZE, \
  207. .max_data_size = IWL60_RTC_DATA_SIZE, \
  208. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  209. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  210. .base_params = &iwl6000_g2_base_params, \
  211. .eeprom_params = &iwl6000_eeprom_params, \
  212. .led_mode = IWL_LED_RF_STATE, \
  213. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  214. const struct iwl_cfg iwl6035_2agn_cfg = {
  215. .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
  216. IWL_DEVICE_6035,
  217. .ht_params = &iwl6000_ht_params,
  218. };
  219. const struct iwl_cfg iwl6035_2agn_sff_cfg = {
  220. .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
  221. IWL_DEVICE_6035,
  222. .ht_params = &iwl6000_ht_params,
  223. };
  224. const struct iwl_cfg iwl1030_bgn_cfg = {
  225. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  226. IWL_DEVICE_6030,
  227. .ht_params = &iwl6000_ht_params,
  228. };
  229. const struct iwl_cfg iwl1030_bg_cfg = {
  230. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  231. IWL_DEVICE_6030,
  232. };
  233. const struct iwl_cfg iwl130_bgn_cfg = {
  234. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  235. IWL_DEVICE_6030,
  236. .ht_params = &iwl6000_ht_params,
  237. .rx_with_siso_diversity = true,
  238. };
  239. const struct iwl_cfg iwl130_bg_cfg = {
  240. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  241. IWL_DEVICE_6030,
  242. .rx_with_siso_diversity = true,
  243. };
  244. /*
  245. * "i": Internal configuration, use internal Power Amplifier
  246. */
  247. #define IWL_DEVICE_6000i \
  248. .fw_name_pre = IWL6000_FW_PRE, \
  249. .ucode_api_max = IWL6000_UCODE_API_MAX, \
  250. .ucode_api_ok = IWL6000_UCODE_API_OK, \
  251. .ucode_api_min = IWL6000_UCODE_API_MIN, \
  252. .device_family = IWL_DEVICE_FAMILY_6000i, \
  253. .max_inst_size = IWL60_RTC_INST_SIZE, \
  254. .max_data_size = IWL60_RTC_DATA_SIZE, \
  255. .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
  256. .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
  257. .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
  258. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
  259. .base_params = &iwl6000_base_params, \
  260. .eeprom_params = &iwl6000_eeprom_params, \
  261. .led_mode = IWL_LED_BLINK, \
  262. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  263. const struct iwl_cfg iwl6000i_2agn_cfg = {
  264. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  265. IWL_DEVICE_6000i,
  266. .ht_params = &iwl6000_ht_params,
  267. };
  268. const struct iwl_cfg iwl6000i_2abg_cfg = {
  269. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  270. IWL_DEVICE_6000i,
  271. };
  272. const struct iwl_cfg iwl6000i_2bg_cfg = {
  273. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  274. IWL_DEVICE_6000i,
  275. };
  276. #define IWL_DEVICE_6050 \
  277. .fw_name_pre = IWL6050_FW_PRE, \
  278. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  279. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  280. .device_family = IWL_DEVICE_FAMILY_6050, \
  281. .max_inst_size = IWL60_RTC_INST_SIZE, \
  282. .max_data_size = IWL60_RTC_DATA_SIZE, \
  283. .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
  284. .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
  285. .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
  286. .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
  287. .base_params = &iwl6050_base_params, \
  288. .eeprom_params = &iwl6000_eeprom_params, \
  289. .led_mode = IWL_LED_BLINK, \
  290. .internal_wimax_coex = true, \
  291. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  292. const struct iwl_cfg iwl6050_2agn_cfg = {
  293. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  294. IWL_DEVICE_6050,
  295. .ht_params = &iwl6000_ht_params,
  296. };
  297. const struct iwl_cfg iwl6050_2abg_cfg = {
  298. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  299. IWL_DEVICE_6050,
  300. };
  301. #define IWL_DEVICE_6150 \
  302. .fw_name_pre = IWL6050_FW_PRE, \
  303. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  304. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  305. .device_family = IWL_DEVICE_FAMILY_6150, \
  306. .max_inst_size = IWL60_RTC_INST_SIZE, \
  307. .max_data_size = IWL60_RTC_DATA_SIZE, \
  308. .nvm_ver = EEPROM_6150_EEPROM_VERSION, \
  309. .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
  310. .base_params = &iwl6050_base_params, \
  311. .eeprom_params = &iwl6000_eeprom_params, \
  312. .led_mode = IWL_LED_BLINK, \
  313. .internal_wimax_coex = true, \
  314. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
  315. const struct iwl_cfg iwl6150_bgn_cfg = {
  316. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  317. IWL_DEVICE_6150,
  318. .ht_params = &iwl6000_ht_params,
  319. };
  320. const struct iwl_cfg iwl6150_bg_cfg = {
  321. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
  322. IWL_DEVICE_6150,
  323. };
  324. const struct iwl_cfg iwl6000_3agn_cfg = {
  325. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  326. .fw_name_pre = IWL6000_FW_PRE,
  327. .ucode_api_max = IWL6000_UCODE_API_MAX,
  328. .ucode_api_ok = IWL6000_UCODE_API_OK,
  329. .ucode_api_min = IWL6000_UCODE_API_MIN,
  330. .device_family = IWL_DEVICE_FAMILY_6000,
  331. .max_inst_size = IWL60_RTC_INST_SIZE,
  332. .max_data_size = IWL60_RTC_DATA_SIZE,
  333. .nvm_ver = EEPROM_6000_EEPROM_VERSION,
  334. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  335. .base_params = &iwl6000_base_params,
  336. .eeprom_params = &iwl6000_eeprom_params,
  337. .ht_params = &iwl6000_ht_params,
  338. .led_mode = IWL_LED_BLINK,
  339. };
  340. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
  341. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
  342. MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
  343. MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));