linux/drivers/net/wireless/intel/iwlegacy/4965-mac.c

// SPDX-License-Identifier: GPL-2.0-only
/******************************************************************************
 *
 * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved.
 *
 * Portions of this file are derived from the ipw3945 project, as well
 * as portions of the ieee80211 subsystem header files.
 *
 * Contact Information:
 *  Intel Linux Wireless <[email protected]>
 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 *
 *****************************************************************************/

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/firmware.h>
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <linux/units.h>

#include <net/mac80211.h>

#include <asm/div64.h>

#define DRV_NAME

#include "common.h"
#include "4965.h"

/******************************************************************************
 *
 * module boiler plate
 *
 ******************************************************************************/

/*
 * module name, copyright, version, etc.
 */
#define DRV_DESCRIPTION

#ifdef CONFIG_IWLEGACY_DEBUG
#define VD
#else
#define VD
#endif

#define DRV_VERSION

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

void
il4965_check_abort_status(struct il_priv *il, u8 frame_count, u32 status)
{}

/*
 * EEPROM
 */
struct il_mod_params il4965_mod_params =;

void
il4965_rx_queue_reset(struct il_priv *il, struct il_rx_queue *rxq)
{}

int
il4965_rx_init(struct il_priv *il, struct il_rx_queue *rxq)
{}

static void
il4965_set_pwr_vmain(struct il_priv *il)
{}

int
il4965_hw_nic_init(struct il_priv *il)
{}

/*
 * il4965_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer ptr
 */
static inline __le32
il4965_dma_addr2rbd_ptr(struct il_priv *il, dma_addr_t dma_addr)
{}

/*
 * il4965_rx_queue_restock - refill RX queue from pre-allocated pool
 *
 * If there are slots in the RX queue that need to be restocked,
 * and we have free pre-allocated buffers, fill the ranks as much
 * as we can, pulling from rx_free.
 *
 * This moves the 'write' idx forward to catch up with 'processed', and
 * also updates the memory address in the firmware to reference the new
 * target buffer.
 */
void
il4965_rx_queue_restock(struct il_priv *il)
{}

/*
 * il4965_rx_replenish - Move all used packet from rx_used to rx_free
 *
 * When moving to rx_free an SKB is allocated for the slot.
 *
 * Also restock the Rx queue via il_rx_queue_restock.
 * This is called as a scheduled work item (except for during initialization)
 */
static void
il4965_rx_allocate(struct il_priv *il, gfp_t priority)
{}

void
il4965_rx_replenish(struct il_priv *il)
{}

void
il4965_rx_replenish_now(struct il_priv *il)
{}

/* Assumes that the skb field of the buffers in 'pool' is kept accurate.
 * If an SKB has been detached, the POOL needs to have its SKB set to NULL
 * This free routine walks the list of POOL entries and if SKB is set to
 * non NULL it is unmapped and freed
 */
void
il4965_rx_queue_free(struct il_priv *il, struct il_rx_queue *rxq)
{}

int
il4965_rxq_stop(struct il_priv *il)
{}

int
il4965_hwrate_to_mac80211_idx(u32 rate_n_flags, enum nl80211_band band)
{}

static int
il4965_calc_rssi(struct il_priv *il, struct il_rx_phy_res *rx_resp)
{}

static u32
il4965_translate_rx_status(struct il_priv *il, u32 decrypt_in)
{}

#define SMALL_PACKET_SIZE

static void
il4965_pass_packet_to_mac80211(struct il_priv *il, struct ieee80211_hdr *hdr,
			       u32 len, u32 ampdu_status, struct il_rx_buf *rxb,
			       struct ieee80211_rx_status *stats)
{}

/* Called for N_RX (legacy ABG frames), or
 * N_RX_MPDU (HT high-throughput N frames). */
static void
il4965_hdl_rx(struct il_priv *il, struct il_rx_buf *rxb)
{}

/* Cache phy data (Rx signal strength, etc) for HT frame (N_RX_PHY).
 * This will be used later in il_hdl_rx() for N_RX_MPDU. */
static void
il4965_hdl_rx_phy(struct il_priv *il, struct il_rx_buf *rxb)
{}

static int
il4965_get_channels_for_scan(struct il_priv *il, struct ieee80211_vif *vif,
			     enum nl80211_band band, u8 is_active,
			     u8 n_probes, struct il_scan_channel *scan_ch)
{}

static void
il4965_toggle_tx_ant(struct il_priv *il, u8 *ant, u8 valid)
{}

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

int
il4965_manage_ibss_station(struct il_priv *il, struct ieee80211_vif *vif,
			   bool add)
{}

void
il4965_free_tfds_in_queue(struct il_priv *il, int sta_id, int tid, int freed)
{}

#define IL_TX_QUEUE_MSK

static bool
il4965_is_single_rx_stream(struct il_priv *il)
{}

#define IL_NUM_RX_CHAINS_MULTIPLE
#define IL_NUM_RX_CHAINS_SINGLE
#define IL_NUM_IDLE_CHAINS_DUAL
#define IL_NUM_IDLE_CHAINS_SINGLE

/*
 * Determine how many receiver/antenna chains to use.
 *
 * More provides better reception via diversity.  Fewer saves power
 * at the expense of throughput, but only when not in powersave to
 * start with.
 *
 * MIMO (dual stream) requires at least 2, but works better with 3.
 * This does not determine *which* chains to use, just how many.
 */
static int
il4965_get_active_rx_chain_count(struct il_priv *il)
{}

/*
 * When we are in power saving mode, unless device support spatial
 * multiplexing power save, use the active count for rx chain count.
 */
static int
il4965_get_idle_rx_chain_count(struct il_priv *il, int active_cnt)
{}

/* up to 4 chains */
static u8
il4965_count_chain_bitmap(u32 chain_bitmap)
{}

/*
 * il4965_set_rxon_chain - Set up Rx chain usage in "staging" RXON image
 *
 * Selects how many and which Rx receivers/antennas/chains to use.
 * This should not be used for scan command ... it puts data in wrong place.
 */
void
il4965_set_rxon_chain(struct il_priv *il)
{}

static const char *
il4965_get_fh_string(int cmd)
{}

int
il4965_dump_fh(struct il_priv *il, char **buf, bool display)
{}

static void
il4965_hdl_missed_beacon(struct il_priv *il, struct il_rx_buf *rxb)
{}

/* Calculate noise level, based on measurements during network silence just
 *   before arriving beacon.  This measurement can be done only if we know
 *   exactly when to expect beacons, therefore only when we're associated. */
static void
il4965_rx_calc_noise(struct il_priv *il)
{}

#ifdef CONFIG_IWLEGACY_DEBUGFS
/*
 *  based on the assumption of all stats counter are in DWORD
 *  FIXME: This function is for debugging, do not deal with
 *  the case of counters roll-over.
 */
static void
il4965_accumulative_stats(struct il_priv *il, __le32 * stats)
{}
#endif

static void
il4965_hdl_stats(struct il_priv *il, struct il_rx_buf *rxb)
{}

static void
il4965_hdl_c_stats(struct il_priv *il, struct il_rx_buf *rxb)
{}


/*
 * mac80211 queues, ACs, hardware queues, FIFOs.
 *
 * Cf. https://wireless.wiki.kernel.org/en/developers/Documentation/mac80211/queues
 *
 * Mac80211 uses the following numbers, which we get as from it
 * by way of skb_get_queue_mapping(skb):
 *
 *     VO      0
 *     VI      1
 *     BE      2
 *     BK      3
 *
 *
 * Regular (not A-MPDU) frames are put into hardware queues corresponding
 * to the FIFOs, see comments in iwl-prph.h. Aggregated frames get their
 * own queue per aggregation session (RA/TID combination), such queues are
 * set up to map into FIFOs too, for which we need an AC->FIFO mapping. In
 * order to map frames to the right queue, we also need an AC->hw queue
 * mapping. This is implemented here.
 *
 * Due to the way hw queues are set up (by the hw specific modules like
 * 4965.c), the AC->hw queue mapping is the identity
 * mapping.
 */

static const u8 tid_to_ac[] =;

static inline int
il4965_get_ac_from_tid(u16 tid)
{}

static inline int
il4965_get_fifo_from_tid(u16 tid)
{}

/*
 * handle build C_TX command notification.
 */
static void
il4965_tx_cmd_build_basic(struct il_priv *il, struct sk_buff *skb,
			  struct il_tx_cmd *tx_cmd,
			  struct ieee80211_tx_info *info,
			  struct ieee80211_hdr *hdr, u8 std_id)
{}

static void
il4965_tx_cmd_build_rate(struct il_priv *il,
			 struct il_tx_cmd *tx_cmd,
			 struct ieee80211_tx_info *info,
			 struct ieee80211_sta *sta,
			 __le16 fc)
{}

static void
il4965_tx_cmd_build_hwcrypto(struct il_priv *il, struct ieee80211_tx_info *info,
			     struct il_tx_cmd *tx_cmd, struct sk_buff *skb_frag,
			     int sta_id)
{}

/*
 * start C_TX command process
 */
int
il4965_tx_skb(struct il_priv *il,
	      struct ieee80211_sta *sta,
	      struct sk_buff *skb)
{}

static inline int
il4965_alloc_dma_ptr(struct il_priv *il, struct il_dma_ptr *ptr, size_t size)
{}

static inline void
il4965_free_dma_ptr(struct il_priv *il, struct il_dma_ptr *ptr)
{}

/*
 * il4965_hw_txq_ctx_free - Free TXQ Context
 *
 * Destroy all TX DMA queues and structures
 */
void
il4965_hw_txq_ctx_free(struct il_priv *il)
{}

/*
 * il4965_txq_ctx_alloc - allocate TX queue context
 * Allocate all Tx DMA structures and initialize them
 */
int
il4965_txq_ctx_alloc(struct il_priv *il)
{}

void
il4965_txq_ctx_reset(struct il_priv *il)
{}

static void
il4965_txq_ctx_unmap(struct il_priv *il)
{}

/*
 * il4965_txq_ctx_stop - Stop all Tx DMA channels
 */
void
il4965_txq_ctx_stop(struct il_priv *il)
{}

/*
 * Find first available (lowest unused) Tx Queue, mark it "active".
 * Called only when finding queue for aggregation.
 * Should never return anything < 7, because they should already
 * be in use as EDCA AC (0-3), Command (4), reserved (5, 6)
 */
static int
il4965_txq_ctx_activate_free(struct il_priv *il)
{}

/*
 * il4965_tx_queue_stop_scheduler - Stop queue, but keep configuration
 */
static void
il4965_tx_queue_stop_scheduler(struct il_priv *il, u16 txq_id)
{}

/*
 * il4965_tx_queue_set_q2ratid - Map unique receiver/tid combination to a queue
 */
static int
il4965_tx_queue_set_q2ratid(struct il_priv *il, u16 ra_tid, u16 txq_id)
{}

/*
 * il4965_tx_queue_agg_enable - Set up & enable aggregation for selected queue
 *
 * NOTE:  txq_id must be greater than IL49_FIRST_AMPDU_QUEUE,
 *        i.e. it must be one of the higher queues used for aggregation
 */
static int
il4965_txq_agg_enable(struct il_priv *il, int txq_id, int tx_fifo, int sta_id,
		      int tid, u16 ssn_idx)
{}

int
il4965_tx_agg_start(struct il_priv *il, struct ieee80211_vif *vif,
		    struct ieee80211_sta *sta, u16 tid, u16 * ssn)
{}

/*
 * txq_id must be greater than IL49_FIRST_AMPDU_QUEUE
 * il->lock must be held by the caller
 */
static int
il4965_txq_agg_disable(struct il_priv *il, u16 txq_id, u16 ssn_idx, u8 tx_fifo)
{}

int
il4965_tx_agg_stop(struct il_priv *il, struct ieee80211_vif *vif,
		   struct ieee80211_sta *sta, u16 tid)
{}

int
il4965_txq_check_empty(struct il_priv *il, int sta_id, u8 tid, int txq_id)
{}

static void
il4965_non_agg_tx_status(struct il_priv *il, const u8 *addr1)
{}

static void
il4965_tx_status(struct il_priv *il, struct sk_buff *skb, bool is_agg)
{}

int
il4965_tx_queue_reclaim(struct il_priv *il, int txq_id, int idx)
{}

/*
 * il4965_tx_status_reply_compressed_ba - Update tx status from block-ack
 *
 * Go through block-ack's bitmap of ACK'd frames, update driver's record of
 * ACK vs. not.  This gets sent to mac80211, then to rate scaling algo.
 */
static int
il4965_tx_status_reply_compressed_ba(struct il_priv *il, struct il_ht_agg *agg,
				     struct il_compressed_ba_resp *ba_resp)
{}

static inline bool
il4965_is_tx_success(u32 status)
{}

static u8
il4965_find_station(struct il_priv *il, const u8 *addr)
{}

static int
il4965_get_ra_sta_id(struct il_priv *il, struct ieee80211_hdr *hdr)
{}

static inline u32
il4965_get_scd_ssn(struct il4965_tx_resp *tx_resp)
{}

static inline u32
il4965_tx_status_to_mac80211(u32 status)
{}

/*
 * il4965_tx_status_reply_tx - Handle Tx response for frames in aggregation queue
 */
static int
il4965_tx_status_reply_tx(struct il_priv *il, struct il_ht_agg *agg,
			  struct il4965_tx_resp *tx_resp, int txq_id,
			  u16 start_idx)
{}

/*
 * il4965_hdl_tx - Handle standard (non-aggregation) Tx response
 */
static void
il4965_hdl_tx(struct il_priv *il, struct il_rx_buf *rxb)
{}

/*
 * translate ucode response to mac80211 tx status control values
 */
void
il4965_hwrate_to_tx_control(struct il_priv *il, u32 rate_n_flags,
			    struct ieee80211_tx_info *info)
{}

/*
 * il4965_hdl_compressed_ba - Handler for N_COMPRESSED_BA
 *
 * Handles block-acknowledge notification from device, which reports success
 * of frames sent via aggregation.
 */
static void
il4965_hdl_compressed_ba(struct il_priv *il, struct il_rx_buf *rxb)
{}

#ifdef CONFIG_IWLEGACY_DEBUG
const char *
il4965_get_tx_fail_reason(u32 status)
{}
#endif /* CONFIG_IWLEGACY_DEBUG */

static struct il_link_quality_cmd *
il4965_sta_alloc_lq(struct il_priv *il, u8 sta_id)
{}

/*
 * il4965_add_bssid_station - Add the special IBSS BSSID station
 *
 * Function sleeps.
 */
int
il4965_add_bssid_station(struct il_priv *il, const u8 *addr, u8 *sta_id_r)
{}

static int
il4965_static_wepkey_cmd(struct il_priv *il, bool send_if_empty)
{}

int
il4965_restore_default_wep_keys(struct il_priv *il)
{}

int
il4965_remove_default_wep_key(struct il_priv *il,
			      struct ieee80211_key_conf *keyconf)
{}

int
il4965_set_default_wep_key(struct il_priv *il,
			   struct ieee80211_key_conf *keyconf)
{}

static int
il4965_set_wep_dynamic_key_info(struct il_priv *il,
				struct ieee80211_key_conf *keyconf, u8 sta_id)
{}

static int
il4965_set_ccmp_dynamic_key_info(struct il_priv *il,
				 struct ieee80211_key_conf *keyconf, u8 sta_id)
{}

static int
il4965_set_tkip_dynamic_key_info(struct il_priv *il,
				 struct ieee80211_key_conf *keyconf, u8 sta_id)
{}

void
il4965_update_tkip_key(struct il_priv *il, struct ieee80211_key_conf *keyconf,
		       struct ieee80211_sta *sta, u32 iv32, u16 *phase1key)
{}

int
il4965_remove_dynamic_key(struct il_priv *il,
			  struct ieee80211_key_conf *keyconf, u8 sta_id)
{}

int
il4965_set_dynamic_key(struct il_priv *il, struct ieee80211_key_conf *keyconf,
		       u8 sta_id)
{}

/*
 * il4965_alloc_bcast_station - add broadcast station into driver's station table.
 *
 * This adds the broadcast station into the driver's station table
 * and marks it driver active, so that it will be restored to the
 * device at the next best time.
 */
int
il4965_alloc_bcast_station(struct il_priv *il)
{}

/*
 * il4965_update_bcast_station - update broadcast station's LQ command
 *
 * Only used by iwl4965. Placed here to have all bcast station management
 * code together.
 */
static int
il4965_update_bcast_station(struct il_priv *il)
{}

int
il4965_update_bcast_stations(struct il_priv *il)
{}

/*
 * il4965_sta_tx_modify_enable_tid - Enable Tx for this TID in station table
 */
int
il4965_sta_tx_modify_enable_tid(struct il_priv *il, int sta_id, int tid)
{}

int
il4965_sta_rx_agg_start(struct il_priv *il, struct ieee80211_sta *sta, int tid,
			u16 ssn)
{}

int
il4965_sta_rx_agg_stop(struct il_priv *il, struct ieee80211_sta *sta, int tid)
{}

void
il4965_sta_modify_sleep_tx_count(struct il_priv *il, int sta_id, int cnt)
{}

void
il4965_update_chain_flags(struct il_priv *il)
{}

static void
il4965_clear_free_frames(struct il_priv *il)
{}

static struct il_frame *
il4965_get_free_frame(struct il_priv *il)
{}

static void
il4965_free_frame(struct il_priv *il, struct il_frame *frame)
{}

static u32
il4965_fill_beacon_frame(struct il_priv *il, struct ieee80211_hdr *hdr,
			 int left)
{}

/* Parse the beacon frame to find the TIM element and set tim_idx & tim_size */
static void
il4965_set_beacon_tim(struct il_priv *il,
		      struct il_tx_beacon_cmd *tx_beacon_cmd, u8 * beacon,
		      u32 frame_size)
{}

static unsigned int
il4965_hw_get_beacon_cmd(struct il_priv *il, struct il_frame *frame)
{}

int
il4965_send_beacon_cmd(struct il_priv *il)
{}

static inline dma_addr_t
il4965_tfd_tb_get_addr(struct il_tfd *tfd, u8 idx)
{}

static inline u16
il4965_tfd_tb_get_len(struct il_tfd *tfd, u8 idx)
{}

static inline void
il4965_tfd_set_tb(struct il_tfd *tfd, u8 idx, dma_addr_t addr, u16 len)
{}

static inline u8
il4965_tfd_get_num_tbs(struct il_tfd *tfd)
{}

/*
 * il4965_hw_txq_free_tfd - Free all chunks referenced by TFD [txq->q.read_ptr]
 *
 * Does NOT advance any TFD circular buffer read/write idxes
 * Does NOT free the TFD itself (which is within circular buffer)
 */
void
il4965_hw_txq_free_tfd(struct il_priv *il, struct il_tx_queue *txq)
{}

int
il4965_hw_txq_attach_buf_to_tfd(struct il_priv *il, struct il_tx_queue *txq,
				dma_addr_t addr, u16 len, u8 reset, u8 pad)
{}

/*
 * Tell nic where to find circular buffer of Tx Frame Descriptors for
 * given Tx queue, and enable the DMA channel used for that queue.
 *
 * 4965 supports up to 16 Tx queues in DRAM, mapped to up to 8 Tx DMA
 * channels supported in hardware.
 */
int
il4965_hw_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq)
{}

/******************************************************************************
 *
 * Generic RX handler implementations
 *
 ******************************************************************************/
static void
il4965_hdl_alive(struct il_priv *il, struct il_rx_buf *rxb)
{}

/*
 * il4965_bg_stats_periodic - Timer callback to queue stats
 *
 * This callback is provided in order to send a stats request.
 *
 * This timer function is continually reset to execute within
 * 60 seconds since the last N_STATS was received.  We need to
 * ensure we receive the stats in order to update the temperature
 * used for calibrating the TXPOWER.
 */
static void
il4965_bg_stats_periodic(struct timer_list *t)
{}

static void
il4965_hdl_beacon(struct il_priv *il, struct il_rx_buf *rxb)
{}

static void
il4965_perform_ct_kill_task(struct il_priv *il)
{}

/* Handle notification from uCode that card's power state is changing
 * due to software, hardware, or critical temperature RFKILL */
static void
il4965_hdl_card_state(struct il_priv *il, struct il_rx_buf *rxb)
{}

/*
 * il4965_setup_handlers - Initialize Rx handler callbacks
 *
 * Setup the RX handlers for each of the reply types sent from the uCode
 * to the host.
 *
 * This function chains into the hardware specific files for them to setup
 * any hardware specific handlers as well.
 */
static void
il4965_setup_handlers(struct il_priv *il)
{}

/*
 * il4965_rx_handle - Main entry function for receiving responses from uCode
 *
 * Uses the il->handlers callback function array to invoke
 * the appropriate handlers, including command responses,
 * frame-received notifications, and other notifications.
 */
void
il4965_rx_handle(struct il_priv *il)
{}

/* call this function to flush any scheduled tasklet */
static inline void
il4965_synchronize_irq(struct il_priv *il)
{}

static void
il4965_irq_tasklet(struct tasklet_struct *t)
{}

/*****************************************************************************
 *
 * sysfs attributes
 *
 *****************************************************************************/

#ifdef CONFIG_IWLEGACY_DEBUG

/*
 * The following adds a new attribute to the sysfs representation
 * of this device driver (i.e. a new file in /sys/class/net/wlan0/device/)
 * used for controlling the debug level.
 *
 * See the level definitions in iwl for details.
 *
 * The debug_level being managed using sysfs below is a per device debug
 * level that is used instead of the global debug level if it (the per
 * device debug level) is set.
 */
static ssize_t
il4965_show_debug_level(struct device *d, struct device_attribute *attr,
			char *buf)
{}

static ssize_t
il4965_store_debug_level(struct device *d, struct device_attribute *attr,
			 const char *buf, size_t count)
{}

static DEVICE_ATTR(debug_level, 0644, il4965_show_debug_level,
		   il4965_store_debug_level);

#endif /* CONFIG_IWLEGACY_DEBUG */

static ssize_t
il4965_show_temperature(struct device *d, struct device_attribute *attr,
			char *buf)
{}

static DEVICE_ATTR(temperature, 0444, il4965_show_temperature, NULL);

static ssize_t
il4965_show_tx_power(struct device *d, struct device_attribute *attr, char *buf)
{}

static ssize_t
il4965_store_tx_power(struct device *d, struct device_attribute *attr,
		      const char *buf, size_t count)
{}

static DEVICE_ATTR(tx_power, 0644, il4965_show_tx_power,
		   il4965_store_tx_power);

static struct attribute *il_sysfs_entries[] =;

static const struct attribute_group il_attribute_group =;

/******************************************************************************
 *
 * uCode download functions
 *
 ******************************************************************************/

static void
il4965_dealloc_ucode_pci(struct il_priv *il)
{}

static void
il4965_nic_start(struct il_priv *il)
{}

static void il4965_ucode_callback(const struct firmware *ucode_raw,
				  void *context);
static int il4965_mac_setup_register(struct il_priv *il, u32 max_probe_length);

static int __must_check
il4965_request_firmware(struct il_priv *il, bool first)
{}

struct il4965_firmware_pieces {};

static int
il4965_load_firmware(struct il_priv *il, const struct firmware *ucode_raw,
		     struct il4965_firmware_pieces *pieces)
{}

/*
 * il4965_ucode_callback - callback when firmware was loaded
 *
 * If loaded successfully, copies the firmware into buffers
 * for the card to fetch (via DMA).
 */
static void
il4965_ucode_callback(const struct firmware *ucode_raw, void *context)
{}

static const char *const desc_lookup_text[] =;

static struct {} advanced_lookup[] =;

static const char *
il4965_desc_lookup(u32 num)
{}

#define ERROR_START_OFFSET
#define ERROR_ELEM_SIZE

void
il4965_dump_nic_error_log(struct il_priv *il)
{}

static void
il4965_rf_kill_ct_config(struct il_priv *il)
{}

static const s8 default_queue_to_tx_fifo[] =;

#define IL_MASK(lo, hi)

static int
il4965_alive_notify(struct il_priv *il)
{}

/*
 * il4965_alive_start - called after N_ALIVE notification received
 *                   from protocol/runtime uCode (initialization uCode's
 *                   Alive gets handled by il_init_alive_start()).
 */
static void
il4965_alive_start(struct il_priv *il)
{}

static void il4965_cancel_deferred_work(struct il_priv *il);

static void
__il4965_down(struct il_priv *il)
{}

static void
il4965_down(struct il_priv *il)
{}


static void
il4965_set_hw_ready(struct il_priv *il)
{}

static void
il4965_prepare_card_hw(struct il_priv *il)
{}

#define MAX_HW_RESTARTS

static int
__il4965_up(struct il_priv *il)
{}

/*****************************************************************************
 *
 * Workqueue callbacks
 *
 *****************************************************************************/

static void
il4965_bg_init_alive_start(struct work_struct *data)
{}

static void
il4965_bg_alive_start(struct work_struct *data)
{}

static void
il4965_bg_run_time_calib_work(struct work_struct *work)
{}

static void
il4965_bg_restart(struct work_struct *data)
{}

static void
il4965_bg_rx_replenish(struct work_struct *data)
{}

/*****************************************************************************
 *
 * mac80211 entry point functions
 *
 *****************************************************************************/

#define UCODE_READY_TIMEOUT

/*
 * Not a mac80211 entry point function, but it fits in with all the
 * other mac80211 functions grouped here.
 */
static int
il4965_mac_setup_register(struct il_priv *il, u32 max_probe_length)
{}

int
il4965_mac_start(struct ieee80211_hw *hw)
{}

void
il4965_mac_stop(struct ieee80211_hw *hw, bool suspend)
{}

void
il4965_mac_tx(struct ieee80211_hw *hw,
	      struct ieee80211_tx_control *control,
	      struct sk_buff *skb)
{}

void
il4965_mac_update_tkip_key(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			   struct ieee80211_key_conf *keyconf,
			   struct ieee80211_sta *sta, u32 iv32, u16 * phase1key)
{}

int
il4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
		   struct ieee80211_vif *vif, struct ieee80211_sta *sta,
		   struct ieee80211_key_conf *key)
{}

int
il4965_mac_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			struct ieee80211_ampdu_params *params)
{}

int
il4965_mac_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		   struct ieee80211_sta *sta)
{}

void
il4965_mac_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			  struct ieee80211_channel_switch *ch_switch)
{}

void
il4965_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
			unsigned int *total_flags, u64 multicast)
{}

/*****************************************************************************
 *
 * driver setup and teardown
 *
 *****************************************************************************/

static void
il4965_bg_txpower_work(struct work_struct *work)
{}

static int
il4965_setup_deferred_work(struct il_priv *il)
{}

static void
il4965_cancel_deferred_work(struct il_priv *il)
{}

static void
il4965_init_hw_rates(struct il_priv *il, struct ieee80211_rate *rates)
{}

/*
 * Acquire il->lock before calling this function !
 */
void
il4965_set_wr_ptrs(struct il_priv *il, int txq_id, u32 idx)
{}

void
il4965_tx_queue_set_status(struct il_priv *il, struct il_tx_queue *txq,
			   int tx_fifo_id, int scd_retry)
{}

static const struct ieee80211_ops il4965_mac_ops =;

static int
il4965_init_drv(struct il_priv *il)
{}

static void
il4965_uninit_drv(struct il_priv *il)
{}

static void
il4965_hw_detect(struct il_priv *il)
{}

static const struct il_sensitivity_ranges il4965_sensitivity =;

static void
il4965_set_hw_params(struct il_priv *il)
{}

static int
il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static void
il4965_pci_remove(struct pci_dev *pdev)
{}

/*
 * Activate/Deactivate Tx DMA/FIFO channels according tx fifos mask
 * must be called under il->lock and mac access
 */
void
il4965_txq_set_sched(struct il_priv *il, u32 mask)
{}

/*****************************************************************************
 *
 * driver and module entry point
 *
 *****************************************************************************/

/* Hardware specific file defines the PCI IDs table for that hardware module */
static const struct pci_device_id il4965_hw_card_ids[] =;
MODULE_DEVICE_TABLE(pci, il4965_hw_card_ids);

static struct pci_driver il4965_driver =;

static int __init
il4965_init(void)
{}

static void __exit
il4965_exit(void)
{}

module_exit(il4965_exit);
module_init();

#ifdef CONFIG_IWLEGACY_DEBUG
module_param_named(debug, il_debug_level, uint, 0644);
MODULE_PARM_DESC();
#endif

module_param_named(swcrypto, il4965_mod_params.sw_crypto, int, 0444);
MODULE_PARM_DESC();
module_param_named(queues_num, il4965_mod_params.num_of_queues, int, 0444);
MODULE_PARM_DESC();
module_param_named(11n_disable, il4965_mod_params.disable_11n, int, 0444);
MODULE_PARM_DESC();
module_param_named(amsdu_size_8K, il4965_mod_params.amsdu_size_8K, int, 0444);
MODULE_PARM_DESC();
module_param_named(fw_restart, il4965_mod_params.restart_fw, int, 0444);
MODULE_PARM_DESC();