iwl-6000.c 12 KB

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