drivers/net/wireless/virtual/mac80211_hwsim_i.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/virtual/mac80211_hwsim_i.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/virtual/mac80211_hwsim_i.h
Extension
.h
Size
4766 bytes
Lines
169
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 hwsim_sta_nan_sched {
	/* Later members are protected by this lock */
	spinlock_t lock;
	u16 committed_dw;
	struct {
		u8 map_id;
		struct cfg80211_chan_def chans[CFG80211_NAN_SCHED_NUM_TIME_SLOTS];
	} maps[CFG80211_NAN_MAX_PEER_MAPS];
};

struct hwsim_sta_priv {
	u32 magic;
	unsigned int last_link;
	u16 active_links_rx;

	/* NAN peer schedule - must be accessed under nan_sched.lock */
	struct hwsim_sta_nan_sched nan_sched;
};

#define HWSIM_STA_MAGIC	0x6d537749

struct mac80211_hwsim_link_data {
	u32 link_id;
	u64 beacon_int	/* beacon interval in us */;
	struct hrtimer beacon_timer;
};

#define HWSIM_NUM_CHANNELS_2GHZ		14
#define HWSIM_NUM_CHANNELS_5GHZ		40
#define HWSIM_NUM_CHANNELS_6GHZ		59
#define HWSIM_NUM_S1G_CHANNELS_US	51
#define HWSIM_NUM_RATES			12
#define HWSIM_NUM_CIPHERS		11

struct mac80211_hwsim_data {
	struct list_head list;
	struct rhash_head rht;
	struct ieee80211_hw *hw;
	struct device *dev;
	struct ieee80211_supported_band bands[NUM_NL80211_BANDS];
	struct ieee80211_channel channels_2ghz[HWSIM_NUM_CHANNELS_2GHZ];
	struct ieee80211_channel channels_5ghz[HWSIM_NUM_CHANNELS_5GHZ];
	struct ieee80211_channel channels_6ghz[HWSIM_NUM_CHANNELS_6GHZ];
	struct ieee80211_channel channels_s1g[HWSIM_NUM_S1G_CHANNELS_US];
	struct ieee80211_rate rates[HWSIM_NUM_RATES];
	struct ieee80211_iface_combination if_combination;
	struct ieee80211_iface_limit if_limits[5];
	int n_if_limits;
	/* Storage space for channels, etc. */
	struct mac80211_hwsim_phy_data *phy_data;

	struct ieee80211_iface_combination if_combination_radio;
	struct wiphy_radio_freq_range radio_range[NUM_NL80211_BANDS];
	struct wiphy_radio radio[NUM_NL80211_BANDS];

	u32 ciphers[HWSIM_NUM_CIPHERS];

	struct mac_address addresses[3];
	int channels, idx;
	bool use_chanctx;
	bool destroy_on_close;
	u32 portid;
	char alpha2[2];
	const struct ieee80211_regdomain *regd;

	struct ieee80211_channel *tmp_chan;
	struct ieee80211_channel *roc_chan;
	u32 roc_duration;
	struct delayed_work roc_start;
	struct delayed_work roc_done;
	struct delayed_work hw_scan;
	struct cfg80211_scan_request *hw_scan_request;
	struct ieee80211_vif *hw_scan_vif;
	int scan_chan_idx;
	u8 scan_addr[ETH_ALEN];
	struct {
		struct ieee80211_channel *channel;
		unsigned long next_start, start, end;
	} survey_data[HWSIM_NUM_CHANNELS_2GHZ +
		      HWSIM_NUM_CHANNELS_5GHZ +
		      HWSIM_NUM_CHANNELS_6GHZ];

	struct ieee80211_channel *channel;
	enum nl80211_chan_width bw;
	unsigned int rx_filter;
	bool started, idle, scanning;
	struct mutex mutex;
	enum ps_mode {
		PS_DISABLED, PS_ENABLED, PS_AUTO_POLL, PS_MANUAL_POLL
	} ps;

Annotation

Implementation Notes