iwl-agn.h revision a8674a1efca60d863d4caa47e102cc4d70d5ff9b
1a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg/****************************************************************************** 2a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 3a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * This file is provided under a dual BSD/GPLv2 license. When using or 4a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * redistributing this file, you may do so under either license. 5a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 6a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * GPL LICENSE SUMMARY 7a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 8901069c71415a76d731857ccda814e18ded062f7Wey-Yi Guy * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 9a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 10a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * This program is free software; you can redistribute it and/or modify 11a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * it under the terms of version 2 of the GNU General Public License as 12a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * published by the Free Software Foundation. 13a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 14a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * This program is distributed in the hope that it will be useful, but 15a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * WITHOUT ANY WARRANTY; without even the implied warranty of 16a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * General Public License for more details. 18a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 19a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * You should have received a copy of the GNU General Public License 20a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * along with this program; if not, write to the Free Software 21a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 22a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * USA 23a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 24a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * The full GNU General Public License is included in this distribution 25a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * in the file called LICENSE.GPL. 26a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 27a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * Contact Information: 28a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * Intel Linux Wireless <ilw@linux.intel.com> 29a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 30a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 31a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * BSD LICENSE 32a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 33901069c71415a76d731857ccda814e18ded062f7Wey-Yi Guy * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. 34a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * All rights reserved. 35a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 36a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * Redistribution and use in source and binary forms, with or without 37a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * modification, are permitted provided that the following conditions 38a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * are met: 39a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 40a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * * Redistributions of source code must retain the above copyright 41a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * notice, this list of conditions and the following disclaimer. 42a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * * Redistributions in binary form must reproduce the above copyright 43a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * notice, this list of conditions and the following disclaimer in 44a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * the documentation and/or other materials provided with the 45a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * distribution. 46a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * * Neither the name Intel Corporation nor the names of its 47a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * contributors may be used to endorse or promote products derived 48a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * from this software without specific prior written permission. 49a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * 50a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 51a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 52a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 53a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 54a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 56a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 57a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 58a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 59a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 60a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg *****************************************************************************/ 62a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg 63a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg#ifndef __iwl_agn_h__ 64a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg#define __iwl_agn_h__ 65a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg 66a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg#include "iwl-dev.h" 67a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg 68bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guy/* configuration for the _agn devices */ 69bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl5300_agn_cfg; 70bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl5100_agn_cfg; 71bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl5350_agn_cfg; 72bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl5100_bgn_cfg; 73bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl5100_abg_cfg; 74bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl5150_agn_cfg; 75bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl5150_abg_cfg; 768b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl6005_2agn_cfg; 778b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl6005_2abg_cfg; 788b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl6005_2bg_cfg; 798b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl1030_bgn_cfg; 808b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl1030_bg_cfg; 818b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl6030_2agn_cfg; 828b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl6030_2abg_cfg; 838b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl6030_2bgn_cfg; 848b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl6030_2bg_cfg; 85bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl6000i_2agn_cfg; 86bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl6000i_2abg_cfg; 87bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl6000i_2bg_cfg; 88bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl6000_3agn_cfg; 89bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl6050_2agn_cfg; 90bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl6050_2abg_cfg; 918b3ee29626031155c7844988ebe4321c151c03a2Wey-Yi Guyextern struct iwl_cfg iwl6150_bgn_cfg; 92bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl1000_bgn_cfg; 93bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guyextern struct iwl_cfg iwl1000_bg_cfg; 941de19eccb3fe634e939cb40f30fdfda93a67fe93Jay Sternbergextern struct iwl_cfg iwl100_bgn_cfg; 951de19eccb3fe634e939cb40f30fdfda93a67fe93Jay Sternbergextern struct iwl_cfg iwl100_bg_cfg; 9658a39090a13cf296afc17ed8fd793a55340b63dbWey-Yi Guyextern struct iwl_cfg iwl130_bgn_cfg; 9758a39090a13cf296afc17ed8fd793a55340b63dbWey-Yi Guyextern struct iwl_cfg iwl130_bg_cfg; 98c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl2000_2bgn_cfg; 99c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl2000_2bg_cfg; 100c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl2030_2bgn_cfg; 101c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl2030_2bg_cfg; 102c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl6035_2agn_cfg; 103c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl6035_2abg_cfg; 104c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl6035_2bg_cfg; 105c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl200_bg_cfg; 106c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl200_bgn_cfg; 107c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl230_bg_cfg; 108c5a5e1853a6d87eb9f58bf8930e267d619dd24f6Wey-Yi Guyextern struct iwl_cfg iwl230_bgn_cfg; 109bd93cbedfc4b280a0eeb6665ad310c3cc96cd669Wey-Yi Guy 110348ee7cd57831c47373dd157f138c558daaf129dWey-Yi Guyextern struct iwl_mod_params iwlagn_mod_params; 1117dc77dba6a8bde512996824643da5669d73cbcdcWey-Yi Guyextern struct iwl_hcmd_ops iwlagn_hcmd; 112b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guyextern struct iwl_hcmd_ops iwlagn_bt_hcmd; 1137dc77dba6a8bde512996824643da5669d73cbcdcWey-Yi Guyextern struct iwl_hcmd_utils_ops iwlagn_hcmd_utils; 114792bc3cbe06cddabd865acc3122ee0415f854a11Wey-Yi Guy 115dc21b5453249e7e9b8878fab356fd60b731cf04dJohannes Bergextern struct ieee80211_ops iwlagn_hw_ops; 116dc21b5453249e7e9b8878fab356fd60b731cf04dJohannes Berg 117a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Bergint iwl_reset_ict(struct iwl_priv *priv); 118a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Bergvoid iwl_disable_ict(struct iwl_priv *priv); 119a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Bergint iwl_alloc_isr_ict(struct iwl_priv *priv); 120a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Bergvoid iwl_free_isr_ict(struct iwl_priv *priv); 121a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Bergirqreturn_t iwl_isr_ict(int irq, void *data); 122a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg 123bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg/* call this function to flush any scheduled tasklet */ 124bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Bergstatic inline void iwl_synchronize_irq(struct iwl_priv *priv) 125bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg{ 126bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg /* wait to make sure we flush pending tasklet*/ 127bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg synchronize_irq(priv->pci_dev->irq); 128bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg tasklet_kill(&priv->irq_tasklet); 129bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg} 130bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg 1313e14c1fd75d909bfcc6caab79c544921fd02bf73Johannes Bergint iwl_prepare_card_hw(struct iwl_priv *priv); 132bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg 1333e14c1fd75d909bfcc6caab79c544921fd02bf73Johannes Bergint iwlagn_start_device(struct iwl_priv *priv); 134bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Bergvoid iwlagn_stop_device(struct iwl_priv *priv); 135bc4f8adac6b30ee5f03dad267896add7e58db729Johannes Berg 136b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guy/* tx queue */ 137b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guyvoid iwlagn_set_wr_ptrs(struct iwl_priv *priv, 138b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guy int txq_id, u32 index); 139b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guyvoid iwlagn_tx_queue_set_status(struct iwl_priv *priv, 140b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guy struct iwl_tx_queue *txq, 141b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guy int tx_fifo_id, int scd_retry); 142b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guyvoid iwlagn_txq_update_byte_cnt_tbl(struct iwl_priv *priv, 143b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guy struct iwl_tx_queue *txq, 144b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guy u16 byte_cnt); 145b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guyvoid iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, 146b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guy struct iwl_tx_queue *txq); 147b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guyvoid iwlagn_txq_set_sched(struct iwl_priv *priv, u32 mask); 1481ff504e07c0fb64a1ceca17d60cb2d82dc134f05Johannes Bergvoid iwl_free_tfds_in_queue(struct iwl_priv *priv, 1491ff504e07c0fb64a1ceca17d60cb2d82dc134f05Johannes Berg int sta_id, int tid, int freed); 150b305a08058f794c8a99c5ee87827b92d6b8c24aeWey-Yi Guy 1517314c2b377afaf367f2966bd9ea67bf83350e29bJohannes Berg/* RXON */ 1527314c2b377afaf367f2966bd9ea67bf83350e29bJohannes Bergint iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx); 1535de33068a2f841536ca8632534e3e193d5b2607fJohannes Bergvoid iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx); 1542295c66b68ae160dde2e6e2dc4f3061105153bfcJohannes Bergint iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed); 1552295c66b68ae160dde2e6e2dc4f3061105153bfcJohannes Bergvoid iwlagn_bss_info_changed(struct ieee80211_hw *hw, 1562295c66b68ae160dde2e6e2dc4f3061105153bfcJohannes Berg struct ieee80211_vif *vif, 1572295c66b68ae160dde2e6e2dc4f3061105153bfcJohannes Berg struct ieee80211_bss_conf *bss_conf, 1582295c66b68ae160dde2e6e2dc4f3061105153bfcJohannes Berg u32 changes); 1597314c2b377afaf367f2966bd9ea67bf83350e29bJohannes Berg 160741a626627e42812afd957f875c34c89be8a103eWey-Yi Guy/* uCode */ 161741a626627e42812afd957f875c34c89be8a103eWey-Yi Guyint iwlagn_load_ucode(struct iwl_priv *priv); 162741a626627e42812afd957f875c34c89be8a103eWey-Yi Guyvoid iwlagn_rx_calib_result(struct iwl_priv *priv, 163741a626627e42812afd957f875c34c89be8a103eWey-Yi Guy struct iwl_rx_mem_buffer *rxb); 164741a626627e42812afd957f875c34c89be8a103eWey-Yi Guyvoid iwlagn_rx_calib_complete(struct iwl_priv *priv, 165741a626627e42812afd957f875c34c89be8a103eWey-Yi Guy struct iwl_rx_mem_buffer *rxb); 166741a626627e42812afd957f875c34c89be8a103eWey-Yi Guyvoid iwlagn_init_alive_start(struct iwl_priv *priv); 167741a626627e42812afd957f875c34c89be8a103eWey-Yi Guyint iwlagn_alive_notify(struct iwl_priv *priv); 16835b1d92dfb361d24664381a0e4ae8ed47c771a66Johannes Bergint iwl_verify_ucode(struct iwl_priv *priv, struct fw_desc *fw_desc); 169f7322f8f05f5755252e96d772fdcf9ca4304dc69Wey-Yi Guyvoid iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type); 170f7322f8f05f5755252e96d772fdcf9ca4304dc69Wey-Yi Guyvoid iwlagn_send_prio_tbl(struct iwl_priv *priv); 171741a626627e42812afd957f875c34c89be8a103eWey-Yi Guy 172e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guy/* lib */ 17304569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guyvoid iwl_check_abort_status(struct iwl_priv *priv, 17404569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy u8 frame_count, u32 status); 175e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guyvoid iwlagn_rx_handler_setup(struct iwl_priv *priv); 176e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guyvoid iwlagn_setup_deferred_work(struct iwl_priv *priv); 177e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guyint iwlagn_hw_valid_rtc_data_addr(u32 addr); 178e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guyint iwlagn_send_tx_power(struct iwl_priv *priv); 179e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guyvoid iwlagn_temperature(struct iwl_priv *priv); 180e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guyu16 iwlagn_eeprom_calib_version(struct iwl_priv *priv); 181e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guyconst u8 *iwlagn_eeprom_query_addr(const struct iwl_priv *priv, 182e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guy size_t offset); 18374bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyvoid iwlagn_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq); 18474bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyint iwlagn_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq); 18574bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyint iwlagn_hw_nic_init(struct iwl_priv *priv); 186716c74b00717ad9caedb4a46059fb64a3da99808Wey-Yi Guyint iwlagn_wait_tx_queue_empty(struct iwl_priv *priv); 187716c74b00717ad9caedb4a46059fb64a3da99808Wey-Yi Guyint iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control); 1886555063666fea1fc81a14396aca53ab021ccb4f2Wey-Yi Guyvoid iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control); 18974bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guy 19054b81550dd674466fe7d01629d2aab015c545a1eWey-Yi Guy/* rx */ 19154b81550dd674466fe7d01629d2aab015c545a1eWey-Yi Guyvoid iwlagn_rx_queue_restock(struct iwl_priv *priv); 19254b81550dd674466fe7d01629d2aab015c545a1eWey-Yi Guyvoid iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority); 19354b81550dd674466fe7d01629d2aab015c545a1eWey-Yi Guyvoid iwlagn_rx_replenish(struct iwl_priv *priv); 19454b81550dd674466fe7d01629d2aab015c545a1eWey-Yi Guyvoid iwlagn_rx_replenish_now(struct iwl_priv *priv); 19554b81550dd674466fe7d01629d2aab015c545a1eWey-Yi Guyvoid iwlagn_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq); 19654b81550dd674466fe7d01629d2aab015c545a1eWey-Yi Guyint iwlagn_rxq_stop(struct iwl_priv *priv); 1978d801080dd8d28bf7d85cacba131f18b7653ee49Wey-Yi Guyint iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band); 198466a19a003f3b45a755bc85f967c21da947f9a00Stanislaw Gruszkavoid iwl_setup_rx_handlers(struct iwl_priv *priv); 19954b81550dd674466fe7d01629d2aab015c545a1eWey-Yi Guy 20074bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guy/* tx */ 2010de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Bergvoid iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); 2020de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Bergint iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, 2030de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg struct iwl_tx_queue *txq, 2040de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg dma_addr_t addr, u16 len, u8 reset, u8 pad); 2050de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Bergint iwl_hw_tx_queue_init(struct iwl_priv *priv, 2060de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg struct iwl_tx_queue *txq); 2078d801080dd8d28bf7d85cacba131f18b7653ee49Wey-Yi Guyvoid iwlagn_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags, 2088d801080dd8d28bf7d85cacba131f18b7653ee49Wey-Yi Guy struct ieee80211_tx_info *info); 20974bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyint iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb); 210832f47e333c7d0db632b57e9f07956ae40dd481dJohannes Bergint iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, 211619753ff57a2e15b58546b856536928d1a3daef9Johannes Berg struct ieee80211_sta *sta, u16 tid, u16 *ssn); 212832f47e333c7d0db632b57e9f07956ae40dd481dJohannes Bergint iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, 213619753ff57a2e15b58546b856536928d1a3daef9Johannes Berg struct ieee80211_sta *sta, u16 tid); 214c8823ec1337017e23b99fb0814e2f3d62537f811Johannes Bergvoid iwlagn_txq_agg_queue_setup(struct iwl_priv *priv, 215c8823ec1337017e23b99fb0814e2f3d62537f811Johannes Berg struct ieee80211_sta *sta, 216c8823ec1337017e23b99fb0814e2f3d62537f811Johannes Berg int tid, int frame_limit); 21774bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyint iwlagn_txq_check_empty(struct iwl_priv *priv, 21874bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guy int sta_id, u8 tid, int txq_id); 21974bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyvoid iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, 22074bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guy struct iwl_rx_mem_buffer *rxb); 22174bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyint iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); 22274bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyvoid iwlagn_hw_txq_ctx_free(struct iwl_priv *priv); 223470058e0ad82fcfaaffd57307d8bf8c094e8e9d7Zhu Yiint iwlagn_txq_ctx_alloc(struct iwl_priv *priv); 224470058e0ad82fcfaaffd57307d8bf8c094e8e9d7Zhu Yivoid iwlagn_txq_ctx_reset(struct iwl_priv *priv); 22574bcdb33e99f49ef5202dd2f8109945b4570edc2Wey-Yi Guyvoid iwlagn_txq_ctx_stop(struct iwl_priv *priv); 226e04ed0a5bb62520345c73587d7ebf51e426642eeWey-Yi Guy 22704569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guystatic inline u32 iwl_tx_status_to_mac80211(u32 status) 22804569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy{ 22904569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy status &= TX_STATUS_MSK; 23004569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy 23104569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy switch (status) { 23204569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy case TX_STATUS_SUCCESS: 23304569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy case TX_STATUS_DIRECT_DONE: 23404569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy return IEEE80211_TX_STAT_ACK; 23504569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy case TX_STATUS_FAIL_DEST_PS: 23668b993118f715cc631b62b6a50574e4701fe9aceGaren Tamrazian case TX_STATUS_FAIL_PASSIVE_NO_RX: 23704569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy return IEEE80211_TX_STAT_TX_FILTERED; 23804569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy default: 23904569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy return 0; 24004569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy } 24104569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy} 24204569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy 24304569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guystatic inline bool iwl_is_tx_success(u32 status) 24404569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy{ 24504569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy status &= TX_STATUS_MSK; 24604569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy return (status == TX_STATUS_SUCCESS) || 24704569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy (status == TX_STATUS_DIRECT_DONE); 24804569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy} 24904569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy 250facd982e8246ed25a049d270a71513fb11b901ecJohannes Bergu8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant_idx, u8 valid); 251facd982e8246ed25a049d270a71513fb11b901ecJohannes Berg 252b6e4c55aaee4fd40526a6816e60c68dd62e565c4Johannes Berg/* scan */ 2533eecce527c7434dfd16517ce08b49632c8a26717Johannes Bergint iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif); 254a77029ee3fc03a37238b73892e55b789273991aaJohannes Bergvoid iwlagn_post_scan(struct iwl_priv *priv); 255b6e4c55aaee4fd40526a6816e60c68dd62e565c4Johannes Berg 2561fa61b2e793dad51271c7ce39377daade51261d7Johannes Berg/* station mgmt */ 2571fa61b2e793dad51271c7ce39377daade51261d7Johannes Bergint iwlagn_manage_ibss_station(struct iwl_priv *priv, 2581fa61b2e793dad51271c7ce39377daade51261d7Johannes Berg struct ieee80211_vif *vif, bool add); 2591fa61b2e793dad51271c7ce39377daade51261d7Johannes Berg 2601808972f16adba592ceb10a47dee42ef8ee39ceeShanyu Zhao/* hcmd */ 261246ed355221076884d225f9d8a4c30a048be8162Johannes Bergint iwlagn_send_rxon_assoc(struct iwl_priv *priv, 262246ed355221076884d225f9d8a4c30a048be8162Johannes Berg struct iwl_rxon_context *ctx); 2631808972f16adba592ceb10a47dee42ef8ee39ceeShanyu Zhaoint iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant); 2642295c66b68ae160dde2e6e2dc4f3061105153bfcJohannes Bergint iwlagn_send_beacon_cmd(struct iwl_priv *priv); 2651808972f16adba592ceb10a47dee42ef8ee39ceeShanyu Zhao 266b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy/* bt coex */ 267b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guyvoid iwlagn_send_advance_bt_config(struct iwl_priv *priv); 268b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guyvoid iwlagn_bt_coex_profile_notif(struct iwl_priv *priv, 269b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy struct iwl_rx_mem_buffer *rxb); 270b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guyvoid iwlagn_bt_rx_handler_setup(struct iwl_priv *priv); 271b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guyvoid iwlagn_bt_setup_deferred_work(struct iwl_priv *priv); 272b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guyvoid iwlagn_bt_cancel_deferred_work(struct iwl_priv *priv); 273b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy 27495b49ed013c9a8856ce768d8d4a62acfc410f73dWey-Yi Guy#ifdef CONFIG_IWLWIFI_DEBUG 27569fdb710b29d096bc50123f7c97891e31ffe45f9Johannes Bergconst char *iwl_get_tx_fail_reason(u32 status); 27695b49ed013c9a8856ce768d8d4a62acfc410f73dWey-Yi Guyconst char *iwl_get_agg_tx_fail_reason(u16 status); 27795b49ed013c9a8856ce768d8d4a62acfc410f73dWey-Yi Guy#else 27869fdb710b29d096bc50123f7c97891e31ffe45f9Johannes Bergstatic inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; } 27995b49ed013c9a8856ce768d8d4a62acfc410f73dWey-Yi Guystatic inline const char *iwl_get_agg_tx_fail_reason(u16 status) { return ""; } 28095b49ed013c9a8856ce768d8d4a62acfc410f73dWey-Yi Guy#endif 281a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg 282a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg/* station management */ 283a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwlagn_alloc_bcast_station(struct iwl_priv *priv, 284a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct iwl_rxon_context *ctx); 285a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwlagn_add_bssid_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx, 286a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg const u8 *addr, u8 *sta_id_r); 287a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_remove_default_wep_key(struct iwl_priv *priv, 288a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct iwl_rxon_context *ctx, 289a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct ieee80211_key_conf *key); 290a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_set_default_wep_key(struct iwl_priv *priv, 291a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct iwl_rxon_context *ctx, 292a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct ieee80211_key_conf *key); 293a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_restore_default_wep_keys(struct iwl_priv *priv, 294a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct iwl_rxon_context *ctx); 295a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_set_dynamic_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx, 296a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct ieee80211_key_conf *key, u8 sta_id); 297a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_remove_dynamic_key(struct iwl_priv *priv, struct iwl_rxon_context *ctx, 298a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct ieee80211_key_conf *key, u8 sta_id); 299a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergvoid iwl_update_tkip_key(struct iwl_priv *priv, 300a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct iwl_rxon_context *ctx, 301a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct ieee80211_key_conf *keyconf, 302a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg struct ieee80211_sta *sta, u32 iv32, u16 *phase1key); 303a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid); 304a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta, 305a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg int tid, u16 ssn); 306a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta, 307a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg int tid); 308a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergvoid iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt); 309a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Bergint iwl_update_bcast_stations(struct iwl_priv *priv); 310ae79d23d0b2c16998e60f49a16dae53521c76a45Johannes Bergvoid iwlagn_mac_sta_notify(struct ieee80211_hw *hw, 311ae79d23d0b2c16998e60f49a16dae53521c76a45Johannes Berg struct ieee80211_vif *vif, 312ae79d23d0b2c16998e60f49a16dae53521c76a45Johannes Berg enum sta_notify_cmd cmd, 313ae79d23d0b2c16998e60f49a16dae53521c76a45Johannes Berg struct ieee80211_sta *sta); 314a30e3112a8bcb5bc1caa48547e597de3992e1b21Johannes Berg 3150de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg/* rate */ 3160de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Bergstatic inline u32 iwl_ant_idx_to_flags(u8 ant_idx) 3170de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg{ 3180de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg return BIT(ant_idx) << RATE_MCS_ANT_POS; 3190de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg} 3200de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg 3210de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Bergstatic inline u8 iwl_hw_get_rate(__le32 rate_n_flags) 3220de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg{ 3232520546aecc969372080448a2422b39eedb2a528Daniel Halperin return le32_to_cpu(rate_n_flags) & RATE_MCS_RATE_MSK; 3240de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg} 3250de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg 3260de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Bergstatic inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags) 3270de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg{ 3280de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg return cpu_to_le32(flags|(u32)rate); 3290de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg} 3300de76736552cff02cc6ee4bae41e5502d7673f8eJohannes Berg 3313be63ff0ae196b371728ba8fc8aca12eafcae218Wey-Yi Guy/* eeprom */ 3323be63ff0ae196b371728ba8fc8aca12eafcae218Wey-Yi Guyvoid iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv); 3333be63ff0ae196b371728ba8fc8aca12eafcae218Wey-Yi Guyvoid iwl_eeprom_get_mac(const struct iwl_priv *priv, u8 *mac); 3343be63ff0ae196b371728ba8fc8aca12eafcae218Wey-Yi Guyint iwlcore_eeprom_acquire_semaphore(struct iwl_priv *priv); 3353be63ff0ae196b371728ba8fc8aca12eafcae218Wey-Yi Guyvoid iwlcore_eeprom_release_semaphore(struct iwl_priv *priv); 3363be63ff0ae196b371728ba8fc8aca12eafcae218Wey-Yi Guy 3377194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Berg/* notification wait support */ 3387194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Bergvoid __acquires(wait_entry) 3397194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Bergiwlagn_init_notification_wait(struct iwl_priv *priv, 3407194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Berg struct iwl_notification_wait *wait_entry, 34109f18afe766ea3f2c749e3af195bf65fde71b62eJohannes Berg u8 cmd, 3427194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Berg void (*fn)(struct iwl_priv *priv, 34309f18afe766ea3f2c749e3af195bf65fde71b62eJohannes Berg struct iwl_rx_packet *pkt, 34409f18afe766ea3f2c749e3af195bf65fde71b62eJohannes Berg void *data), 34509f18afe766ea3f2c749e3af195bf65fde71b62eJohannes Berg void *fn_data); 346a8674a1efca60d863d4caa47e102cc4d70d5ff9bJohannes Bergint __must_check __releases(wait_entry) 3477194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Bergiwlagn_wait_notification(struct iwl_priv *priv, 3487194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Berg struct iwl_notification_wait *wait_entry, 3497194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Berg unsigned long timeout); 3507194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Bergvoid __releases(wait_entry) 3517194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Bergiwlagn_remove_notification(struct iwl_priv *priv, 3527194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Berg struct iwl_notification_wait *wait_entry); 3537194207ceea7a54c846e0865d2459f4887fe1e0dJohannes Berg 354a1175124f34a4b859b5064efb84a197e4f6794a6Johannes Berg#endif /* __iwl_agn_h__ */ 355