Commit 3b9ce80c authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

cfg80211/mac80211: apply station uAPSD parameters selectively

Currently, when hostapd sets the station as authorized
we also overwrite its uAPSD parameter. This obviously
leads to buggy behaviour (later, with my patches that
actually add uAPSD support). To fix this, only apply
those parameters if they were actually set in nl80211,
and to achieve that add a bitmap of things to apply.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ffca2871
...@@ -423,6 +423,17 @@ enum plink_actions { ...@@ -423,6 +423,17 @@ enum plink_actions {
PLINK_ACTION_BLOCK, PLINK_ACTION_BLOCK,
}; };
/**
* enum station_parameters_apply_mask - station parameter values to apply
* @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
*
* Not all station parameters have in-band "no change" signalling,
* for those that don't these flags will are used.
*/
enum station_parameters_apply_mask {
STATION_PARAM_APPLY_UAPSD = BIT(0),
};
/** /**
* struct station_parameters - station parameters * struct station_parameters - station parameters
* *
...@@ -450,6 +461,7 @@ struct station_parameters { ...@@ -450,6 +461,7 @@ struct station_parameters {
u8 *supported_rates; u8 *supported_rates;
struct net_device *vlan; struct net_device *vlan;
u32 sta_flags_mask, sta_flags_set; u32 sta_flags_mask, sta_flags_set;
u32 sta_modify_mask;
int listen_interval; int listen_interval;
u16 aid; u16 aid;
u8 supported_rates_len; u8 supported_rates_len;
......
...@@ -714,8 +714,10 @@ static void sta_apply_parameters(struct ieee80211_local *local, ...@@ -714,8 +714,10 @@ static void sta_apply_parameters(struct ieee80211_local *local,
} }
spin_unlock_irqrestore(&sta->flaglock, flags); spin_unlock_irqrestore(&sta->flaglock, flags);
sta->sta.uapsd_queues = params->uapsd_queues; if (params->sta_modify_mask & STATION_PARAM_APPLY_UAPSD) {
sta->sta.max_sp = params->max_sp; sta->sta.uapsd_queues = params->uapsd_queues;
sta->sta.max_sp = params->max_sp;
}
/* /*
* cfg80211 validates this (1-2007) and allows setting the AID * cfg80211 validates this (1-2007) and allows setting the AID
......
...@@ -2643,6 +2643,8 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) ...@@ -2643,6 +2643,8 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
if (params.max_sp & ~IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK) if (params.max_sp & ~IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK)
return -EINVAL; return -EINVAL;
params.sta_modify_mask |= STATION_PARAM_APPLY_UAPSD;
} }
if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment