Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00d3f14c authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: use cfg80211s BSS infrastructure



Remove all the code from mac80211 to keep track of BSSes
and use the cfg80211-provided code completely.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 79420f09
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@ typedef u16 __nocast zd_addr_t;
#  define dev_dbg_f(dev, fmt, args...) \
	  dev_printk_f(KERN_DEBUG, dev, fmt, ## args)
#  define dev_dbg_f_limit(dev, fmt, args...) do { \
	if (net_ratelimit())
		dev_printk_f(KERN_DEBUG, dev, fmt, ## args)
	if (net_ratelimit()) \
		dev_printk_f(KERN_DEBUG, dev, fmt, ## args); \
} while (0)
#else
#  define dev_dbg_f(dev, fmt, args...) do { (void)(dev); } while (0)
+15 −27
Original line number Diff line number Diff line
@@ -72,43 +72,36 @@ struct ieee80211_fragment_entry {


struct ieee80211_bss {
	struct list_head list;
	struct ieee80211_bss *hnext;
	size_t ssid_len;
	/* Yes, this is a hack */
	struct cfg80211_bss cbss;

	atomic_t users;

	u8 bssid[ETH_ALEN];
	/* don't want to look up all the time */
	size_t ssid_len;
	u8 ssid[IEEE80211_MAX_SSID_LEN];

	u8 dtim_period;
	u16 capability; /* host byte order */
	enum ieee80211_band band;
	int freq;
	int signal, noise, qual;
	u8 *ies; /* all information elements from the last Beacon or Probe
		  * Response frames; note Beacon frame is not allowed to
		  * override values from Probe Response */
	size_t ies_len;

	bool wmm_used;

	unsigned long last_probe_resp;

#ifdef CONFIG_MAC80211_MESH
	u8 *mesh_id;
	size_t mesh_id_len;
	u8 *mesh_cfg;
#endif

#define IEEE80211_MAX_SUPP_RATES 32
	u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
	size_t supp_rates_len;
	u64 timestamp;
	int beacon_int;

	unsigned long last_probe_resp;
	unsigned long last_update;

	/* during assocation, we save an ERP value from a probe response so
	/*
	 * During assocation, we save an ERP value from a probe response so
	 * that we can feed ERP info to the driver when handling the
	 * association completes. these fields probably won't be up-to-date
	 * otherwise, you probably don't want to use them. */
	int has_erp_value;
	 * otherwise, you probably don't want to use them.
	 */
	bool has_erp_value;
	u8 erp_value;
};

@@ -668,9 +661,6 @@ struct ieee80211_local {
	struct ieee80211_sub_if_data *scan_sdata;
	enum nl80211_channel_type oper_channel_type;
	struct ieee80211_channel *oper_channel, *csa_channel;
	struct list_head bss_list;
	struct ieee80211_bss *bss_hash[STA_HASH_SIZE];
	spinlock_t bss_lock;

	/* SNMP counters */
	/* dot11CountersTable */
@@ -936,8 +926,6 @@ ieee80211_rx_result
ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata,
		  struct sk_buff *skb,
		  struct ieee80211_rx_status *rx_status);
void ieee80211_rx_bss_list_init(struct ieee80211_local *local);
void ieee80211_rx_bss_list_deinit(struct ieee80211_local *local);
int ieee80211_sta_set_extra_ie(struct ieee80211_sub_if_data *sdata,
			       char *ie, size_t len);

+3 −3
Original line number Diff line number Diff line
@@ -734,6 +734,9 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,

	wiphy->privid = mac80211_wiphy_privid;
	wiphy->max_scan_ssids = 4;
	/* Yes, putting cfg80211_bss into ieee80211_bss is a hack */
	wiphy->bss_priv_size = sizeof(struct ieee80211_bss) -
			       sizeof(struct cfg80211_bss);

	local = wiphy_priv(wiphy);
	local->hw.wiphy = wiphy;
@@ -877,8 +880,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
	mpriv->local = local;
	local->mdev = mdev;

	ieee80211_rx_bss_list_init(local);

	local->hw.workqueue =
		create_singlethread_workqueue(wiphy_name(local->hw.wiphy));
	if (!local->hw.workqueue) {
@@ -1018,7 +1019,6 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)

	rtnl_unlock();

	ieee80211_rx_bss_list_deinit(local);
	ieee80211_clear_tx_pending(local);
	sta_info_stop(local);
	rate_control_deinitialize(local);
+0 −10
Original line number Diff line number Diff line
@@ -275,16 +275,6 @@ u32 mesh_table_hash(u8 *addr, struct ieee80211_sub_if_data *sdata, struct mesh_t
		& tbl->hash_mask;
}

u8 mesh_id_hash(u8 *mesh_id, int mesh_id_len)
{
	if (!mesh_id_len)
		return 1;
	else if (mesh_id_len == 1)
		return (u8) mesh_id[0];
	else
		return (u8) (mesh_id[0] + 2 * mesh_id[1]);
}

struct mesh_table *mesh_table_alloc(int size_order)
{
	int i;
+0 −1
Original line number Diff line number Diff line
@@ -196,7 +196,6 @@ struct mesh_rmc {

/* Public interfaces */
/* Various */
u8 mesh_id_hash(u8 *mesh_id, int mesh_id_len);
int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr);
int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr,
		struct ieee80211_sub_if_data *sdata);
Loading