aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-11-09 08:57:54 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-12-02 05:51:21 -0500
commit01e0daa43f129fc1a6bc6f1197343c0293af866d (patch)
tree8979029acf47904bbf6d2805b2fa72615960ff11 /net/wireless/nl80211.c
parentf12140c04ca49ea34c448b1bd8aa40fb9411690c (diff)
cfg80211: fix reporting 5/10 MHz support to user space
nla_put_flag needs a real nl80211 attribute id, not a wiphy flag bit. While at it, split 5 and 10 MHz capability flags in case we ever need to support hardware that can only do one of the two. Also move the flag settings to the split-only information so we don't increase the space needed for old userspace. Signed-off-by: Felix Fietkau <nbd@openwrt.org> [change location of flag setting] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 79632edebb6c..8c83fbb3824f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1228,10 +1228,6 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1228 if ((dev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) && 1228 if ((dev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) &&
1229 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP)) 1229 nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP))
1230 goto nla_put_failure; 1230 goto nla_put_failure;
1231 if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
1232 nla_put_flag(msg, WIPHY_FLAG_SUPPORTS_5_10_MHZ))
1233 goto nla_put_failure;
1234
1235 state->split_start++; 1231 state->split_start++;
1236 if (state->split) 1232 if (state->split)
1237 break; 1233 break;
@@ -1560,6 +1556,11 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
1560 if (nl80211_send_coalesce(msg, dev)) 1556 if (nl80211_send_coalesce(msg, dev))
1561 goto nla_put_failure; 1557 goto nla_put_failure;
1562 1558
1559 if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
1560 (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) ||
1561 nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ)))
1562 goto nla_put_failure;
1563
1563 /* done */ 1564 /* done */
1564 state->split_start = 0; 1565 state->split_start = 0;
1565 break; 1566 break;