/drivers/net/wireless/iwlwifi/iwl-6000.c

http://github.com/mirrors/linux · C · 380 lines · 302 code · 46 blank · 32 comment · 0 complexity · 90b32ea7ba0ae26bc1abceb310c46971 MD5 · raw file

  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 iwl6035_2agn_sff_cfg = {
  214. .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
  215. IWL_DEVICE_6035,
  216. .ht_params = &iwl6000_ht_params,
  217. };
  218. const struct iwl_cfg iwl1030_bgn_cfg = {
  219. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  220. IWL_DEVICE_6030,
  221. .ht_params = &iwl6000_ht_params,
  222. };
  223. const struct iwl_cfg iwl1030_bg_cfg = {
  224. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  225. IWL_DEVICE_6030,
  226. };
  227. const struct iwl_cfg iwl130_bgn_cfg = {
  228. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  229. IWL_DEVICE_6030,
  230. .ht_params = &iwl6000_ht_params,
  231. .rx_with_siso_diversity = true,
  232. };
  233. const struct iwl_cfg iwl130_bg_cfg = {
  234. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  235. IWL_DEVICE_6030,
  236. .rx_with_siso_diversity = true,
  237. };
  238. /*
  239. * "i": Internal configuration, use internal Power Amplifier
  240. */
  241. #define IWL_DEVICE_6000i \
  242. .fw_name_pre = IWL6000_FW_PRE, \
  243. .ucode_api_max = IWL6000_UCODE_API_MAX, \
  244. .ucode_api_ok = IWL6000_UCODE_API_OK, \
  245. .ucode_api_min = IWL6000_UCODE_API_MIN, \
  246. .device_family = IWL_DEVICE_FAMILY_6000i, \
  247. .max_inst_size = IWL60_RTC_INST_SIZE, \
  248. .max_data_size = IWL60_RTC_DATA_SIZE, \
  249. .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
  250. .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
  251. .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
  252. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
  253. .base_params = &iwl6000_base_params, \
  254. .eeprom_params = &iwl6000_eeprom_params, \
  255. .led_mode = IWL_LED_BLINK
  256. const struct iwl_cfg iwl6000i_2agn_cfg = {
  257. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  258. IWL_DEVICE_6000i,
  259. .ht_params = &iwl6000_ht_params,
  260. };
  261. const struct iwl_cfg iwl6000i_2abg_cfg = {
  262. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  263. IWL_DEVICE_6000i,
  264. };
  265. const struct iwl_cfg iwl6000i_2bg_cfg = {
  266. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  267. IWL_DEVICE_6000i,
  268. };
  269. #define IWL_DEVICE_6050 \
  270. .fw_name_pre = IWL6050_FW_PRE, \
  271. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  272. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  273. .device_family = IWL_DEVICE_FAMILY_6050, \
  274. .max_inst_size = IWL60_RTC_INST_SIZE, \
  275. .max_data_size = IWL60_RTC_DATA_SIZE, \
  276. .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
  277. .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
  278. .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
  279. .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
  280. .base_params = &iwl6050_base_params, \
  281. .eeprom_params = &iwl6000_eeprom_params, \
  282. .led_mode = IWL_LED_BLINK, \
  283. .internal_wimax_coex = true
  284. const struct iwl_cfg iwl6050_2agn_cfg = {
  285. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  286. IWL_DEVICE_6050,
  287. .ht_params = &iwl6000_ht_params,
  288. };
  289. const struct iwl_cfg iwl6050_2abg_cfg = {
  290. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  291. IWL_DEVICE_6050,
  292. };
  293. #define IWL_DEVICE_6150 \
  294. .fw_name_pre = IWL6050_FW_PRE, \
  295. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  296. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  297. .device_family = IWL_DEVICE_FAMILY_6150, \
  298. .max_inst_size = IWL60_RTC_INST_SIZE, \
  299. .max_data_size = IWL60_RTC_DATA_SIZE, \
  300. .nvm_ver = EEPROM_6150_EEPROM_VERSION, \
  301. .nvm_calib_ver = EEPROM_6150_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 iwl6150_bgn_cfg = {
  307. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  308. IWL_DEVICE_6150,
  309. .ht_params = &iwl6000_ht_params,
  310. };
  311. const struct iwl_cfg iwl6150_bg_cfg = {
  312. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
  313. IWL_DEVICE_6150,
  314. };
  315. const struct iwl_cfg iwl6000_3agn_cfg = {
  316. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  317. .fw_name_pre = IWL6000_FW_PRE,
  318. .ucode_api_max = IWL6000_UCODE_API_MAX,
  319. .ucode_api_ok = IWL6000_UCODE_API_OK,
  320. .ucode_api_min = IWL6000_UCODE_API_MIN,
  321. .device_family = IWL_DEVICE_FAMILY_6000,
  322. .max_inst_size = IWL60_RTC_INST_SIZE,
  323. .max_data_size = IWL60_RTC_DATA_SIZE,
  324. .nvm_ver = EEPROM_6000_EEPROM_VERSION,
  325. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  326. .base_params = &iwl6000_base_params,
  327. .eeprom_params = &iwl6000_eeprom_params,
  328. .ht_params = &iwl6000_ht_params,
  329. .led_mode = IWL_LED_BLINK,
  330. };
  331. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
  332. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
  333. MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
  334. MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));