diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-12 11:59:39 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-15 03:41:38 -0500 |
commit | 50640f169372b9977487a328dedf13a8debedff7 (patch) | |
tree | 5ee6bf0cc8d936441049e94d48f7773a5fbdd420 /net/wireless | |
parent | c7a6ee27abd46247c1c7edfc49fb935138da7875 (diff) |
nl80211: advertise HT/VHT channel limitations
When drivers or regulatory have limitations on
40, 80 or 160 MHz channels, advertise these to
userspace via nl80211. Also add a new feature
flag to let userspace know this is supported.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 3 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 922002105062..33b75b9b8efa 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -367,7 +367,8 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv) | |||
367 | rdev->wiphy.rts_threshold = (u32) -1; | 367 | rdev->wiphy.rts_threshold = (u32) -1; |
368 | rdev->wiphy.coverage_class = 0; | 368 | rdev->wiphy.coverage_class = 0; |
369 | 369 | ||
370 | rdev->wiphy.features = NL80211_FEATURE_SCAN_FLUSH; | 370 | rdev->wiphy.features = NL80211_FEATURE_SCAN_FLUSH | |
371 | NL80211_FEATURE_ADVERTISE_CHAN_LIMITS; | ||
371 | 372 | ||
372 | return &rdev->wiphy; | 373 | return &rdev->wiphy; |
373 | } | 374 | } |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c1e18ccf4049..7e40b9e82b45 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -562,6 +562,18 @@ static int nl80211_msg_put_channel(struct sk_buff *msg, | |||
562 | if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_TIME, time)) | 562 | if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_TIME, time)) |
563 | goto nla_put_failure; | 563 | goto nla_put_failure; |
564 | } | 564 | } |
565 | if ((chan->flags & IEEE80211_CHAN_NO_HT40MINUS) && | ||
566 | nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_MINUS)) | ||
567 | goto nla_put_failure; | ||
568 | if ((chan->flags & IEEE80211_CHAN_NO_HT40PLUS) && | ||
569 | nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_HT40_PLUS)) | ||
570 | goto nla_put_failure; | ||
571 | if ((chan->flags & IEEE80211_CHAN_NO_80MHZ) && | ||
572 | nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_80MHZ)) | ||
573 | goto nla_put_failure; | ||
574 | if ((chan->flags & IEEE80211_CHAN_NO_160MHZ) && | ||
575 | nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_160MHZ)) | ||
576 | goto nla_put_failure; | ||
565 | 577 | ||
566 | if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER, | 578 | if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER, |
567 | DBM_TO_MBM(chan->max_power))) | 579 | DBM_TO_MBM(chan->max_power))) |