From eb86da3b4ba8696fdab98e2df254969d44569f4e Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 10 Jul 2019 16:23:13 -0500 Subject: [PATCH] wiphy: Add wiphy_rrm_capable --- src/wiphy.c | 13 +++++++++++++ src/wiphy.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/wiphy.c b/src/wiphy.c index d0dd8175..84a6512c 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -318,6 +318,19 @@ bool wiphy_can_randomize_mac_addr(struct wiphy *wiphy) return wiphy_has_feature(wiphy, NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR); } +bool wiphy_rrm_capable(struct wiphy *wiphy) +{ + if (wiphy_has_feature(wiphy, + NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) && + wiphy_has_feature(wiphy, NL80211_FEATURE_QUIET)) + return true; + + if (wiphy_has_ext_feature(wiphy, NL80211_EXT_FEATURE_RRM)) + return true; + + return false; +} + bool wiphy_has_ext_feature(struct wiphy *wiphy, uint32_t feature) { return feature < sizeof(wiphy->ext_features) * 8 && diff --git a/src/wiphy.h b/src/wiphy.h index 5114c6c5..376db864 100644 --- a/src/wiphy.h +++ b/src/wiphy.h @@ -62,6 +62,7 @@ const struct scan_freq_set *wiphy_get_supported_freqs( const struct wiphy *wiphy); bool wiphy_can_connect(struct wiphy *wiphy, struct scan_bss *bss); bool wiphy_can_randomize_mac_addr(struct wiphy *wiphy); +bool wiphy_rrm_capable(struct wiphy *wiphy); bool wiphy_has_feature(struct wiphy *wiphy, uint32_t feature); bool wiphy_has_ext_feature(struct wiphy *wiphy, uint32_t feature); uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy);