mac80211: revamp virtual interface handling
This patch revamps the virtual interface handling and makes the code much easier to follow. Fewer functions, better names, less spaghetti code. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
3e122be089
commit
75636525fb
@@ -476,12 +476,12 @@ static void del_mesh_config(struct ieee80211_sub_if_data *sdata)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void del_files(struct ieee80211_sub_if_data *sdata, int type)
|
||||
static void del_files(struct ieee80211_sub_if_data *sdata)
|
||||
{
|
||||
if (!sdata->debugfsdir)
|
||||
return;
|
||||
|
||||
switch (type) {
|
||||
switch (sdata->vif.type) {
|
||||
case IEEE80211_IF_TYPE_MESH_POINT:
|
||||
#ifdef CONFIG_MAC80211_MESH
|
||||
del_mesh_stats(sdata);
|
||||
@@ -521,22 +521,16 @@ void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata)
|
||||
sprintf(buf, "netdev:%s", sdata->dev->name);
|
||||
sdata->debugfsdir = debugfs_create_dir(buf,
|
||||
sdata->local->hw.wiphy->debugfsdir);
|
||||
add_files(sdata);
|
||||
}
|
||||
|
||||
void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata)
|
||||
{
|
||||
del_files(sdata, sdata->vif.type);
|
||||
del_files(sdata);
|
||||
debugfs_remove(sdata->debugfsdir);
|
||||
sdata->debugfsdir = NULL;
|
||||
}
|
||||
|
||||
void ieee80211_debugfs_change_if_type(struct ieee80211_sub_if_data *sdata,
|
||||
int oldtype)
|
||||
{
|
||||
del_files(sdata, oldtype);
|
||||
add_files(sdata);
|
||||
}
|
||||
|
||||
static int netdev_notify(struct notifier_block *nb,
|
||||
unsigned long state,
|
||||
void *ndev)
|
||||
|
Reference in New Issue
Block a user