/* 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 (-127)
/* * 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 2347U #define MIN_RTS_THRESHOLD 0U #define MAX_RTS_THRESHOLD 2347U #define MAX_MSDU_SIZE 2304U #define MAX_MPDU_SIZE 2346U #define DEFAULT_BEACON_INTERVAL 100U #define DEFAULT_SHORT_RETRY_LIMIT 7U #define DEFAULT_LONG_RETRY_LIMIT 4U
struct il_cmd_meta { /* only for SYNC commands, iff the reply skb is wanted */ struct il_host_cmd *source; /* * only for ASYNC commands * (which is somewhat stupid -- look at common.c for instance * which duplicates a bunch of code because the callback isn't * invoked for SYNC commands, if it were and its result passed * through it would be simpler...)
*/ void (*callback) (struct il_priv *il, struct il_device_cmd *cmd, struct il_rx_pkt *pkt);
/* The CMD_SIZE_HUGE flag bit indicates that the command
* structure is stored at the end of the shared queue memory. */
u32 flags;
/* * Generic queue structure * * Contains common data for Rx and Tx queues
*/ struct il_queue { int n_bd; /* number of BDs in this queue */ int write_ptr; /* 1-st empty entry (idx) host_w */ int read_ptr; /* last used entry (idx) host_r */ /* use for monitoring and recovering the stuck queue */
dma_addr_t dma_addr; /* physical addr for BD's */ int n_win; /* safe queue win */
u32 id; int low_mark; /* low watermark, resume queue if free
* space more than this */ int high_mark; /* high watermark, stop queue if free
* space less than this */
};
/** * 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 256 #define TFD_CMD_SLOTS 32
/* * 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 5000 /* uSec */
#define IL_EEPROM_SEM_TIMEOUT 10 /* microseconds */ #define IL_EEPROM_SEM_RETRY_LIMIT 1000 /* number of attempts (not time) */
/* * 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 5 enum {
EEPROM_CHANNEL_VALID = (1 << 0), /* usable for this SKU/geo */
EEPROM_CHANNEL_IBSS = (1 << 1), /* usable as an IBSS channel */ /* Bit 2 Reserved */
EEPROM_CHANNEL_ACTIVE = (1 << 3), /* active scanning allowed */
EEPROM_CHANNEL_RADAR = (1 << 4), /* radar detection required */
EEPROM_CHANNEL_WIDE = (1 << 5), /* 20 MHz channel okay */ /* Bit 6 Reserved (was Narrow Channel) */
EEPROM_CHANNEL_DFS = (1 << 7), /* dynamic freq selection candidate */
};
/* *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 {
u8 flags; /* EEPROM_CHANNEL_* flags copied from EEPROM */
s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
} __packed;
/* 3945 Specific */ #define EEPROM_3945_EEPROM_VERSION (0x2f)
/* 4965 has two radio transmitters (and 3 radio receivers) */ #define EEPROM_TX_POWER_TX_CHAINS (2)
/* 4965 has room for up to 8 sets of txpower calibration data */ #define EEPROM_TX_POWER_BANDS (8)
/* 4965 factory calibration measures txpower gain settings for
* each of 3 target output levels */ #define EEPROM_TX_POWER_MEASUREMENTS (3)
/* 4965 Specific */ /* 4965 driver does not work with txpower calibration version < 5 */ #define EEPROM_4965_TX_POWER_VERSION (5) #define EEPROM_4965_EEPROM_VERSION (0x2f) #define EEPROM_4965_CALIB_VERSION_OFFSET (2*0xB6) /* 2 bytes */ #define EEPROM_4965_CALIB_TXPOWER_OFFSET (2*0xE8) /* 48 bytes */ #define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */ #define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */
/* * 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 {
u8 temperature; /* Device temperature (Celsius) */
u8 gain_idx; /* Index into gain table */
u8 actual_pow; /* Measured RF output power, half-dBm */
s8 pa_det; /* Power amp detector level (not used) */
} __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 {
u8 ch_num; struct il_eeprom_calib_measure
measurements[EEPROM_TX_POWER_TX_CHAINS]
[EEPROM_TX_POWER_MEASUREMENTS];
} __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 {
u8 ch_from; /* channel number of lowest channel in subband */
u8 ch_to; /* channel number of highest channel in subband */ struct il_eeprom_calib_ch_info ch1; struct il_eeprom_calib_ch_info ch2;
} __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 {
u8 saturation_power24; /* half-dBm (e.g. "34" = 17 dBm) */
u8 saturation_power52; /* half-dBm */
__le16 voltage; /* signed */ struct il_eeprom_calib_subband_info band_info[EEPROM_TX_POWER_BANDS];
} __packed;
/* * 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 (2*0xA0) /* 14 bytes */
struct il3945_clip_group { /* maximum power level to prevent clipping for each rate, derived by
* us from this band's saturation power in EEPROM */ const s8 clip_powers[IL_MAX_RATES];
};
/* 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 { struct il3945_tx_power tpc; /* actual radio and DSP gain settings */
s8 power_table_idx; /* actual (compenst'd) idx into gain table */
s8 base_power_idx; /* gain idx for power at factory temp. */
s8 requested_power; /* power (dBm) requested for this chnl/rate */
};
/* current scan Tx power values to use, one for each scan rate for each
* channel. */ struct il3945_scan_power_info { struct il3945_tx_power tpc; /* actual radio and DSP gain settings */
s8 power_table_idx; /* actual (compenst'd) idx into gain table */
s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
};
/* * 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 { struct il4965_channel_tgd_info tgd; struct il4965_channel_tgh_info tgh; struct il_eeprom_channel eeprom; /* EEPROM regulatory limit */ struct il_eeprom_channel ht40_eeprom; /* EEPROM regulatory limit for
* HT40 channel */
u8 channel; /* channel number */
u8 flags; /* flags copied from EEPROM */
s8 max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
s8 curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) limit */
s8 min_power; /* always 0 */
s8 scan_power; /* (dBm) regul. eeprom, direct scans, any rate */
/* HT40 channel info */
s8 ht40_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
u8 ht40_flags; /* flags copied from EEPROM */
u8 ht40_extension_channel; /* HT_IE_EXT_CHANNEL_* */
/* Radio/DSP gain settings for each "normal" data Tx rate. * These include, in addition to RF and DSP gain, a few fields for
* remembering/modifying gain settings (idxes). */ struct il3945_channel_power_info power_info[IL4965_MAX_RATE];
/* Radio/DSP gain settings for each scan rate, for directed scans. */ struct il3945_scan_power_info scan_pwr_info[IL_NUM_SCAN_RATES];
};
/* 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 10
/** * 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 { struct il_cmd_header hdr; /* uCode API */ union {
u32 flags;
u8 val8;
u16 val16;
u32 val32; struct il_tx_cmd_hdr tx;
u8 payload[DEF_CMD_PAYLOAD_SIZE];
} __packed cmd;
} __packed;
/** * 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 {
__le32 *bd;
dma_addr_t bd_dma; struct il_rx_buf pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; struct il_rx_buf *queue[RX_QUEUE_SIZE];
u32 read;
u32 write;
u32 free_count;
u32 write_actual; struct list_head rx_free; struct list_head rx_used; int need_update; struct il_rb_status *rb_stts;
dma_addr_t rb_stts_dma;
spinlock_t lock;
};
/** * 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 {
u16 txq_id;
u16 frame_count;
u16 wait_for_ba;
u16 start_idx;
u64 bitmap;
u32 rate_n_flags; #define IL_AGG_OFF 0 #define IL_AGG_ON 1 #define IL_EMPTYING_HW_QUEUE_ADDBA 2 #define IL_EMPTYING_HW_QUEUE_DELBA 3
u8 state;
};
/* * 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_addsta_cmd sta; struct il_tid_data tid[MAX_TID_COUNT];
u8 used; struct il_hw_key keyinfo; struct il_link_quality_cmd *lq;
};
struct il_station_priv_common {
u8 sta_id;
};
/** * 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 {
u8 ibss_bssid_sta_id;
};
/* one for each uCode image (inst/data, boot/init/runtime) */ struct fw_desc { void *v_addr; /* access by driver */
dma_addr_t p_addr; /* access by card's busmaster DMA */
u32 len; /* bytes */
};
/* uCode file layout */ struct il_ucode_header {
__le32 ver; /* major/minor/API/serial */ struct {
__le32 inst_size; /* bytes of runtime code */
__le32 data_size; /* bytes of runtime data */
__le32 init_size; /* bytes of init code */
__le32 init_data_size; /* bytes of init data */
__le32 boot_size; /* bytes of bootstrap code */
u8 data[0]; /* in same order as sizes */
} v1;
};
/** * 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 {
u8 bcast_id;
u8 max_txq_num;
u8 dma_chnl_num;
u16 scd_bc_tbls_size;
u32 tfd_size;
u8 tx_chains_num;
u8 rx_chains_num;
u8 valid_tx_ant;
u8 valid_rx_ant;
u16 max_rxq_size;
u16 max_rxq_log;
u32 rx_page_order;
u32 rx_wrt_ptr_reg;
u8 max_stations;
u8 ht40_channel;
u8 max_beacon_itrvl; /* in 1024 ms */
u32 max_inst_size;
u32 max_data_size;
u32 max_bsm_size;
u32 ct_kill_threshold; /* value in hw-dependent units */
u16 beacon_time_tsf_bits; conststruct il_sensitivity_ranges *sens;
};
/****************************************************************************** * * 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); externconst u8 il_bcast_addr[ETH_ALEN]; int il_queue_space(conststruct il_queue *q); staticinlineint
il_queue_used(conststruct il_queue *q, int i)
{ return q->write_ptr >= q->read_ptr ? (i >= q->read_ptr &&
i < q->write_ptr) : !(i <
q->read_ptr
&& i >=
q->
write_ptr);
}
staticinline u8
il_get_cmd_idx(struct il_queue *q, u32 idx, int is_huge)
{ /* * This is for init calibration result and scan command which * required buffer > TFD_MAX_PAYLOAD_SIZE, * the big buffer at end of command array
*/ if (is_huge) return q->n_win; /* must be power of 2 */
/* Otherwise, use normal size buffers */ return idx & (q->n_win - 1);
}
struct il_force_reset { int reset_request_count; int reset_success_count; int reset_reject_count; unsignedlong reset_duration; unsignedlong last_force_reset_jiffies;
};
/* extend beacon time format bit shifting */ /* * for _3945 devices * bits 31:24 - extended * bits 23:0 - interval
*/ #define IL3945_EXT_BEACON_TIME_POS 24 /* * for _4965 devices * bits 31:22 - extended * bits 21:0 - interval
*/ #define IL4965_EXT_BEACON_TIME_POS 22
/* ucode beacon time */
u32 ucode_beacon_time; int missed_beacon_threshold;
/* track IBSS manager (last beacon) status */
u32 ibss_manager;
/* force reset */ struct il_force_reset force_reset;
/* we allocate array of il_channel_info for NIC's valid channels.
* Access via channel # using indirect idx array */ struct il_channel_info *channel_info; /* channel info array */
u8 channel_count; /* # of channels */
/* * We declare this const so it can only be * changed via explicit cast within the * routines that actually update the physical * hardware.
*/ conststruct il_rxon_cmd active; struct il_rxon_cmd staging;
struct il_rxon_time_cmd timing;
__le16 switch_channel;
/* 1st responses from initialize and runtime uCode images.
* _4965's initialize alive response contains some calibration data. */ struct il_init_alive_resp card_alive_init; struct il_alive_resp card_alive;
/* context information */
u8 bssid[ETH_ALEN]; /* used only on 3945 but filled by core */
/* station table variables */
/* Note: if lock and sta_lock are needed, lock must be acquired first */
spinlock_t sta_lock; int num_stations; struct il_station_entry stations[IL_STATION_COUNT]; unsignedlong ucode_key_table;
/* queue refcounts */ #define IL_MAX_HW_QUEUES 32 unsignedlong queue_stopped[BITS_TO_LONGS(IL_MAX_HW_QUEUES)]; #define IL_STOP_REASON_PASSIVE 0 unsignedlong stop_reason; /* for each AC */
atomic_t queue_stop_count[4];
/* Indication if ieee80211_ops->open has been called */
u8 is_open;
u8 mac80211_registered;
/* eeprom -- this is in the card's little endian byte order */
u8 *eeprom; struct il_eeprom_calib_info *calib_info;
enum nl80211_iftype iw_mode;
/* Last Rx'd beacon timestamp */
u64 timestamp;
union { #if IS_ENABLED(CONFIG_IWL3945) struct { void *shared_virt;
dma_addr_t shared_phys;
/* * chain noise reset and gain commands are the * two extra calibration commands follows the standard * phy calibration commands
*/
u8 phy_calib_chain_noise_reset_cmd;
u8 phy_calib_chain_noise_gain_cmd;
/* * 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 {
IL_LED_DEFAULT,
IL_LED_RF_STATE,
IL_LED_BLINK,
};
/** * 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 { /* params specific to an individual device within a device family */ constchar *name; constchar *fw_name_pre; constunsignedint ucode_api_max; constunsignedint ucode_api_min;
u8 valid_tx_ant;
u8 valid_rx_ant; unsignedint sku;
u16 eeprom_ver;
u16 eeprom_calib_ver; /* module based parameters which can be set from modprobe cmd */ conststruct il_mod_params *mod_params; /* params not likely to change within a device family */ struct il_base_params *base_params; /* params likely to change within a device family */
u8 scan_rx_antennas[NUM_NL80211_BANDS]; enum il_led_mode led_mode;
int eeprom_size; int num_of_queues; /* def: HW dependent */ int num_of_ampdu_queues; /* def: HW dependent */ /* for il_apm_init() */
u32 pll_cfg_val; bool set_l0s; bool use_bsm;
/* 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 cpu_to_le16(10) /* msec */ #define IL_PLCP_QUIET_THRESH cpu_to_le16(1) /* packets */
#define IL_SCAN_CHECK_WATCHDOG (HZ * 7)
/***************************************************** * S e n d i n g H o s t C o m m a n d s *
*****************************************************/
staticinlineint
il_is_ready(struct il_priv *il)
{ /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are
* set but EXIT_PENDING is not */ return test_bit(S_READY, &il->status) &&
test_bit(S_GEO_CONFIGURED, &il->status) &&
!test_bit(S_EXIT_PENDING, &il->status);
}
staticinlinebool il_need_reclaim(struct il_priv *il, struct il_rx_pkt *pkt)
{ /* Reclaim a command buffer only if this packet is a response * to a (driver-originated) command. If the packet (e.g. Rx frame) * originated from uCode, there is no command buffer to reclaim. * Ucode should set SEQ_RX_FRAME bit if ucode-originated, but * apparently a few don't get set; catch them here.
*/ return !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
pkt->hdr.cmd != N_STATS && pkt->hdr.cmd != C_TX &&
pkt->hdr.cmd != N_RX_PHY && pkt->hdr.cmd != N_RX &&
pkt->hdr.cmd != N_RX_MPDU && pkt->hdr.cmd != N_COMPRESSED_BA;
}
spin_lock_irqsave(&il->reg_lock, reg_flags); if (likely(_il_grab_nic_access(il))) {
val = _il_rd_prph(il, reg);
_il_wr_prph(il, reg, (val & ~mask));
_il_release_nic_access(il);
}
spin_unlock_irqrestore(&il->reg_lock, reg_flags);
}
#define HW_KEY_DYNAMIC 0 #define HW_KEY_DEFAULT 1
#define IL_STA_DRIVER_ACTIVE BIT(0) /* driver entry is active */ #define IL_STA_UCODE_ACTIVE BIT(1) /* ucode entry is active */ #define IL_STA_UCODE_INPROGRESS BIT(2) /* ucode entry is in process of
being activated */ #define IL_STA_LOCAL BIT(3) /* station state not directed by mac80211;
(this is for the IBSS BSSID stations) */ #define IL_STA_BCAST BIT(4) /* this station is the special bcast station */
/** * 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.
*/ staticinlinevoid
il_clear_driver_stations(struct il_priv *il)
{ unsignedlong flags;
/** * 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.
*/ staticinlineint
il_sta_id_or_broadcast(struct il_priv *il, struct ieee80211_sta *sta)
{ int sta_id;
if (!sta) return il->hw_params.bcast_id;
sta_id = il_sta_id(sta);
/* * mac80211 should not be passing a partially * initialised station!
*/
WARN_ON(sta_id == IL_INVALID_STATION);
return sta_id;
}
/** * 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)
*/ staticinlineint
il_queue_inc_wrap(int idx, int n_bd)
{ return ++idx & (n_bd - 1);
}
/**
--> --------------------
--> maximum size reached
--> --------------------
Messung V0.5
¤ Dauer der Verarbeitung: 0.65 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.