From 77a6b498037263f76b592af77749f53b3cf5f9b6 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 14 Jun 2019 10:06:35 -0700 Subject: [PATCH] wiphy: parse OFFCHANNEL_TX_OK attribute The wiphy can indicate if it supports sending offchannel frames. This allows us to bail out of a Hotspot connection early if this is not supported. --- src/wiphy.c | 9 +++++++++ src/wiphy.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/wiphy.c b/src/wiphy.c index 67f12f39..f8840b0d 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -74,6 +74,7 @@ struct wiphy { bool support_adhoc_rsn:1; bool soft_rfkill : 1; bool hard_rfkill : 1; + bool offchannel_tx_ok : 1; }; static struct l_queue *wiphy_list = NULL; @@ -331,6 +332,11 @@ bool wiphy_supports_adhoc_rsn(struct wiphy *wiphy) return wiphy->support_adhoc_rsn; } +bool wiphy_can_offchannel_tx(struct wiphy *wiphy) +{ + return wiphy->offchannel_tx_ok; +} + const char *wiphy_get_driver(struct wiphy *wiphy) { return wiphy->driver_str; @@ -613,6 +619,9 @@ static void wiphy_parse_attributes(struct wiphy *wiphy, if (l_genl_attr_recurse(attr, &nested)) parse_supported_iftypes(wiphy, &nested); break; + case NL80211_ATTR_OFFCHANNEL_TX_OK: + wiphy->offchannel_tx_ok = true; + break; } } } diff --git a/src/wiphy.h b/src/wiphy.h index c187d3e5..15e78cbe 100644 --- a/src/wiphy.h +++ b/src/wiphy.h @@ -67,6 +67,7 @@ bool wiphy_has_ext_feature(struct wiphy *wiphy, uint32_t feature); uint8_t wiphy_get_max_num_ssids_per_scan(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); const char *wiphy_get_driver(struct wiphy *wiphy); uint32_t wiphy_state_watch_add(struct wiphy *wiphy,