diff options
author | Mahesh Palivela <maheshp@posedge.com> | 2012-06-22 03:27:46 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-06-28 07:08:34 -0400 |
commit | bf0c111ec80355ee9fe2e2bdb609a536b54768d8 (patch) | |
tree | 9a2f8b805b588948015bcf8350425a9e6b66560e | |
parent | ce0e169529a2db1cd910d2d45a5713fcdc29f6e1 (diff) |
cfg80211: allow advertising VHT capabilities
Allow drivers to advertise their VHT capabilities
and export them to userspace via nl80211.
Signed-off-by: Mahesh Palivela <maheshp@posedge.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | include/linux/nl80211.h | 6 | ||||
-rw-r--r-- | include/net/cfg80211.h | 17 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 9 |
3 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index c0fc5d277338..23003272c70e 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -1813,6 +1813,9 @@ enum nl80211_mpath_info { | |||
1813 | * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE | 1813 | * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE |
1814 | * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n | 1814 | * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n |
1815 | * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n | 1815 | * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n |
1816 | * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as | ||
1817 | * defined in 802.11ac | ||
1818 | * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE | ||
1816 | * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined | 1819 | * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined |
1817 | * @__NL80211_BAND_ATTR_AFTER_LAST: internal use | 1820 | * @__NL80211_BAND_ATTR_AFTER_LAST: internal use |
1818 | */ | 1821 | */ |
@@ -1826,6 +1829,9 @@ enum nl80211_band_attr { | |||
1826 | NL80211_BAND_ATTR_HT_AMPDU_FACTOR, | 1829 | NL80211_BAND_ATTR_HT_AMPDU_FACTOR, |
1827 | NL80211_BAND_ATTR_HT_AMPDU_DENSITY, | 1830 | NL80211_BAND_ATTR_HT_AMPDU_DENSITY, |
1828 | 1831 | ||
1832 | NL80211_BAND_ATTR_VHT_MCS_SET, | ||
1833 | NL80211_BAND_ATTR_VHT_CAPA, | ||
1834 | |||
1829 | /* keep last */ | 1835 | /* keep last */ |
1830 | __NL80211_BAND_ATTR_AFTER_LAST, | 1836 | __NL80211_BAND_ATTR_AFTER_LAST, |
1831 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 | 1837 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7d3cd3ce9a26..1fc89c4f930c 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -211,6 +211,22 @@ struct ieee80211_sta_ht_cap { | |||
211 | }; | 211 | }; |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * struct ieee80211_sta_vht_cap - STA's VHT capabilities | ||
215 | * | ||
216 | * This structure describes most essential parameters needed | ||
217 | * to describe 802.11ac VHT capabilities for an STA. | ||
218 | * | ||
219 | * @vht_supported: is VHT supported by the STA | ||
220 | * @cap: VHT capabilities map as described in 802.11ac spec | ||
221 | * @vht_mcs: Supported VHT MCS rates | ||
222 | */ | ||
223 | struct ieee80211_sta_vht_cap { | ||
224 | bool vht_supported; | ||
225 | u32 cap; /* use IEEE80211_VHT_CAP_ */ | ||
226 | struct ieee80211_vht_mcs_info vht_mcs; | ||
227 | }; | ||
228 | |||
229 | /** | ||
214 | * struct ieee80211_supported_band - frequency band definition | 230 | * struct ieee80211_supported_band - frequency band definition |
215 | * | 231 | * |
216 | * This structure describes a frequency band a wiphy | 232 | * This structure describes a frequency band a wiphy |
@@ -233,6 +249,7 @@ struct ieee80211_supported_band { | |||
233 | int n_channels; | 249 | int n_channels; |
234 | int n_bitrates; | 250 | int n_bitrates; |
235 | struct ieee80211_sta_ht_cap ht_cap; | 251 | struct ieee80211_sta_ht_cap ht_cap; |
252 | struct ieee80211_sta_vht_cap vht_cap; | ||
236 | }; | 253 | }; |
237 | 254 | ||
238 | /* | 255 | /* |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 067c9fe02a7f..5c4a720f0442 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -921,6 +921,15 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
921 | dev->wiphy.bands[band]->ht_cap.ampdu_density))) | 921 | dev->wiphy.bands[band]->ht_cap.ampdu_density))) |
922 | goto nla_put_failure; | 922 | goto nla_put_failure; |
923 | 923 | ||
924 | /* add VHT info */ | ||
925 | if (dev->wiphy.bands[band]->vht_cap.vht_supported && | ||
926 | (nla_put(msg, NL80211_BAND_ATTR_VHT_MCS_SET, | ||
927 | sizeof(dev->wiphy.bands[band]->vht_cap.vht_mcs), | ||
928 | &dev->wiphy.bands[band]->vht_cap.vht_mcs) || | ||
929 | nla_put_u32(msg, NL80211_BAND_ATTR_VHT_CAPA, | ||
930 | dev->wiphy.bands[band]->vht_cap.cap))) | ||
931 | goto nla_put_failure; | ||
932 | |||
924 | /* add frequencies */ | 933 | /* add frequencies */ |
925 | nl_freqs = nla_nest_start(msg, NL80211_BAND_ATTR_FREQS); | 934 | nl_freqs = nla_nest_start(msg, NL80211_BAND_ATTR_FREQS); |
926 | if (!nl_freqs) | 935 | if (!nl_freqs) |