From 933eabb6ef86abf6e74b134191e713a6ad56ff8b Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Thu, 24 May 2018 10:12:10 -0700 Subject: [PATCH] wiphy: added accessor for the feature flags --- src/wiphy.c | 5 +++++ src/wiphy.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wiphy.c b/src/wiphy.c index b911e6d3..bb671b0c 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -185,6 +185,11 @@ bool wiphy_can_connect(struct wiphy *wiphy, struct scan_bss *bss) return true; } +bool wiphy_has_feature(struct wiphy *wiphy, uint32_t feature) +{ + return wiphy->feature_flags & feature; +} + bool wiphy_get_ext_feature(struct wiphy *wiphy, unsigned int idx) { return idx < sizeof(wiphy->ext_features) * 8 && diff --git a/src/wiphy.h b/src/wiphy.h index 64f5147c..5b95518e 100644 --- a/src/wiphy.h +++ b/src/wiphy.h @@ -34,7 +34,8 @@ struct wiphy *wiphy_find(int wiphy_id); const char *wiphy_get_path(struct wiphy *wiphy); uint32_t wiphy_get_supported_bands(struct wiphy *wiphy); bool wiphy_can_connect(struct wiphy *wiphy, struct scan_bss *bss); -bool wiphy_get_ext_feature(struct wiphy *wiphy, unsigned int idx); +bool wiphy_has_feature(struct wiphy *wiphy, uint32_t feature); +bool wiphy_has_ext_feature(struct wiphy *wiphy, unsigned int idx); uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy); bool wiphy_init(struct l_genl_family *in, const char *whitelist,