drivers/net/wireless/ralink/rt2x00/rt2x00lib.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ralink/rt2x00/rt2x00lib.h
Extension
.h
Size
13036 bytes
Lines
435
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 rt2x00_rate {
	unsigned short flags;
#define DEV_RATE_CCK			0x0001
#define DEV_RATE_OFDM			0x0002
#define DEV_RATE_SHORT_PREAMBLE		0x0004

	unsigned short bitrate; /* In 100kbit/s */
	unsigned short ratemask;

	unsigned short plcp;
	unsigned short mcs;
};

extern const struct rt2x00_rate rt2x00_supported_rates[12];

static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value)
{
	return &rt2x00_supported_rates[hw_value & 0xff];
}

#define RATE_MCS(__mode, __mcs) \
	((((__mode) & 0x00ff) << 8) | ((__mcs) & 0x00ff))

static inline int rt2x00_get_rate_mcs(const u16 mcs_value)
{
	return (mcs_value & 0x00ff);
}

/*
 * Radio control handlers.
 */
int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev);
void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev);

/*
 * Initialization handlers.
 */
int rt2x00lib_start(struct rt2x00_dev *rt2x00dev);
void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev);

/*
 * Configuration handlers.
 */
void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
			   struct rt2x00_intf *intf,
			   enum nl80211_iftype type,
			   const u8 *mac, const u8 *bssid);
void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev,
			  struct rt2x00_intf *intf,
			  struct ieee80211_bss_conf *conf,
			  u32 changed);
void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
			      struct antenna_setup ant);
void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
		      struct ieee80211_conf *conf,
		      const unsigned int changed_flags);

/**
 * DOC: Queue handlers
 */

/**
 * rt2x00queue_alloc_rxskb - allocate a skb for RX purposes.
 * @entry: The entry for which the skb will be applicable.
 */
struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry, gfp_t gfp);

/**
 * rt2x00queue_free_skb - free a skb
 * @entry: The entry for which the skb will be applicable.
 */
void rt2x00queue_free_skb(struct queue_entry *entry);

/**
 * rt2x00queue_align_frame - Align 802.11 frame to 4-byte boundary
 * @skb: The skb to align
 *
 * Align the start of the 802.11 frame to a 4-byte boundary, this could
 * mean the payload is not aligned properly though.
 */
void rt2x00queue_align_frame(struct sk_buff *skb);

/**
 * rt2x00queue_insert_l2pad - Align 802.11 header & payload to 4-byte boundary
 * @skb: The skb to align
 * @header_length: Length of 802.11 header
 *
 * Apply L2 padding to align both header and payload to 4-byte boundary
 */
void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length);

Annotation

Implementation Notes