drivers/net/wireless/realtek/rtlwifi/usb.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/usb.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/realtek/rtlwifi/usb.h
Extension
.h
Size
3607 bytes
Lines
143
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 rtl_ep_map {
	u32 ep_mapping[__RTL_TXQ_NUM];
};

struct _trx_info {
	struct rtl_usb *rtlusb;
	u32 ep_num;
};

static inline void _rtl_install_trx_info(struct rtl_usb *rtlusb,
					 struct sk_buff *skb,
					 u32 ep_num)
{
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);

	info->rate_driver_data[0] = rtlusb;
	info->rate_driver_data[1] = (void *)(__kernel_size_t)ep_num;
}

/*  Add suspend/resume later */
enum rtl_usb_state {
	USB_STATE_STOP	= 0,
	USB_STATE_START	= 1,
};

#define IS_USB_STOP(rtlusb_ptr) (USB_STATE_STOP == (rtlusb_ptr)->state)
#define IS_USB_START(rtlusb_ptr) (USB_STATE_START == (rtlusb_ptr)->state)
#define SET_USB_STOP(rtlusb_ptr) \
	do {							\
		(rtlusb_ptr)->state = USB_STATE_STOP;		\
	} while (0)

#define SET_USB_START(rtlusb_ptr)				\
	do { \
		(rtlusb_ptr)->state = USB_STATE_START;		\
	} while (0)

struct rtl_usb {
	struct usb_device *udev;
	struct usb_interface *intf;
	enum rtl_usb_state state;

	/* Bcn control register setting */
	u32 reg_bcn_ctrl_val;
	/* for 88/92cu card disable */
	u8	disablehwsm;
	/*QOS & EDCA */
	enum acm_method acm_method;
	/* irq  . HIMR,HIMR_EX */
	u32 irq_mask[2];
	bool irq_enabled;

	u16 (*usb_mq_to_hwq)(__le16 fc, u16 mac80211_queue_index);

	/* Tx */
	u8 out_ep_nums ;
	u8 out_eps[RTL_USB_MAX_BULKOUT_NUM];
	u8 out_queue_sel;
	struct rtl_ep_map ep_map;

	u32 max_bulk_out_size;
	u32 tx_submitted_urbs;
	struct sk_buff_head tx_skb_queue[RTL_USB_MAX_EP_NUM];

	struct usb_anchor tx_pending[RTL_USB_MAX_EP_NUM];
	struct usb_anchor tx_submitted;

	struct sk_buff *(*usb_tx_aggregate_hdl)(struct ieee80211_hw *,
						struct sk_buff_head *);
	int (*usb_tx_post_hdl)(struct ieee80211_hw *,
			       struct urb *, struct sk_buff *);
	void (*usb_tx_cleanup)(struct ieee80211_hw *, struct sk_buff *);

	/* Rx */
	u8 in_ep_nums;
	u32 in_ep;		/* Bulk IN endpoint number */
	u32 rx_max_size;	/* Bulk IN max buffer size */
	u32 rx_urb_num;		/* How many Bulk INs are submitted to host. */
	struct usb_anchor	rx_submitted;
	struct usb_anchor	rx_cleanup_urbs;
	struct tasklet_struct   rx_work_tasklet;
	struct sk_buff_head	rx_queue;
	void (*usb_rx_segregate_hdl)(struct ieee80211_hw *, struct sk_buff *,
				     struct sk_buff_head *);
	void (*usb_rx_hdl)(struct ieee80211_hw *, struct sk_buff *);
};

struct rtl_usb_priv {
	struct bt_coexist_info bt_coexist;
	struct rtl_usb dev;

Annotation

Implementation Notes