wiphy: Add wiphy_rrm_capable

This commit is contained in:
Denis Kenzior 2019-07-10 16:23:13 -05:00
parent 7b48da5df2
commit eb86da3b4b
2 changed files with 14 additions and 0 deletions

View File

@ -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 &&

View File

@ -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);