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

/* SPDX-License-Identifier: GPL-2.0-only */
/******************************************************************************
 *
 * Copyright(c) 2003 - 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
 *
 *****************************************************************************/
#ifndef __il_core_h__
#define __il_core_h__

#include <linux/interrupt.h>
#include <linux/pci.h>		/* for struct pci_device_id */
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/wait.h>
#include <linux/io.h>
#include <net/mac80211.h>
#include <net/ieee80211_radiotap.h>

#include "commands.h"
#include "csr.h"
#include "prph.h"

struct il_host_cmd;
struct il_cmd;
struct il_tx_queue;

#define IL_ERR(f, a...)
#define IL_WARN(f, a...)
#define IL_WARN_ONCE(f, a...)
#define IL_INFO(f, a...)

#define RX_QUEUE_SIZE
#define RX_QUEUE_MASK
#define RX_QUEUE_SIZE_LOG

/*
 * RX related structures and functions
 */
#define RX_FREE_BUFFERS
#define RX_LOW_WATERMARK

#define U32_PAD(n)

/* CT-KILL constants */
#define CT_KILL_THRESHOLD_LEGACY

/* Default noise level to report when noise measurement is not available.
 *   This may be because we're:
 *   1)  Not associated (4965, no beacon stats being sent to driver)
 *   2)  Scanning (noise measurement does not apply to associated channel)
 *   3)  Receiving CCK (3945 delivers noise info only for OFDM frames)
 * Use default noise value of -127 ... this is below the range of measurable
 *   Rx dBm for either 3945 or 4965, so it can indicate "unmeasurable" to user.
 *   Also, -127 works better than 0 when averaging frames with/without
 *   noise info (e.g. averaging might be done in app); measured dBm values are
 *   always negative ... using a negative value as the default keeps all
 *   averages within an s8's (used in some apps) range of negative values. */
#define IL_NOISE_MEAS_NOT_AVAILABLE

/*
 * RTS threshold here is total size [2347] minus 4 FCS bytes
 * Per spec:
 *   a value of 0 means RTS on all data/management packets
 *   a value > max MSDU size means no RTS
 * else RTS for data/management frames where MPDU is larger
 *   than RTS value.
 */
#define DEFAULT_RTS_THRESHOLD
#define MIN_RTS_THRESHOLD
#define MAX_RTS_THRESHOLD
#define MAX_MSDU_SIZE
#define MAX_MPDU_SIZE
#define DEFAULT_BEACON_INTERVAL
#define DEFAULT_SHORT_RETRY_LIMIT
#define DEFAULT_LONG_RETRY_LIMIT

struct il_rx_buf {};

#define rxb_addr(r)

/* defined below */
struct il_device_cmd;

struct il_cmd_meta {};

/*
 * Generic queue structure
 *
 * Contains common data for Rx and Tx queues
 */
struct il_queue {};

/**
 * struct il_tx_queue - Tx Queue for DMA
 * @q: generic Rx/Tx queue descriptor
 * @bd: base of circular buffer of TFDs
 * @cmd: array of command/TX buffer pointers
 * @meta: array of meta data for each command/tx buffer
 * @dma_addr_cmd: physical address of cmd/tx buffer array
 * @skbs: array of per-TFD socket buffer pointers
 * @time_stamp: time (in jiffies) of last read_ptr change
 * @need_update: indicates need to update read/write idx
 * @sched_retry: indicates queue is high-throughput aggregation (HT AGG) enabled
 *
 * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame
 * descriptors) and required locking structures.
 */
#define TFD_TX_CMD_SLOTS
#define TFD_CMD_SLOTS

struct il_tx_queue {};

/*
 * EEPROM access time values:
 *
 * Driver initiates EEPROM read by writing byte address << 1 to CSR_EEPROM_REG.
 * Driver then polls CSR_EEPROM_REG for CSR_EEPROM_REG_READ_VALID_MSK (0x1).
 * When polling, wait 10 uSec between polling loops, up to a maximum 5000 uSec.
 * Driver reads 16-bit value from bits 31-16 of CSR_EEPROM_REG.
 */
#define IL_EEPROM_ACCESS_TIMEOUT

#define IL_EEPROM_SEM_TIMEOUT
#define IL_EEPROM_SEM_RETRY_LIMIT

/*
 * Regulatory channel usage flags in EEPROM struct il4965_eeprom_channel.flags.
 *
 * IBSS and/or AP operation is allowed *only* on those channels with
 * (VALID && IBSS && ACTIVE && !RADAR).  This restriction is in place because
 * RADAR detection is not supported by the 4965 driver, but is a
 * requirement for establishing a new network for legal operation on channels
 * requiring RADAR detection or restricting ACTIVE scanning.
 *
 * NOTE:  "WIDE" flag does not indicate anything about "HT40" 40 MHz channels.
 *        It only indicates that 20 MHz channel use is supported; HT40 channel
 *        usage is indicated by a separate set of regulatory flags for each
 *        HT40 channel pair.
 *
 * NOTE:  Using a channel inappropriately will result in a uCode error!
 */
#define IL_NUM_TX_CALIB_GROUPS
enum {};

/* SKU Capabilities */
/* 3945 only */
#define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE
#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE

/* *regulatory* channel data format in eeprom, one for each channel.
 * There are separate entries for HT40 (40 MHz) vs. normal (20 MHz) channels. */
struct il_eeprom_channel {} __packed;

/* 3945 Specific */
#define EEPROM_3945_EEPROM_VERSION

/* 4965 has two radio transmitters (and 3 radio receivers) */
#define EEPROM_TX_POWER_TX_CHAINS

/* 4965 has room for up to 8 sets of txpower calibration data */
#define EEPROM_TX_POWER_BANDS

/* 4965 factory calibration measures txpower gain settings for
 * each of 3 target output levels */
#define EEPROM_TX_POWER_MEASUREMENTS

/* 4965 Specific */
/* 4965 driver does not work with txpower calibration version < 5 */
#define EEPROM_4965_TX_POWER_VERSION
#define EEPROM_4965_EEPROM_VERSION
#define EEPROM_4965_CALIB_VERSION_OFFSET
#define EEPROM_4965_CALIB_TXPOWER_OFFSET
#define EEPROM_4965_BOARD_REVISION
#define EEPROM_4965_BOARD_PBA

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

/*
 * factory calibration data for one txpower level, on one channel,
 * measured on one of the 2 tx chains (radio transmitter and associated
 * antenna).  EEPROM contains:
 *
 * 1)  Temperature (degrees Celsius) of device when measurement was made.
 *
 * 2)  Gain table idx used to achieve the target measurement power.
 *     This refers to the "well-known" gain tables (see 4965.h).
 *
 * 3)  Actual measured output power, in half-dBm ("34" = 17 dBm).
 *
 * 4)  RF power amplifier detector level measurement (not used).
 */
struct il_eeprom_calib_measure {} __packed;

/*
 * measurement set for one channel.  EEPROM contains:
 *
 * 1)  Channel number measured
 *
 * 2)  Measurements for each of 3 power levels for each of 2 radio transmitters
 *     (a.k.a. "tx chains") (6 measurements altogether)
 */
struct il_eeprom_calib_ch_info {} __packed;

/*
 * txpower subband info.
 *
 * For each frequency subband, EEPROM contains the following:
 *
 * 1)  First and last channels within range of the subband.  "0" values
 *     indicate that this sample set is not being used.
 *
 * 2)  Sample measurement sets for 2 channels close to the range endpoints.
 */
struct il_eeprom_calib_subband_info {} __packed;

/*
 * txpower calibration info.  EEPROM contains:
 *
 * 1)  Factory-measured saturation power levels (maximum levels at which
 *     tx power amplifier can output a signal without too much distortion).
 *     There is one level for 2.4 GHz band and one for 5 GHz band.  These
 *     values apply to all channels within each of the bands.
 *
 * 2)  Factory-measured power supply voltage level.  This is assumed to be
 *     constant (i.e. same value applies to all channels/bands) while the
 *     factory measurements are being made.
 *
 * 3)  Up to 8 sets of factory-measured txpower calibration values.
 *     These are for different frequency ranges, since txpower gain
 *     characteristics of the analog radio circuitry vary with frequency.
 *
 *     Not all sets need to be filled with data;
 *     struct il_eeprom_calib_subband_info contains range of channels
 *     (0 if unused) for each set of data.
 */
struct il_eeprom_calib_info {} __packed;

/* General */
#define EEPROM_DEVICE_ID
#define EEPROM_MAC_ADDRESS
#define EEPROM_BOARD_REVISION
#define EEPROM_BOARD_PBA_NUMBER
#define EEPROM_VERSION
#define EEPROM_SKU_CAP
#define EEPROM_OEM_MODE
#define EEPROM_WOWLAN_MODE
#define EEPROM_RADIO_CONFIG
#define EEPROM_NUM_MAC_ADDRESS

/* The following masks are to be applied on EEPROM_RADIO_CONFIG */
#define EEPROM_RF_CFG_TYPE_MSK(x)
#define EEPROM_RF_CFG_STEP_MSK(x)
#define EEPROM_RF_CFG_DASH_MSK(x)
#define EEPROM_RF_CFG_PNUM_MSK(x)
#define EEPROM_RF_CFG_TX_ANT_MSK(x)
#define EEPROM_RF_CFG_RX_ANT_MSK(x)

#define EEPROM_3945_RF_CFG_TYPE_MAX
#define EEPROM_4965_RF_CFG_TYPE_MAX

/*
 * Per-channel regulatory data.
 *
 * Each channel that *might* be supported by iwl has a fixed location
 * in EEPROM containing EEPROM_CHANNEL_* usage flags (LSB) and max regulatory
 * txpower (MSB).
 *
 * Entries immediately below are for 20 MHz channel width.  HT40 (40 MHz)
 * channels (only for 4965, not supported by 3945) appear later in the EEPROM.
 *
 * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
 */
#define EEPROM_REGULATORY_SKU_ID
#define EEPROM_REGULATORY_BAND_1
#define EEPROM_REGULATORY_BAND_1_CHANNELS

/*
 * 4.9 GHz channels 183, 184, 185, 187, 188, 189, 192, 196,
 * 5.0 GHz channels 7, 8, 11, 12, 16
 * (4915-5080MHz) (none of these is ever supported)
 */
#define EEPROM_REGULATORY_BAND_2
#define EEPROM_REGULATORY_BAND_2_CHANNELS

/*
 * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64
 * (5170-5320MHz)
 */
#define EEPROM_REGULATORY_BAND_3
#define EEPROM_REGULATORY_BAND_3_CHANNELS

/*
 * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
 * (5500-5700MHz)
 */
#define EEPROM_REGULATORY_BAND_4
#define EEPROM_REGULATORY_BAND_4_CHANNELS

/*
 * 5.7 GHz channels 145, 149, 153, 157, 161, 165
 * (5725-5825MHz)
 */
#define EEPROM_REGULATORY_BAND_5
#define EEPROM_REGULATORY_BAND_5_CHANNELS

/*
 * 2.4 GHz HT40 channels 1 (5), 2 (6), 3 (7), 4 (8), 5 (9), 6 (10), 7 (11)
 *
 * The channel listed is the center of the lower 20 MHz half of the channel.
 * The overall center frequency is actually 2 channels (10 MHz) above that,
 * and the upper half of each HT40 channel is centered 4 channels (20 MHz) away
 * from the lower half; e.g. the upper half of HT40 channel 1 is channel 5,
 * and the overall HT40 channel width centers on channel 3.
 *
 * NOTE:  The RXON command uses 20 MHz channel numbers to specify the
 *        control channel to which to tune.  RXON also specifies whether the
 *        control channel is the upper or lower half of a HT40 channel.
 *
 * NOTE:  4965 does not support HT40 channels on 2.4 GHz.
 */
#define EEPROM_4965_REGULATORY_BAND_24_HT40_CHANNELS

/*
 * 5.2 GHz HT40 channels 36 (40), 44 (48), 52 (56), 60 (64),
 * 100 (104), 108 (112), 116 (120), 124 (128), 132 (136), 149 (153), 157 (161)
 */
#define EEPROM_4965_REGULATORY_BAND_52_HT40_CHANNELS

#define EEPROM_REGULATORY_BAND_NO_HT40

int il_eeprom_init(struct il_priv *il);
void il_eeprom_free(struct il_priv *il);
const u8 *il_eeprom_query_addr(const struct il_priv *il, size_t offset);
u16 il_eeprom_query16(const struct il_priv *il, size_t offset);
int il_init_channel_map(struct il_priv *il);
void il_free_channel_map(struct il_priv *il);
const struct il_channel_info *il_get_channel_info(const struct il_priv *il,
						  enum nl80211_band band,
						  u16 channel);

#define IL_NUM_SCAN_RATES

struct il4965_channel_tgd_info {};

struct il4965_channel_tgh_info {};

#define IL4965_MAX_RATE

struct il3945_clip_group {};

/* current Tx power values to use, one for each rate for each channel.
 * requested power is limited by:
 * -- regulatory EEPROM limits for this channel
 * -- hardware capabilities (clip-powers)
 * -- spectrum management
 * -- user preference (e.g. iwconfig)
 * when requested power is set, base power idx must also be set. */
struct il3945_channel_power_info {};

/* current scan Tx power values to use, one for each scan rate for each
 * channel. */
struct il3945_scan_power_info {};

/*
 * One for each channel, holds all channel setup data
 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
 *     with one another!
 */
struct il_channel_info {};

#define IL_TX_FIFO_BK
#define IL_TX_FIFO_BE
#define IL_TX_FIFO_VI
#define IL_TX_FIFO_VO
#define IL_TX_FIFO_UNUSED

/* Minimum number of queues. MAX_NUM is defined in hw specific files.
 * Set the minimum to accommodate the 4 standard TX queues, 1 command
 * queue, 2 (unused) HCCA queues, and 4 HT queues (one for each AC) */
#define IL_MIN_NUM_QUEUES

#define IL_DEFAULT_CMD_QUEUE_NUM

#define IEEE80211_DATA_LEN
#define IEEE80211_4ADDR_LEN
#define IEEE80211_HLEN
#define IEEE80211_FRAME_LEN

struct il_frame {};

enum {};

#define DEF_CMD_PAYLOAD_SIZE

/**
 * struct il_device_cmd
 *
 * For allocation of the command and tx queues, this establishes the overall
 * size of the largest command we send to uCode, except for a scan command
 * (which is relatively huge; space is allocated separately).
 */
struct il_device_cmd {} __packed;

#define TFD_MAX_PAYLOAD_SIZE

struct il_host_cmd {};

#define SUP_RATE_11A_MAX_NUM_CHANNELS
#define SUP_RATE_11B_MAX_NUM_CHANNELS
#define SUP_RATE_11G_MAX_NUM_CHANNELS

/**
 * struct il_rx_queue - Rx queue
 * @bd: driver's pointer to buffer of receive buffer descriptors (rbd)
 * @bd_dma: bus address of buffer of receive buffer descriptors (rbd)
 * @read: Shared idx to newest available Rx buffer
 * @write: Shared idx to oldest written Rx packet
 * @free_count: Number of pre-allocated buffers in rx_free
 * @rx_free: list of free SKBs for use
 * @rx_used: List of Rx buffers with no SKB
 * @need_update: flag to indicate we need to update read/write idx
 * @rb_stts: driver's pointer to receive buffer status
 * @rb_stts_dma: bus address of receive buffer status
 *
 * NOTE:  rx_free and rx_used are used as a FIFO for il_rx_bufs
 */
struct il_rx_queue {};

#define IL_SUPPORTED_RATES_IE_LEN

#define MAX_TID_COUNT

#define IL_INVALID_RATE
#define IL_INVALID_VALUE

/**
 * struct il_ht_agg -- aggregation status while waiting for block-ack
 * @txq_id: Tx queue used for Tx attempt
 * @frame_count: # frames attempted by Tx command
 * @wait_for_ba: Expect block-ack before next Tx reply
 * @start_idx: Index of 1st Transmit Frame Descriptor (TFD) in Tx win
 * @bitmap0: Low order bitmap, one bit for each frame pending ACK in Tx win
 * @bitmap1: High order, one bit for each frame pending ACK in Tx win
 * @rate_n_flags: Rate at which Tx was attempted
 *
 * If C_TX indicates that aggregation was attempted, driver must wait
 * for block ack (N_COMPRESSED_BA).  This struct stores tx reply info
 * until block ack arrives.
 */
struct il_ht_agg {};

struct il_tid_data {};

struct il_hw_key {};

il_ht_rate_supp;

#define CFG_HT_RX_AMPDU_FACTOR_8K
#define CFG_HT_RX_AMPDU_FACTOR_16K
#define CFG_HT_RX_AMPDU_FACTOR_32K
#define CFG_HT_RX_AMPDU_FACTOR_64K
#define CFG_HT_RX_AMPDU_FACTOR_DEF
#define CFG_HT_RX_AMPDU_FACTOR_MAX
#define CFG_HT_RX_AMPDU_FACTOR_MIN

/*
 * Maximal MPDU density for TX aggregation
 * 4 - 2us density
 * 5 - 4us density
 * 6 - 8us density
 * 7 - 16us density
 */
#define CFG_HT_MPDU_DENSITY_2USEC
#define CFG_HT_MPDU_DENSITY_4USEC
#define CFG_HT_MPDU_DENSITY_8USEC
#define CFG_HT_MPDU_DENSITY_16USEC
#define CFG_HT_MPDU_DENSITY_DEF
#define CFG_HT_MPDU_DENSITY_MAX
#define CFG_HT_MPDU_DENSITY_MIN

struct il_ht_config {};

/* QoS structures */
struct il_qos_info {};

/*
 * Structure should be accessed with sta_lock held. When station addition
 * is in progress (IL_STA_UCODE_INPROGRESS) it is possible to access only
 * the commands (il_addsta_cmd and il_link_quality_cmd) without
 * sta_lock held.
 */
struct il_station_entry {};

struct il_station_priv_common {};

/**
 * struct il_vif_priv - driver's ilate per-interface information
 *
 * When mac80211 allocates a virtual interface, it can allocate
 * space for us to put data into.
 */
struct il_vif_priv {};

/* one for each uCode image (inst/data, boot/init/runtime) */
struct fw_desc {};

/* uCode file layout */
struct il_ucode_header {};

struct il4965_ibss_seq {};

struct il_sensitivity_ranges {};

/**
 * struct il_hw_params
 * @bcast_id: f/w broadcast station ID
 * @max_txq_num: Max # Tx queues supported
 * @dma_chnl_num: Number of Tx DMA/FIFO channels
 * @scd_bc_tbls_size: size of scheduler byte count tables
 * @tfd_size: TFD size
 * @tx/rx_chains_num: Number of TX/RX chains
 * @valid_tx/rx_ant: usable antennas
 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2)
 * @max_rxq_log: Log-base-2 of max_rxq_size
 * @rx_page_order: Rx buffer page order
 * @rx_wrt_ptr_reg: FH{39}_RSCSR_CHNL0_WPTR
 * @max_stations:
 * @ht40_channel: is 40MHz width possible in band 2.4
 * BIT(NL80211_BAND_5GHZ) BIT(NL80211_BAND_5GHZ)
 * @sw_crypto: 0 for hw, 1 for sw
 * @max_xxx_size: for ucode uses
 * @ct_kill_threshold: temperature threshold
 * @beacon_time_tsf_bits: number of valid tsf bits for beacon time
 * @struct il_sensitivity_ranges: range of sensitivity values
 */
struct il_hw_params {};

/******************************************************************************
 *
 * Functions implemented in core module which are forward declared here
 * for use by iwl-[4-5].c
 *
 * NOTE:  The implementation of these functions are not hardware specific
 * which is why they are in the core module files.
 *
 * Naming convention --
 * il_         <-- Is part of iwlwifi
 * iwlXXXX_     <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
 * il4965_bg_      <-- Called from work queue context
 * il4965_mac_     <-- mac80211 callback
 *
 ****************************************************************************/
void il4965_update_chain_flags(struct il_priv *il);
extern const u8 il_bcast_addr[ETH_ALEN];
int il_queue_space(const struct il_queue *q);
static inline int
il_queue_used(const struct il_queue *q, int i)
{}

static inline u8
il_get_cmd_idx(struct il_queue *q, u32 idx, int is_huge)
{}

struct il_dma_ptr {};

#define IL_OPERATION_MODE_AUTO
#define IL_OPERATION_MODE_HT_ONLY
#define IL_OPERATION_MODE_MIXED
#define IL_OPERATION_MODE_20MHZ

#define IL_TX_CRC_SIZE
#define IL_TX_DELIMITER_SIZE

#define TX_POWER_IL_ILLEGAL_VOLTAGE

/* Sensitivity and chain noise calibration */
#define INITIALIZATION_VALUE
#define IL4965_CAL_NUM_BEACONS
#define IL_CAL_NUM_BEACONS
#define MAXIMUM_ALLOWED_PATHLOSS

#define CHAIN_NOISE_MAX_DELTA_GAIN_CODE

#define MAX_FA_OFDM
#define MIN_FA_OFDM
#define MAX_FA_CCK
#define MIN_FA_CCK

#define AUTO_CORR_STEP_OFDM

#define AUTO_CORR_STEP_CCK
#define AUTO_CORR_MAX_TH_CCK

#define NRG_DIFF
#define NRG_STEP_CCK
#define NRG_MARGIN
#define MAX_NUMBER_CCK_NO_FA

#define AUTO_CORR_CCK_MIN_VAL_DEF

#define CHAIN_A
#define CHAIN_B
#define CHAIN_C
#define CHAIN_NOISE_DELTA_GAIN_INIT_VAL
#define ALL_BAND_FILTER
#define IN_BAND_FILTER
#define MIN_AVERAGE_NOISE_MAX_VALUE

#define NRG_NUM_PREV_STAT_L
#define NUM_RX_CHAINS

enum il4965_false_alarm_state {};

enum il4965_chain_noise_state {};

enum ucode_type {};

/* Sensitivity calib data */
struct il_sensitivity_data {};

/* Chain noise (differential Rx gain) calib data */
struct il_chain_noise_data {};

#define EEPROM_SEM_TIMEOUT
#define EEPROM_SEM_RETRY_LIMIT

#define IL_TRAFFIC_ENTRIES
#define IL_TRAFFIC_ENTRY_SIZE

enum {};

/* interrupt stats */
struct isr_stats {};

/* management stats */
enum il_mgmt_stats {};
/* control stats */
enum il_ctrl_stats {};

struct traffic_stats {};

/*
 * host interrupt timeout value
 * used with setting interrupt coalescing timer
 * the CSR_INT_COALESCING is an 8 bit register in 32-usec unit
 *
 * default interrupt coalescing timer is 64 x 32 = 2048 usecs
 * default interrupt coalescing calibration timer is 16 x 32 = 512 usecs
 */
#define IL_HOST_INT_TIMEOUT_MAX
#define IL_HOST_INT_TIMEOUT_DEF
#define IL_HOST_INT_TIMEOUT_MIN
#define IL_HOST_INT_CALIB_TIMEOUT_MAX
#define IL_HOST_INT_CALIB_TIMEOUT_DEF
#define IL_HOST_INT_CALIB_TIMEOUT_MIN

#define IL_DELAY_NEXT_FORCE_FW_RELOAD

/* TX queue watchdog timeouts in mSecs */
#define IL_DEF_WD_TIMEOUT
#define IL_LONG_WD_TIMEOUT
#define IL_MAX_WD_TIMEOUT

struct il_force_reset {};

/* extend beacon time format bit shifting  */
/*
 * for _3945 devices
 * bits 31:24 - extended
 * bits 23:0  - interval
 */
#define IL3945_EXT_BEACON_TIME_POS
/*
 * for _4965 devices
 * bits 31:22 - extended
 * bits 21:0  - interval
 */
#define IL4965_EXT_BEACON_TIME_POS

struct il_rxon_context {};

struct il_power_mgr {};

struct il_priv {};				/*il_priv */

static inline void
il_txq_ctx_activate(struct il_priv *il, int txq_id)
{}

static inline void
il_txq_ctx_deactivate(struct il_priv *il, int txq_id)
{}

static inline int
il_is_associated(struct il_priv *il)
{}

static inline int
il_is_any_associated(struct il_priv *il)
{}

static inline int
il_is_channel_valid(const struct il_channel_info *ch_info)
{}

static inline int
il_is_channel_radar(const struct il_channel_info *ch_info)
{}

static inline u8
il_is_channel_a_band(const struct il_channel_info *ch_info)
{}

static inline int
il_is_channel_passive(const struct il_channel_info *ch)
{}

static inline int
il_is_channel_ibss(const struct il_channel_info *ch)
{}

static inline void
__il_free_pages(struct il_priv *il, struct page *page)
{}

static inline void
il_free_pages(struct il_priv *il, unsigned long page)
{}

#define IWLWIFI_VERSION
#define DRV_COPYRIGHT
#define DRV_AUTHOR

#define IL_PCI_DEVICE(dev, subdev, cfg)

#define TIME_UNIT

#define IL_SKU_G
#define IL_SKU_A
#define IL_SKU_N

#define IL_CMD(x)

/* Size of one Rx buffer in host DRAM */
#define IL_RX_BUF_SIZE_3K
#define IL_RX_BUF_SIZE_4K
#define IL_RX_BUF_SIZE_8K

#ifdef CONFIG_IWLEGACY_DEBUGFS
struct il_debugfs_ops {};
#endif

struct il_ops {};

struct il_mod_params {};

#define IL_LED_SOLID
#define IL_DEF_LED_INTRVL

#define IL_LED_ACTIVITY
#define IL_LED_LINK

/*
 * LED mode
 *    IL_LED_DEFAULT:  use device default
 *    IL_LED_RF_STATE: turn LED on/off based on RF state
 *			LED ON  = RF ON
 *			LED OFF = RF OFF
 *    IL_LED_BLINK:    adjust led blink rate based on blink table
 */
enum il_led_mode {};

void il_leds_init(struct il_priv *il);
void il_leds_exit(struct il_priv *il);

/**
 * struct il_cfg
 * @fw_name_pre: Firmware filename prefix. The api version and extension
 *	(.ucode) will be added to filename before loading from disk. The
 *	filename is constructed as fw_name_pre<api>.ucode.
 * @ucode_api_max: Highest version of uCode API supported by driver.
 * @ucode_api_min: Lowest version of uCode API supported by driver.
 * @scan_antennas: available antenna for scan operation
 * @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off)
 *
 * We enable the driver to be backward compatible wrt API version. The
 * driver specifies which APIs it supports (with @ucode_api_max being the
 * highest and @ucode_api_min the lowest). Firmware will only be loaded if
 * it has a supported API version. The firmware's API version will be
 * stored in @il_priv, enabling the driver to make runtime changes based
 * on firmware version used.
 *
 * For example,
 * if (IL_UCODE_API(il->ucode_ver) >= 2) {
 *	Driver interacts with Firmware API version >= 2.
 * } else {
 *	Driver interacts with Firmware API version 1.
 * }
 *
 * The ideal usage of this infrastructure is to treat a new ucode API
 * release as a new hardware revision. That is, through utilizing the
 * il_hcmd_utils_ops etc. we accommodate different command structures
 * and flows between hardware versions as well as their API
 * versions.
 *
 */
struct il_cfg {};

/***************************
 *   L i b                 *
 ***************************/

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);
int il_mac_tx_last_beacon(struct ieee80211_hw *hw);

void il_set_rxon_hwcrypto(struct il_priv *il, int hw_decrypt);
int il_check_rxon_cmd(struct il_priv *il);
int il_full_rxon_required(struct il_priv *il);
int il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch);
void il_set_flags_for_band(struct il_priv *il, enum nl80211_band band,
			   struct ieee80211_vif *vif);
u8 il_get_single_channel_number(struct il_priv *il, enum nl80211_band band);
void il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf);
bool il_is_ht40_tx_allowed(struct il_priv *il,
			   struct ieee80211_sta_ht_cap *ht_cap);
void il_connection_init_rx_config(struct il_priv *il);
void il_set_rate(struct il_priv *il);
int il_set_decrypted_flag(struct il_priv *il, struct ieee80211_hdr *hdr,
			  u32 decrypt_res, struct ieee80211_rx_status *stats);
void il_irq_handle_error(struct il_priv *il);
int il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
void il_mac_remove_interface(struct ieee80211_hw *hw,
			     struct ieee80211_vif *vif);
int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			    enum nl80211_iftype newtype, bool newp2p);
void il_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		  u32 queues, bool drop);
int il_alloc_txq_mem(struct il_priv *il);
void il_free_txq_mem(struct il_priv *il);

#ifdef CONFIG_IWLEGACY_DEBUGFS
void il_update_stats(struct il_priv *il, bool is_tx, __le16 fc, u16 len);
#else
static inline void
il_update_stats(struct il_priv *il, bool is_tx, __le16 fc, u16 len)
{
}
#endif

/*****************************************************
 * Handlers
 ***************************************************/
void il_hdl_pm_sleep(struct il_priv *il, struct il_rx_buf *rxb);
void il_hdl_pm_debug_stats(struct il_priv *il, struct il_rx_buf *rxb);
void il_hdl_error(struct il_priv *il, struct il_rx_buf *rxb);
void il_hdl_csa(struct il_priv *il, struct il_rx_buf *rxb);

/*****************************************************
* RX
******************************************************/
void il_cmd_queue_unmap(struct il_priv *il);
void il_cmd_queue_free(struct il_priv *il);
int il_rx_queue_alloc(struct il_priv *il);
void il_rx_queue_update_write_ptr(struct il_priv *il, struct il_rx_queue *q);
int il_rx_queue_space(const struct il_rx_queue *q);
void il_tx_cmd_complete(struct il_priv *il, struct il_rx_buf *rxb);

void il_hdl_spectrum_measurement(struct il_priv *il, struct il_rx_buf *rxb);
void il_recover_from_stats(struct il_priv *il, struct il_rx_pkt *pkt);
void il_chswitch_done(struct il_priv *il, bool is_success);

/*****************************************************
* TX
******************************************************/
void il_txq_update_write_ptr(struct il_priv *il, struct il_tx_queue *txq);
int il_tx_queue_init(struct il_priv *il, u32 txq_id);
void il_tx_queue_reset(struct il_priv *il, u32 txq_id);
void il_tx_queue_unmap(struct il_priv *il, int txq_id);
void il_tx_queue_free(struct il_priv *il, int txq_id);
void il_setup_watchdog(struct il_priv *il);
/*****************************************************
 * TX power
 ****************************************************/
int il_set_tx_power(struct il_priv *il, s8 tx_power, bool force);

/*******************************************************************************
 * Rate
 ******************************************************************************/

u8 il_get_lowest_plcp(struct il_priv *il);

/*******************************************************************************
 * Scanning
 ******************************************************************************/
void il_init_scan_params(struct il_priv *il);
int il_scan_cancel(struct il_priv *il);
int il_scan_cancel_timeout(struct il_priv *il, unsigned long ms);
void il_force_scan_end(struct il_priv *il);
int il_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		   struct ieee80211_scan_request *hw_req);
void il_internal_short_hw_scan(struct il_priv *il);
int il_force_reset(struct il_priv *il, bool external);
u16 il_fill_probe_req(struct il_priv *il, struct ieee80211_mgmt *frame,
		      const u8 *ta, const u8 *ie, int ie_len, int left);
void il_setup_rx_scan_handlers(struct il_priv *il);
u16 il_get_active_dwell_time(struct il_priv *il, enum nl80211_band band,
			     u8 n_probes);
u16 il_get_passive_dwell_time(struct il_priv *il, enum nl80211_band band,
			      struct ieee80211_vif *vif);
void il_setup_scan_deferred_work(struct il_priv *il);
void il_cancel_scan_deferred_work(struct il_priv *il);

/* For faster active scanning, scan will move to the next channel if fewer than
 * PLCP_QUIET_THRESH packets are heard on this channel within
 * ACTIVE_QUIET_TIME after sending probe request.  This shortens the dwell
 * time if it's a quiet channel (nothing responded to our probe, and there's
 * no other traffic).
 * Disable "quiet" feature by setting PLCP_QUIET_THRESH to 0. */
#define IL_ACTIVE_QUIET_TIME
#define IL_PLCP_QUIET_THRESH

#define IL_SCAN_CHECK_WATCHDOG

/*****************************************************
 *   S e n d i n g     H o s t     C o m m a n d s   *
 *****************************************************/

const char *il_get_cmd_string(u8 cmd);
int __must_check il_send_cmd_sync(struct il_priv *il, struct il_host_cmd *cmd);
int il_send_cmd(struct il_priv *il, struct il_host_cmd *cmd);
int __must_check il_send_cmd_pdu(struct il_priv *il, u8 id, u16 len,
				 const void *data);
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));

int il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd);

/*****************************************************
 * PCI						     *
 *****************************************************/

void il_bg_watchdog(struct timer_list *t);
u32 il_usecs_to_beacons(struct il_priv *il, u32 usec, u32 beacon_interval);
__le32 il_add_beacon_time(struct il_priv *il, u32 base, u32 addon,
			  u32 beacon_interval);

#ifdef CONFIG_PM_SLEEP
extern const struct dev_pm_ops il_pm_ops;

#define IL_LEGACY_PM_OPS

#else /* !CONFIG_PM_SLEEP */

#define IL_LEGACY_PM_OPS

#endif /* !CONFIG_PM_SLEEP */

/*****************************************************
*  Error Handling Debugging
******************************************************/
void il4965_dump_nic_error_log(struct il_priv *il);
#ifdef CONFIG_IWLEGACY_DEBUG
void il_print_rx_config_cmd(struct il_priv *il);
#else
static inline void
il_print_rx_config_cmd(struct il_priv *il)
{
}
#endif

void il_clear_isr_stats(struct il_priv *il);

/*****************************************************
*  GEOS
******************************************************/
int il_init_geos(struct il_priv *il);
void il_free_geos(struct il_priv *il);

/*************** DRIVER STATUS FUNCTIONS   *****/

#define S_HCMD_ACTIVE
/* 1 is unused (used to be S_HCMD_SYNC_ACTIVE) */
#define S_INT_ENABLED
#define S_RFKILL
#define S_CT_KILL
#define S_INIT
#define S_ALIVE
#define S_READY
#define S_TEMPERATURE
#define S_GEO_CONFIGURED
#define S_EXIT_PENDING
#define S_STATS
#define S_SCANNING
#define S_SCAN_ABORTING
#define S_SCAN_HW
#define S_POWER_PMI
#define S_FW_ERROR
#define S_CHANNEL_SWITCH_PENDING

static inline int
il_is_ready(struct il_priv *il)
{}

static inline int
il_is_alive(struct il_priv *il)
{}

static inline int
il_is_init(struct il_priv *il)
{}

static inline int
il_is_rfkill(struct il_priv *il)
{}

static inline int
il_is_ctkill(struct il_priv *il)
{}

static inline int
il_is_ready_rf(struct il_priv *il)
{}

void il_send_bt_config(struct il_priv *il);
int il_send_stats_request(struct il_priv *il, u8 flags, bool clear);
void il_apm_stop(struct il_priv *il);
void _il_apm_stop(struct il_priv *il);

int il_apm_init(struct il_priv *il);

int il_send_rxon_timing(struct il_priv *il);

static inline int
il_send_rxon_assoc(struct il_priv *il)
{}

static inline int
il_commit_rxon(struct il_priv *il)
{}

static inline const struct ieee80211_supported_band *
il_get_hw_mode(struct il_priv *il, enum nl80211_band band)
{}

/* mac80211 handlers */
int il_mac_config(struct ieee80211_hw *hw, u32 changed);
void il_mac_reset_tsf(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);
void il_tx_cmd_protection(struct il_priv *il, struct ieee80211_tx_info *info,
			  __le16 fc, __le32 *tx_flags);

irqreturn_t il_isr(int irq, void *data);

void il_set_bit(struct il_priv *p, u32 r, u32 m);
void il_clear_bit(struct il_priv *p, u32 r, u32 m);
bool _il_grab_nic_access(struct il_priv *il);
int _il_poll_bit(struct il_priv *il, u32 addr, u32 bits, u32 mask, int timeout);
int il_poll_bit(struct il_priv *il, u32 addr, u32 mask, int timeout);
u32 il_rd_prph(struct il_priv *il, u32 reg);
void il_wr_prph(struct il_priv *il, u32 addr, u32 val);
u32 il_read_targ_mem(struct il_priv *il, u32 addr);
void il_write_targ_mem(struct il_priv *il, u32 addr, u32 val);

static inline bool il_need_reclaim(struct il_priv *il, struct il_rx_pkt *pkt)
{}

static inline void
_il_write8(struct il_priv *il, u32 ofs, u8 val)
{}
#define il_write8(il, ofs, val)

static inline void
_il_wr(struct il_priv *il, u32 ofs, u32 val)
{}

static inline u32
_il_rd(struct il_priv *il, u32 ofs)
{}

static inline void
_il_clear_bit(struct il_priv *il, u32 reg, u32 mask)
{}

static inline void
_il_set_bit(struct il_priv *il, u32 reg, u32 mask)
{}

static inline void
_il_release_nic_access(struct il_priv *il)
{}

static inline u32
il_rd(struct il_priv *il, u32 reg)
{}

static inline void
il_wr(struct il_priv *il, u32 reg, u32 value)
{}

static inline u32
_il_rd_prph(struct il_priv *il, u32 reg)
{}

static inline void
_il_wr_prph(struct il_priv *il, u32 addr, u32 val)
{}

static inline void
il_set_bits_prph(struct il_priv *il, u32 reg, u32 mask)
{}

static inline void
il_set_bits_mask_prph(struct il_priv *il, u32 reg, u32 bits, u32 mask)
{}

static inline void
il_clear_bits_prph(struct il_priv *il, u32 reg, u32 mask)
{}

#define HW_KEY_DYNAMIC
#define HW_KEY_DEFAULT

#define IL_STA_DRIVER_ACTIVE
#define IL_STA_UCODE_ACTIVE
#define IL_STA_UCODE_INPROGRESS
#define IL_STA_LOCAL
#define IL_STA_BCAST

void il_restore_stations(struct il_priv *il);
void il_clear_ucode_stations(struct il_priv *il);
void il_dealloc_bcast_stations(struct il_priv *il);
int il_get_free_ucode_key_idx(struct il_priv *il);
int il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags);
int il_add_station_common(struct il_priv *il, const u8 *addr, bool is_ap,
			  struct ieee80211_sta *sta, u8 *sta_id_r);
int il_remove_station(struct il_priv *il, const u8 sta_id, const u8 * addr);
int il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		      struct ieee80211_sta *sta);

u8 il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap,
		   struct ieee80211_sta *sta);

int il_send_lq_cmd(struct il_priv *il, struct il_link_quality_cmd *lq,
		   u8 flags, bool init);

/**
 * il_clear_driver_stations - clear knowledge of all stations from driver
 * @il: iwl il struct
 *
 * This is called during il_down() to make sure that in the case
 * we're coming there from a hardware restart mac80211 will be
 * able to reconfigure stations -- if we're getting there in the
 * normal down flow then the stations will already be cleared.
 */
static inline void
il_clear_driver_stations(struct il_priv *il)
{}

static inline int
il_sta_id(struct ieee80211_sta *sta)
{}

/**
 * il_sta_id_or_broadcast - return sta_id or broadcast sta
 * @il: iwl il
 * @context: the current context
 * @sta: mac80211 station
 *
 * In certain circumstances mac80211 passes a station pointer
 * that may be %NULL, for example during TX or key setup. In
 * that case, we need to use the broadcast station, so this
 * inline wraps that pattern.
 */
static inline int
il_sta_id_or_broadcast(struct il_priv *il, struct ieee80211_sta *sta)
{}

/**
 * il_queue_inc_wrap - increment queue idx, wrap back to beginning
 * @idx -- current idx
 * @n_bd -- total number of entries in queue (must be power of 2)
 */
static inline int
il_queue_inc_wrap(int idx, int n_bd)
{}

/**
 * il_queue_dec_wrap - decrement queue idx, wrap back to end
 * @idx -- current idx
 * @n_bd -- total number of entries in queue (must be power of 2)
 */
static inline int
il_queue_dec_wrap(int idx, int n_bd)
{}

/* TODO: Move fw_desc functions to iwl-pci.ko */
static inline void
il_free_fw_desc(struct pci_dev *pci_dev, struct fw_desc *desc)
{}

static inline int
il_alloc_fw_desc(struct pci_dev *pci_dev, struct fw_desc *desc)
{}

/*
 * we have 8 bits used like this:
 *
 * 7 6 5 4 3 2 1 0
 * | | | | | | | |
 * | | | | | | +-+-------- AC queue (0-3)
 * | | | | | |
 * | +-+-+-+-+------------ HW queue ID
 * |
 * +---------------------- unused
 */
static inline void
il_set_swq_id(struct il_tx_queue *txq, u8 ac, u8 hwq)
{}

static inline void
_il_wake_queue(struct il_priv *il, u8 ac)
{}

static inline void
_il_stop_queue(struct il_priv *il, u8 ac)
{}
static inline void
il_wake_queue(struct il_priv *il, struct il_tx_queue *txq)
{}

static inline void
il_stop_queue(struct il_priv *il, struct il_tx_queue *txq)
{}

static inline void
il_wake_queues_by_reason(struct il_priv *il, int reason)
{}

static inline void
il_stop_queues_by_reason(struct il_priv *il, int reason)
{}

#ifdef ieee80211_stop_queue
#undef ieee80211_stop_queue
#endif

#define ieee80211_stop_queue

#ifdef ieee80211_wake_queue
#undef ieee80211_wake_queue
#endif

#define ieee80211_wake_queue

static inline void
il_disable_interrupts(struct il_priv *il)
{}

static inline void
il_enable_rfkill_int(struct il_priv *il)
{}

static inline void
il_enable_interrupts(struct il_priv *il)
{}

/**
 * il_beacon_time_mask_low - mask of lower 32 bit of beacon time
 * @il -- pointer to il_priv data structure
 * @tsf_bits -- number of bits need to shift for masking)
 */
static inline u32
il_beacon_time_mask_low(struct il_priv *il, u16 tsf_bits)
{}

/**
 * il_beacon_time_mask_high - mask of higher 32 bit of beacon time
 * @il -- pointer to il_priv data structure
 * @tsf_bits -- number of bits need to shift for masking)
 */
static inline u32
il_beacon_time_mask_high(struct il_priv *il, u16 tsf_bits)
{}

/**
 * struct il_rb_status - reseve buffer status host memory mapped FH registers
 *
 * @closed_rb_num [0:11] - Indicates the idx of the RB which was closed
 * @closed_fr_num [0:11] - Indicates the idx of the RX Frame which was closed
 * @finished_rb_num [0:11] - Indicates the idx of the current RB
 *			     in which the last frame was written to
 * @finished_fr_num [0:11] - Indicates the idx of the RX Frame
 *			     which was transferred
 */
struct il_rb_status {} __packed;

#define TFD_QUEUE_SIZE_MAX
#define TFD_QUEUE_SIZE_BC_DUP
#define TFD_QUEUE_BC_SIZE
#define IL_TX_DMA_MASK
#define IL_NUM_OF_TBS

static inline u8
il_get_dma_hi_addr(dma_addr_t addr)
{}

/**
 * struct il_tfd_tb transmit buffer descriptor within transmit frame descriptor
 *
 * This structure contains dma address and length of transmission address
 *
 * @lo: low [31:0] portion of the dma address of TX buffer every even is
 *	unaligned on 16 bit boundary
 * @hi_n_len: 0-3 [35:32] portion of dma
 *	      4-15 length of the tx buffer
 */
struct il_tfd_tb {} __packed;

/**
 * struct il_tfd
 *
 * Transmit Frame Descriptor (TFD)
 *
 * @ __reserved1[3] reserved
 * @ num_tbs 0-4 number of active tbs
 *	     5   reserved
 * 	     6-7 padding (not used)
 * @ tbs[20]	transmit frame buffer descriptors
 * @ __pad	padding
 *
 * Each Tx queue uses a circular buffer of 256 TFDs stored in host DRAM.
 * Both driver and device share these circular buffers, each of which must be
 * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes
 *
 * Driver must indicate the physical address of the base of each
 * circular buffer via the FH49_MEM_CBBC_QUEUE registers.
 *
 * Each TFD contains pointer/size information for up to 20 data buffers
 * in host DRAM.  These buffers collectively contain the (one) frame described
 * by the TFD.  Each buffer must be a single contiguous block of memory within
 * itself, but buffers may be scattered in host DRAM.  Each buffer has max size
 * of (4K - 4).  The concatenates all of a TFD's buffers into a single
 * Tx frame, up to 8 KBytes in size.
 *
 * A maximum of 255 (not 256!) TFDs may be on a queue waiting for Tx.
 */
struct il_tfd {} __packed;
/* PCI registers */
#define PCI_CFG_RETRY_TIMEOUT

struct il_rate_info {};

struct il3945_rate_info {};

/*
 * These serve as idxes into
 * struct il_rate_info il_rates[RATE_COUNT];
 */
enum {};

enum {};

enum {};

/* #define vs. enum to keep from defaulting to 'large integer' */
#define RATE_6M_MASK
#define RATE_9M_MASK
#define RATE_12M_MASK
#define RATE_18M_MASK
#define RATE_24M_MASK
#define RATE_36M_MASK
#define RATE_48M_MASK
#define RATE_54M_MASK
#define RATE_60M_MASK
#define RATE_1M_MASK
#define RATE_2M_MASK
#define RATE_5M_MASK
#define RATE_11M_MASK

/* uCode API values for legacy bit rates, both OFDM and CCK */
enum {};

/* uCode API values for OFDM high-throughput (HT) bit rates */
enum {};

/* MAC header values for bit rates */
enum {};

#define IL_CCK_BASIC_RATES_MASK

#define IL_CCK_RATES_MASK

#define IL_OFDM_BASIC_RATES_MASK

#define IL_OFDM_RATES_MASK

#define IL_BASIC_RATES_MASK

#define RATES_MASK
#define RATES_MASK_3945

#define IL_INVALID_VALUE

#define IL_MIN_RSSI_VAL
#define IL_MAX_RSSI_VAL

/* These values specify how many Tx frame attempts before
 * searching for a new modulation mode */
#define IL_LEGACY_FAILURE_LIMIT
#define IL_LEGACY_SUCCESS_LIMIT
#define IL_LEGACY_TBL_COUNT

#define IL_NONE_LEGACY_FAILURE_LIMIT
#define IL_NONE_LEGACY_SUCCESS_LIMIT
#define IL_NONE_LEGACY_TBL_COUNT

/* Success ratio (ACKed / attempted tx frames) values (perfect is 128 * 100) */
#define IL_RS_GOOD_RATIO
#define RATE_SCALE_SWITCH
#define RATE_HIGH_TH
#define RATE_INCREASE_TH
#define RATE_DECREASE_TH

/* possible actions when in legacy mode */
#define IL_LEGACY_SWITCH_ANTENNA1
#define IL_LEGACY_SWITCH_ANTENNA2
#define IL_LEGACY_SWITCH_SISO
#define IL_LEGACY_SWITCH_MIMO2_AB
#define IL_LEGACY_SWITCH_MIMO2_AC
#define IL_LEGACY_SWITCH_MIMO2_BC

/* possible actions when in siso mode */
#define IL_SISO_SWITCH_ANTENNA1
#define IL_SISO_SWITCH_ANTENNA2
#define IL_SISO_SWITCH_MIMO2_AB
#define IL_SISO_SWITCH_MIMO2_AC
#define IL_SISO_SWITCH_MIMO2_BC
#define IL_SISO_SWITCH_GI

/* possible actions when in mimo mode */
#define IL_MIMO2_SWITCH_ANTENNA1
#define IL_MIMO2_SWITCH_ANTENNA2
#define IL_MIMO2_SWITCH_SISO_A
#define IL_MIMO2_SWITCH_SISO_B
#define IL_MIMO2_SWITCH_SISO_C
#define IL_MIMO2_SWITCH_GI

#define IL_MAX_SEARCH

#define IL_ACTION_LIMIT

#define LQ_SIZE

/* load per tid defines for A-MPDU activation */
#define IL_AGG_TPT_THREHOLD
#define IL_AGG_LOAD_THRESHOLD
#define IL_AGG_ALL_TID
#define TID_QUEUE_CELL_SPACING
#define TID_QUEUE_MAX_SIZE
#define TID_ROUND_VALUE
#define TID_MAX_LOAD_COUNT

#define TID_MAX_TIME_DIFF
#define TIME_WRAP_AROUND(x, y)

extern const struct il_rate_info il_rates[RATE_COUNT];

enum il_table_type {};

#define is_legacy(tbl)
#define is_siso(tbl)
#define is_mimo2(tbl)
#define is_mimo(tbl)
#define is_Ht(tbl)
#define is_a_band(tbl)
#define is_g_and(tbl)

#define ANT_NONE
#define ANT_A
#define ANT_B
#define ANT_AB
#define ANT_C
#define ANT_AC
#define ANT_BC
#define ANT_ABC

#define IL_MAX_MCS_DISPLAY_SIZE

struct il_rate_mcs_info {};

/**
 * struct il_rate_scale_data -- tx success history for one rate
 */
struct il_rate_scale_data {};

/**
 * struct il_scale_tbl_info -- tx params and success history for all rates
 *
 * There are two of these in struct il_lq_sta,
 * one for "active", and one for "search".
 */
struct il_scale_tbl_info {};

struct il_traffic_load {};

/**
 * struct il_lq_sta -- driver's rate scaling ilate structure
 *
 * Pointer to this gets passed back and forth between driver and mac80211.
 */
struct il_lq_sta {};

/*
 * il_station_priv: Driver's ilate station information
 *
 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
 * in the structure for use by driver. This structure is places in that
 * space.
 *
 * The common struct MUST be first because it is shared between
 * 3945 and 4965!
 */
struct il_station_priv {};

static inline u8
il4965_num_of_ant(u8 m)
{}

static inline u8
il4965_first_antenna(u8 mask)
{}

/**
 * il3945_rate_scale_init - Initialize the rate scale table based on assoc info
 *
 * The specific throughput table used is based on the type of network
 * the associated with, including A, B, G, and G w/ TGG protection
 */
void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);

/* Initialize station's rate scaling information after adding station */
void il4965_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta,
			 u8 sta_id);
void il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta,
			 u8 sta_id);

/**
 * il_rate_control_register - Register the rate control algorithm callbacks
 *
 * Since the rate control algorithm is hardware specific, there is no need
 * or reason to place it as a stand alone module.  The driver can call
 * il_rate_control_register in order to register the rate control callbacks
 * with the mac80211 subsystem.  This should be performed prior to calling
 * ieee80211_register_hw
 *
 */
int il4965_rate_control_register(void);
int il3945_rate_control_register(void);

/**
 * il_rate_control_unregister - Unregister the rate control callbacks
 *
 * This should be called after calling ieee80211_unregister_hw, but before
 * the driver is unloaded.
 */
void il4965_rate_control_unregister(void);
void il3945_rate_control_unregister(void);

int il_power_update_mode(struct il_priv *il, bool force);
void il_power_initialize(struct il_priv *il);

extern u32 il_debug_level;

#ifdef CONFIG_IWLEGACY_DEBUG
/*
 * il_get_debug_level: Return active debug level for device
 *
 * Using sysfs it is possible to set per device debug level. This debug
 * level will be used if set, otherwise the global debug level which can be
 * set via module parameter is used.
 */
static inline u32
il_get_debug_level(struct il_priv *il)
{}
#else
static inline u32
il_get_debug_level(struct il_priv *il)
{
	return il_debug_level;
}
#endif

#define il_print_hex_error(il, p, len)

#ifdef CONFIG_IWLEGACY_DEBUG
#define IL_DBG(level, fmt, args...)

#define il_print_hex_dump(il, level, p, len)

#else
#define IL_DBG
static inline void
il_print_hex_dump(struct il_priv *il, int level, const void *p, u32 len)
{
}
#endif /* CONFIG_IWLEGACY_DEBUG */

#ifdef CONFIG_IWLEGACY_DEBUGFS
void il_dbgfs_register(struct il_priv *il, const char *name);
void il_dbgfs_unregister(struct il_priv *il);
#else
static inline void il_dbgfs_register(struct il_priv *il, const char *name)
{
}

static inline void
il_dbgfs_unregister(struct il_priv *il)
{
}
#endif /* CONFIG_IWLEGACY_DEBUGFS */

/*
 * To use the debug system:
 *
 * If you are defining a new debug classification, simply add it to the #define
 * list here in the form of
 *
 * #define IL_DL_xxxx VALUE
 *
 * where xxxx should be the name of the classification (for example, WEP).
 *
 * You then need to either add a IL_xxxx_DEBUG() macro definition for your
 * classification, or use IL_DBG(IL_DL_xxxx, ...) whenever you want
 * to send output to that classification.
 *
 * The active debug levels can be accessed via files
 *
 *	/sys/module/iwl4965/parameters/debug
 *	/sys/module/iwl3945/parameters/debug
 *	/sys/class/net/wlan0/device/debug_level
 *
 * when CONFIG_IWLEGACY_DEBUG=y.
 */

/* 0x0000000F - 0x00000001 */
#define IL_DL_INFO
#define IL_DL_MAC80211
#define IL_DL_HCMD
#define IL_DL_STATE
/* 0x000000F0 - 0x00000010 */
#define IL_DL_MACDUMP
#define IL_DL_HCMD_DUMP
#define IL_DL_EEPROM
#define IL_DL_RADIO
/* 0x00000F00 - 0x00000100 */
#define IL_DL_POWER
#define IL_DL_TEMP
#define IL_DL_NOTIF
#define IL_DL_SCAN
/* 0x0000F000 - 0x00001000 */
#define IL_DL_ASSOC
#define IL_DL_DROP
#define IL_DL_TXPOWER
#define IL_DL_AP
/* 0x000F0000 - 0x00010000 */
#define IL_DL_FW
#define IL_DL_RF_KILL
#define IL_DL_FW_ERRORS
#define IL_DL_LED
/* 0x00F00000 - 0x00100000 */
#define IL_DL_RATE
#define IL_DL_CALIB
#define IL_DL_WEP
#define IL_DL_TX
/* 0x0F000000 - 0x01000000 */
#define IL_DL_RX
#define IL_DL_ISR
#define IL_DL_HT
/* 0xF0000000 - 0x10000000 */
#define IL_DL_11H
#define IL_DL_STATS
#define IL_DL_TX_REPLY
#define IL_DL_QOS

#define D_INFO(f, a...)
#define D_MAC80211(f, a...)
#define D_MACDUMP(f, a...)
#define D_TEMP(f, a...)
#define D_SCAN(f, a...)
#define D_RX(f, a...)
#define D_TX(f, a...)
#define D_ISR(f, a...)
#define D_LED(f, a...)
#define D_WEP(f, a...)
#define D_HC(f, a...)
#define D_HC_DUMP(f, a...)
#define D_EEPROM(f, a...)
#define D_CALIB(f, a...)
#define D_FW(f, a...)
#define D_RF_KILL(f, a...)
#define D_DROP(f, a...)
#define D_AP(f, a...)
#define D_TXPOWER(f, a...)
#define D_RATE(f, a...)
#define D_NOTIF(f, a...)
#define D_ASSOC(f, a...)
#define D_HT(f, a...)
#define D_STATS(f, a...)
#define D_TX_REPLY(f, a...)
#define D_QOS(f, a...)
#define D_RADIO(f, a...)
#define D_POWER(f, a...)
#define D_11H(f, a...)

#endif /* __il_core_h__ */