summaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorAyala Beker <ayala.beker@intel.com>2015-10-23 04:20:06 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-11-03 05:20:29 -0500
commite4208427247ecc7306c8f71ab3c5c08e08cf9fda (patch)
tree9849cbeb4072a17d47bb345303ec6901842387a0 /net/wireless/nl80211.c
parentdcae9e0203dfd887a7413cd38d1f87aaac1127f4 (diff)
cfg80211: allow AID/listen interval changes for unassociated station
Currently, cfg80211 rejects updates of AID and listen interval parameters for existing entries. This information is known only at association stage and as a result it's impossible to update entries that were added unassociated. Fix this by allowing updates of these properies for stations that the driver (or mac80211) assigned unassociated state. This then fixes mac80211's use of NL80211_FEATURE_FULL_AP_CLIENT_STATE. Signed-off-by: Ayala Beker <ayala.beker@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 40ef5d604eb4..c71e274c810a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3968,10 +3968,13 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
3968 struct station_parameters *params, 3968 struct station_parameters *params,
3969 enum cfg80211_station_type statype) 3969 enum cfg80211_station_type statype)
3970{ 3970{
3971 if (params->listen_interval != -1) 3971 if (params->listen_interval != -1 &&
3972 statype != CFG80211_STA_AP_CLIENT_UNASSOC)
3972 return -EINVAL; 3973 return -EINVAL;
3974
3973 if (params->aid && 3975 if (params->aid &&
3974 !(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))) 3976 !(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) &&
3977 statype != CFG80211_STA_AP_CLIENT_UNASSOC)
3975 return -EINVAL; 3978 return -EINVAL;
3976 3979
3977 /* When you run into this, adjust the code below for the new flag */ 3980 /* When you run into this, adjust the code below for the new flag */
@@ -4245,13 +4248,22 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
4245 4248
4246 memset(&params, 0, sizeof(params)); 4249 memset(&params, 0, sizeof(params));
4247 4250
4248 params.listen_interval = -1;
4249
4250 if (!rdev->ops->change_station) 4251 if (!rdev->ops->change_station)
4251 return -EOPNOTSUPP; 4252 return -EOPNOTSUPP;
4252 4253
4253 if (info->attrs[NL80211_ATTR_STA_AID]) 4254 /*
4254 return -EINVAL; 4255 * AID and listen_interval properties can be set only for unassociated
4256 * station. Include these parameters here and will check them in
4257 * cfg80211_check_station_change().
4258 */
4259 if (info->attrs[NL80211_ATTR_PEER_AID])
4260 params.aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]);
4261
4262 if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL])
4263 params.listen_interval =
4264 nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]);
4265 else
4266 params.listen_interval = -1;
4255 4267
4256 if (!info->attrs[NL80211_ATTR_MAC]) 4268 if (!info->attrs[NL80211_ATTR_MAC])
4257 return -EINVAL; 4269 return -EINVAL;
@@ -4278,9 +4290,6 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
4278 nla_len(info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]); 4290 nla_len(info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]);
4279 } 4291 }
4280 4292
4281 if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL])
4282 return -EINVAL;
4283
4284 if (parse_station_flags(info, dev->ieee80211_ptr->iftype, &params)) 4293 if (parse_station_flags(info, dev->ieee80211_ptr->iftype, &params))
4285 return -EINVAL; 4294 return -EINVAL;
4286 4295