commit cd47834d6ccd73dff8e579801ab076b3cb080416
parent a1189d64b1d2e46a234837610b7605cd58bd57f5
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Mon, 21 Oct 2019 15:55:09 +0200
wiphy: Add wiphy_get_max_roc_duration
Add a function to retrieve the maximum Remain On Channel listen duration
supported by the wiphy's driver.
Diffstat:
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/wiphy.c b/src/wiphy.c
@@ -66,6 +66,7 @@ struct wiphy {
uint32_t feature_flags;
uint8_t ext_features[(NUM_NL80211_EXT_FEATURES + 7) / 8];
uint8_t max_num_ssids_per_scan;
+ uint32_t max_roc_duration;
uint16_t supported_iftypes;
uint16_t supported_ciphers;
struct scan_freq_set *supported_freqs;
@@ -355,6 +356,11 @@ uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy)
return wiphy->max_num_ssids_per_scan;
}
+uint32_t wiphy_get_max_roc_duration(struct wiphy *wiphy)
+{
+ return wiphy->max_roc_duration;
+}
+
bool wiphy_supports_adhoc_rsn(struct wiphy *wiphy)
{
return wiphy->support_adhoc_rsn;
@@ -769,6 +775,12 @@ static void wiphy_parse_attributes(struct wiphy *wiphy,
parse_iftype_extended_capabilities(wiphy, &nested);
break;
+ case NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION:
+ if (len != 4)
+ l_warn("Invalid MAX_ROC_DURATION attribute");
+ else
+ wiphy->max_roc_duration = *((uint32_t *) data);
+ break;
}
}
}
diff --git a/src/wiphy.h b/src/wiphy.h
@@ -64,6 +64,7 @@ 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);
+uint32_t wiphy_get_max_roc_duration(struct wiphy *wiphy);
bool wiphy_supports_iftype(struct wiphy *wiphy, uint32_t iftype);
bool wiphy_supports_adhoc_rsn(struct wiphy *wiphy);
bool wiphy_can_offchannel_tx(struct wiphy *wiphy);