iwl-6000.c 21 KB

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