iwl-6000.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  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. 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 = IWL6000G2B_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. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  176. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  177. .base_params = &iwl6000_g2_base_params, \
  178. .eeprom_params = &iwl6000_eeprom_params, \
  179. .led_mode = IWL_LED_RF_STATE
  180. const struct iwl_cfg iwl6030_2agn_cfg = {
  181. .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
  182. IWL_DEVICE_6030,
  183. .ht_params = &iwl6000_ht_params,
  184. };
  185. const struct iwl_cfg iwl6030_2abg_cfg = {
  186. .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
  187. IWL_DEVICE_6030,
  188. };
  189. const struct iwl_cfg iwl6030_2bgn_cfg = {
  190. .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
  191. IWL_DEVICE_6030,
  192. .ht_params = &iwl6000_ht_params,
  193. };
  194. const struct iwl_cfg iwl6030_2bg_cfg = {
  195. .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
  196. IWL_DEVICE_6030,
  197. };
  198. #define IWL_DEVICE_6035 \
  199. .fw_name_pre = IWL6030_FW_PRE, \
  200. .ucode_api_max = IWL6035_UCODE_API_MAX, \
  201. .ucode_api_ok = IWL6035_UCODE_API_OK, \
  202. .ucode_api_min = IWL6035_UCODE_API_MIN, \
  203. .device_family = IWL_DEVICE_FAMILY_6030, \
  204. .max_inst_size = IWL60_RTC_INST_SIZE, \
  205. .max_data_size = IWL60_RTC_DATA_SIZE, \
  206. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  207. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  208. .base_params = &iwl6000_g2_base_params, \
  209. .eeprom_params = &iwl6000_eeprom_params, \
  210. .led_mode = IWL_LED_RF_STATE
  211. const struct iwl_cfg iwl6035_2agn_cfg = {
  212. .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
  213. IWL_DEVICE_6035,
  214. .ht_params = &iwl6000_ht_params,
  215. };
  216. const struct iwl_cfg iwl6035_2agn_sff_cfg = {
  217. .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
  218. IWL_DEVICE_6035,
  219. .ht_params = &iwl6000_ht_params,
  220. };
  221. const struct iwl_cfg iwl1030_bgn_cfg = {
  222. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  223. IWL_DEVICE_6030,
  224. .ht_params = &iwl6000_ht_params,
  225. };
  226. const struct iwl_cfg iwl1030_bg_cfg = {
  227. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  228. IWL_DEVICE_6030,
  229. };
  230. const struct iwl_cfg iwl130_bgn_cfg = {
  231. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  232. IWL_DEVICE_6030,
  233. .ht_params = &iwl6000_ht_params,
  234. .rx_with_siso_diversity = true,
  235. };
  236. const struct iwl_cfg iwl130_bg_cfg = {
  237. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  238. IWL_DEVICE_6030,
  239. .rx_with_siso_diversity = true,
  240. };
  241. /*
  242. * "i": Internal configuration, use internal Power Amplifier
  243. */
  244. #define IWL_DEVICE_6000i \
  245. .fw_name_pre = IWL6000_FW_PRE, \
  246. .ucode_api_max = IWL6000_UCODE_API_MAX, \
  247. .ucode_api_ok = IWL6000_UCODE_API_OK, \
  248. .ucode_api_min = IWL6000_UCODE_API_MIN, \
  249. .device_family = IWL_DEVICE_FAMILY_6000i, \
  250. .max_inst_size = IWL60_RTC_INST_SIZE, \
  251. .max_data_size = IWL60_RTC_DATA_SIZE, \
  252. .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
  253. .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
  254. .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
  255. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
  256. .base_params = &iwl6000_base_params, \
  257. .eeprom_params = &iwl6000_eeprom_params, \
  258. .led_mode = IWL_LED_BLINK
  259. const struct iwl_cfg iwl6000i_2agn_cfg = {
  260. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  261. IWL_DEVICE_6000i,
  262. .ht_params = &iwl6000_ht_params,
  263. };
  264. const struct iwl_cfg iwl6000i_2abg_cfg = {
  265. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  266. IWL_DEVICE_6000i,
  267. };
  268. const struct iwl_cfg iwl6000i_2bg_cfg = {
  269. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  270. IWL_DEVICE_6000i,
  271. };
  272. #define IWL_DEVICE_6050 \
  273. .fw_name_pre = IWL6050_FW_PRE, \
  274. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  275. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  276. .device_family = IWL_DEVICE_FAMILY_6050, \
  277. .max_inst_size = IWL60_RTC_INST_SIZE, \
  278. .max_data_size = IWL60_RTC_DATA_SIZE, \
  279. .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
  280. .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
  281. .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
  282. .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
  283. .base_params = &iwl6050_base_params, \
  284. .eeprom_params = &iwl6000_eeprom_params, \
  285. .led_mode = IWL_LED_BLINK, \
  286. .internal_wimax_coex = true
  287. const struct iwl_cfg iwl6050_2agn_cfg = {
  288. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  289. IWL_DEVICE_6050,
  290. .ht_params = &iwl6000_ht_params,
  291. };
  292. const struct iwl_cfg iwl6050_2abg_cfg = {
  293. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  294. IWL_DEVICE_6050,
  295. };
  296. #define IWL_DEVICE_6150 \
  297. .fw_name_pre = IWL6050_FW_PRE, \
  298. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  299. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  300. .device_family = IWL_DEVICE_FAMILY_6150, \
  301. .max_inst_size = IWL60_RTC_INST_SIZE, \
  302. .max_data_size = IWL60_RTC_DATA_SIZE, \
  303. .nvm_ver = EEPROM_6150_EEPROM_VERSION, \
  304. .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
  305. .base_params = &iwl6050_base_params, \
  306. .eeprom_params = &iwl6000_eeprom_params, \
  307. .led_mode = IWL_LED_BLINK, \
  308. .internal_wimax_coex = true
  309. const struct iwl_cfg iwl6150_bgn_cfg = {
  310. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  311. IWL_DEVICE_6150,
  312. .ht_params = &iwl6000_ht_params,
  313. };
  314. const struct iwl_cfg iwl6150_bg_cfg = {
  315. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
  316. IWL_DEVICE_6150,
  317. };
  318. const struct iwl_cfg iwl6000_3agn_cfg = {
  319. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  320. .fw_name_pre = IWL6000_FW_PRE,
  321. .ucode_api_max = IWL6000_UCODE_API_MAX,
  322. .ucode_api_ok = IWL6000_UCODE_API_OK,
  323. .ucode_api_min = IWL6000_UCODE_API_MIN,
  324. .device_family = IWL_DEVICE_FAMILY_6000,
  325. .max_inst_size = IWL60_RTC_INST_SIZE,
  326. .max_data_size = IWL60_RTC_DATA_SIZE,
  327. .nvm_ver = EEPROM_6000_EEPROM_VERSION,
  328. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  329. .base_params = &iwl6000_base_params,
  330. .eeprom_params = &iwl6000_eeprom_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));