aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGautam Kumar Shukla <gautams@broadcom.com>2014-12-23 10:55:19 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-06 06:10:24 -0500
commitd75bb06b61cb69ee6223d791d3bb230e68623b20 (patch)
treea395b7335718bcafbd87275bb148169ed708666c /include
parent1803f594cbf9bb2e662ac945038113d0d0cc5e89 (diff)
cfg80211: add extensible feature flag attribute
With the wiphy::features flag being used up this patch adds a new field wiphy::ext_features. Considering extensibility this new field is declared as a byte array. This extensible flag is exposed to user-space by NL80211_ATTR_EXT_FEATURES. Cc: Avinash Patil <patila@marvell.com> Signed-off-by: Gautam (Gautam Kumar) Shukla <gautams@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h39
-rw-r--r--include/uapi/linux/nl80211.h22
2 files changed, 61 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bd672ea08c9a..f38645fb83b9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3016,6 +3016,8 @@ struct wiphy_vendor_command {
3016 * @regulatory_flags: wiphy regulatory flags, see 3016 * @regulatory_flags: wiphy regulatory flags, see
3017 * &enum ieee80211_regulatory_flags 3017 * &enum ieee80211_regulatory_flags
3018 * @features: features advertised to nl80211, see &enum nl80211_feature_flags. 3018 * @features: features advertised to nl80211, see &enum nl80211_feature_flags.
3019 * @ext_features: extended features advertised to nl80211, see
3020 * &enum nl80211_ext_feature_index.
3019 * @bss_priv_size: each BSS struct has private data allocated with it, 3021 * @bss_priv_size: each BSS struct has private data allocated with it,
3020 * this variable determines its size 3022 * this variable determines its size
3021 * @max_scan_ssids: maximum number of SSIDs the device can scan for in 3023 * @max_scan_ssids: maximum number of SSIDs the device can scan for in
@@ -3125,6 +3127,7 @@ struct wiphy {
3125 u16 max_acl_mac_addrs; 3127 u16 max_acl_mac_addrs;
3126 3128
3127 u32 flags, regulatory_flags, features; 3129 u32 flags, regulatory_flags, features;
3130 u8 ext_features[DIV_ROUND_UP(NUM_NL80211_EXT_FEATURES, 8)];
3128 3131
3129 u32 ap_sme_capa; 3132 u32 ap_sme_capa;
3130 3133
@@ -5052,6 +5055,42 @@ void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
5052 */ 5055 */
5053void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy); 5056void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy);
5054 5057
5058/**
5059 * wiphy_ext_feature_set - set the extended feature flag
5060 *
5061 * @wiphy: the wiphy to modify.
5062 * @ftidx: extended feature bit index.
5063 *
5064 * The extended features are flagged in multiple bytes (see
5065 * &struct wiphy.@ext_features)
5066 */
5067static inline void wiphy_ext_feature_set(struct wiphy *wiphy,
5068 enum nl80211_ext_feature_index ftidx)
5069{
5070 u8 *ft_byte;
5071
5072 ft_byte = &wiphy->ext_features[ftidx / 8];
5073 *ft_byte |= BIT(ftidx % 8);
5074}
5075
5076/**
5077 * wiphy_ext_feature_isset - check the extended feature flag
5078 *
5079 * @wiphy: the wiphy to modify.
5080 * @ftidx: extended feature bit index.
5081 *
5082 * The extended features are flagged in multiple bytes (see
5083 * &struct wiphy.@ext_features)
5084 */
5085static inline bool
5086wiphy_ext_feature_isset(struct wiphy *wiphy,
5087 enum nl80211_ext_feature_index ftidx)
5088{
5089 u8 ft_byte;
5090
5091 ft_byte = wiphy->ext_features[ftidx / 8];
5092 return (ft_byte & BIT(ftidx % 8)) != 0;
5093}
5055 5094
5056/* ethtool helper */ 5095/* ethtool helper */
5057void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info); 5096void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 54f391141351..f95d35483086 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1713,6 +1713,13 @@ enum nl80211_commands {
1713 * obtained from it is coming from the device's wiphy and not the global 1713 * obtained from it is coming from the device's wiphy and not the global
1714 * cfg80211 regdomain. 1714 * cfg80211 regdomain.
1715 * 1715 *
1716 * @NL80211_ATTR_EXT_FEATURES: extended feature flags contained in a byte
1717 * array. The feature flags are identified by their bit index (see &enum
1718 * nl80211_ext_feature_index). The bit index is ordered starting at the
1719 * least-significant bit of the first byte in the array, ie. bit index 0
1720 * is located at bit 0 of byte 0. bit index 25 would be located at bit 1
1721 * of byte 3 (u8 array).
1722 *
1716 * @NUM_NL80211_ATTR: total number of nl80211_attrs available 1723 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
1717 * @NL80211_ATTR_MAX: highest attribute number currently defined 1724 * @NL80211_ATTR_MAX: highest attribute number currently defined
1718 * @__NL80211_ATTR_AFTER_LAST: internal use 1725 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2072,6 +2079,8 @@ enum nl80211_attrs {
2072 2079
2073 NL80211_ATTR_WIPHY_SELF_MANAGED_REG, 2080 NL80211_ATTR_WIPHY_SELF_MANAGED_REG,
2074 2081
2082 NL80211_ATTR_EXT_FEATURES,
2083
2075 /* add attributes here, update the policy in nl80211.c */ 2084 /* add attributes here, update the policy in nl80211.c */
2076 2085
2077 __NL80211_ATTR_AFTER_LAST, 2086 __NL80211_ATTR_AFTER_LAST,
@@ -4224,6 +4233,19 @@ enum nl80211_feature_flags {
4224}; 4233};
4225 4234
4226/** 4235/**
4236 * enum nl80211_ext_feature_index - bit index of extended features.
4237 *
4238 * @NUM_NL80211_EXT_FEATURES: number of extended features.
4239 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
4240 */
4241enum nl80211_ext_feature_index {
4242
4243 /* add new features before the definition below */
4244 NUM_NL80211_EXT_FEATURES,
4245 MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1
4246};
4247
4248/**
4227 * enum nl80211_probe_resp_offload_support_attr - optional supported 4249 * enum nl80211_probe_resp_offload_support_attr - optional supported
4228 * protocols for probe-response offloading by the driver/FW. 4250 * protocols for probe-response offloading by the driver/FW.
4229 * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute. 4251 * To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute.