iwl-6000.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  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. #define IWL130_UCODE_API_MAX 5
  54. /* Lowest firmware API version supported */
  55. #define IWL6000_UCODE_API_MIN 4
  56. #define IWL6050_UCODE_API_MIN 4
  57. #define IWL6000G2_UCODE_API_MIN 4
  58. #define IWL130_UCODE_API_MIN 5
  59. #define IWL6000_FW_PRE "iwlwifi-6000-"
  60. #define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode"
  61. #define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api)
  62. #define IWL6050_FW_PRE "iwlwifi-6050-"
  63. #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
  64. #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
  65. #define IWL6000G2A_FW_PRE "iwlwifi-6000g2a-"
  66. #define _IWL6000G2A_MODULE_FIRMWARE(api) IWL6000G2A_FW_PRE #api ".ucode"
  67. #define IWL6000G2A_MODULE_FIRMWARE(api) _IWL6000G2A_MODULE_FIRMWARE(api)
  68. #define IWL6000G2B_FW_PRE "iwlwifi-6000g2b-"
  69. #define _IWL6000G2B_MODULE_FIRMWARE(api) IWL6000G2B_FW_PRE #api ".ucode"
  70. #define IWL6000G2B_MODULE_FIRMWARE(api) _IWL6000G2B_MODULE_FIRMWARE(api)
  71. #define IWL130_FW_PRE "iwlwifi-130-"
  72. #define _IWL130_MODULE_FIRMWARE(api) IWL130_FW_PRE #api ".ucode"
  73. #define IWL130_MODULE_FIRMWARE(api) _IWL130_MODULE_FIRMWARE(api)
  74. static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
  75. {
  76. /* want Celsius */
  77. priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
  78. priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
  79. }
  80. static void iwl6050_additional_nic_config(struct iwl_priv *priv)
  81. {
  82. /* Indicate calibration version to uCode. */
  83. if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
  84. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  85. CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
  86. }
  87. static void iwl6050g2_additional_nic_config(struct iwl_priv *priv)
  88. {
  89. /* Indicate calibration version to uCode. */
  90. if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
  91. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  92. CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
  93. iwl_set_bit(priv, CSR_GP_DRIVER_REG,
  94. CSR_GP_DRIVER_REG_BIT_6050_1x2);
  95. }
  96. /* NIC configuration for 6000 series */
  97. static void iwl6000_nic_config(struct iwl_priv *priv)
  98. {
  99. u16 radio_cfg;
  100. radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
  101. /* write radio config values to register */
  102. if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX)
  103. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  104. EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
  105. EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
  106. EEPROM_RF_CFG_DASH_MSK(radio_cfg));
  107. /* set CSR_HW_CONFIG_REG for uCode use */
  108. iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
  109. CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
  110. CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
  111. /* no locking required for register write */
  112. if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
  113. /* 2x2 IPA phy type */
  114. iwl_write32(priv, CSR_GP_DRIVER_REG,
  115. CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
  116. }
  117. /* do additional nic configuration if needed */
  118. if (priv->cfg->ops->nic &&
  119. priv->cfg->ops->nic->additional_nic_config) {
  120. priv->cfg->ops->nic->additional_nic_config(priv);
  121. }
  122. }
  123. static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
  124. .min_nrg_cck = 97,
  125. .max_nrg_cck = 0, /* not used, set to 0 */
  126. .auto_corr_min_ofdm = 80,
  127. .auto_corr_min_ofdm_mrc = 128,
  128. .auto_corr_min_ofdm_x1 = 105,
  129. .auto_corr_min_ofdm_mrc_x1 = 192,
  130. .auto_corr_max_ofdm = 145,
  131. .auto_corr_max_ofdm_mrc = 232,
  132. .auto_corr_max_ofdm_x1 = 110,
  133. .auto_corr_max_ofdm_mrc_x1 = 232,
  134. .auto_corr_min_cck = 125,
  135. .auto_corr_max_cck = 175,
  136. .auto_corr_min_cck_mrc = 160,
  137. .auto_corr_max_cck_mrc = 310,
  138. .nrg_th_cck = 97,
  139. .nrg_th_ofdm = 100,
  140. .barker_corr_th_min = 190,
  141. .barker_corr_th_min_mrc = 390,
  142. .nrg_th_cca = 62,
  143. };
  144. static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
  145. {
  146. if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
  147. priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
  148. priv->cfg->base_params->num_of_queues =
  149. priv->cfg->mod_params->num_of_queues;
  150. priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
  151. priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
  152. priv->hw_params.scd_bc_tbls_size =
  153. priv->cfg->base_params->num_of_queues *
  154. sizeof(struct iwlagn_scd_bc_tbl);
  155. priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
  156. priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
  157. priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
  158. priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
  159. priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
  160. priv->hw_params.max_bsm_size = 0;
  161. priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
  162. BIT(IEEE80211_BAND_5GHZ);
  163. priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
  164. priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
  165. priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
  166. priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
  167. priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
  168. if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
  169. priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
  170. /* Set initial sensitivity parameters */
  171. /* Set initial calibration set */
  172. priv->hw_params.sens = &iwl6000_sensitivity;
  173. priv->hw_params.calib_init_cfg =
  174. BIT(IWL_CALIB_XTAL) |
  175. BIT(IWL_CALIB_LO) |
  176. BIT(IWL_CALIB_TX_IQ) |
  177. BIT(IWL_CALIB_BASE_BAND);
  178. if (priv->cfg->need_dc_calib)
  179. priv->hw_params.calib_rt_cfg |= BIT(IWL_CALIB_CFG_DC_IDX);
  180. priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
  181. return 0;
  182. }
  183. static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
  184. struct ieee80211_channel_switch *ch_switch)
  185. {
  186. /*
  187. * MULTI-FIXME
  188. * See iwl_mac_channel_switch.
  189. */
  190. struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
  191. struct iwl6000_channel_switch_cmd cmd;
  192. const struct iwl_channel_info *ch_info;
  193. u32 switch_time_in_usec, ucode_switch_time;
  194. u16 ch;
  195. u32 tsf_low;
  196. u8 switch_count;
  197. u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval);
  198. struct ieee80211_vif *vif = ctx->vif;
  199. struct iwl_host_cmd hcmd = {
  200. .id = REPLY_CHANNEL_SWITCH,
  201. .len = sizeof(cmd),
  202. .flags = CMD_SYNC,
  203. .data = &cmd,
  204. };
  205. cmd.band = priv->band == IEEE80211_BAND_2GHZ;
  206. ch = ch_switch->channel->hw_value;
  207. IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
  208. ctx->active.channel, ch);
  209. cmd.channel = cpu_to_le16(ch);
  210. cmd.rxon_flags = ctx->staging.flags;
  211. cmd.rxon_filter_flags = ctx->staging.filter_flags;
  212. switch_count = ch_switch->count;
  213. tsf_low = ch_switch->timestamp & 0x0ffffffff;
  214. /*
  215. * calculate the ucode channel switch time
  216. * adding TSF as one of the factor for when to switch
  217. */
  218. if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
  219. if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
  220. beacon_interval)) {
  221. switch_count -= (priv->ucode_beacon_time -
  222. tsf_low) / beacon_interval;
  223. } else
  224. switch_count = 0;
  225. }
  226. if (switch_count <= 1)
  227. cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
  228. else {
  229. switch_time_in_usec =
  230. vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
  231. ucode_switch_time = iwl_usecs_to_beacons(priv,
  232. switch_time_in_usec,
  233. beacon_interval);
  234. cmd.switch_time = iwl_add_beacon_time(priv,
  235. priv->ucode_beacon_time,
  236. ucode_switch_time,
  237. beacon_interval);
  238. }
  239. IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
  240. cmd.switch_time);
  241. ch_info = iwl_get_channel_info(priv, priv->band, ch);
  242. if (ch_info)
  243. cmd.expect_beacon = is_channel_radar(ch_info);
  244. else {
  245. IWL_ERR(priv, "invalid channel switch from %u to %u\n",
  246. ctx->active.channel, ch);
  247. return -EFAULT;
  248. }
  249. priv->switch_rxon.channel = cmd.channel;
  250. priv->switch_rxon.switch_in_progress = true;
  251. return iwl_send_cmd_sync(priv, &hcmd);
  252. }
  253. static struct iwl_lib_ops iwl6000_lib = {
  254. .set_hw_params = iwl6000_hw_set_hw_params,
  255. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  256. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  257. .txq_set_sched = iwlagn_txq_set_sched,
  258. .txq_agg_enable = iwlagn_txq_agg_enable,
  259. .txq_agg_disable = iwlagn_txq_agg_disable,
  260. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  261. .txq_free_tfd = iwl_hw_txq_free_tfd,
  262. .txq_init = iwl_hw_tx_queue_init,
  263. .rx_handler_setup = iwlagn_rx_handler_setup,
  264. .setup_deferred_work = iwlagn_setup_deferred_work,
  265. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  266. .load_ucode = iwlagn_load_ucode,
  267. .dump_nic_event_log = iwl_dump_nic_event_log,
  268. .dump_nic_error_log = iwl_dump_nic_error_log,
  269. .dump_csr = iwl_dump_csr,
  270. .dump_fh = iwl_dump_fh,
  271. .init_alive_start = iwlagn_init_alive_start,
  272. .alive_notify = iwlagn_alive_notify,
  273. .send_tx_power = iwlagn_send_tx_power,
  274. .update_chain_flags = iwl_update_chain_flags,
  275. .set_channel_switch = iwl6000_hw_channel_switch,
  276. .apm_ops = {
  277. .init = iwl_apm_init,
  278. .stop = iwl_apm_stop,
  279. .config = iwl6000_nic_config,
  280. .set_pwr_src = iwl_set_pwr_src,
  281. },
  282. .eeprom_ops = {
  283. .regulatory_bands = {
  284. EEPROM_REG_BAND_1_CHANNELS,
  285. EEPROM_REG_BAND_2_CHANNELS,
  286. EEPROM_REG_BAND_3_CHANNELS,
  287. EEPROM_REG_BAND_4_CHANNELS,
  288. EEPROM_REG_BAND_5_CHANNELS,
  289. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  290. EEPROM_REG_BAND_52_HT40_CHANNELS
  291. },
  292. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  293. .release_semaphore = iwlcore_eeprom_release_semaphore,
  294. .calib_version = iwlagn_eeprom_calib_version,
  295. .query_addr = iwlagn_eeprom_query_addr,
  296. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  297. },
  298. .post_associate = iwl_post_associate,
  299. .isr = iwl_isr_ict,
  300. .config_ap = iwl_config_ap,
  301. .temp_ops = {
  302. .temperature = iwlagn_temperature,
  303. .set_ct_kill = iwl6000_set_ct_threshold,
  304. },
  305. .manage_ibss_station = iwlagn_manage_ibss_station,
  306. .update_bcast_stations = iwl_update_bcast_stations,
  307. .debugfs_ops = {
  308. .rx_stats_read = iwl_ucode_rx_stats_read,
  309. .tx_stats_read = iwl_ucode_tx_stats_read,
  310. .general_stats_read = iwl_ucode_general_stats_read,
  311. .bt_stats_read = iwl_ucode_bt_stats_read,
  312. .reply_tx_error = iwl_reply_tx_error_read,
  313. },
  314. .recover_from_tx_stall = iwl_bg_monitor_recover,
  315. .check_plcp_health = iwl_good_plcp_health,
  316. .check_ack_health = iwl_good_ack_health,
  317. .txfifo_flush = iwlagn_txfifo_flush,
  318. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  319. .tt_ops = {
  320. .lower_power_detection = iwl_tt_is_low_power_state,
  321. .tt_power_mode = iwl_tt_current_power_mode,
  322. .ct_kill_check = iwl_check_for_ct_kill,
  323. }
  324. };
  325. static struct iwl_lib_ops iwl6000g2b_lib = {
  326. .set_hw_params = iwl6000_hw_set_hw_params,
  327. .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
  328. .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
  329. .txq_set_sched = iwlagn_txq_set_sched,
  330. .txq_agg_enable = iwlagn_txq_agg_enable,
  331. .txq_agg_disable = iwlagn_txq_agg_disable,
  332. .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
  333. .txq_free_tfd = iwl_hw_txq_free_tfd,
  334. .txq_init = iwl_hw_tx_queue_init,
  335. .rx_handler_setup = iwlagn_bt_rx_handler_setup,
  336. .setup_deferred_work = iwlagn_bt_setup_deferred_work,
  337. .cancel_deferred_work = iwlagn_bt_cancel_deferred_work,
  338. .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
  339. .load_ucode = iwlagn_load_ucode,
  340. .dump_nic_event_log = iwl_dump_nic_event_log,
  341. .dump_nic_error_log = iwl_dump_nic_error_log,
  342. .dump_csr = iwl_dump_csr,
  343. .dump_fh = iwl_dump_fh,
  344. .init_alive_start = iwlagn_init_alive_start,
  345. .alive_notify = iwlagn_alive_notify,
  346. .send_tx_power = iwlagn_send_tx_power,
  347. .update_chain_flags = iwl_update_chain_flags,
  348. .set_channel_switch = iwl6000_hw_channel_switch,
  349. .apm_ops = {
  350. .init = iwl_apm_init,
  351. .stop = iwl_apm_stop,
  352. .config = iwl6000_nic_config,
  353. .set_pwr_src = iwl_set_pwr_src,
  354. },
  355. .eeprom_ops = {
  356. .regulatory_bands = {
  357. EEPROM_REG_BAND_1_CHANNELS,
  358. EEPROM_REG_BAND_2_CHANNELS,
  359. EEPROM_REG_BAND_3_CHANNELS,
  360. EEPROM_REG_BAND_4_CHANNELS,
  361. EEPROM_REG_BAND_5_CHANNELS,
  362. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  363. EEPROM_REG_BAND_52_HT40_CHANNELS
  364. },
  365. .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
  366. .release_semaphore = iwlcore_eeprom_release_semaphore,
  367. .calib_version = iwlagn_eeprom_calib_version,
  368. .query_addr = iwlagn_eeprom_query_addr,
  369. .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
  370. },
  371. .post_associate = iwl_post_associate,
  372. .isr = iwl_isr_ict,
  373. .config_ap = iwl_config_ap,
  374. .temp_ops = {
  375. .temperature = iwlagn_temperature,
  376. .set_ct_kill = iwl6000_set_ct_threshold,
  377. },
  378. .manage_ibss_station = iwlagn_manage_ibss_station,
  379. .update_bcast_stations = iwl_update_bcast_stations,
  380. .debugfs_ops = {
  381. .rx_stats_read = iwl_ucode_rx_stats_read,
  382. .tx_stats_read = iwl_ucode_tx_stats_read,
  383. .general_stats_read = iwl_ucode_general_stats_read,
  384. .bt_stats_read = iwl_ucode_bt_stats_read,
  385. .reply_tx_error = iwl_reply_tx_error_read,
  386. },
  387. .recover_from_tx_stall = iwl_bg_monitor_recover,
  388. .check_plcp_health = iwl_good_plcp_health,
  389. .check_ack_health = iwl_good_ack_health,
  390. .txfifo_flush = iwlagn_txfifo_flush,
  391. .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
  392. .tt_ops = {
  393. .lower_power_detection = iwl_tt_is_low_power_state,
  394. .tt_power_mode = iwl_tt_current_power_mode,
  395. .ct_kill_check = iwl_check_for_ct_kill,
  396. }
  397. };
  398. static struct iwl_nic_ops iwl6050_nic_ops = {
  399. .additional_nic_config = &iwl6050_additional_nic_config,
  400. };
  401. static struct iwl_nic_ops iwl6050g2_nic_ops = {
  402. .additional_nic_config = &iwl6050g2_additional_nic_config,
  403. };
  404. static const struct iwl_ops iwl6000_ops = {
  405. .lib = &iwl6000_lib,
  406. .hcmd = &iwlagn_hcmd,
  407. .utils = &iwlagn_hcmd_utils,
  408. .led = &iwlagn_led_ops,
  409. };
  410. static const struct iwl_ops iwl6050_ops = {
  411. .lib = &iwl6000_lib,
  412. .hcmd = &iwlagn_hcmd,
  413. .utils = &iwlagn_hcmd_utils,
  414. .led = &iwlagn_led_ops,
  415. .nic = &iwl6050_nic_ops,
  416. };
  417. static const struct iwl_ops iwl6050g2_ops = {
  418. .lib = &iwl6000_lib,
  419. .hcmd = &iwlagn_hcmd,
  420. .utils = &iwlagn_hcmd_utils,
  421. .led = &iwlagn_led_ops,
  422. .nic = &iwl6050g2_nic_ops,
  423. };
  424. static const struct iwl_ops iwl6000g2b_ops = {
  425. .lib = &iwl6000g2b_lib,
  426. .hcmd = &iwlagn_bt_hcmd,
  427. .utils = &iwlagn_hcmd_utils,
  428. .led = &iwlagn_led_ops,
  429. };
  430. static struct iwl_base_params iwl6000_base_params = {
  431. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  432. .num_of_queues = IWLAGN_NUM_QUEUES,
  433. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  434. .pll_cfg_val = 0,
  435. .set_l0s = true,
  436. .use_bsm = false,
  437. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  438. .shadow_ram_support = true,
  439. .led_compensation = 51,
  440. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  441. .supports_idle = true,
  442. .adv_thermal_throttle = true,
  443. .support_ct_kill_exit = true,
  444. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  445. .chain_noise_scale = 1000,
  446. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  447. .max_event_log_size = 512,
  448. .ucode_tracing = true,
  449. .sensitivity_calib_by_driver = true,
  450. .chain_noise_calib_by_driver = true,
  451. };
  452. static struct iwl_base_params iwl6050_base_params = {
  453. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  454. .num_of_queues = IWLAGN_NUM_QUEUES,
  455. .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
  456. .pll_cfg_val = 0,
  457. .set_l0s = true,
  458. .use_bsm = false,
  459. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  460. .shadow_ram_support = true,
  461. .led_compensation = 51,
  462. .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
  463. .supports_idle = true,
  464. .adv_thermal_throttle = true,
  465. .support_ct_kill_exit = true,
  466. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  467. .chain_noise_scale = 1500,
  468. .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
  469. .max_event_log_size = 1024,
  470. .ucode_tracing = true,
  471. .sensitivity_calib_by_driver = true,
  472. .chain_noise_calib_by_driver = true,
  473. };
  474. static struct iwl_ht_params iwl6000_ht_params = {
  475. .ht_greenfield_support = true,
  476. .use_rts_for_aggregation = true, /* use rts/cts protection */
  477. };
  478. static struct iwl_bt_params iwl6000_bt_params = {
  479. .bt_statistics = true,
  480. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  481. .advanced_bt_coexist = true,
  482. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  483. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
  484. };
  485. struct iwl_cfg iwl6000g2a_2agn_cfg = {
  486. .name = "6000 Series 2x2 AGN Gen2a",
  487. .fw_name_pre = IWL6000G2A_FW_PRE,
  488. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  489. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  490. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  491. .valid_tx_ant = ANT_AB,
  492. .valid_rx_ant = ANT_AB,
  493. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  494. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  495. .ops = &iwl6000_ops,
  496. .mod_params = &iwlagn_mod_params,
  497. .base_params = &iwl6000_base_params,
  498. .ht_params = &iwl6000_ht_params,
  499. .need_dc_calib = true,
  500. };
  501. struct iwl_cfg iwl6000g2a_2abg_cfg = {
  502. .name = "6000 Series 2x2 ABG Gen2a",
  503. .fw_name_pre = IWL6000G2A_FW_PRE,
  504. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  505. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  506. .sku = IWL_SKU_A|IWL_SKU_G,
  507. .valid_tx_ant = ANT_AB,
  508. .valid_rx_ant = ANT_AB,
  509. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  510. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  511. .ops = &iwl6000_ops,
  512. .mod_params = &iwlagn_mod_params,
  513. .base_params = &iwl6000_base_params,
  514. .need_dc_calib = true,
  515. };
  516. struct iwl_cfg iwl6000g2a_2bg_cfg = {
  517. .name = "6000 Series 2x2 BG Gen2a",
  518. .fw_name_pre = IWL6000G2A_FW_PRE,
  519. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  520. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  521. .sku = IWL_SKU_G,
  522. .valid_tx_ant = ANT_AB,
  523. .valid_rx_ant = ANT_AB,
  524. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  525. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  526. .ops = &iwl6000_ops,
  527. .mod_params = &iwlagn_mod_params,
  528. .base_params = &iwl6000_base_params,
  529. .need_dc_calib = true,
  530. };
  531. struct iwl_cfg iwl6000g2b_2agn_cfg = {
  532. .name = "6000 Series 2x2 AGN Gen2b",
  533. .fw_name_pre = IWL6000G2B_FW_PRE,
  534. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  535. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  536. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  537. .valid_tx_ant = ANT_AB,
  538. .valid_rx_ant = ANT_AB,
  539. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  540. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  541. .ops = &iwl6000g2b_ops,
  542. .mod_params = &iwlagn_mod_params,
  543. .base_params = &iwl6000_base_params,
  544. .bt_params = &iwl6000_bt_params,
  545. .ht_params = &iwl6000_ht_params,
  546. .need_dc_calib = true,
  547. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  548. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  549. };
  550. struct iwl_cfg iwl6000g2b_2abg_cfg = {
  551. .name = "6000 Series 2x2 ABG Gen2b",
  552. .fw_name_pre = IWL6000G2B_FW_PRE,
  553. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  554. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  555. .sku = IWL_SKU_A|IWL_SKU_G,
  556. .valid_tx_ant = ANT_AB,
  557. .valid_rx_ant = ANT_AB,
  558. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  559. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  560. .ops = &iwl6000g2b_ops,
  561. .mod_params = &iwlagn_mod_params,
  562. .base_params = &iwl6000_base_params,
  563. .bt_params = &iwl6000_bt_params,
  564. .need_dc_calib = true,
  565. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  566. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  567. };
  568. struct iwl_cfg iwl6000g2b_2bgn_cfg = {
  569. .name = "6000 Series 2x2 BGN Gen2b",
  570. .fw_name_pre = IWL6000G2B_FW_PRE,
  571. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  572. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  573. .sku = IWL_SKU_G|IWL_SKU_N,
  574. .valid_tx_ant = ANT_AB,
  575. .valid_rx_ant = ANT_AB,
  576. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  577. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  578. .ops = &iwl6000g2b_ops,
  579. .mod_params = &iwlagn_mod_params,
  580. .base_params = &iwl6000_base_params,
  581. .bt_params = &iwl6000_bt_params,
  582. .ht_params = &iwl6000_ht_params,
  583. .need_dc_calib = true,
  584. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  585. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  586. };
  587. struct iwl_cfg iwl6000g2b_2bg_cfg = {
  588. .name = "6000 Series 2x2 BG Gen2b",
  589. .fw_name_pre = IWL6000G2B_FW_PRE,
  590. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  591. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  592. .sku = IWL_SKU_G,
  593. .valid_tx_ant = ANT_AB,
  594. .valid_rx_ant = ANT_AB,
  595. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  596. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  597. .ops = &iwl6000g2b_ops,
  598. .mod_params = &iwlagn_mod_params,
  599. .base_params = &iwl6000_base_params,
  600. .bt_params = &iwl6000_bt_params,
  601. .need_dc_calib = true,
  602. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  603. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  604. };
  605. struct iwl_cfg iwl6000g2b_bgn_cfg = {
  606. .name = "6000 Series 1x2 BGN Gen2b",
  607. .fw_name_pre = IWL6000G2B_FW_PRE,
  608. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  609. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  610. .sku = IWL_SKU_G|IWL_SKU_N,
  611. .valid_tx_ant = ANT_A,
  612. .valid_rx_ant = ANT_AB,
  613. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  614. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  615. .ops = &iwl6000g2b_ops,
  616. .mod_params = &iwlagn_mod_params,
  617. .base_params = &iwl6000_base_params,
  618. .bt_params = &iwl6000_bt_params,
  619. .ht_params = &iwl6000_ht_params,
  620. .need_dc_calib = true,
  621. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  622. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  623. };
  624. struct iwl_cfg iwl6000g2b_bg_cfg = {
  625. .name = "6000 Series 1x2 BG Gen2b",
  626. .fw_name_pre = IWL6000G2B_FW_PRE,
  627. .ucode_api_max = IWL6000G2_UCODE_API_MAX,
  628. .ucode_api_min = IWL6000G2_UCODE_API_MIN,
  629. .sku = IWL_SKU_G,
  630. .valid_tx_ant = ANT_A,
  631. .valid_rx_ant = ANT_AB,
  632. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  633. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  634. .ops = &iwl6000g2b_ops,
  635. .mod_params = &iwlagn_mod_params,
  636. .base_params = &iwl6000_base_params,
  637. .bt_params = &iwl6000_bt_params,
  638. .need_dc_calib = true,
  639. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  640. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  641. };
  642. /*
  643. * "i": Internal configuration, use internal Power Amplifier
  644. */
  645. struct iwl_cfg iwl6000i_2agn_cfg = {
  646. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  647. .fw_name_pre = IWL6000_FW_PRE,
  648. .ucode_api_max = IWL6000_UCODE_API_MAX,
  649. .ucode_api_min = IWL6000_UCODE_API_MIN,
  650. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  651. .valid_tx_ant = ANT_BC,
  652. .valid_rx_ant = ANT_BC,
  653. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  654. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  655. .ops = &iwl6000_ops,
  656. .mod_params = &iwlagn_mod_params,
  657. .base_params = &iwl6000_base_params,
  658. .ht_params = &iwl6000_ht_params,
  659. .pa_type = IWL_PA_INTERNAL,
  660. };
  661. struct iwl_cfg iwl6000i_2abg_cfg = {
  662. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  663. .fw_name_pre = IWL6000_FW_PRE,
  664. .ucode_api_max = IWL6000_UCODE_API_MAX,
  665. .ucode_api_min = IWL6000_UCODE_API_MIN,
  666. .sku = IWL_SKU_A|IWL_SKU_G,
  667. .valid_tx_ant = ANT_BC,
  668. .valid_rx_ant = ANT_BC,
  669. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  670. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  671. .ops = &iwl6000_ops,
  672. .mod_params = &iwlagn_mod_params,
  673. .base_params = &iwl6000_base_params,
  674. .pa_type = IWL_PA_INTERNAL,
  675. };
  676. struct iwl_cfg iwl6000i_2bg_cfg = {
  677. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  678. .fw_name_pre = IWL6000_FW_PRE,
  679. .ucode_api_max = IWL6000_UCODE_API_MAX,
  680. .ucode_api_min = IWL6000_UCODE_API_MIN,
  681. .sku = IWL_SKU_G,
  682. .valid_tx_ant = ANT_BC,
  683. .valid_rx_ant = ANT_BC,
  684. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  685. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  686. .ops = &iwl6000_ops,
  687. .mod_params = &iwlagn_mod_params,
  688. .base_params = &iwl6000_base_params,
  689. .pa_type = IWL_PA_INTERNAL,
  690. };
  691. struct iwl_cfg iwl6050_2agn_cfg = {
  692. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  693. .fw_name_pre = IWL6050_FW_PRE,
  694. .ucode_api_max = IWL6050_UCODE_API_MAX,
  695. .ucode_api_min = IWL6050_UCODE_API_MIN,
  696. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  697. .valid_tx_ant = ANT_AB,
  698. .valid_rx_ant = ANT_AB,
  699. .ops = &iwl6000_ops,
  700. .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
  701. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
  702. .mod_params = &iwlagn_mod_params,
  703. .base_params = &iwl6050_base_params,
  704. .ht_params = &iwl6000_ht_params,
  705. .need_dc_calib = true,
  706. };
  707. struct iwl_cfg iwl6050g2_bgn_cfg = {
  708. .name = "6050 Series 1x2 BGN Gen2",
  709. .fw_name_pre = IWL6050_FW_PRE,
  710. .ucode_api_max = IWL6050_UCODE_API_MAX,
  711. .ucode_api_min = IWL6050_UCODE_API_MIN,
  712. .sku = IWL_SKU_G|IWL_SKU_N,
  713. .valid_tx_ant = ANT_A,
  714. .valid_rx_ant = ANT_AB,
  715. .eeprom_ver = EEPROM_6050G2_EEPROM_VERSION,
  716. .eeprom_calib_ver = EEPROM_6050G2_TX_POWER_VERSION,
  717. .ops = &iwl6050g2_ops,
  718. .mod_params = &iwlagn_mod_params,
  719. .base_params = &iwl6050_base_params,
  720. .ht_params = &iwl6000_ht_params,
  721. .need_dc_calib = true,
  722. };
  723. struct iwl_cfg iwl6050_2abg_cfg = {
  724. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  725. .fw_name_pre = IWL6050_FW_PRE,
  726. .ucode_api_max = IWL6050_UCODE_API_MAX,
  727. .ucode_api_min = IWL6050_UCODE_API_MIN,
  728. .sku = IWL_SKU_A|IWL_SKU_G,
  729. .valid_tx_ant = ANT_AB,
  730. .valid_rx_ant = ANT_AB,
  731. .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
  732. .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
  733. .ops = &iwl6050_ops,
  734. .mod_params = &iwlagn_mod_params,
  735. .base_params = &iwl6050_base_params,
  736. .need_dc_calib = true,
  737. };
  738. struct iwl_cfg iwl6000_3agn_cfg = {
  739. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  740. .fw_name_pre = IWL6000_FW_PRE,
  741. .ucode_api_max = IWL6000_UCODE_API_MAX,
  742. .ucode_api_min = IWL6000_UCODE_API_MIN,
  743. .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
  744. .valid_tx_ant = ANT_ABC,
  745. .valid_rx_ant = ANT_ABC,
  746. .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
  747. .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  748. .ops = &iwl6000_ops,
  749. .mod_params = &iwlagn_mod_params,
  750. .base_params = &iwl6000_base_params,
  751. .ht_params = &iwl6000_ht_params,
  752. .need_dc_calib = true,
  753. };
  754. struct iwl_cfg iwl130_bgn_cfg = {
  755. .name = "Intel(R) 130 Series 1x1 BGN",
  756. .fw_name_pre = IWL6000G2B_FW_PRE,
  757. .ucode_api_max = IWL130_UCODE_API_MAX,
  758. .ucode_api_min = IWL130_UCODE_API_MIN,
  759. .sku = IWL_SKU_G|IWL_SKU_N,
  760. .valid_tx_ant = ANT_A,
  761. .valid_rx_ant = ANT_A,
  762. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  763. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  764. .ops = &iwl6000g2b_ops,
  765. .mod_params = &iwlagn_mod_params,
  766. .base_params = &iwl6000_base_params,
  767. .bt_params = &iwl6000_bt_params,
  768. .ht_params = &iwl6000_ht_params,
  769. .need_dc_calib = true,
  770. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  771. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  772. };
  773. struct iwl_cfg iwl130_bg_cfg = {
  774. .name = "Intel(R) 130 Series 1x2 BG",
  775. .fw_name_pre = IWL6000G2B_FW_PRE,
  776. .ucode_api_max = IWL130_UCODE_API_MAX,
  777. .ucode_api_min = IWL130_UCODE_API_MIN,
  778. .sku = IWL_SKU_G,
  779. .valid_tx_ant = ANT_A,
  780. .valid_rx_ant = ANT_A,
  781. .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
  782. .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
  783. .ops = &iwl6000g2b_ops,
  784. .mod_params = &iwlagn_mod_params,
  785. .base_params = &iwl6000_base_params,
  786. .bt_params = &iwl6000_bt_params,
  787. .need_dc_calib = true,
  788. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  789. .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
  790. };
  791. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
  792. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
  793. MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
  794. MODULE_FIRMWARE(IWL6000G2B_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
  795. MODULE_FIRMWARE(IWL130_MODULE_FIRMWARE(IWL130_UCODE_API_MAX));