diff options
author | Kanchanapally, Vidyullatha <vkanchan@qti.qualcomm.com> | 2016-05-16 10:41:04 +0530 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-05-31 15:23:13 +0200 |
commit | 019ae3a918811715192b22c400ac78d54acc26a9 (patch) | |
tree | ca99aaee90d64947b7eb3d15d54da6bf70536dd4 /net/wireless/core.c | |
parent | bf1ecd210541ef5f3a110e88e8ca5d33b4aa5c23 (diff) |
cfg80211: Advertise extended capabilities per interface type to userspace
The driver extended capabilities may differ for different
interface types which the userspace needs to know (for
example the fine timing measurement initiator and responder
bits might differ for a station and AP). Add a new nl80211
attribute to provide extended capabilities per interface type
to userspace.
Signed-off-by: Vidyullatha Kanchanapally <vkanchan@qti.qualcomm.com>
Reviewed-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index d25c82bc1bbe..b8e10a952111 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -750,6 +750,36 @@ int wiphy_register(struct wiphy *wiphy) nl80211_send_reg_change_event(&request); } + /* Check that nobody globally advertises any capabilities they do not + * advertise on all possible interface types. + */ + if (wiphy->extended_capabilities_len && + wiphy->num_iftype_ext_capab && + wiphy->iftype_ext_capab) { + u8 supported_on_all, j; + const struct wiphy_iftype_ext_capab *capab; + + capab = wiphy->iftype_ext_capab; + for (j = 0; j < wiphy->extended_capabilities_len; j++) { + if (capab[0].extended_capabilities_len > j) + supported_on_all = + capab[0].extended_capabilities[j]; + else + supported_on_all = 0x00; + for (i = 1; i < wiphy->num_iftype_ext_capab; i++) { + if (j >= capab[i].extended_capabilities_len) { + supported_on_all = 0x00; + break; + } + supported_on_all &= + capab[i].extended_capabilities[j]; + } + if (WARN_ON(wiphy->extended_capabilities[j] & + ~supported_on_all)) + break; + } + } + rdev->wiphy.registered = true; rtnl_unlock(); |