drivers/net/wireless/intel/ipw2x00/ipw2100.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/ipw2x00/ipw2100.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/ipw2x00/ipw2100.h
Extension
.h
Size
40348 bytes
Lines
1141
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 bd_status {
	union {
		struct {
			u8 nlf:1, txType:2, intEnabled:1, reserved:4;
		} fields;
		u8 field;
	} info;
} __packed;

struct ipw2100_bd {
	u32 host_addr;
	u32 buf_length;
	struct bd_status status;
	/* number of fragments for frame (should be set only for
	 * 1st TBD) */
	u8 num_fragments;
	u8 reserved[6];
} __packed;

#define IPW_BD_QUEUE_LENGTH(n) (1<<n)
#define IPW_BD_ALIGNMENT(L)    (L*sizeof(struct ipw2100_bd))

#define IPW_BD_STATUS_TX_FRAME_802_3             0x00
#define IPW_BD_STATUS_TX_FRAME_NOT_LAST_FRAGMENT 0x01
#define IPW_BD_STATUS_TX_FRAME_COMMAND		 0x02
#define IPW_BD_STATUS_TX_FRAME_802_11	         0x04
#define IPW_BD_STATUS_TX_INTERRUPT_ENABLE	 0x08

struct ipw2100_bd_queue {
	/* driver (virtual) pointer to queue */
	struct ipw2100_bd *drv;

	/* firmware (physical) pointer to queue */
	dma_addr_t nic;

	/* Length of phy memory allocated for BDs */
	u32 size;

	/* Number of BDs in queue (and in array) */
	u32 entries;

	/* Number of available BDs (invalid for NIC BDs) */
	u32 available;

	/* Offset of oldest used BD in array (next one to
	 * check for completion) */
	u32 oldest;

	/* Offset of next available (unused) BD */
	u32 next;
};

#define RX_QUEUE_LENGTH 256
#define TX_QUEUE_LENGTH 256
#define HW_QUEUE_LENGTH 256

#define TX_PENDED_QUEUE_LENGTH (TX_QUEUE_LENGTH / NUMBER_OF_BD_PER_DATA_PACKET)

#define STATUS_TYPE_MASK	0x0000000f
#define COMMAND_STATUS_VAL	0
#define STATUS_CHANGE_VAL	1
#define P80211_DATA_VAL 	2
#define P8023_DATA_VAL		3
#define HOST_NOTIFICATION_VAL	4

#define IPW2100_RSSI_TO_DBM (-98)

struct ipw2100_status {
	u32 frame_size;
	u16 status_fields;
	u8 flags;
#define IPW_STATUS_FLAG_DECRYPTED	(1<<0)
#define IPW_STATUS_FLAG_WEP_ENCRYPTED	(1<<1)
#define IPW_STATUS_FLAG_CRC_ERROR       (1<<2)
	u8 rssi;
} __packed;

struct ipw2100_status_queue {
	/* driver (virtual) pointer to queue */
	struct ipw2100_status *drv;

	/* firmware (physical) pointer to queue */
	dma_addr_t nic;

	/* Length of phy memory allocated for BDs */
	u32 size;
};

#define HOST_COMMAND_PARAMS_REG_LEN	100
#define CMD_STATUS_PARAMS_REG_LEN 	3

Annotation

Implementation Notes