drivers/net/wireless/ath/ar5523/ar5523.h

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

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ath/ar5523/ar5523.h
Extension
.h
Size
4175 bytes
Lines
152
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 ar5523_tx_cmd {
	struct ar5523		*ar;
	struct urb		*urb_tx;
	void			*buf_tx;
	void			*odata;
	int			olen;
	int			flags;
	int			res;
	struct completion	done;
};

/* This struct is placed in tx_info->driver_data. It must not be larger
 *  than IEEE80211_TX_INFO_DRIVER_DATA_SIZE.
 */
struct ar5523_tx_data {
	struct list_head	list;
	struct ar5523		*ar;
	struct urb		*urb;
};

struct ar5523_rx_data {
	struct	list_head	list;
	struct ar5523		*ar;
	struct urb		*urb;
	struct sk_buff		*skb;
};

struct ar5523 {
	struct usb_device	*dev;
	struct ieee80211_hw	*hw;

	unsigned long		flags;
	struct mutex		mutex;
	struct workqueue_struct *wq;

	struct ar5523_tx_cmd	tx_cmd;

	struct delayed_work	stat_work;

	struct timer_list	tx_wd_timer;
	struct work_struct	tx_wd_work;
	struct work_struct	tx_work;
	struct list_head	tx_queue_pending;
	struct list_head	tx_queue_submitted;
	spinlock_t		tx_data_list_lock;
	wait_queue_head_t	tx_flush_waitq;

	/* Queued + Submitted TX frames */
	atomic_t		tx_nr_total;

	/* Submitted TX frames */
	atomic_t		tx_nr_pending;

	void			*rx_cmd_buf;
	struct urb		*rx_cmd_urb;

	struct ar5523_rx_data	rx_data[AR5523_RX_DATA_COUNT];
	spinlock_t		rx_data_list_lock;
	struct list_head	rx_data_free;
	struct list_head	rx_data_used;
	atomic_t		rx_data_free_cnt;

	struct work_struct	rx_refill_work;

	unsigned int		rxbufsz;
	u8			serial[16];

	struct ieee80211_channel channels[14];
	struct ieee80211_rate	rates[12];
	struct ieee80211_supported_band band;
	struct ieee80211_vif	*vif;
};

/* flags for sending firmware commands */
#define AR5523_CMD_FLAG_READ	(1 << 1)
#define AR5523_CMD_FLAG_MAGIC	(1 << 2)

#define ar5523_dbg(ar, format, arg...) \
	dev_dbg(&(ar)->dev->dev, format, ## arg)

/* On USB hot-unplug there can be a lot of URBs in flight and they'll all
 * fail. Instead of dealing with them in every possible place just surpress
 * any messages on USB disconnect.
 */
#define ar5523_err(ar, format, arg...) \
do { \
	if (!test_bit(AR5523_USB_DISCONNECTED, &ar->flags)) { \
		dev_err(&(ar)->dev->dev, format, ## arg); \
	} \
} while (0)

Annotation

Implementation Notes