mac80211: add vif debugfs driver callbacks

Add debugfs driver callbacks so drivers can add
debugfs entries for interfaces. Note that they
_must_ remove the entries again as add/remove in
the driver doesn't correspond to add/remove in
debugfs; the former is up/down while the latter
is netdev create/destroy.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Alexander Bondar
2012-12-22 10:43:33 +02:00
committed by Johannes Berg
parent 776b358017
commit b207cdb07f
3 changed files with 59 additions and 0 deletions

View File

@@ -528,6 +528,43 @@ static inline void drv_sta_remove_debugfs(struct ieee80211_local *local,
local->ops->sta_remove_debugfs(&local->hw, &sdata->vif,
sta, dir);
}
static inline
void drv_add_interface_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{
might_sleep();
check_sdata_in_driver(sdata);
if (!local->ops->add_interface_debugfs)
return;
local->ops->add_interface_debugfs(&local->hw, &sdata->vif,
sdata->debugfs.dir);
}
static inline
void drv_remove_interface_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{
might_sleep();
check_sdata_in_driver(sdata);
if (!local->ops->remove_interface_debugfs)
return;
local->ops->remove_interface_debugfs(&local->hw, &sdata->vif,
sdata->debugfs.dir);
}
#else
static inline
void drv_add_interface_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata) {}
static inline
void drv_remove_interface_debugfs(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata) {}
#endif
static inline __must_check