diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-04-12 11:23:28 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-04-13 13:41:38 +0200 |
commit | 818a986e4ebacea2020622e48c8bc04b7f500d89 (patch) | |
tree | fd2c14201f014bf4f4598d61a98e0ae25a4be6f3 /net/mac80211 | |
parent | 8c5e68894450d3bb7471e426e2eec9a8472bb660 (diff) |
cfg80211: move add/change interface monitor flags into params
Instead passing both flags, which can be NULL, and vif_params,
which are never NULL, move the flags into the vif_params and
use BIT(0), which is invalid from userspace, to indicate that
the flags were changed.
While updating all drivers, fix a small bug in wil6210 where
it was setting the flags to 0 instead of leaving them unchanged.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index e276b8cb24a4..5c16d23e28dd 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -69,7 +69,6 @@ static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, const char *name, unsigned char name_assign_type, enum nl80211_iftype type, - u32 *flags, struct vif_params *params) { struct ieee80211_local *local = wiphy_priv(wiphy); @@ -90,8 +89,7 @@ static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, return NULL; } - if (flags) - sdata->u.mntr.flags = *flags; + sdata->u.mntr.flags = params->flags; } return wdev; @@ -106,7 +104,7 @@ static int ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev) static int ieee80211_change_iface(struct wiphy *wiphy, struct net_device *dev, - enum nl80211_iftype type, u32 *flags, + enum nl80211_iftype type, struct vif_params *params) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); @@ -133,7 +131,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, if (err) return err; - if (!flags) + if (!params->flags) return 0; if (ieee80211_sdata_running(sdata)) { @@ -149,11 +147,12 @@ static int ieee80211_change_iface(struct wiphy *wiphy, * cooked_mntrs, monitor and all fif_* counters * reconfigure hardware */ - if ((*flags & mask) != (sdata->u.mntr.flags & mask)) + if ((params->flags & mask) != + (sdata->u.mntr.flags & mask)) return -EBUSY; ieee80211_adjust_monitor_flags(sdata, -1); - sdata->u.mntr.flags = *flags; + sdata->u.mntr.flags = params->flags; ieee80211_adjust_monitor_flags(sdata, 1); ieee80211_configure_filter(local); @@ -163,7 +162,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, * and ieee80211_do_open take care of "everything" * mentioned in the comment above. */ - sdata->u.mntr.flags = *flags; + sdata->u.mntr.flags = params->flags; } } |