commit eb86da3b4ba8696fdab98e2df254969d44569f4e
parent 7b48da5df2985ca8326f3bdbf5b3d55f86407f8e
Author: Denis Kenzior <denkenz@gmail.com>
Date: Wed, 10 Jul 2019 16:23:13 -0500
wiphy: Add wiphy_rrm_capable
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git 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
@@ -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);