aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-08-31 04:29:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-13 15:50:56 -0400
commitcedb5412baeffd7326fc4869aa996d7f68d98ebb (patch)
tree6b5f5c0c034e508b0bff1f7d52cf1aabde5fad3b
parent4690c33df6be8bf78a0d5fe58baae33462b0bc1f (diff)
nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag
add WIPHY_FLAG_AP_UAPSD flag to indicate uapsd support on AP mode. Advertise it to userspace by including a new NL80211_ATTR_SUPPORT_AP_UAPSD attribute. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/linux/nl80211.h3
-rw-r--r--include/net/cfg80211.h2
-rw-r--r--net/wireless/nl80211.c5
3 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index f2d75e3ceb43..387e6e220502 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1044,6 +1044,8 @@ enum nl80211_commands {
1044 * 1044 *
1045 * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration 1045 * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration
1046 * of the station, see &enum nl80211_sta_wme_attr. 1046 * of the station, see &enum nl80211_sta_wme_attr.
1047 * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working
1048 * as AP.
1047 * 1049 *
1048 * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of 1050 * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of
1049 * roaming to another AP in the same ESS if the signal lever is low. 1051 * roaming to another AP in the same ESS if the signal lever is low.
@@ -1259,6 +1261,7 @@ enum nl80211_attrs {
1259 NL80211_ATTR_IE_ASSOC_RESP, 1261 NL80211_ATTR_IE_ASSOC_RESP,
1260 1262
1261 NL80211_ATTR_STA_WME, 1263 NL80211_ATTR_STA_WME,
1264 NL80211_ATTR_SUPPORT_AP_UAPSD,
1262 1265
1263 NL80211_ATTR_ROAM_SUPPORT, 1266 NL80211_ATTR_ROAM_SUPPORT,
1264 1267
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 53609dec2c9f..01c6bde99a41 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1621,6 +1621,7 @@ struct cfg80211_ops {
1621 * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans. 1621 * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans.
1622 * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the 1622 * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the
1623 * firmware. 1623 * firmware.
1624 * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP.
1624 */ 1625 */
1625enum wiphy_flags { 1626enum wiphy_flags {
1626 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 1627 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -1636,6 +1637,7 @@ enum wiphy_flags {
1636 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), 1637 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11),
1637 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12), 1638 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12),
1638 WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13), 1639 WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13),
1640 WIPHY_FLAG_AP_UAPSD = BIT(14),
1639}; 1641};
1640 1642
1641/** 1643/**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ad13903c9b89..0cda46ab35e5 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -720,6 +720,8 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
720 NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_IBSS_RSN); 720 NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_IBSS_RSN);
721 if (dev->wiphy.flags & WIPHY_FLAG_MESH_AUTH) 721 if (dev->wiphy.flags & WIPHY_FLAG_MESH_AUTH)
722 NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_MESH_AUTH); 722 NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_MESH_AUTH);
723 if (dev->wiphy.flags & WIPHY_FLAG_AP_UAPSD)
724 NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_AP_UAPSD);
723 725
724 if (dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM) 726 if (dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_FW_ROAM)
725 NLA_PUT_FLAG(msg, NL80211_ATTR_ROAM_SUPPORT); 727 NLA_PUT_FLAG(msg, NL80211_ATTR_ROAM_SUPPORT);
@@ -2601,7 +2603,8 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
2601 return -EINVAL; 2603 return -EINVAL;
2602 2604
2603 /* parse WME attributes if sta is WME capable */ 2605 /* parse WME attributes if sta is WME capable */
2604 if ((params.sta_flags_set & NL80211_STA_FLAG_WME) && 2606 if ((rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) &&
2607 (params.sta_flags_set & NL80211_STA_FLAG_WME) &&
2605 info->attrs[NL80211_ATTR_STA_WME]) { 2608 info->attrs[NL80211_ATTR_STA_WME]) {
2606 struct nlattr *tb[NL80211_STA_WME_MAX + 1]; 2609 struct nlattr *tb[NL80211_STA_WME_MAX + 1];
2607 struct nlattr *nla; 2610 struct nlattr *nla;