drivers/net/wireless/ath/carl9170/carl9170.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/carl9170/carl9170.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ath/carl9170/carl9170.h
Extension
.h
Size
18254 bytes
Lines
670
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 carl9170_sta_tid {
	/* must be the first entry! */
	struct list_head list;

	/* temporary list for RCU unlink procedure */
	struct list_head tmp_list;

	/* lock for the following data structures */
	spinlock_t lock;

	unsigned int counter;
	enum carl9170_tid_state state;
	u8 tid;		/* TID number ( 0 - 15 ) */
	u16 max;	/* max. AMPDU size */

	u16 snx;	/* awaiting _next_ frame */
	u16 hsn;	/* highest _queued_ sequence */
	u16 bsn;	/* base of the tx/agg bitmap */
	unsigned long bitmap[CARL9170_BAW_SIZE];

	/* Preaggregation reorder queue */
	struct sk_buff_head queue;

	struct ieee80211_sta *sta;
	struct ieee80211_vif *vif;
};

#define CARL9170_QUEUE_TIMEOUT		256
#define CARL9170_BUMP_QUEUE		1000
#define CARL9170_TX_TIMEOUT		2500
#define CARL9170_JANITOR_DELAY		128
#define CARL9170_QUEUE_STUCK_TIMEOUT	5500
#define CARL9170_STAT_WORK		30000

#define CARL9170_NUM_TX_AGG_MAX		30

/*
 * Tradeoff between stability/latency and speed.
 *
 * AR9170_TXQ_DEPTH is devised by dividing the amount of available
 * tx buffers with the size of a full ethernet frame + overhead.
 *
 * Naturally: The higher the limit, the faster the device CAN send.
 * However, even a slight over-commitment at the wrong time and the
 * hardware is doomed to send all already-queued frames at suboptimal
 * rates. This in turn leads to an enormous amount of unsuccessful
 * retries => Latency goes up, whereas the throughput goes down. CRASH!
 */
#define CARL9170_NUM_TX_LIMIT_HARD	((AR9170_TXQ_DEPTH * 3) / 2)
#define CARL9170_NUM_TX_LIMIT_SOFT	(AR9170_TXQ_DEPTH)

struct carl9170_tx_queue_stats {
	unsigned int count;
	unsigned int limit;
	unsigned int len;
};

struct carl9170_vif {
	unsigned int id;
	struct ieee80211_vif __rcu *vif;
};

struct carl9170_vif_info {
	struct list_head list;
	bool active;
	unsigned int id;
	struct sk_buff *beacon;
	bool enable_beacon;
};

#define AR9170_NUM_RX_URBS	16
#define AR9170_NUM_RX_URBS_MUL	2
#define AR9170_NUM_TX_URBS	8
#define AR9170_NUM_RX_URBS_POOL (AR9170_NUM_RX_URBS_MUL * AR9170_NUM_RX_URBS)

enum carl9170_device_features {
	CARL9170_WPS_BUTTON		= BIT(0),
	CARL9170_ONE_LED		= BIT(1),
};

#ifdef CONFIG_CARL9170_LEDS
struct ar9170;

struct carl9170_led {
	struct ar9170 *ar;
	struct led_classdev l;
	char name[32];
	unsigned int toggled;
	bool last_state;
	bool registered;

Annotation

Implementation Notes