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.
This commit is contained in:
James Prestwood 2019-06-14 10:06:35 -07:00 committed by Denis Kenzior
parent 65eeab1313
commit 77a6b49803
2 changed files with 10 additions and 0 deletions

View File

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

View File

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