aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-14 18:48:33 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-03-06 10:35:40 -0500
commit77ee7c891a04c3d254711ddf1bde5d7381339fb3 (patch)
tree0983da0e1067bcf1c4b34ffd6bc8a0fb97eb5dfd /drivers/net/wireless/ath/ath6kl
parentff276691e9f13bc1619cc8f091fb887c2b4f98a1 (diff)
cfg80211: comprehensively check station changes
The station change API isn't being checked properly before drivers are called, and as a result it is difficult to see what should be allowed and what not. In order to comprehensively check the API parameters parse everything first, and then have the driver call a function (cfg80211_check_station_change()) with the additionally information about the kind of station that is being changed; this allows the function to make better decisions than the old code could. While at it, also add a few checks, particularly in mesh and clarify the TDLS station lifetime in documentation. To be able to reduce a few checks, ignore any flag set bits when the mask isn't set, they shouldn't be applied then. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 752ffc4f4166..28c413f861a2 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2990,13 +2990,15 @@ static int ath6kl_change_station(struct wiphy *wiphy, struct net_device *dev,
2990{ 2990{
2991 struct ath6kl *ar = ath6kl_priv(dev); 2991 struct ath6kl *ar = ath6kl_priv(dev);
2992 struct ath6kl_vif *vif = netdev_priv(dev); 2992 struct ath6kl_vif *vif = netdev_priv(dev);
2993 int err;
2993 2994
2994 if (vif->nw_type != AP_NETWORK) 2995 if (vif->nw_type != AP_NETWORK)
2995 return -EOPNOTSUPP; 2996 return -EOPNOTSUPP;
2996 2997
2997 /* Use this only for authorizing/unauthorizing a station */ 2998 err = cfg80211_check_station_change(wiphy, params,
2998 if (!(params->sta_flags_mask & BIT(NL80211_STA_FLAG_AUTHORIZED))) 2999 CFG80211_STA_AP_MLME_CLIENT);
2999 return -EOPNOTSUPP; 3000 if (err)
3001 return err;
3000 3002
3001 if (params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED)) 3003 if (params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED))
3002 return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, 3004 return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx,