From 3b4cc1bfe26debae5cebf926ac4d5a8bfd8f3309 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 24 May 2018 13:12:36 -0500 Subject: [PATCH] wiphy: Rename get_ext_feature API to has_ext_feature --- src/ap.c | 2 +- src/netdev.c | 10 +++++----- src/wiphy.c | 6 +++--- src/wiphy.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ap.c b/src/ap.c index 70687f98..56c75d0d 100644 --- a/src/ap.c +++ b/src/ap.c @@ -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_CHANNEL_WIDTH, 4, &ch_width); - if (wiphy_get_ext_feature(wiphy, + if (wiphy_has_ext_feature(wiphy, 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, diff --git a/src/netdev.c b/src/netdev.c index 25d79c73..21990d38 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -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 */ 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)) return; @@ -2151,7 +2151,7 @@ static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev, bss->ssid_len, bss->ssid); 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)) l_genl_msg_append_attr(msg, 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) + 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)) return netdev_control_port_write_pae(netdev, dest, proto, 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)) return -ENOSPC; - if (!wiphy_get_ext_feature(netdev->wiphy, + if (!wiphy_has_ext_feature(netdev->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST)) goto done; @@ -3849,7 +3849,7 @@ static void netdev_create_from_genl(struct l_genl_msg *msg) return; } - if (!wiphy_get_ext_feature(wiphy, + if (!wiphy_has_ext_feature(wiphy, NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211)) { l_debug("No Control Port over NL80211 support for ifindex: %u," " using PAE socket", *ifindex); diff --git a/src/wiphy.c b/src/wiphy.c index bb671b0c..2c658f33 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -190,10 +190,10 @@ 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) +bool wiphy_has_ext_feature(struct wiphy *wiphy, uint32_t feature) { - return idx < sizeof(wiphy->ext_features) * 8 && - util_is_bit_set(wiphy->ext_features[idx >> 3], idx & 7); + return feature < sizeof(wiphy->ext_features) * 8 && + util_is_bit_set(wiphy->ext_features[feature >> 3], feature & 7); } uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy) diff --git a/src/wiphy.h b/src/wiphy.h index 5b95518e..eb468cf8 100644 --- a/src/wiphy.h +++ b/src/wiphy.h @@ -35,7 +35,7 @@ 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_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); bool wiphy_init(struct l_genl_family *in, const char *whitelist,