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

Commit 7bcfaf2f authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

cfg80211/mac80211: use debugfs_remove_recursive



We can save a lot of code and pointers in the structs
by using debugfs_remove_recursive().

First, change cfg80211 to use debugfs_remove_recursive()
so that drivers do not need to clean up any files they
added to the per-wiphy debugfs (if and only if they are
ok to be accessed until after wiphy_unregister!).

Then also make mac80211 use debugfs_remove_recursive()
where necessary -- it need not remove per-wiphy files
as cfg80211 now removes those, but netdev etc. files
still need to be handled but can now be removed without
needing struct dentry pointers to all of them.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2c0d6100
Loading
Loading
Loading
Loading
+4 −69
Original line number Original line Diff line number Diff line

/*
/*
 * mac80211 debugfs for wireless PHYs
 * mac80211 debugfs for wireless PHYs
 *
 *
@@ -38,16 +39,10 @@ static const struct file_operations name## _ops = { \
};
};


#define DEBUGFS_ADD(name)						\
#define DEBUGFS_ADD(name)						\
	local->debugfs.name = debugfs_create_file(#name, 0400, phyd,	\
	debugfs_create_file(#name, 0400, phyd, local, &name## _ops);
						  local, &name## _ops);


#define DEBUGFS_ADD_MODE(name, mode)					\
#define DEBUGFS_ADD_MODE(name, mode)					\
	local->debugfs.name = debugfs_create_file(#name, mode, phyd,	\
	debugfs_create_file(#name, mode, phyd, local, &name## _ops);
						  local, &name## _ops);

#define DEBUGFS_DEL(name)						\
	debugfs_remove(local->debugfs.name);				\
	local->debugfs.name = NULL;




DEBUGFS_READONLY_FILE(frequency, 20, "%d",
DEBUGFS_READONLY_FILE(frequency, 20, "%d",
@@ -233,12 +228,7 @@ static const struct file_operations stats_ ##name## _ops = { \
};
};


#define DEBUGFS_STATS_ADD(name)						\
#define DEBUGFS_STATS_ADD(name)						\
	local->debugfs.stats.name = debugfs_create_file(#name, 0400, statsd,\
	debugfs_create_file(#name, 0400, statsd, local, &stats_ ##name## _ops);
		local, &stats_ ##name## _ops);

#define DEBUGFS_STATS_DEL(name)						\
	debugfs_remove(local->debugfs.stats.name);			\
	local->debugfs.stats.name = NULL;


DEBUGFS_STATS_FILE(transmitted_fragment_count, 20, "%u",
DEBUGFS_STATS_FILE(transmitted_fragment_count, 20, "%u",
		   local->dot11TransmittedFragmentCount);
		   local->dot11TransmittedFragmentCount);
@@ -326,7 +316,6 @@ void debugfs_hw_add(struct ieee80211_local *local)
	DEBUGFS_ADD(noack);
	DEBUGFS_ADD(noack);


	statsd = debugfs_create_dir("statistics", phyd);
	statsd = debugfs_create_dir("statistics", phyd);
	local->debugfs.statistics = statsd;


	/* if the dir failed, don't put all the other things into the root! */
	/* if the dir failed, don't put all the other things into the root! */
	if (!statsd)
	if (!statsd)
@@ -367,57 +356,3 @@ void debugfs_hw_add(struct ieee80211_local *local)
	DEBUGFS_STATS_ADD(dot11FCSErrorCount);
	DEBUGFS_STATS_ADD(dot11FCSErrorCount);
	DEBUGFS_STATS_ADD(dot11RTSSuccessCount);
	DEBUGFS_STATS_ADD(dot11RTSSuccessCount);
}
}

void debugfs_hw_del(struct ieee80211_local *local)
{
	DEBUGFS_DEL(frequency);
	DEBUGFS_DEL(total_ps_buffered);
	DEBUGFS_DEL(wep_iv);
	DEBUGFS_DEL(tsf);
	DEBUGFS_DEL(queues);
	DEBUGFS_DEL(reset);
	DEBUGFS_DEL(noack);

	DEBUGFS_STATS_DEL(transmitted_fragment_count);
	DEBUGFS_STATS_DEL(multicast_transmitted_frame_count);
	DEBUGFS_STATS_DEL(failed_count);
	DEBUGFS_STATS_DEL(retry_count);
	DEBUGFS_STATS_DEL(multiple_retry_count);
	DEBUGFS_STATS_DEL(frame_duplicate_count);
	DEBUGFS_STATS_DEL(received_fragment_count);
	DEBUGFS_STATS_DEL(multicast_received_frame_count);
	DEBUGFS_STATS_DEL(transmitted_frame_count);
	DEBUGFS_STATS_DEL(num_scans);
#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
	DEBUGFS_STATS_DEL(tx_handlers_drop);
	DEBUGFS_STATS_DEL(tx_handlers_queued);
	DEBUGFS_STATS_DEL(tx_handlers_drop_unencrypted);
	DEBUGFS_STATS_DEL(tx_handlers_drop_fragment);
	DEBUGFS_STATS_DEL(tx_handlers_drop_wep);
	DEBUGFS_STATS_DEL(tx_handlers_drop_not_assoc);
	DEBUGFS_STATS_DEL(tx_handlers_drop_unauth_port);
	DEBUGFS_STATS_DEL(rx_handlers_drop);
	DEBUGFS_STATS_DEL(rx_handlers_queued);
	DEBUGFS_STATS_DEL(rx_handlers_drop_nullfunc);
	DEBUGFS_STATS_DEL(rx_handlers_drop_defrag);
	DEBUGFS_STATS_DEL(rx_handlers_drop_short);
	DEBUGFS_STATS_DEL(rx_handlers_drop_passive_scan);
	DEBUGFS_STATS_DEL(tx_expand_skb_head);
	DEBUGFS_STATS_DEL(tx_expand_skb_head_cloned);
	DEBUGFS_STATS_DEL(rx_expand_skb_head);
	DEBUGFS_STATS_DEL(rx_expand_skb_head2);
	DEBUGFS_STATS_DEL(rx_handlers_fragments);
	DEBUGFS_STATS_DEL(tx_status_drop);
#endif
	DEBUGFS_STATS_DEL(dot11ACKFailureCount);
	DEBUGFS_STATS_DEL(dot11RTSFailureCount);
	DEBUGFS_STATS_DEL(dot11FCSErrorCount);
	DEBUGFS_STATS_DEL(dot11RTSSuccessCount);

	debugfs_remove(local->debugfs.statistics);
	local->debugfs.statistics = NULL;
	debugfs_remove(local->debugfs.stations);
	local->debugfs.stations = NULL;
	debugfs_remove(local->debugfs.keys);
	local->debugfs.keys = NULL;
}
+0 −2
Original line number Original line Diff line number Diff line
@@ -3,14 +3,12 @@


#ifdef CONFIG_MAC80211_DEBUGFS
#ifdef CONFIG_MAC80211_DEBUGFS
extern void debugfs_hw_add(struct ieee80211_local *local);
extern void debugfs_hw_add(struct ieee80211_local *local);
extern void debugfs_hw_del(struct ieee80211_local *local);
extern int mac80211_open_file_generic(struct inode *inode, struct file *file);
extern int mac80211_open_file_generic(struct inode *inode, struct file *file);
#else
#else
static inline void debugfs_hw_add(struct ieee80211_local *local)
static inline void debugfs_hw_add(struct ieee80211_local *local)
{
{
	return;
	return;
}
}
static inline void debugfs_hw_del(struct ieee80211_local *local) {}
#endif
#endif


#endif /* __MAC80211_DEBUGFS_H */
#endif /* __MAC80211_DEBUGFS_H */
+13 −31
Original line number Original line Diff line number Diff line
@@ -225,8 +225,8 @@ static ssize_t key_key_read(struct file *file, char __user *userbuf,
KEY_OPS(key);
KEY_OPS(key);


#define DEBUGFS_ADD(name) \
#define DEBUGFS_ADD(name) \
	key->debugfs.name = debugfs_create_file(#name, 0400,\
	debugfs_create_file(#name, 0400, key->debugfs.dir, \
				key->debugfs.dir, key, &key_##name##_ops);
			    key, &key_##name##_ops);


void ieee80211_debugfs_key_add(struct ieee80211_key *key)
void ieee80211_debugfs_key_add(struct ieee80211_key *key)
  {
  {
@@ -271,30 +271,12 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
	DEBUGFS_ADD(ifindex);
	DEBUGFS_ADD(ifindex);
};
};


#define DEBUGFS_DEL(name) \
	debugfs_remove(key->debugfs.name); key->debugfs.name = NULL;

void ieee80211_debugfs_key_remove(struct ieee80211_key *key)
void ieee80211_debugfs_key_remove(struct ieee80211_key *key)
{
{
	if (!key)
	if (!key)
		return;
		return;


	DEBUGFS_DEL(keylen);
	debugfs_remove_recursive(key->debugfs.dir);
	DEBUGFS_DEL(flags);
	DEBUGFS_DEL(keyidx);
	DEBUGFS_DEL(hw_key_idx);
	DEBUGFS_DEL(tx_rx_count);
	DEBUGFS_DEL(algorithm);
	DEBUGFS_DEL(tx_spec);
	DEBUGFS_DEL(rx_spec);
	DEBUGFS_DEL(replays);
	DEBUGFS_DEL(icverrors);
	DEBUGFS_DEL(key);
	DEBUGFS_DEL(ifindex);

	debugfs_remove(key->debugfs.stalink);
	key->debugfs.stalink = NULL;
	debugfs_remove(key->debugfs.dir);
	key->debugfs.dir = NULL;
	key->debugfs.dir = NULL;
}
}
void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
@@ -302,7 +284,7 @@ void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
	char buf[50];
	char buf[50];
	struct ieee80211_key *key;
	struct ieee80211_key *key;


	if (!sdata->debugfsdir)
	if (!sdata->debugfs.dir)
		return;
		return;


	/* this is running under the key lock */
	/* this is running under the key lock */
@@ -310,9 +292,9 @@ void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
	key = sdata->default_key;
	key = sdata->default_key;
	if (key) {
	if (key) {
		sprintf(buf, "../keys/%d", key->debugfs.cnt);
		sprintf(buf, "../keys/%d", key->debugfs.cnt);
		sdata->common_debugfs.default_key =
		sdata->debugfs.default_key =
			debugfs_create_symlink("default_key",
			debugfs_create_symlink("default_key",
					       sdata->debugfsdir, buf);
					       sdata->debugfs.dir, buf);
	} else
	} else
		ieee80211_debugfs_key_remove_default(sdata);
		ieee80211_debugfs_key_remove_default(sdata);
}
}
@@ -322,8 +304,8 @@ void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata)
	if (!sdata)
	if (!sdata)
		return;
		return;


	debugfs_remove(sdata->common_debugfs.default_key);
	debugfs_remove(sdata->debugfs.default_key);
	sdata->common_debugfs.default_key = NULL;
	sdata->debugfs.default_key = NULL;
}
}


void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata)
void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata)
@@ -331,7 +313,7 @@ void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata)
	char buf[50];
	char buf[50];
	struct ieee80211_key *key;
	struct ieee80211_key *key;


	if (!sdata->debugfsdir)
	if (!sdata->debugfs.dir)
		return;
		return;


	/* this is running under the key lock */
	/* this is running under the key lock */
@@ -339,9 +321,9 @@ void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata)
	key = sdata->default_mgmt_key;
	key = sdata->default_mgmt_key;
	if (key) {
	if (key) {
		sprintf(buf, "../keys/%d", key->debugfs.cnt);
		sprintf(buf, "../keys/%d", key->debugfs.cnt);
		sdata->common_debugfs.default_mgmt_key =
		sdata->debugfs.default_mgmt_key =
			debugfs_create_symlink("default_mgmt_key",
			debugfs_create_symlink("default_mgmt_key",
					       sdata->debugfsdir, buf);
					       sdata->debugfs.dir, buf);
	} else
	} else
		ieee80211_debugfs_key_remove_mgmt_default(sdata);
		ieee80211_debugfs_key_remove_mgmt_default(sdata);
}
}
@@ -351,8 +333,8 @@ void ieee80211_debugfs_key_remove_mgmt_default(struct ieee80211_sub_if_data *sda
	if (!sdata)
	if (!sdata)
		return;
		return;


	debugfs_remove(sdata->common_debugfs.default_mgmt_key);
	debugfs_remove(sdata->debugfs.default_mgmt_key);
	sdata->common_debugfs.default_mgmt_key = NULL;
	sdata->debugfs.default_mgmt_key = NULL;
}
}


void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key,
void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key,
+26 −148
Original line number Original line Diff line number Diff line
@@ -153,8 +153,8 @@ IEEE80211_IF_FILE(min_discovery_timeout,




#define DEBUGFS_ADD(name, type) \
#define DEBUGFS_ADD(name, type) \
	sdata->debugfs.type.name = debugfs_create_file(#name, 0400,\
	debugfs_create_file(#name, 0400, sdata->debugfs.dir, \
		sdata->debugfsdir, sdata, &name##_ops);
			    sdata, &name##_ops);


static void add_sta_files(struct ieee80211_sub_if_data *sdata)
static void add_sta_files(struct ieee80211_sub_if_data *sdata)
{
{
@@ -199,30 +199,32 @@ static void add_monitor_files(struct ieee80211_sub_if_data *sdata)
}
}


#ifdef CONFIG_MAC80211_MESH
#ifdef CONFIG_MAC80211_MESH
#define MESHSTATS_ADD(name)\
	sdata->mesh_stats.name = debugfs_create_file(#name, 0400,\
		sdata->mesh_stats_dir, sdata, &name##_ops);


static void add_mesh_stats(struct ieee80211_sub_if_data *sdata)
static void add_mesh_stats(struct ieee80211_sub_if_data *sdata)
{
{
	sdata->mesh_stats_dir = debugfs_create_dir("mesh_stats",
	struct dentry *dir = debugfs_create_dir("mesh_stats",
				sdata->debugfsdir);
						sdata->debugfs.dir);

#define MESHSTATS_ADD(name)\
	debugfs_create_file(#name, 0400, dir, sdata, &name##_ops);

	MESHSTATS_ADD(fwded_mcast);
	MESHSTATS_ADD(fwded_mcast);
	MESHSTATS_ADD(fwded_unicast);
	MESHSTATS_ADD(fwded_unicast);
	MESHSTATS_ADD(fwded_frames);
	MESHSTATS_ADD(fwded_frames);
	MESHSTATS_ADD(dropped_frames_ttl);
	MESHSTATS_ADD(dropped_frames_ttl);
	MESHSTATS_ADD(dropped_frames_no_route);
	MESHSTATS_ADD(dropped_frames_no_route);
	MESHSTATS_ADD(estab_plinks);
	MESHSTATS_ADD(estab_plinks);
#undef MESHSTATS_ADD
}
}


#define MESHPARAMS_ADD(name)\
	sdata->mesh_config.name = debugfs_create_file(#name, 0600,\
		sdata->mesh_config_dir, sdata, &name##_ops);

static void add_mesh_config(struct ieee80211_sub_if_data *sdata)
static void add_mesh_config(struct ieee80211_sub_if_data *sdata)
{
{
	sdata->mesh_config_dir = debugfs_create_dir("mesh_config",
	struct dentry *dir = debugfs_create_dir("mesh_config",
				sdata->debugfsdir);
						sdata->debugfs.dir);

#define MESHPARAMS_ADD(name) \
	debugfs_create_file(#name, 0600, dir, sdata, &name##_ops);

	MESHPARAMS_ADD(dot11MeshMaxRetries);
	MESHPARAMS_ADD(dot11MeshMaxRetries);
	MESHPARAMS_ADD(dot11MeshRetryTimeout);
	MESHPARAMS_ADD(dot11MeshRetryTimeout);
	MESHPARAMS_ADD(dot11MeshConfirmTimeout);
	MESHPARAMS_ADD(dot11MeshConfirmTimeout);
@@ -236,12 +238,14 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata)
	MESHPARAMS_ADD(dot11MeshHWMPmaxPREQretries);
	MESHPARAMS_ADD(dot11MeshHWMPmaxPREQretries);
	MESHPARAMS_ADD(path_refresh_time);
	MESHPARAMS_ADD(path_refresh_time);
	MESHPARAMS_ADD(min_discovery_timeout);
	MESHPARAMS_ADD(min_discovery_timeout);

#undef MESHPARAMS_ADD
}
}
#endif
#endif


static void add_files(struct ieee80211_sub_if_data *sdata)
static void add_files(struct ieee80211_sub_if_data *sdata)
{
{
	if (!sdata->debugfsdir)
	if (!sdata->debugfs.dir)
		return;
		return;


	switch (sdata->vif.type) {
	switch (sdata->vif.type) {
@@ -274,134 +278,6 @@ static void add_files(struct ieee80211_sub_if_data *sdata)
	}
	}
}
}


#define DEBUGFS_DEL(name, type)					\
	do {							\
		debugfs_remove(sdata->debugfs.type.name);	\
		sdata->debugfs.type.name = NULL;		\
	} while (0)

static void del_sta_files(struct ieee80211_sub_if_data *sdata)
{
	DEBUGFS_DEL(drop_unencrypted, sta);
	DEBUGFS_DEL(force_unicast_rateidx, sta);
	DEBUGFS_DEL(max_ratectrl_rateidx, sta);

	DEBUGFS_DEL(bssid, sta);
	DEBUGFS_DEL(aid, sta);
	DEBUGFS_DEL(capab, sta);
}

static void del_ap_files(struct ieee80211_sub_if_data *sdata)
{
	DEBUGFS_DEL(drop_unencrypted, ap);
	DEBUGFS_DEL(force_unicast_rateidx, ap);
	DEBUGFS_DEL(max_ratectrl_rateidx, ap);

	DEBUGFS_DEL(num_sta_ps, ap);
	DEBUGFS_DEL(dtim_count, ap);
	DEBUGFS_DEL(num_buffered_multicast, ap);
}

static void del_wds_files(struct ieee80211_sub_if_data *sdata)
{
	DEBUGFS_DEL(drop_unencrypted, wds);
	DEBUGFS_DEL(force_unicast_rateidx, wds);
	DEBUGFS_DEL(max_ratectrl_rateidx, wds);

	DEBUGFS_DEL(peer, wds);
}

static void del_vlan_files(struct ieee80211_sub_if_data *sdata)
{
	DEBUGFS_DEL(drop_unencrypted, vlan);
	DEBUGFS_DEL(force_unicast_rateidx, vlan);
	DEBUGFS_DEL(max_ratectrl_rateidx, vlan);
}

static void del_monitor_files(struct ieee80211_sub_if_data *sdata)
{
}

#ifdef CONFIG_MAC80211_MESH
#define MESHSTATS_DEL(name)			\
	do {						\
		debugfs_remove(sdata->mesh_stats.name);	\
		sdata->mesh_stats.name = NULL;		\
	} while (0)

static void del_mesh_stats(struct ieee80211_sub_if_data *sdata)
{
	MESHSTATS_DEL(fwded_mcast);
	MESHSTATS_DEL(fwded_unicast);
	MESHSTATS_DEL(fwded_frames);
	MESHSTATS_DEL(dropped_frames_ttl);
	MESHSTATS_DEL(dropped_frames_no_route);
	MESHSTATS_DEL(estab_plinks);
	debugfs_remove(sdata->mesh_stats_dir);
	sdata->mesh_stats_dir = NULL;
}

#define MESHPARAMS_DEL(name)			\
	do {						\
		debugfs_remove(sdata->mesh_config.name);	\
		sdata->mesh_config.name = NULL;		\
	} while (0)

static void del_mesh_config(struct ieee80211_sub_if_data *sdata)
{
	MESHPARAMS_DEL(dot11MeshMaxRetries);
	MESHPARAMS_DEL(dot11MeshRetryTimeout);
	MESHPARAMS_DEL(dot11MeshConfirmTimeout);
	MESHPARAMS_DEL(dot11MeshHoldingTimeout);
	MESHPARAMS_DEL(dot11MeshTTL);
	MESHPARAMS_DEL(auto_open_plinks);
	MESHPARAMS_DEL(dot11MeshMaxPeerLinks);
	MESHPARAMS_DEL(dot11MeshHWMPactivePathTimeout);
	MESHPARAMS_DEL(dot11MeshHWMPpreqMinInterval);
	MESHPARAMS_DEL(dot11MeshHWMPnetDiameterTraversalTime);
	MESHPARAMS_DEL(dot11MeshHWMPmaxPREQretries);
	MESHPARAMS_DEL(path_refresh_time);
	MESHPARAMS_DEL(min_discovery_timeout);
	debugfs_remove(sdata->mesh_config_dir);
	sdata->mesh_config_dir = NULL;
}
#endif

static void del_files(struct ieee80211_sub_if_data *sdata)
{
	if (!sdata->debugfsdir)
		return;

	switch (sdata->vif.type) {
	case NL80211_IFTYPE_MESH_POINT:
#ifdef CONFIG_MAC80211_MESH
		del_mesh_stats(sdata);
		del_mesh_config(sdata);
#endif
		break;
	case NL80211_IFTYPE_STATION:
		del_sta_files(sdata);
		break;
	case NL80211_IFTYPE_ADHOC:
		/* XXX */
		break;
	case NL80211_IFTYPE_AP:
		del_ap_files(sdata);
		break;
	case NL80211_IFTYPE_WDS:
		del_wds_files(sdata);
		break;
	case NL80211_IFTYPE_MONITOR:
		del_monitor_files(sdata);
		break;
	case NL80211_IFTYPE_AP_VLAN:
		del_vlan_files(sdata);
		break;
	default:
		break;
	}
}

static int notif_registered;
static int notif_registered;


void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata)
void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata)
@@ -412,16 +288,18 @@ void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata)
		return;
		return;


	sprintf(buf, "netdev:%s", sdata->dev->name);
	sprintf(buf, "netdev:%s", sdata->dev->name);
	sdata->debugfsdir = debugfs_create_dir(buf,
	sdata->debugfs.dir = debugfs_create_dir(buf,
		sdata->local->hw.wiphy->debugfsdir);
		sdata->local->hw.wiphy->debugfsdir);
	add_files(sdata);
	add_files(sdata);
}
}


void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata)
void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata)
{
{
	del_files(sdata);
	if (!sdata->debugfs.dir)
	debugfs_remove(sdata->debugfsdir);
		return;
	sdata->debugfsdir = NULL;

	debugfs_remove_recursive(sdata->debugfs.dir);
	sdata->debugfs.dir = NULL;
}
}


static int netdev_notify(struct notifier_block *nb,
static int netdev_notify(struct notifier_block *nb,
@@ -444,7 +322,7 @@ static int netdev_notify(struct notifier_block *nb,


	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
	sdata = IEEE80211_DEV_TO_SUB_IF(dev);


	dir = sdata->debugfsdir;
	dir = sdata->debugfs.dir;


	if (!dir)
	if (!dir)
		return 0;
		return 0;
+2 −29
Original line number Original line Diff line number Diff line
@@ -158,13 +158,9 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf,
STA_OPS(agg_status);
STA_OPS(agg_status);


#define DEBUGFS_ADD(name) \
#define DEBUGFS_ADD(name) \
	sta->debugfs.name = debugfs_create_file(#name, 0400, \
	debugfs_create_file(#name, 0400, \
		sta->debugfs.dir, sta, &sta_ ##name## _ops);
		sta->debugfs.dir, sta, &sta_ ##name## _ops);


#define DEBUGFS_DEL(name) \
	debugfs_remove(sta->debugfs.name);\
	sta->debugfs.name = NULL;



void ieee80211_sta_debugfs_add(struct sta_info *sta)
void ieee80211_sta_debugfs_add(struct sta_info *sta)
{
{
@@ -216,29 +212,6 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)


void ieee80211_sta_debugfs_remove(struct sta_info *sta)
void ieee80211_sta_debugfs_remove(struct sta_info *sta)
{
{
	DEBUGFS_DEL(flags);
	debugfs_remove_recursive(sta->debugfs.dir);
	DEBUGFS_DEL(num_ps_buf_frames);
	DEBUGFS_DEL(inactive_ms);
	DEBUGFS_DEL(last_seq_ctrl);
	DEBUGFS_DEL(agg_status);
	DEBUGFS_DEL(aid);
	DEBUGFS_DEL(dev);
	DEBUGFS_DEL(rx_packets);
	DEBUGFS_DEL(tx_packets);
	DEBUGFS_DEL(rx_bytes);
	DEBUGFS_DEL(tx_bytes);
	DEBUGFS_DEL(rx_duplicates);
	DEBUGFS_DEL(rx_fragments);
	DEBUGFS_DEL(rx_dropped);
	DEBUGFS_DEL(tx_fragments);
	DEBUGFS_DEL(tx_filtered);
	DEBUGFS_DEL(tx_retry_failed);
	DEBUGFS_DEL(tx_retry_count);
	DEBUGFS_DEL(last_signal);
	DEBUGFS_DEL(last_qual);
	DEBUGFS_DEL(last_noise);
	DEBUGFS_DEL(wep_weak_iv_count);

	debugfs_remove(sta->debugfs.dir);
	sta->debugfs.dir = NULL;
	sta->debugfs.dir = NULL;
}
}
Loading