iwl-6000.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 2010 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/kernel.h>
  27. #include <linux/module.h>
  28. #include <linux/init.h>
  29. #include <linux/pci.h>
  30. #include <linux/dma-mapping.h>
  31. #include <linux/delay.h>
  32. #include <linux/skbuff.h>
  33. #include <linux/netdevice.h>
  34. #include <linux/wireless.h>
  35. #include <net/mac80211.h>
  36. #include <linux/etherdevice.h>
  37. #include <asm/unaligned.h>
  38. #include "iwl-eeprom.h"
  39. #include "iwl-dev.h"
  40. #include "iwl-core.h"
  41. #include "iwl-io.h"
  42. #include "iwl-sta.h"
  43. #include "iwl-agn.h"
  44. #include "iwl-helpers.h"
  45. #include "iwl-agn-hw.h"
  46. #include "iwl-6000-hw.h"
  47. #include "iwl-agn-led.h"
  48. #include "iwl-agn-debugfs.h"
  49. /* Highest firmware API version supported */
  50. #define IWL6000_UCODE_API_MAX 4
  51. #define IWL6050_UCODE_API_MAX 5
  52. #define IWL6000G2_UCODE_API_MAX 5
  53. /* Lowest firmware API version supported */
  54. #define IWL6000_UCODE_API_MIN 4
  55. #define IWL6050_UCODE_API_MIN 4
  56. #define IWL6000G2_UCODE_API_MIN 4
  57. #define IWL6000_FW_PRE "iwlwifi-6000-"
  58. #define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode"
  59. #define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api)
  60. #define IWL6050_FW_PRE "iwlwifi-6050-"
  61. #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
  62. #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
  63. #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
  64. #define _IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE #api ".ucode"
  65. #define IWL6005_MODULE_FIRMWARE(api) _IWL6005_MODULE_FIRMWARE(api)
  66. #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
  67. #define _IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE #api ".ucode"
  68. #define IWL6030_MODULE_FIRMWARE(api) _IWL6030_MODULE_FIRMWARE(api)
  69. static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
  70. {
  71. /* want Celsius */
  72. priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
  73. priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
  74. }
  75. static void iwl6050_additional_nic_config(struct iwl_priv *priv)
  76. {
  77. /* Indicate calibration version to uCode. */
  78. if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
  79. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  80. CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
  81. }
  82. static void iwl6150_additional_nic_config(struct iwl_priv *priv)
  83. {
  84. /* Indicate calibration version to uCode. */
  85. if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
  86. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  87. CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
  88. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  89. CSR_GP_DRIVER_REG_BIT_6050_1x2);
  90. }
  91. /* NIC configuration for 6000 series */
  92. static void iwl6000_nic_config(struct iwl_priv *priv)
  93. {
  94. u16 radio_cfg;
  95. radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
  96. /* write radio config values to register */
  97. if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX)
  98. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  99. EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
  100. EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
  101. EEPROM_RF_CFG_DASH_MSK(radio_cfg));
  102. /* set CSR_HW_CONFIG_REG for uCode use */
  103. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  104. CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
  105. CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
  106. /* no locking required for register write */
  107. if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
  108. /* 2x2 IPA phy type */
  109. iwl_write32(priv, CSR_GP_DRIVER_REG,
  110. CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
  111. }
  112. /* do additional nic configuration if needed */
  113. if (priv->cfg->ops->nic &&
  114. priv->cfg->ops->nic->additional_nic_config) {
  115. priv->cfg->ops->nic->additional_nic_config(priv);
  116. }
  117. }
  118. static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
  119. .min_nrg_cck = 97,
  120. .max_nrg_cck = 0, /* not used, set to 0 */
  121. .auto_corr_min_ofdm = 80,
  122. .auto_corr_min_ofdm_mrc = 128,
  123. .auto_corr_min_ofdm_x1 = 105,
  124. .auto_corr_min_ofdm_mrc_x1 = 192,
  125. .auto_corr_max_ofdm = 145,
  126. .auto_corr_max_ofdm_mrc = 232,
  127. .auto_corr_max_ofdm_x1 = 110,
  128. .auto_corr_max_ofdm_mrc_x1 = 232,
  129. .auto_corr_min_cck = 125,
  130. .auto_corr_max_cck = 175,
  131. .auto_corr_min_cck_mrc = 160,
  132. .auto_corr_max_cck_mrc = 310,
  133. .nrg_th_cck = 97,
  134. .nrg_th_ofdm = 100,
  135. .barker_corr_th_min = 190,
  136. .barker_corr_th_min_mrc = 390,
  137. .nrg_th_cca = 62,
  138. };
  139. static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
  140. {
  141. if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
  142. priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
  143. priv->cfg->base_params->num_of_queues =
  144. priv->cfg->mod_params->num_of_queues;
  145. priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
  146. priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
  147. priv->hw_params.scd_bc_tbls_size =
  148. priv->cfg->base_params->num_of_queues *
  149. sizeof(struct iwlagn_scd_bc_tbl);
  150. priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
  151. priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
  152. priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
  153. priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
  154. priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
  155. priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
  156. BIT(IEEE80211_BAND_5GHZ);
  157. priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
  158. priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
  159. if (priv->cfg->rx_with_siso_diversity)
  160. priv->hw_params.rx_chains_num = 1;
  161. else
  162. priv->hw_params.rx_chains_num =
  163. num_of_ant(priv->cfg->valid_rx_ant);
  164. priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
  165. priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
  166. iwl6000_set_ct_threshold(priv);
  167. /* Set initial sensitivity parameters */
  168. /* Set initial calibration set */
  169. priv->hw_params.sens = &iwl6000_sensitivity;
  170. priv->hw_params.calib_init_cfg =
  171. BIT(IWL_CALIB_XTAL) |
  172. BIT(IWL_CALIB_LO) |
  173. BIT(IWL_CALIB_TX_IQ) |
  174. BIT(IWL_CALIB_BASE_BAND);
  175. if (priv->cfg->need_dc_calib)
  176. priv->hw_params.calib_rt_cfg |= BIT(IWL_CALIB_CFG_DC_IDX);
  177. if (priv->cfg->need_temp_offset_calib)
  178. priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_TEMP_OFFSET);
  179. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  180. return 0;
  181. }
  182. static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
  183. struct ieee80211_channel_switch *ch_switch)
  184. {
  185. /*
  186. * MULTI-FIXME
  187. * See iwl_mac_channel_switch.
  188. */
  189. struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
  190. struct iwl6000_channel_switch_cmd cmd;
  191. const struct iwl_channel_info *ch_info;
  192. u32 switch_time_in_usec, ucode_switch_time;
  193. u16 ch;
  194. u32 tsf_low;
  195. u8 switch_count;
  196. u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval);
  197. struct ieee80211_vif *vif = ctx->vif;
  198. struct iwl_host_cmd hcmd = {
  199. .id = REPLY_CHANNEL_SWITCH,
  200. .len = sizeof(cmd),
  201. .flags = CMD_SYNC,
  202. .data = &cmd,
  203. };
  204. cmd.band = priv->band == IEEE80211_BAND_2GHZ;
  205. ch = ch_switch->channel->hw_value;
  206. IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
  207. ctx->active.channel, ch);
  208. cmd.channel = cpu_to_le16(ch);
  209. cmd.rxon_flags = ctx->staging.flags;
  210. cmd.rxon_filter_flags = ctx->staging.filter_flags;
  211. switch_count = ch_switch->count;
  212. tsf_low = ch_switch->timestamp & 0x0ffffffff;
  213. /*
  214. * calculate the ucode channel switch time
  215. * adding TSF as one of the factor for when to switch
  216. */
  217. if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
  218. if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
  219. beacon_interval)) {
  220. switch_count -= (priv->ucode_beacon_time -
  221. tsf_low) / beacon_interval;
  222. } else
  223. switch_count = 0;
  224. }
  225. if (switch_count <= 1)
  226. cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
  227. else {
  228. switch_time_in_usec =
  229. vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
  230. ucode_switch_time = iwl_usecs_to_beacons(priv,
  231. switch_time_in_usec,
  232. beacon_interval);
  233. cmd.switch_time = iwl_add_beacon_time(priv,
  234. priv->ucode_beacon_time,
  235. ucode_switch_time,
  236. beacon_interval);
  237. }
  238. IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
  239. cmd.switch_time);
  240. ch_info = iwl_get_channel_info(priv, priv->band, ch);
  241. if (ch_info)
  242. cmd.expect_beacon = is_channel_radar(ch_info);
  243. else {
  244. IWL_ERR(priv, "invalid channel switch from %u to %u\n",
  245. ctx->active.channel, ch);
  246. return -EFAULT;
  247. }
  248. priv->switch_rxon.channel = cmd.channel;
  249. priv->switch_rxon.switch_in_progress = true;
  250. return iwl_send_cmd_sync(priv, &hcmd);
  251. }
  252. static struct iwl_lib_ops iwl6000_lib = {
  253. .set_hw_params = iwl6000_hw_set_hw_params,
  254. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  255. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  256. .txq_set_sched = iwlagn_txq_set_sched,
  257. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  258. .txq_free_tfd = iwl_hw_txq_free_tfd,
  259. .txq_init = iwl_hw_tx_queue_init,
  260. .rx_handler_setup = iwlagn_rx_handler_setup,
  261. .setup_deferred_work = iwlagn_setup_deferred_work,
  262. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  263. .dump_nic_event_log = iwl_dump_nic_event_log,
  264. .dump_nic_error_log = iwl_dump_nic_error_log,
  265. .dump_csr = iwl_dump_csr,
  266. .dump_fh = iwl_dump_fh,
  267. .send_tx_power = iwlagn_send_tx_power,
  268. .update_chain_flags = iwl_update_chain_flags,
  269. .set_channel_switch = iwl6000_hw_channel_switch,
  270. .apm_ops = {
  271. .init = iwl_apm_init,
  272. .config = iwl6000_nic_config,
  273. },
  274. .eeprom_ops = {
  275. .regulatory_bands = {
  276. EEPROM_REG_BAND_1_CHANNELS,
  277. EEPROM_REG_BAND_2_CHANNELS,
  278. EEPROM_REG_BAND_3_CHANNELS,
  279. EEPROM_REG_BAND_4_CHANNELS,
  280. EEPROM_REG_BAND_5_CHANNELS,
  281. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  282. EEPROM_REG_BAND_52_HT40_CHANNELS
  283. },
  284. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  285. .release_semaphore = iwlcore_eeprom_release_semaphore,
  286. .calib_version = iwlagn_eeprom_calib_version,
  287. .query_addr = iwlagn_eeprom_query_addr,
  288. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  289. },
  290. .isr_ops = {
  291. .isr = iwl_isr_ict,
  292. .free = iwl_free_isr_ict,
  293. .alloc = iwl_alloc_isr_ict,
  294. .reset = iwl_reset_ict,
  295. .disable = iwl_disable_ict,
  296. },
  297. .temp_ops = {
  298. .temperature = iwlagn_temperature,
  299. },
  300. .debugfs_ops = {
  301. .rx_stats_read = iwl_ucode_rx_stats_read,
  302. .tx_stats_read = iwl_ucode_tx_stats_read,
  303. .general_stats_read = iwl_ucode_general_stats_read,
  304. .bt_stats_read = iwl_ucode_bt_stats_read,
  305. .reply_tx_error = iwl_reply_tx_error_read,
  306. },
  307. .txfifo_flush = iwlagn_txfifo_flush,
  308. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  309. .tt_ops = {
  310. .lower_power_detection = iwl_tt_is_low_power_state,
  311. .tt_power_mode = iwl_tt_current_power_mode,
  312. .ct_kill_check = iwl_check_for_ct_kill,
  313. }
  314. };
  315. static struct iwl_lib_ops iwl6030_lib = {
  316. .set_hw_params = iwl6000_hw_set_hw_params,
  317. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  318. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  319. .txq_set_sched = iwlagn_txq_set_sched,
  320. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  321. .txq_free_tfd = iwl_hw_txq_free_tfd,
  322. .txq_init = iwl_hw_tx_queue_init,
  323. .rx_handler_setup = iwlagn_bt_rx_handler_setup,
  324. .setup_deferred_work = iwlagn_bt_setup_deferred_work,
  325. .cancel_deferred_work = iwlagn_bt_cancel_deferred_work,
  326. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  327. .dump_nic_event_log = iwl_dump_nic_event_log,
  328. .dump_nic_error_log = iwl_dump_nic_error_log,
  329. .dump_csr = iwl_dump_csr,
  330. .dump_fh = iwl_dump_fh,
  331. .send_tx_power = iwlagn_send_tx_power,
  332. .update_chain_flags = iwl_update_chain_flags,
  333. .set_channel_switch = iwl6000_hw_channel_switch,
  334. .apm_ops = {
  335. .init = iwl_apm_init,
  336. .config = iwl6000_nic_config,
  337. },
  338. .eeprom_ops = {
  339. .regulatory_bands = {
  340. EEPROM_REG_BAND_1_CHANNELS,
  341. EEPROM_REG_BAND_2_CHANNELS,
  342. EEPROM_REG_BAND_3_CHANNELS,
  343. EEPROM_REG_BAND_4_CHANNELS,
  344. EEPROM_REG_BAND_5_CHANNELS,
  345. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  346. EEPROM_REG_BAND_52_HT40_CHANNELS
  347. },
  348. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  349. .release_semaphore = iwlcore_eeprom_release_semaphore,
  350. .calib_version = iwlagn_eeprom_calib_version,
  351. .query_addr = iwlagn_eeprom_query_addr,
  352. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  353. },
  354. .isr_ops = {
  355. .isr = iwl_isr_ict,
  356. .free = iwl_free_isr_ict,
  357. .alloc = iwl_alloc_isr_ict,
  358. .reset = iwl_reset_ict,
  359. .disable = iwl_disable_ict,
  360. },
  361. .temp_ops = {
  362. .temperature = iwlagn_temperature,
  363. },
  364. .debugfs_ops = {
  365. .rx_stats_read = iwl_ucode_rx_stats_read,
  366. .tx_stats_read = iwl_ucode_tx_stats_read,
  367. .general_stats_read = iwl_ucode_general_stats_read,
  368. .bt_stats_read = iwl_ucode_bt_stats_read,
  369. .reply_tx_error = iwl_reply_tx_error_read,
  370. },
  371. .txfifo_flush = iwlagn_txfifo_flush,
  372. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  373. .tt_ops = {
  374. .lower_power_detection = iwl_tt_is_low_power_state,
  375. .tt_power_mode = iwl_tt_current_power_mode,
  376. .ct_kill_check = iwl_check_for_ct_kill,
  377. }
  378. };
  379. static struct iwl_nic_ops iwl6050_nic_ops = {
  380. .additional_nic_config = &iwl6050_additional_nic_config,
  381. };
  382. static struct iwl_nic_ops iwl6150_nic_ops = {
  383. .additional_nic_config = &iwl6150_additional_nic_config,
  384. };
  385. static const struct iwl_ops iwl6000_ops = {
  386. .lib = &iwl6000_lib,
  387. .hcmd = &iwlagn_hcmd,
  388. .utils = &iwlagn_hcmd_utils,
  389. .led = &iwlagn_led_ops,
  390. .ieee80211_ops = &iwlagn_hw_ops,
  391. };
  392. static const struct iwl_ops iwl6050_ops = {
  393. .lib = &iwl6000_lib,
  394. .hcmd = &iwlagn_hcmd,
  395. .utils = &iwlagn_hcmd_utils,
  396. .led = &iwlagn_led_ops,
  397. .nic = &iwl6050_nic_ops,
  398. .ieee80211_ops = &iwlagn_hw_ops,
  399. };
  400. static const struct iwl_ops iwl6150_ops = {
  401. .lib = &iwl6000_lib,
  402. .hcmd = &iwlagn_hcmd,
  403. .utils = &iwlagn_hcmd_utils,
  404. .led = &iwlagn_led_ops,
  405. .nic = &iwl6150_nic_ops,
  406. .ieee80211_ops = &iwlagn_hw_ops,
  407. };
  408. static const struct iwl_ops iwl6030_ops = {
  409. .lib = &iwl6030_lib,
  410. .hcmd = &iwlagn_bt_hcmd,
  411. .utils = &iwlagn_hcmd_utils,
  412. .led = &iwlagn_led_ops,
  413. .ieee80211_ops = &iwlagn_hw_ops,
  414. };
  415. static struct iwl_base_params iwl6000_base_params = {
  416. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  417. .num_of_queues = IWLAGN_NUM_QUEUES,
  418. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  419. .pll_cfg_val = 0,
  420. .set_l0s = true,
  421. .use_bsm = false,
  422. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  423. .shadow_ram_support = true,
  424. .led_compensation = 51,
  425. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  426. .adv_thermal_throttle = true,
  427. .support_ct_kill_exit = true,
  428. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  429. .chain_noise_scale = 1000,
  430. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  431. .max_event_log_size = 512,
  432. .ucode_tracing = true,
  433. .sensitivity_calib_by_driver = true,
  434. .chain_noise_calib_by_driver = true,
  435. .shadow_reg_enable = true,
  436. };
  437. static struct iwl_base_params iwl6050_base_params = {
  438. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  439. .num_of_queues = IWLAGN_NUM_QUEUES,
  440. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  441. .pll_cfg_val = 0,
  442. .set_l0s = true,
  443. .use_bsm = false,
  444. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  445. .shadow_ram_support = true,
  446. .led_compensation = 51,
  447. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  448. .adv_thermal_throttle = true,
  449. .support_ct_kill_exit = true,
  450. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  451. .chain_noise_scale = 1500,
  452. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  453. .max_event_log_size = 1024,
  454. .ucode_tracing = true,
  455. .sensitivity_calib_by_driver = true,
  456. .chain_noise_calib_by_driver = true,
  457. .shadow_reg_enable = true,
  458. };
  459. static struct iwl_base_params iwl6000_g2_base_params = {
  460. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  461. .num_of_queues = IWLAGN_NUM_QUEUES,
  462. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  463. .pll_cfg_val = 0,
  464. .set_l0s = true,
  465. .use_bsm = false,
  466. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  467. .shadow_ram_support = true,
  468. .led_compensation = 57,
  469. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  470. .adv_thermal_throttle = true,
  471. .support_ct_kill_exit = true,
  472. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  473. .chain_noise_scale = 1000,
  474. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  475. .max_event_log_size = 512,
  476. .ucode_tracing = true,
  477. .sensitivity_calib_by_driver = true,
  478. .chain_noise_calib_by_driver = true,
  479. .shadow_reg_enable = true,
  480. };
  481. static struct iwl_ht_params iwl6000_ht_params = {
  482. .ht_greenfield_support = true,
  483. .use_rts_for_aggregation = true, /* use rts/cts protection */
  484. };
  485. static struct iwl_bt_params iwl6000_bt_params = {
  486. .bt_statistics = true,
  487. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  488. .advanced_bt_coexist = true,
  489. .agg_time_limit = BT_AGG_THRESHOLD_DEF,
  490. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  491. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
  492. .bt_sco_disable = true,
  493. };
  494. #define IWL_DEVICE_6005 \
  495. .fw_name_pre = IWL6005_FW_PRE, \
  496. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  497. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  498. .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \
  499. .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
  500. .ops = &iwl6000_ops, \
  501. .mod_params = &iwlagn_mod_params, \
  502. .base_params = &iwl6000_g2_base_params, \
  503. .need_dc_calib = true, \
  504. .need_temp_offset_calib = true, \
  505. .led_mode = IWL_LED_RF_STATE
  506. struct iwl_cfg iwl6005_2agn_cfg = {
  507. .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
  508. IWL_DEVICE_6005,
  509. .ht_params = &iwl6000_ht_params,
  510. };
  511. struct iwl_cfg iwl6005_2abg_cfg = {
  512. .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
  513. IWL_DEVICE_6005,
  514. };
  515. struct iwl_cfg iwl6005_2bg_cfg = {
  516. .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
  517. IWL_DEVICE_6005,
  518. };
  519. #define IWL_DEVICE_6030 \
  520. .fw_name_pre = IWL6030_FW_PRE, \
  521. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  522. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  523. .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \
  524. .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  525. .ops = &iwl6030_ops, \
  526. .mod_params = &iwlagn_mod_params, \
  527. .base_params = &iwl6000_g2_base_params, \
  528. .bt_params = &iwl6000_bt_params, \
  529. .need_dc_calib = true, \
  530. .need_temp_offset_calib = true, \
  531. .led_mode = IWL_LED_RF_STATE, \
  532. .adv_pm = true \
  533. struct iwl_cfg iwl6030_2agn_cfg = {
  534. .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
  535. IWL_DEVICE_6030,
  536. .ht_params = &iwl6000_ht_params,
  537. };
  538. struct iwl_cfg iwl6030_2abg_cfg = {
  539. .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
  540. IWL_DEVICE_6030,
  541. };
  542. struct iwl_cfg iwl6030_2bgn_cfg = {
  543. .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
  544. IWL_DEVICE_6030,
  545. .ht_params = &iwl6000_ht_params,
  546. };
  547. struct iwl_cfg iwl6030_2bg_cfg = {
  548. .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
  549. IWL_DEVICE_6030,
  550. };
  551. struct iwl_cfg iwl6035_2agn_cfg = {
  552. .name = "6035 Series 2x2 AGN/BT",
  553. IWL_DEVICE_6030,
  554. .ht_params = &iwl6000_ht_params,
  555. };
  556. struct iwl_cfg iwl6035_2abg_cfg = {
  557. .name = "6035 Series 2x2 ABG/BT",
  558. IWL_DEVICE_6030,
  559. };
  560. struct iwl_cfg iwl6035_2bg_cfg = {
  561. .name = "6035 Series 2x2 BG/BT",
  562. IWL_DEVICE_6030,
  563. };
  564. struct iwl_cfg iwl1030_bgn_cfg = {
  565. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  566. IWL_DEVICE_6030,
  567. .ht_params = &iwl6000_ht_params,
  568. };
  569. struct iwl_cfg iwl1030_bg_cfg = {
  570. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  571. IWL_DEVICE_6030,
  572. };
  573. struct iwl_cfg iwl130_bgn_cfg = {
  574. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  575. IWL_DEVICE_6030,
  576. .ht_params = &iwl6000_ht_params,
  577. .rx_with_siso_diversity = true,
  578. };
  579. struct iwl_cfg iwl130_bg_cfg = {
  580. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  581. IWL_DEVICE_6030,
  582. .rx_with_siso_diversity = true,
  583. };
  584. /*
  585. * "i": Internal configuration, use internal Power Amplifier
  586. */
  587. #define IWL_DEVICE_6000i \
  588. .fw_name_pre = IWL6000_FW_PRE, \
  589. .ucode_api_max = IWL6000_UCODE_API_MAX, \
  590. .ucode_api_min = IWL6000_UCODE_API_MIN, \
  591. .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
  592. .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
  593. .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \
  594. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
  595. .ops = &iwl6000_ops, \
  596. .mod_params = &iwlagn_mod_params, \
  597. .base_params = &iwl6000_base_params, \
  598. .pa_type = IWL_PA_INTERNAL, \
  599. .led_mode = IWL_LED_BLINK
  600. struct iwl_cfg iwl6000i_2agn_cfg = {
  601. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  602. IWL_DEVICE_6000i,
  603. .ht_params = &iwl6000_ht_params,
  604. };
  605. struct iwl_cfg iwl6000i_2abg_cfg = {
  606. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  607. IWL_DEVICE_6000i,
  608. };
  609. struct iwl_cfg iwl6000i_2bg_cfg = {
  610. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  611. IWL_DEVICE_6000i,
  612. };
  613. #define IWL_DEVICE_6050 \
  614. .fw_name_pre = IWL6050_FW_PRE, \
  615. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  616. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  617. .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
  618. .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
  619. .ops = &iwl6050_ops, \
  620. .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \
  621. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
  622. .mod_params = &iwlagn_mod_params, \
  623. .base_params = &iwl6050_base_params, \
  624. .need_dc_calib = true, \
  625. .led_mode = IWL_LED_BLINK, \
  626. .internal_wimax_coex = true
  627. struct iwl_cfg iwl6050_2agn_cfg = {
  628. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  629. IWL_DEVICE_6050,
  630. .ht_params = &iwl6000_ht_params,
  631. };
  632. struct iwl_cfg iwl6050_2abg_cfg = {
  633. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  634. IWL_DEVICE_6050,
  635. };
  636. struct iwl_cfg iwl6150_bgn_cfg = {
  637. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  638. .fw_name_pre = IWL6050_FW_PRE,
  639. .ucode_api_max = IWL6050_UCODE_API_MAX,
  640. .ucode_api_min = IWL6050_UCODE_API_MIN,
  641. .eeprom_ver = EEPROM_6150_EEPROM_VERSION,
  642. .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION,
  643. .ops = &iwl6150_ops,
  644. .mod_params = &iwlagn_mod_params,
  645. .base_params = &iwl6050_base_params,
  646. .ht_params = &iwl6000_ht_params,
  647. .need_dc_calib = true,
  648. .led_mode = IWL_LED_RF_STATE,
  649. .internal_wimax_coex = true,
  650. };
  651. struct iwl_cfg iwl6000_3agn_cfg = {
  652. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  653. .fw_name_pre = IWL6000_FW_PRE,
  654. .ucode_api_max = IWL6000_UCODE_API_MAX,
  655. .ucode_api_min = IWL6000_UCODE_API_MIN,
  656. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  657. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  658. .ops = &iwl6000_ops,
  659. .mod_params = &iwlagn_mod_params,
  660. .base_params = &iwl6000_base_params,
  661. .ht_params = &iwl6000_ht_params,
  662. .need_dc_calib = true,
  663. .led_mode = IWL_LED_BLINK,
  664. };
  665. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
  666. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
  667. MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
  668. MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));