#ifndef __MAC80211_HWSIM_I_H
#define __MAC80211_HWSIM_I_H
#include <net/mac80211.h>
#include "mac80211_hwsim.h"
#include "mac80211_hwsim_nan.h"
struct hwsim_sta_nan_sched {
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;
struct hwsim_sta_nan_sched nan_sched;
};
#define HWSIM_STA_MAGIC 0x6d537749
struct mac80211_hwsim_link_data {
u32 link_id;
u64 beacon_int ;
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;
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;
bool ps_poll_pending;
struct dentry *debugfs;
struct cfg80211_chan_def radar_background_chandef;
atomic_t pending_cookie;
struct sk_buff_head pending;
u64 group;
int netgroup;
u32 wmediumd;
spinlock_t tsf_offset_lock;
s64 tsf_offset;
u64 tx_pkts;
u64 rx_pkts;
u64 tx_bytes;
u64 rx_bytes;
u64 tx_dropped;
u64 tx_failed;
int rx_rssi;
struct cfg80211_pmsr_capabilities pmsr_capa;
struct cfg80211_pmsr_request *pmsr_request;
struct wireless_dev *pmsr_request_wdev;
struct mac80211_hwsim_link_data link_data[IEEE80211_MLD_MAX_NUM_LINKS];
struct mac80211_hwsim_nan_data nan;
};
extern spinlock_t hwsim_radio_lock;
extern struct list_head hwsim_radios;
ktime_t mac80211_hwsim_tsf_to_boottime(struct mac80211_hwsim_data *data,
u64 tsf);
u64 mac80211_hwsim_boottime_to_tsf(struct mac80211_hwsim_data *data,
ktime_t ts);
u64 mac80211_hwsim_get_tsf(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
struct sk_buff *skb,
struct ieee80211_channel *chan);
void ieee80211_hwsim_wake_tx_queue(struct ieee80211_hw *hw,
struct ieee80211_txq *txq);
#endif