]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/wireless/nl80211.c
Merge remote-tracking branch 'arm-soc/for-next'
[karo-tx-linux.git] / net / wireless / nl80211.c
index d693c9d031fc8c9869277e2ff758f05353e22a1a..c71e274c810ac6610df652ec029838000ee7c69d 100644 (file)
@@ -3432,12 +3432,6 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
                                           wdev->iftype))
                return -EINVAL;
 
-       if (info->attrs[NL80211_ATTR_ACL_POLICY]) {
-               params.acl = parse_acl_data(&rdev->wiphy, info);
-               if (IS_ERR(params.acl))
-                       return PTR_ERR(params.acl);
-       }
-
        if (info->attrs[NL80211_ATTR_SMPS_MODE]) {
                params.smps_mode =
                        nla_get_u8(info->attrs[NL80211_ATTR_SMPS_MODE]);
@@ -3461,6 +3455,12 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
                params.smps_mode = NL80211_SMPS_OFF;
        }
 
+       if (info->attrs[NL80211_ATTR_ACL_POLICY]) {
+               params.acl = parse_acl_data(&rdev->wiphy, info);
+               if (IS_ERR(params.acl))
+                       return PTR_ERR(params.acl);
+       }
+
        wdev_lock(wdev);
        err = rdev_start_ap(rdev, dev, &params);
        if (!err) {
@@ -3968,10 +3968,13 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
                                  struct station_parameters *params,
                                  enum cfg80211_station_type statype)
 {
-       if (params->listen_interval != -1)
+       if (params->listen_interval != -1 &&
+           statype != CFG80211_STA_AP_CLIENT_UNASSOC)
                return -EINVAL;
+
        if (params->aid &&
-           !(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)))
+           !(params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) &&
+           statype != CFG80211_STA_AP_CLIENT_UNASSOC)
                return -EINVAL;
 
        /* 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)
 
        memset(&params, 0, sizeof(params));
 
-       params.listen_interval = -1;
-
        if (!rdev->ops->change_station)
                return -EOPNOTSUPP;
 
-       if (info->attrs[NL80211_ATTR_STA_AID])
-               return -EINVAL;
+       /*
+        * AID and listen_interval properties can be set only for unassociated
+        * station. Include these parameters here and will check them in
+        * cfg80211_check_station_change().
+        */
+       if (info->attrs[NL80211_ATTR_PEER_AID])
+               params.aid = nla_get_u16(info->attrs[NL80211_ATTR_PEER_AID]);
+
+       if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL])
+               params.listen_interval =
+                    nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]);
+       else
+               params.listen_interval = -1;
 
        if (!info->attrs[NL80211_ATTR_MAC])
                return -EINVAL;
@@ -4278,9 +4290,6 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
                        nla_len(info->attrs[NL80211_ATTR_STA_EXT_CAPABILITY]);
        }
 
-       if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL])
-               return -EINVAL;
-
        if (parse_station_flags(info, dev->ieee80211_ptr->iftype, &params))
                return -EINVAL;