wiphy: Rename get_ext_feature API

to has_ext_feature
This commit is contained in:
Denis Kenzior 2018-05-24 13:12:36 -05:00
parent 933eabb6ef
commit 3b4cc1bfe2
4 changed files with 10 additions and 10 deletions

View File

@ -1566,7 +1566,7 @@ static struct l_genl_msg *ap_build_cmd_start_ap(struct ap_state *ap)
l_genl_msg_append_attr(cmd, NL80211_ATTR_WIPHY_FREQ, 4, &ch_freq); l_genl_msg_append_attr(cmd, NL80211_ATTR_WIPHY_FREQ, 4, &ch_freq);
l_genl_msg_append_attr(cmd, NL80211_ATTR_CHANNEL_WIDTH, 4, &ch_width); l_genl_msg_append_attr(cmd, NL80211_ATTR_CHANNEL_WIDTH, 4, &ch_width);
if (wiphy_get_ext_feature(wiphy, if (wiphy_has_ext_feature(wiphy,
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211)) { NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211)) {
l_genl_msg_append_attr(cmd, NL80211_ATTR_SOCKET_OWNER, 0, NULL); l_genl_msg_append_attr(cmd, NL80211_ATTR_SOCKET_OWNER, 0, NULL);
l_genl_msg_append_attr(cmd, l_genl_msg_append_attr(cmd,

View File

@ -394,7 +394,7 @@ static void netdev_rssi_poll(struct l_timeout *timeout, void *user_data)
/* To be called whenever operational or rssi_levels_num are updated */ /* To be called whenever operational or rssi_levels_num are updated */
static void netdev_rssi_polling_update(struct netdev *netdev) static void netdev_rssi_polling_update(struct netdev *netdev)
{ {
if (wiphy_get_ext_feature(netdev->wiphy, if (wiphy_has_ext_feature(netdev->wiphy,
NL80211_EXT_FEATURE_CQM_RSSI_LIST)) NL80211_EXT_FEATURE_CQM_RSSI_LIST))
return; return;
@ -2151,7 +2151,7 @@ static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev,
bss->ssid_len, bss->ssid); bss->ssid_len, bss->ssid);
l_genl_msg_append_attr(msg, NL80211_ATTR_AUTH_TYPE, 4, &auth_type); l_genl_msg_append_attr(msg, NL80211_ATTR_AUTH_TYPE, 4, &auth_type);
if (wiphy_get_ext_feature(netdev->wiphy, if (wiphy_has_ext_feature(netdev->wiphy,
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211)) NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211))
l_genl_msg_append_attr(msg, l_genl_msg_append_attr(msg,
NL80211_ATTR_CONTROL_PORT_OVER_NL80211, NL80211_ATTR_CONTROL_PORT_OVER_NL80211,
@ -3263,7 +3263,7 @@ static int netdev_control_port_frame(uint32_t ifindex,
frame_size = sizeof(struct eapol_header) + frame_size = sizeof(struct eapol_header) +
L_BE16_TO_CPU(ef->header.packet_len); L_BE16_TO_CPU(ef->header.packet_len);
if (!wiphy_get_ext_feature(netdev->wiphy, if (!wiphy_has_ext_feature(netdev->wiphy,
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211)) NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211))
return netdev_control_port_write_pae(netdev, dest, proto, return netdev_control_port_write_pae(netdev, dest, proto,
ef, noencrypt); ef, noencrypt);
@ -3396,7 +3396,7 @@ int netdev_set_rssi_report_levels(struct netdev *netdev, const int8_t *levels,
if (levels_num > L_ARRAY_SIZE(netdev->rssi_levels)) if (levels_num > L_ARRAY_SIZE(netdev->rssi_levels))
return -ENOSPC; return -ENOSPC;
if (!wiphy_get_ext_feature(netdev->wiphy, if (!wiphy_has_ext_feature(netdev->wiphy,
NL80211_EXT_FEATURE_CQM_RSSI_LIST)) NL80211_EXT_FEATURE_CQM_RSSI_LIST))
goto done; goto done;
@ -3849,7 +3849,7 @@ static void netdev_create_from_genl(struct l_genl_msg *msg)
return; return;
} }
if (!wiphy_get_ext_feature(wiphy, if (!wiphy_has_ext_feature(wiphy,
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211)) { NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211)) {
l_debug("No Control Port over NL80211 support for ifindex: %u," l_debug("No Control Port over NL80211 support for ifindex: %u,"
" using PAE socket", *ifindex); " using PAE socket", *ifindex);

View File

@ -190,10 +190,10 @@ bool wiphy_has_feature(struct wiphy *wiphy, uint32_t feature)
return wiphy->feature_flags & feature; return wiphy->feature_flags & feature;
} }
bool wiphy_get_ext_feature(struct wiphy *wiphy, unsigned int idx) bool wiphy_has_ext_feature(struct wiphy *wiphy, uint32_t feature)
{ {
return idx < sizeof(wiphy->ext_features) * 8 && return feature < sizeof(wiphy->ext_features) * 8 &&
util_is_bit_set(wiphy->ext_features[idx >> 3], idx & 7); util_is_bit_set(wiphy->ext_features[feature >> 3], feature & 7);
} }
uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy) uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy)

View File

@ -35,7 +35,7 @@ const char *wiphy_get_path(struct wiphy *wiphy);
uint32_t wiphy_get_supported_bands(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_can_connect(struct wiphy *wiphy, struct scan_bss *bss);
bool wiphy_has_feature(struct wiphy *wiphy, uint32_t feature); bool wiphy_has_feature(struct wiphy *wiphy, uint32_t feature);
bool wiphy_has_ext_feature(struct wiphy *wiphy, unsigned int idx); bool wiphy_has_ext_feature(struct wiphy *wiphy, uint32_t feature);
uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy); uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy);
bool wiphy_init(struct l_genl_family *in, const char *whitelist, bool wiphy_init(struct l_genl_family *in, const char *whitelist,