aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 57ecfa4ad3b8..bddb5595c659 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2545,6 +2545,12 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
2545 return err; 2545 return err;
2546} 2546}
2547 2547
2548static struct nla_policy
2549nl80211_sta_wme_policy[NL80211_STA_WME_MAX + 1] __read_mostly = {
2550 [NL80211_STA_WME_UAPSD_QUEUES] = { .type = NLA_U8 },
2551 [NL80211_STA_WME_MAX_SP] = { .type = NLA_U8 },
2552};
2553
2548static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) 2554static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
2549{ 2555{
2550 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 2556 struct cfg80211_registered_device *rdev = info->user_ptr[0];
@@ -2590,6 +2596,27 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
2590 if (parse_station_flags(info, &params)) 2596 if (parse_station_flags(info, &params))
2591 return -EINVAL; 2597 return -EINVAL;
2592 2598
2599 /* parse WME attributes if sta is WME capable */
2600 if ((params.sta_flags_set & NL80211_STA_FLAG_WME) &&
2601 info->attrs[NL80211_ATTR_STA_WME]) {
2602 struct nlattr *tb[NL80211_STA_WME_MAX + 1];
2603 struct nlattr *nla;
2604
2605 nla = info->attrs[NL80211_ATTR_STA_WME];
2606 err = nla_parse_nested(tb, NL80211_STA_WME_MAX, nla,
2607 nl80211_sta_wme_policy);
2608 if (err)
2609 return err;
2610
2611 if (tb[NL80211_STA_WME_UAPSD_QUEUES])
2612 params.uapsd_queues =
2613 nla_get_u8(tb[NL80211_STA_WME_UAPSD_QUEUES]);
2614
2615 if (tb[NL80211_STA_WME_MAX_SP])
2616 params.max_sp =
2617 nla_get_u8(tb[NL80211_STA_WME_MAX_SP]);
2618 }
2619
2593 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && 2620 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
2594 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && 2621 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN &&
2595 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT && 2622 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT &&