iwl-6000.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  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. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  76. .max_event_log_size = 512,
  77. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  78. };
  79. static const struct iwl_base_params iwl6050_base_params = {
  80. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  81. .num_of_queues = IWLAGN_NUM_QUEUES,
  82. .pll_cfg_val = 0,
  83. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  84. .shadow_ram_support = true,
  85. .led_compensation = 51,
  86. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  87. .max_event_log_size = 1024,
  88. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  89. };
  90. static const struct iwl_base_params iwl6000_g2_base_params = {
  91. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  92. .num_of_queues = IWLAGN_NUM_QUEUES,
  93. .pll_cfg_val = 0,
  94. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  95. .shadow_ram_support = true,
  96. .led_compensation = 57,
  97. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  98. .max_event_log_size = 512,
  99. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  100. };
  101. static const struct iwl_ht_params iwl6000_ht_params = {
  102. .ht_greenfield_support = true,
  103. .use_rts_for_aggregation = true, /* use rts/cts protection */
  104. .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
  105. };
  106. static const struct iwl_eeprom_params iwl6000_eeprom_params = {
  107. .regulatory_bands = {
  108. EEPROM_REG_BAND_1_CHANNELS,
  109. EEPROM_REG_BAND_2_CHANNELS,
  110. EEPROM_REG_BAND_3_CHANNELS,
  111. EEPROM_REG_BAND_4_CHANNELS,
  112. EEPROM_REG_BAND_5_CHANNELS,
  113. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  114. EEPROM_REG_BAND_52_HT40_CHANNELS
  115. },
  116. .enhanced_txpower = true,
  117. };
  118. #define IWL_DEVICE_6005 \
  119. .fw_name_pre = IWL6005_FW_PRE, \
  120. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  121. .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
  122. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  123. .device_family = IWL_DEVICE_FAMILY_6005, \
  124. .max_inst_size = IWL60_RTC_INST_SIZE, \
  125. .max_data_size = IWL60_RTC_DATA_SIZE, \
  126. .nvm_ver = EEPROM_6005_EEPROM_VERSION, \
  127. .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
  128. .base_params = &iwl6000_g2_base_params, \
  129. .eeprom_params = &iwl6000_eeprom_params, \
  130. .led_mode = IWL_LED_RF_STATE
  131. const struct iwl_cfg iwl6005_2agn_cfg = {
  132. .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
  133. IWL_DEVICE_6005,
  134. .ht_params = &iwl6000_ht_params,
  135. };
  136. const struct iwl_cfg iwl6005_2abg_cfg = {
  137. .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
  138. IWL_DEVICE_6005,
  139. };
  140. const struct iwl_cfg iwl6005_2bg_cfg = {
  141. .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
  142. IWL_DEVICE_6005,
  143. };
  144. const struct iwl_cfg iwl6005_2agn_sff_cfg = {
  145. .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
  146. IWL_DEVICE_6005,
  147. .ht_params = &iwl6000_ht_params,
  148. };
  149. const struct iwl_cfg iwl6005_2agn_d_cfg = {
  150. .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
  151. IWL_DEVICE_6005,
  152. .ht_params = &iwl6000_ht_params,
  153. };
  154. const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
  155. .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
  156. IWL_DEVICE_6005,
  157. .ht_params = &iwl6000_ht_params,
  158. };
  159. const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
  160. .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
  161. IWL_DEVICE_6005,
  162. .ht_params = &iwl6000_ht_params,
  163. };
  164. #define IWL_DEVICE_6030 \
  165. .fw_name_pre = IWL6030_FW_PRE, \
  166. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  167. .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \
  168. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  169. .device_family = IWL_DEVICE_FAMILY_6030, \
  170. .max_inst_size = IWL60_RTC_INST_SIZE, \
  171. .max_data_size = IWL60_RTC_DATA_SIZE, \
  172. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  173. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  174. .base_params = &iwl6000_g2_base_params, \
  175. .eeprom_params = &iwl6000_eeprom_params, \
  176. .led_mode = IWL_LED_RF_STATE
  177. const struct iwl_cfg iwl6030_2agn_cfg = {
  178. .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
  179. IWL_DEVICE_6030,
  180. .ht_params = &iwl6000_ht_params,
  181. };
  182. const struct iwl_cfg iwl6030_2abg_cfg = {
  183. .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
  184. IWL_DEVICE_6030,
  185. };
  186. const struct iwl_cfg iwl6030_2bgn_cfg = {
  187. .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
  188. IWL_DEVICE_6030,
  189. .ht_params = &iwl6000_ht_params,
  190. };
  191. const struct iwl_cfg iwl6030_2bg_cfg = {
  192. .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
  193. IWL_DEVICE_6030,
  194. };
  195. #define IWL_DEVICE_6035 \
  196. .fw_name_pre = IWL6030_FW_PRE, \
  197. .ucode_api_max = IWL6035_UCODE_API_MAX, \
  198. .ucode_api_ok = IWL6035_UCODE_API_OK, \
  199. .ucode_api_min = IWL6035_UCODE_API_MIN, \
  200. .device_family = IWL_DEVICE_FAMILY_6030, \
  201. .max_inst_size = IWL60_RTC_INST_SIZE, \
  202. .max_data_size = IWL60_RTC_DATA_SIZE, \
  203. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  204. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  205. .base_params = &iwl6000_g2_base_params, \
  206. .eeprom_params = &iwl6000_eeprom_params, \
  207. .led_mode = IWL_LED_RF_STATE
  208. const struct iwl_cfg iwl6035_2agn_cfg = {
  209. .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
  210. IWL_DEVICE_6035,
  211. .ht_params = &iwl6000_ht_params,
  212. };
  213. const struct iwl_cfg iwl1030_bgn_cfg = {
  214. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  215. IWL_DEVICE_6030,
  216. .ht_params = &iwl6000_ht_params,
  217. };
  218. const struct iwl_cfg iwl1030_bg_cfg = {
  219. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  220. IWL_DEVICE_6030,
  221. };
  222. const struct iwl_cfg iwl130_bgn_cfg = {
  223. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  224. IWL_DEVICE_6030,
  225. .ht_params = &iwl6000_ht_params,
  226. .rx_with_siso_diversity = true,
  227. };
  228. const struct iwl_cfg iwl130_bg_cfg = {
  229. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  230. IWL_DEVICE_6030,
  231. .rx_with_siso_diversity = true,
  232. };
  233. /*
  234. * "i": Internal configuration, use internal Power Amplifier
  235. */
  236. #define IWL_DEVICE_6000i \
  237. .fw_name_pre = IWL6000_FW_PRE, \
  238. .ucode_api_max = IWL6000_UCODE_API_MAX, \
  239. .ucode_api_ok = IWL6000_UCODE_API_OK, \
  240. .ucode_api_min = IWL6000_UCODE_API_MIN, \
  241. .device_family = IWL_DEVICE_FAMILY_6000i, \
  242. .max_inst_size = IWL60_RTC_INST_SIZE, \
  243. .max_data_size = IWL60_RTC_DATA_SIZE, \
  244. .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
  245. .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
  246. .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
  247. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
  248. .base_params = &iwl6000_base_params, \
  249. .eeprom_params = &iwl6000_eeprom_params, \
  250. .led_mode = IWL_LED_BLINK
  251. const struct iwl_cfg iwl6000i_2agn_cfg = {
  252. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  253. IWL_DEVICE_6000i,
  254. .ht_params = &iwl6000_ht_params,
  255. };
  256. const struct iwl_cfg iwl6000i_2abg_cfg = {
  257. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  258. IWL_DEVICE_6000i,
  259. };
  260. const struct iwl_cfg iwl6000i_2bg_cfg = {
  261. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  262. IWL_DEVICE_6000i,
  263. };
  264. #define IWL_DEVICE_6050 \
  265. .fw_name_pre = IWL6050_FW_PRE, \
  266. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  267. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  268. .device_family = IWL_DEVICE_FAMILY_6050, \
  269. .max_inst_size = IWL60_RTC_INST_SIZE, \
  270. .max_data_size = IWL60_RTC_DATA_SIZE, \
  271. .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
  272. .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
  273. .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
  274. .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
  275. .base_params = &iwl6050_base_params, \
  276. .eeprom_params = &iwl6000_eeprom_params, \
  277. .led_mode = IWL_LED_BLINK, \
  278. .internal_wimax_coex = true
  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. const struct iwl_cfg iwl6150_bgn_cfg = {
  302. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  303. IWL_DEVICE_6150,
  304. .ht_params = &iwl6000_ht_params,
  305. };
  306. const struct iwl_cfg iwl6150_bg_cfg = {
  307. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
  308. IWL_DEVICE_6150,
  309. };
  310. const struct iwl_cfg iwl6000_3agn_cfg = {
  311. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  312. .fw_name_pre = IWL6000_FW_PRE,
  313. .ucode_api_max = IWL6000_UCODE_API_MAX,
  314. .ucode_api_ok = IWL6000_UCODE_API_OK,
  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_OK));
  327. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
  328. MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
  329. MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));