Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352654
b: refs/heads/master
c: b207cdb
h: refs/heads/master
v: v3
  • Loading branch information
Alexander Bondar authored and Johannes Berg committed Feb 11, 2013
1 parent 1189887 commit b4292d8
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 776b3580178f2065838fa0db0eb7a41b57495c0a
refs/heads/master: b207cdb07f3f01ec1adaac62e9d0cc918c60a81a
18 changes: 18 additions & 0 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2167,6 +2167,18 @@ enum ieee80211_rate_control_changed {
* MAC address of the device going away.
* Hence, this callback must be implemented. It can sleep.
*
* @add_interface_debugfs: Drivers can use this callback to add debugfs files
* when a vif is added to mac80211. This callback and
* @remove_interface_debugfs should be within a CONFIG_MAC80211_DEBUGFS
* conditional. @remove_interface_debugfs must be provided for cleanup.
* This callback can sleep.
*
* @remove_interface_debugfs: Remove the debugfs files which were added using
* @add_interface_debugfs. This callback must remove all debugfs entries
* that were added because mac80211 only removes interface debugfs when the
* interface is destroyed, not when it is removed from the driver.
* This callback can sleep.
*
* @config: Handler for configuration requests. IEEE 802.11 code calls this
* function to change hardware configuration, e.g., channel.
* This function should never fail but returns a negative error code
Expand Down Expand Up @@ -2580,6 +2592,12 @@ struct ieee80211_ops {
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct dentry *dir);
void (*add_interface_debugfs)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct dentry *dir);
void (*remove_interface_debugfs)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct dentry *dir);
#endif
void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
enum sta_notify_cmd, struct ieee80211_sta *sta);
Expand Down
37 changes: 37 additions & 0 deletions trunk/net/mac80211/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions trunk/net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
goto err_del_interface;
}

drv_add_interface_debugfs(local, sdata);

if (sdata->vif.type == NL80211_IFTYPE_AP) {
local->fif_pspoll++;
local->fif_probe_req++;
Expand Down Expand Up @@ -882,6 +884,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
*/
ieee80211_free_keys(sdata);

drv_remove_interface_debugfs(local, sdata);

if (going_down)
drv_remove_interface(local, sdata);
}
Expand Down

0 comments on commit b4292d8

Please sign in to comment.