drivers/net/wireless/intel/iwlegacy/common.h
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlegacy/common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlegacy/common.h- Extension
.h- Size
- 89936 bytes
- Lines
- 3067
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hlinux/pci.hlinux/kernel.hlinux/leds.hlinux/wait.hlinux/io.hnet/mac80211.hnet/ieee80211_radiotap.hcommands.hcsr.hprph.h
Detected Declarations
struct il_host_cmdstruct il_cmdstruct il_tx_queuestruct il_rx_bufstruct il_device_cmdstruct il_cmd_metastruct il_queuestruct il_tx_queuestruct il_eeprom_channelstruct il_eeprom_calib_measurestruct il_eeprom_calib_ch_infostruct il_eeprom_calib_subband_infostruct il_eeprom_calib_infostruct il4965_channel_tgd_infostruct il4965_channel_tgh_infostruct il3945_clip_groupstruct il3945_channel_power_infostruct il3945_scan_power_infostruct il_channel_infostruct il_framestruct il_device_cmdstruct il_device_cmd_hugestruct il_host_cmdstruct il_rx_queuestruct il_ht_aggstruct il_tid_datastruct il_hw_keystruct il_ht_configstruct il_qos_infostruct il_station_entrystruct il_station_priv_commonstruct il_vif_privstruct fw_descstruct il_ucode_headerstruct il4965_ibss_seqstruct il_sensitivity_rangesstruct il_hw_paramsstruct il_dma_ptrstruct il_sensitivity_datastruct il_chain_noise_datastruct isr_statsstruct traffic_statsstruct il_force_resetstruct il_rxon_contextstruct il_power_mgrstruct il_privstruct il_debugfs_opsstruct il_ops
Annotated Snippet
struct il_rx_buf {
dma_addr_t page_dma;
struct page *page;
struct list_head list;
};
#define rxb_addr(r) page_address(r->page)
/* defined below */
struct il_device_cmd;
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;
DEFINE_DMA_UNMAP_ADDR(mapping);
DEFINE_DMA_UNMAP_LEN(len);
};
/*
* 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
struct il_tx_queue {
struct il_queue q;
void *tfds;
struct il_device_cmd **cmd;
struct il_cmd_meta *meta;
struct sk_buff **skbs;
unsigned long time_stamp;
u8 need_update;
u8 sched_retry;
u8 active;
u8 swq_id;
};
/*
* 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.
*/
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/pci.h`, `linux/kernel.h`, `linux/leds.h`, `linux/wait.h`, `linux/io.h`, `net/mac80211.h`, `net/ieee80211_radiotap.h`.
- Detected declarations: `struct il_host_cmd`, `struct il_cmd`, `struct il_tx_queue`, `struct il_rx_buf`, `struct il_device_cmd`, `struct il_cmd_meta`, `struct il_queue`, `struct il_tx_queue`, `struct il_eeprom_channel`, `struct il_eeprom_calib_measure`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.