drivers/net/wireless/intel/iwlegacy/commands.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlegacy/commands.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlegacy/commands.h
Extension
.h
Size
113611 bytes
Lines
3391
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct il_cmd_header {
	u8 cmd;			/* Command ID:  C_RXON, etc. */
	u8 flags;		/* 0:5 reserved, 6 abort, 7 internal */
	/*
	 * The driver sets up the sequence number to values of its choosing.
	 * uCode does not use this value, but passes it back to the driver
	 * when sending the response to each driver-originated command, so
	 * the driver can match the response to the command.  Since the values
	 * don't get used by uCode, the driver may set up an arbitrary format.
	 *
	 * There is one exception:  uCode sets bit 15 when it originates
	 * the response/notification, i.e. when the response/notification
	 * is not a direct response to a command sent by the driver.  For
	 * example, uCode issues N_3945_RX when it sends a received frame
	 * to the driver; it is not a direct response to any driver command.
	 *
	 * The Linux driver uses the following format:
	 *
	 *  0:7         tfd idx - position within TX queue
	 *  8:12        TX queue id
	 *  13          reserved
	 *  14          huge - driver sets this to indicate command is in the
	 *              'huge' storage at the end of the command buffers
	 *  15          unsolicited RX or uCode-originated notification
	 */
	__le16 sequence;
} __packed;

/**
 * struct il3945_tx_power
 *
 * Used in C_TX_PWR_TBL, C_SCAN, C_CHANNEL_SWITCH
 *
 * Each entry contains two values:
 * 1)  DSP gain (or sometimes called DSP attenuation).  This is a fine-grained
 *     linear value that multiplies the output of the digital signal processor,
 *     before being sent to the analog radio.
 * 2)  Radio gain.  This sets the analog gain of the radio Tx path.
 *     It is a coarser setting, and behaves in a logarithmic (dB) fashion.
 *
 * Driver obtains values from struct il3945_tx_power power_gain_table[][].
 */
struct il3945_tx_power {
	u8 tx_gain;		/* gain for analog radio */
	u8 dsp_atten;		/* gain for DSP */
} __packed;

/**
 * struct il3945_power_per_rate
 *
 * Used in C_TX_PWR_TBL, C_CHANNEL_SWITCH
 */
struct il3945_power_per_rate {
	u8 rate;		/* plcp */
	struct il3945_tx_power tpc;
	u8 reserved;
} __packed;

/**
 * iwl4965 rate_n_flags bit fields
 *
 * rate_n_flags format is used in following iwl4965 commands:
 *  N_RX (response only)
 *  N_RX_MPDU (response only)
 *  C_TX (both command and response)
 *  C_TX_LINK_QUALITY_CMD
 *
 * High-throughput (HT) rate format for bits 7:0 (bit 8 must be "1"):
 *  2-0:  0)   6 Mbps
 *        1)  12 Mbps
 *        2)  18 Mbps
 *        3)  24 Mbps
 *        4)  36 Mbps
 *        5)  48 Mbps
 *        6)  54 Mbps
 *        7)  60 Mbps
 *
 *  4-3:  0)  Single stream (SISO)
 *        1)  Dual stream (MIMO)
 *        2)  Triple stream (MIMO)
 *
 *    5:  Value of 0x20 in bits 7:0 indicates 6 Mbps HT40 duplicate data
 *
 * Legacy OFDM rate format for bits 7:0 (bit 8 must be "0", bit 9 "0"):
 *  3-0:  0xD)   6 Mbps
 *        0xF)   9 Mbps
 *        0x5)  12 Mbps
 *        0x7)  18 Mbps
 *        0x9)  24 Mbps
 *        0xB)  36 Mbps

Annotation

Implementation Notes