linux/drivers/net/wireless/intel/iwlegacy/common.c

// SPDX-License-Identifier: GPL-2.0-only
/******************************************************************************
 *
 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
 *
 * Contact Information:
 *  Intel Linux Wireless <[email protected]>
 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 *****************************************************************************/

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/etherdevice.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/lockdep.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <net/mac80211.h>

#include "common.h"

int
_il_poll_bit(struct il_priv *il, u32 addr, u32 bits, u32 mask, int timeout)
{}
EXPORT_SYMBOL();

void
il_set_bit(struct il_priv *p, u32 r, u32 m)
{}
EXPORT_SYMBOL();

void
il_clear_bit(struct il_priv *p, u32 r, u32 m)
{}
EXPORT_SYMBOL();

bool
_il_grab_nic_access(struct il_priv *il)
{}
EXPORT_SYMBOL_GPL();

int
il_poll_bit(struct il_priv *il, u32 addr, u32 mask, int timeout)
{}
EXPORT_SYMBOL();

u32
il_rd_prph(struct il_priv *il, u32 reg)
{}
EXPORT_SYMBOL();

void
il_wr_prph(struct il_priv *il, u32 addr, u32 val)
{}
EXPORT_SYMBOL();

u32
il_read_targ_mem(struct il_priv *il, u32 addr)
{}
EXPORT_SYMBOL();

void
il_write_targ_mem(struct il_priv *il, u32 addr, u32 val)
{}
EXPORT_SYMBOL();

const char *
il_get_cmd_string(u8 cmd)
{}
EXPORT_SYMBOL();

#define HOST_COMPLETE_TIMEOUT

static void
il_generic_cmd_callback(struct il_priv *il, struct il_device_cmd *cmd,
			struct il_rx_pkt *pkt)
{}

static int
il_send_cmd_async(struct il_priv *il, struct il_host_cmd *cmd)
{}

int
il_send_cmd_sync(struct il_priv *il, struct il_host_cmd *cmd)
{}
EXPORT_SYMBOL();

int
il_send_cmd(struct il_priv *il, struct il_host_cmd *cmd)
{}
EXPORT_SYMBOL();

int
il_send_cmd_pdu(struct il_priv *il, u8 id, u16 len, const void *data)
{}
EXPORT_SYMBOL();

int
il_send_cmd_pdu_async(struct il_priv *il, u8 id, u16 len, const void *data,
		      void (*callback) (struct il_priv *il,
					struct il_device_cmd *cmd,
					struct il_rx_pkt *pkt))
{}
EXPORT_SYMBOL();

/* default: IL_LED_BLINK(0) using blinking idx table */
static int led_mode;
module_param(led_mode, int, 0444);
MODULE_PARM_DESC();

/* Throughput		OFF time(ms)	ON time (ms)
 *	>300			25		25
 *	>200 to 300		40		40
 *	>100 to 200		55		55
 *	>70 to 100		65		65
 *	>50 to 70		75		75
 *	>20 to 50		85		85
 *	>10 to 20		95		95
 *	>5 to 10		110		110
 *	>1 to 5			130		130
 *	>0 to 1			167		167
 *	<=0					SOLID ON
 */
static const struct ieee80211_tpt_blink il_blink[] =;

/*
 * Adjust led blink rate to compensate on a MAC Clock difference on every HW
 * Led blink rate analysis showed an average deviation of 0% on 3945,
 * 5% on 4965 HW.
 * Need to compensate on the led on/off time per HW according to the deviation
 * to achieve the desired led frequency
 * The calculation is: (100-averageDeviation)/100 * blinkTime
 * For code efficiency the calculation will be:
 *     compensation = (100 - averageDeviation) * 64 / 100
 *     NewBlinkTime = (compensation * BlinkTime) / 64
 */
static inline u8
il_blink_compensation(struct il_priv *il, u8 time, u16 compensation)
{}

/* Set led pattern command */
static int
il_led_cmd(struct il_priv *il, unsigned long on, unsigned long off)
{}

static void
il_led_brightness_set(struct led_classdev *led_cdev,
		      enum led_brightness brightness)
{}

static int
il_led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on,
		 unsigned long *delay_off)
{}

void
il_leds_init(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_leds_exit(struct il_priv *il)
{}
EXPORT_SYMBOL();

/************************** EEPROM BANDS ****************************
 *
 * The il_eeprom_band definitions below provide the mapping from the
 * EEPROM contents to the specific channel number supported for each
 * band.
 *
 * For example, il_priv->eeprom.band_3_channels[4] from the band_3
 * definition below maps to physical channel 42 in the 5.2GHz spectrum.
 * The specific geography and calibration information for that channel
 * is contained in the eeprom map itself.
 *
 * During init, we copy the eeprom information and channel map
 * information into il->channel_info_24/52 and il->channel_map_24/52
 *
 * channel_map_24/52 provides the idx in the channel_info array for a
 * given channel.  We have to have two separate maps as there is channel
 * overlap with the 2.4GHz and 5.2GHz spectrum as seen in band_1 and
 * band_2
 *
 * A value of 0xff stored in the channel_map indicates that the channel
 * is not supported by the hardware at all.
 *
 * A value of 0xfe in the channel_map indicates that the channel is not
 * valid for Tx with the current hardware.  This means that
 * while the system can tune and receive on a given channel, it may not
 * be able to associate or transmit any frames on that
 * channel.  There is no corresponding channel information for that
 * entry.
 *
 *********************************************************************/

/* 2.4 GHz */
const u8 il_eeprom_band_1[14] =;

/* 5.2 GHz bands */
static const u8 il_eeprom_band_2[] =;

static const u8 il_eeprom_band_3[] =;

static const u8 il_eeprom_band_4[] =;

static const u8 il_eeprom_band_5[] =;

static const u8 il_eeprom_band_6[] =;

static const u8 il_eeprom_band_7[] =;

/******************************************************************************
 *
 * EEPROM related functions
 *
******************************************************************************/

static int
il_eeprom_verify_signature(struct il_priv *il)
{}

const u8 *
il_eeprom_query_addr(const struct il_priv *il, size_t offset)
{}
EXPORT_SYMBOL();

u16
il_eeprom_query16(const struct il_priv *il, size_t offset)
{}
EXPORT_SYMBOL();

/*
 * il_eeprom_init - read EEPROM contents
 *
 * Load the EEPROM contents from adapter into il->eeprom
 *
 * NOTE:  This routine uses the non-debug IO access functions.
 */
int
il_eeprom_init(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_eeprom_free(struct il_priv *il)
{}
EXPORT_SYMBOL();

static void
il_init_band_reference(const struct il_priv *il, int eep_band,
		       int *eeprom_ch_count,
		       const struct il_eeprom_channel **eeprom_ch_info,
		       const u8 **eeprom_ch_idx)
{}

#define CHECK_AND_PRINT(x)
/*
 * il_mod_ht40_chan_info - Copy ht40 channel info into driver's il.
 *
 * Does not set up a command, or touch hardware.
 */
static int
il_mod_ht40_chan_info(struct il_priv *il, enum nl80211_band band, u16 channel,
		      const struct il_eeprom_channel *eeprom_ch,
		      u8 clear_ht40_extension_channel)
{}

#define CHECK_AND_PRINT_I(x)

/*
 * il_init_channel_map - Set up driver's info for all possible channels
 */
int
il_init_channel_map(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * il_free_channel_map - undo allocations in il_init_channel_map
 */
void
il_free_channel_map(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * il_get_channel_info - Find driver's ilate channel info
 *
 * Based on band and channel number.
 */
const struct il_channel_info *
il_get_channel_info(const struct il_priv *il, enum nl80211_band band,
		    u16 channel)
{}
EXPORT_SYMBOL();

/*
 * Setting power level allows the card to go to sleep when not busy.
 *
 * We calculate a sleep command based on the required latency, which
 * we get from mac80211.
 */

#define SLP_VEC(X0, X1, X2, X3, X4)

static void
il_build_powertable_cmd(struct il_priv *il, struct il_powertable_cmd *cmd)
{}

static int
il_set_power(struct il_priv *il, struct il_powertable_cmd *cmd)
{}

static int
il_power_set_mode(struct il_priv *il, struct il_powertable_cmd *cmd, bool force)
{}

int
il_power_update_mode(struct il_priv *il, bool force)
{}
EXPORT_SYMBOL();

/* initialize to default */
void
il_power_initialize(struct il_priv *il)
{}
EXPORT_SYMBOL();

/* For active scan, listen ACTIVE_DWELL_TIME (msec) on each channel after
 * sending probe req.  This should be set long enough to hear probe responses
 * from more than one AP.  */
#define IL_ACTIVE_DWELL_TIME_24
#define IL_ACTIVE_DWELL_TIME_52

#define IL_ACTIVE_DWELL_FACTOR_24GHZ
#define IL_ACTIVE_DWELL_FACTOR_52GHZ

/* For passive scan, listen PASSIVE_DWELL_TIME (msec) on each channel.
 * Must be set longer than active dwell time.
 * For the most reliable scan, set > AP beacon interval (typically 100msec). */
#define IL_PASSIVE_DWELL_TIME_24
#define IL_PASSIVE_DWELL_TIME_52
#define IL_PASSIVE_DWELL_BASE
#define IL_CHANNEL_TUNE_TIME

static int
il_send_scan_abort(struct il_priv *il)
{}

static void
il_complete_scan(struct il_priv *il, bool aborted)
{}

void
il_force_scan_end(struct il_priv *il)
{}

static void
il_do_scan_abort(struct il_priv *il)
{}

/*
 * il_scan_cancel - Cancel any currently executing HW scan
 */
int
il_scan_cancel(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * il_scan_cancel_timeout - Cancel any currently executing HW scan
 * @ms: amount of time to wait (in milliseconds) for scan to abort
 *
 */
int
il_scan_cancel_timeout(struct il_priv *il, unsigned long ms)
{}
EXPORT_SYMBOL();

/* Service response to C_SCAN (0x80) */
static void
il_hdl_scan(struct il_priv *il, struct il_rx_buf *rxb)
{}

/* Service N_SCAN_START (0x82) */
static void
il_hdl_scan_start(struct il_priv *il, struct il_rx_buf *rxb)
{}

/* Service N_SCAN_RESULTS (0x83) */
static void
il_hdl_scan_results(struct il_priv *il, struct il_rx_buf *rxb)
{}

/* Service N_SCAN_COMPLETE (0x84) */
static void
il_hdl_scan_complete(struct il_priv *il, struct il_rx_buf *rxb)
{}

void
il_setup_rx_scan_handlers(struct il_priv *il)
{}
EXPORT_SYMBOL();

u16
il_get_active_dwell_time(struct il_priv *il, enum nl80211_band band,
			 u8 n_probes)
{}
EXPORT_SYMBOL();

u16
il_get_passive_dwell_time(struct il_priv *il, enum nl80211_band band,
			  struct ieee80211_vif *vif)
{}
EXPORT_SYMBOL();

void
il_init_scan_params(struct il_priv *il)
{}
EXPORT_SYMBOL();

static int
il_scan_initiate(struct il_priv *il, struct ieee80211_vif *vif)
{}

int
il_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
	       struct ieee80211_scan_request *hw_req)
{}
EXPORT_SYMBOL();

static void
il_bg_scan_check(struct work_struct *data)
{}

/*
 * il_fill_probe_req - fill in all required fields and IE for probe request
 */
u16
il_fill_probe_req(struct il_priv *il, struct ieee80211_mgmt *frame,
		  const u8 *ta, const u8 *ies, int ie_len, int left)
{}
EXPORT_SYMBOL();

static void
il_bg_abort_scan(struct work_struct *work)
{}

static void
il_bg_scan_completed(struct work_struct *work)
{}

void
il_setup_scan_deferred_work(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_cancel_scan_deferred_work(struct il_priv *il)
{}
EXPORT_SYMBOL();

/* il->sta_lock must be held */
static void
il_sta_ucode_activate(struct il_priv *il, u8 sta_id)
{}

static int
il_process_add_sta_resp(struct il_priv *il, struct il_addsta_cmd *addsta,
			struct il_rx_pkt *pkt, bool sync)
{}

static void
il_add_sta_callback(struct il_priv *il, struct il_device_cmd *cmd,
		    struct il_rx_pkt *pkt)
{}

int
il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags)
{}
EXPORT_SYMBOL();

static void
il_set_ht_add_station(struct il_priv *il, u8 idx, struct ieee80211_sta *sta)
{}

/*
 * il_prep_station - Prepare station information for addition
 *
 * should be called with sta_lock held
 */
u8
il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap,
		struct ieee80211_sta *sta)
{}
EXPORT_SYMBOL_GPL();

#define STA_WAIT_TIMEOUT

/*
 * il_add_station_common -
 */
int
il_add_station_common(struct il_priv *il, const u8 *addr, bool is_ap,
		      struct ieee80211_sta *sta, u8 *sta_id_r)
{}
EXPORT_SYMBOL();

/*
 * il_sta_ucode_deactivate - deactivate ucode status for a station
 *
 * il->sta_lock must be held
 */
static void
il_sta_ucode_deactivate(struct il_priv *il, u8 sta_id)
{}

static int
il_send_remove_station(struct il_priv *il, const u8 * addr, int sta_id,
		       bool temporary)
{}

/*
 * il_remove_station - Remove driver's knowledge of station.
 */
int
il_remove_station(struct il_priv *il, const u8 sta_id, const u8 * addr)
{}
EXPORT_SYMBOL_GPL();

/*
 * il_clear_ucode_stations - clear ucode station table bits
 *
 * This function clears all the bits in the driver indicating
 * which stations are active in the ucode. Call when something
 * other than explicit station management would cause this in
 * the ucode, e.g. unassociated RXON.
 */
void
il_clear_ucode_stations(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * il_restore_stations() - Restore driver known stations to device
 *
 * All stations considered active by driver, but not present in ucode, is
 * restored.
 *
 * Function sleeps.
 */
void
il_restore_stations(struct il_priv *il)
{}
EXPORT_SYMBOL();

int
il_get_free_ucode_key_idx(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_dealloc_bcast_stations(struct il_priv *il)
{}
EXPORT_SYMBOL_GPL();

#ifdef CONFIG_IWLEGACY_DEBUG
static void
il_dump_lq_cmd(struct il_priv *il, struct il_link_quality_cmd *lq)
{}
#else
static inline void
il_dump_lq_cmd(struct il_priv *il, struct il_link_quality_cmd *lq)
{
}
#endif

/*
 * il_is_lq_table_valid() - Test one aspect of LQ cmd for validity
 *
 * It sometimes happens when a HT rate has been in use and we
 * loose connectivity with AP then mac80211 will first tell us that the
 * current channel is not HT anymore before removing the station. In such a
 * scenario the RXON flags will be updated to indicate we are not
 * communicating HT anymore, but the LQ command may still contain HT rates.
 * Test for this to prevent driver from sending LQ command between the time
 * RXON flags are updated and when LQ command is updated.
 */
static bool
il_is_lq_table_valid(struct il_priv *il, struct il_link_quality_cmd *lq)
{}

/*
 * il_send_lq_cmd() - Send link quality command
 * @init: This command is sent as part of station initialization right
 *        after station has been added.
 *
 * The link quality command is sent as the last step of station creation.
 * This is the special case in which init is set and we call a callback in
 * this case to clear the state indicating that station creation is in
 * progress.
 */
int
il_send_lq_cmd(struct il_priv *il, struct il_link_quality_cmd *lq,
	       u8 flags, bool init)
{}
EXPORT_SYMBOL();

int
il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		  struct ieee80211_sta *sta)
{}
EXPORT_SYMBOL();

/************************** RX-FUNCTIONS ****************************/
/*
 * Rx theory of operation
 *
 * Driver allocates a circular buffer of Receive Buffer Descriptors (RBDs),
 * each of which point to Receive Buffers to be filled by the NIC.  These get
 * used not only for Rx frames, but for any command response or notification
 * from the NIC.  The driver and NIC manage the Rx buffers by means
 * of idxes into the circular buffer.
 *
 * Rx Queue Indexes
 * The host/firmware share two idx registers for managing the Rx buffers.
 *
 * The READ idx maps to the first position that the firmware may be writing
 * to -- the driver can read up to (but not including) this position and get
 * good data.
 * The READ idx is managed by the firmware once the card is enabled.
 *
 * The WRITE idx maps to the last position the driver has read from -- the
 * position preceding WRITE is the last slot the firmware can place a packet.
 *
 * The queue is empty (no good data) if WRITE = READ - 1, and is full if
 * WRITE = READ.
 *
 * During initialization, the host sets up the READ queue position to the first
 * IDX position, and WRITE to the last (READ - 1 wrapped)
 *
 * When the firmware places a packet in a buffer, it will advance the READ idx
 * and fire the RX interrupt.  The driver can then query the READ idx and
 * process as many packets as possible, moving the WRITE idx forward as it
 * resets the Rx queue buffers with new memory.
 *
 * The management in the driver is as follows:
 * + A list of pre-allocated SKBs is stored in iwl->rxq->rx_free.  When
 *   iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled
 *   to replenish the iwl->rxq->rx_free.
 * + In il_rx_replenish (scheduled) if 'processed' != 'read' then the
 *   iwl->rxq is replenished and the READ IDX is updated (updating the
 *   'processed' and 'read' driver idxes as well)
 * + A received packet is processed and handed to the kernel network stack,
 *   detached from the iwl->rxq.  The driver 'processed' idx is updated.
 * + The Host/Firmware iwl->rxq is replenished at tasklet time from the rx_free
 *   list. If there are no allocated buffers in iwl->rxq->rx_free, the READ
 *   IDX is not incremented and iwl->status(RX_STALLED) is set.  If there
 *   were enough free buffers and RX_STALLED is set it is cleared.
 *
 *
 * Driver sequence:
 *
 * il_rx_queue_alloc()   Allocates rx_free
 * il_rx_replenish()     Replenishes rx_free list from rx_used, and calls
 *                            il_rx_queue_restock
 * il_rx_queue_restock() Moves available buffers from rx_free into Rx
 *                            queue, updates firmware pointers, and updates
 *                            the WRITE idx.  If insufficient rx_free buffers
 *                            are available, schedules il_rx_replenish
 *
 * -- enable interrupts --
 * ISR - il_rx()         Detach il_rx_bufs from pool up to the
 *                            READ IDX, detaching the SKB from the pool.
 *                            Moves the packet buffer from queue to rx_used.
 *                            Calls il_rx_queue_restock to refill any empty
 *                            slots.
 * ...
 *
 */

/*
 * il_rx_queue_space - Return number of free slots available in queue.
 */
int
il_rx_queue_space(const struct il_rx_queue *q)
{}
EXPORT_SYMBOL();

/*
 * il_rx_queue_update_write_ptr - Update the write pointer for the RX queue
 */
void
il_rx_queue_update_write_ptr(struct il_priv *il, struct il_rx_queue *q)
{}
EXPORT_SYMBOL();

int
il_rx_queue_alloc(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_hdl_spectrum_measurement(struct il_priv *il, struct il_rx_buf *rxb)
{}
EXPORT_SYMBOL();

/*
 * returns non-zero if packet should be dropped
 */
int
il_set_decrypted_flag(struct il_priv *il, struct ieee80211_hdr *hdr,
		      u32 decrypt_res, struct ieee80211_rx_status *stats)
{}
EXPORT_SYMBOL();

/*
 * il_txq_update_write_ptr - Send new write idx to hardware
 */
void
il_txq_update_write_ptr(struct il_priv *il, struct il_tx_queue *txq)
{}
EXPORT_SYMBOL();

/*
 * il_tx_queue_unmap -  Unmap any remaining DMA mappings and free skb's
 */
void
il_tx_queue_unmap(struct il_priv *il, int txq_id)
{}
EXPORT_SYMBOL();

/*
 * il_tx_queue_free - Deallocate DMA queue.
 * @txq: Transmit queue to deallocate.
 *
 * Empty queue by removing and destroying all BD's.
 * Free all buffers.
 * 0-fill, but do not free "txq" descriptor structure.
 */
void
il_tx_queue_free(struct il_priv *il, int txq_id)
{}
EXPORT_SYMBOL();

/*
 * il_cmd_queue_unmap - Unmap any remaining DMA mappings from command queue
 */
void
il_cmd_queue_unmap(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * il_cmd_queue_free - Deallocate DMA queue.
 *
 * Empty queue by removing and destroying all BD's.
 * Free all buffers.
 * 0-fill, but do not free "txq" descriptor structure.
 */
void
il_cmd_queue_free(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*************** DMA-QUEUE-GENERAL-FUNCTIONS  *****
 * DMA services
 *
 * Theory of operation
 *
 * A Tx or Rx queue resides in host DRAM, and is comprised of a circular buffer
 * of buffer descriptors, each of which points to one or more data buffers for
 * the device to read from or fill.  Driver and device exchange status of each
 * queue via "read" and "write" pointers.  Driver keeps minimum of 2 empty
 * entries in each circular buffer, to protect against confusing empty and full
 * queue states.
 *
 * The device reads or writes the data in the queues via the device's several
 * DMA/FIFO channels.  Each queue is mapped to a single DMA channel.
 *
 * For Tx queue, there are low mark and high mark limits. If, after queuing
 * the packet for Tx, free space become < low mark, Tx queue stopped. When
 * reclaiming packets (on 'tx done IRQ), if free space become > high mark,
 * Tx queue resumed.
 *
 * See more detailed info in 4965.h.
 ***************************************************/

int
il_queue_space(const struct il_queue *q)
{}
EXPORT_SYMBOL();


/*
 * il_queue_init - Initialize queue's high/low-water and read/write idxes
 */
static int
il_queue_init(struct il_priv *il, struct il_queue *q, int slots, u32 id)
{}

/*
 * il_tx_queue_alloc - Alloc driver data and TFD CB for one Tx/cmd queue
 */
static int
il_tx_queue_alloc(struct il_priv *il, struct il_tx_queue *txq, u32 id)
{}

/*
 * il_tx_queue_init - Allocate and initialize one tx/cmd queue
 */
int
il_tx_queue_init(struct il_priv *il, u32 txq_id)
{}
EXPORT_SYMBOL();

void
il_tx_queue_reset(struct il_priv *il, u32 txq_id)
{}
EXPORT_SYMBOL();

/*************** HOST COMMAND QUEUE FUNCTIONS   *****/

/*
 * il_enqueue_hcmd - enqueue a uCode command
 * @il: device ilate data point
 * @cmd: a point to the ucode command structure
 *
 * The function returns < 0 values to indicate the operation is
 * failed. On success, it turns the idx (> 0) of command in the
 * command queue.
 */
int
il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
{}

/*
 * il_hcmd_queue_reclaim - Reclaim TX command queue entries already Tx'd
 *
 * When FW advances 'R' idx, all entries between old and new 'R' idx
 * need to be reclaimed. As result, some free space forms.  If there is
 * enough free space (> low mark), wake the stack that feeds us.
 */
static void
il_hcmd_queue_reclaim(struct il_priv *il, int txq_id, int idx, int cmd_idx)
{}

/*
 * il_tx_cmd_complete - Pull unused buffers off the queue and reclaim them
 * @rxb: Rx buffer to reclaim
 *
 * If an Rx buffer has an async callback associated with it the callback
 * will be executed.  The attached skb (if present) will only be freed
 * if the callback returns 1
 */
void
il_tx_cmd_complete(struct il_priv *il, struct il_rx_buf *rxb)
{}
EXPORT_SYMBOL();

MODULE_DESCRIPTION();
MODULE_VERSION();
MODULE_AUTHOR();
MODULE_LICENSE();

/*
 * set bt_coex_active to true, uCode will do kill/defer
 * every time the priority line is asserted (BT is sending signals on the
 * priority line in the PCIx).
 * set bt_coex_active to false, uCode will ignore the BT activity and
 * perform the normal operation
 *
 * User might experience transmit issue on some platform due to WiFi/BT
 * co-exist problem. The possible behaviors are:
 *   Able to scan and finding all the available AP
 *   Not able to associate with any AP
 * On those platforms, WiFi communication can be restored by set
 * "bt_coex_active" module parameter to "false"
 *
 * default: bt_coex_active = true (BT_COEX_ENABLE)
 */
static bool bt_coex_active =;
module_param(bt_coex_active, bool, 0444);
MODULE_PARM_DESC();

u32 il_debug_level;
EXPORT_SYMBOL();

const u8 il_bcast_addr[ETH_ALEN] =;
EXPORT_SYMBOL();

#define MAX_BIT_RATE_40_MHZ
#define MAX_BIT_RATE_20_MHZ
static void
il_init_ht_hw_capab(const struct il_priv *il,
		    struct ieee80211_sta_ht_cap *ht_info,
		    enum nl80211_band band)
{}

/*
 * il_init_geos - Initialize mac80211's geo/channel info based from eeprom
 */
int
il_init_geos(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * il_free_geos - undo allocations in il_init_geos
 */
void
il_free_geos(struct il_priv *il)
{}
EXPORT_SYMBOL();

static bool
il_is_channel_extension(struct il_priv *il, enum nl80211_band band,
			u16 channel, u8 extension_chan_offset)
{}

bool
il_is_ht40_tx_allowed(struct il_priv *il, struct ieee80211_sta_ht_cap *ht_cap)
{}
EXPORT_SYMBOL();

static u16 noinline
il_adjust_beacon_interval(u16 beacon_val, u16 max_beacon_val)
{}

int
il_send_rxon_timing(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_set_rxon_hwcrypto(struct il_priv *il, int hw_decrypt)
{}
EXPORT_SYMBOL();

/* validate RXON structure is valid */
int
il_check_rxon_cmd(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * il_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed
 * @il: staging_rxon is compared to active_rxon
 *
 * If the RXON structure is changing enough to require a new tune,
 * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that
 * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required.
 */
int
il_full_rxon_required(struct il_priv *il)
{}
EXPORT_SYMBOL();

u8
il_get_lowest_plcp(struct il_priv *il)
{}
EXPORT_SYMBOL();

static void
_il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf)
{}

void
il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf)
{}
EXPORT_SYMBOL();

/* Return valid, unused, channel for a passive scan to reset the RF */
u8
il_get_single_channel_number(struct il_priv *il, enum nl80211_band band)
{}
EXPORT_SYMBOL();

/*
 * il_set_rxon_channel - Set the band and channel values in staging RXON
 * @ch: requested channel as a pointer to struct ieee80211_channel

 * NOTE:  Does not commit to the hardware; it sets appropriate bit fields
 * in the staging RXON flag structure based on the ch->band
 */
int
il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch)
{}
EXPORT_SYMBOL();

void
il_set_flags_for_band(struct il_priv *il, enum nl80211_band band,
		      struct ieee80211_vif *vif)
{}
EXPORT_SYMBOL();

/*
 * initialize rxon structure with default values from eeprom
 */
void
il_connection_init_rx_config(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_set_rate(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_chswitch_done(struct il_priv *il, bool is_success)
{}
EXPORT_SYMBOL();

void
il_hdl_csa(struct il_priv *il, struct il_rx_buf *rxb)
{}
EXPORT_SYMBOL();

#ifdef CONFIG_IWLEGACY_DEBUG
void
il_print_rx_config_cmd(struct il_priv *il)
{}
EXPORT_SYMBOL();
#endif
/*
 * il_irq_handle_error - called for HW or SW error interrupt from card
 */
void
il_irq_handle_error(struct il_priv *il)
{}
EXPORT_SYMBOL();

static int
_il_apm_stop_master(struct il_priv *il)
{}

void
_il_apm_stop(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_apm_stop(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * Start up NIC's basic functionality after it has been reset
 * (e.g. after platform boot, or shutdown via il_apm_stop())
 * NOTE:  This does not load uCode nor start the embedded processor
 */
int
il_apm_init(struct il_priv *il)
{}
EXPORT_SYMBOL();

int
il_set_tx_power(struct il_priv *il, s8 tx_power, bool force)
{}
EXPORT_SYMBOL();

void
il_send_bt_config(struct il_priv *il)
{}
EXPORT_SYMBOL();

int
il_send_stats_request(struct il_priv *il, u8 flags, bool clear)
{}
EXPORT_SYMBOL();

void
il_hdl_pm_sleep(struct il_priv *il, struct il_rx_buf *rxb)
{}
EXPORT_SYMBOL();

void
il_hdl_pm_debug_stats(struct il_priv *il, struct il_rx_buf *rxb)
{}
EXPORT_SYMBOL();

void
il_hdl_error(struct il_priv *il, struct il_rx_buf *rxb)
{}
EXPORT_SYMBOL();

void
il_clear_isr_stats(struct il_priv *il)
{}

int
il_mac_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
	       unsigned int link_id, u16 queue,
	       const struct ieee80211_tx_queue_params *params)
{}
EXPORT_SYMBOL();

int
il_mac_tx_last_beacon(struct ieee80211_hw *hw)
{}
EXPORT_SYMBOL_GPL();

static int
il_set_mode(struct il_priv *il)
{}

int
il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{}
EXPORT_SYMBOL();

static void
il_teardown_interface(struct il_priv *il, struct ieee80211_vif *vif)
{}

void
il_mac_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{}
EXPORT_SYMBOL();

int
il_alloc_txq_mem(struct il_priv *il)
{}
EXPORT_SYMBOL();

void
il_free_txq_mem(struct il_priv *il)
{}
EXPORT_SYMBOL();

int
il_force_reset(struct il_priv *il, bool external)
{}
EXPORT_SYMBOL();

int
il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			enum nl80211_iftype newtype, bool newp2p)
{}
EXPORT_SYMBOL();

void il_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		  u32 queues, bool drop)
{}
EXPORT_SYMBOL();

/*
 * On every watchdog tick we check (latest) time stamp. If it does not
 * change during timeout period and queue is not empty we reset firmware.
 */
static int
il_check_stuck_queue(struct il_priv *il, int cnt)
{}

/*
 * Making watchdog tick be a quarter of timeout assure we will
 * discover the queue hung between timeout and 1.25*timeout
 */
#define IL_WD_TICK(timeout)

/*
 * Watchdog timer callback, we check each tx queue for stuck, if hung
 * we reset the firmware. If everything is fine just rearm the timer.
 */
void
il_bg_watchdog(struct timer_list *t)
{}
EXPORT_SYMBOL();

void
il_setup_watchdog(struct il_priv *il)
{}
EXPORT_SYMBOL();

/*
 * extended beacon time format
 * time in usec will be changed into a 32-bit value in extended:internal format
 * the extended part is the beacon counts
 * the internal part is the time in usec within one beacon interval
 */
u32
il_usecs_to_beacons(struct il_priv *il, u32 usec, u32 beacon_interval)
{}
EXPORT_SYMBOL();

/* base is usually what we get from ucode with each received frame,
 * the same as HW timer counter counting down
 */
__le32
il_add_beacon_time(struct il_priv *il, u32 base, u32 addon,
		   u32 beacon_interval)
{}
EXPORT_SYMBOL();

#ifdef CONFIG_PM_SLEEP

static int
il_pci_suspend(struct device *device)
{}

static int
il_pci_resume(struct device *device)
{}

SIMPLE_DEV_PM_OPS(il_pm_ops, il_pci_suspend, il_pci_resume);
EXPORT_SYMBOL();

#endif /* CONFIG_PM_SLEEP */

static void
il_update_qos(struct il_priv *il)
{}

/*
 * il_mac_config - mac80211 config callback
 */
int
il_mac_config(struct ieee80211_hw *hw, u32 changed)
{}
EXPORT_SYMBOL();

void
il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{}
EXPORT_SYMBOL();

static void
il_ht_conf(struct il_priv *il, struct ieee80211_vif *vif)
{}

static inline void
il_set_no_assoc(struct il_priv *il, struct ieee80211_vif *vif)
{}

static void
il_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{}

void
il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			struct ieee80211_bss_conf *bss_conf, u64 changes)
{}
EXPORT_SYMBOL();

irqreturn_t
il_isr(int irq, void *data)
{}
EXPORT_SYMBOL();

/*
 *  il_tx_cmd_protection: Set rts/cts. 3945 and 4965 only share this
 *  function.
 */
void
il_tx_cmd_protection(struct il_priv *il, struct ieee80211_tx_info *info,
		     __le16 fc, __le32 *tx_flags)
{}
EXPORT_SYMBOL();