]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Convert int to bool for throughput estimate tables
authorJouni Malinen <j@w1.fi>
Fri, 19 Jun 2020 14:28:25 +0000 (17:28 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 19 Jun 2020 15:34:26 +0000 (18:34 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/scan.c

index 1c62c2ecff4a96fa729c6998b5e7bd3b53d024e6..7415eae9fe48fdcc5da44c0b9b5c60e1412bcd8e 100644 (file)
@@ -2249,7 +2249,7 @@ static unsigned int interpolate_rate(int snr, int snr0, int snr1,
 
 
 static unsigned int max_rate(const struct minsnr_bitrate_entry table[],
-                            int snr, int vht)
+                            int snr, bool vht)
 {
        const struct minsnr_bitrate_entry *prev, *entry = table;
 
@@ -2267,13 +2267,13 @@ static unsigned int max_rate(const struct minsnr_bitrate_entry table[],
 }
 
 
-static unsigned int max_ht20_rate(int snr, int vht)
+static unsigned int max_ht20_rate(int snr, bool vht)
 {
        return max_rate(vht20_table, snr, vht);
 }
 
 
-static unsigned int max_ht40_rate(int snr, int vht)
+static unsigned int max_ht40_rate(int snr, bool vht)
 {
        return max_rate(vht40_table, snr, vht);
 }
@@ -2337,7 +2337,7 @@ unsigned int wpas_get_est_tpt(const struct wpa_supplicant *wpa_s,
        if (capab == CAPAB_HT || capab == CAPAB_HT40 || capab == CAPAB_VHT) {
                ie = get_ie(ies, ies_len, WLAN_EID_HT_CAP);
                if (ie) {
-                       tmp = max_ht20_rate(snr, 0);
+                       tmp = max_ht20_rate(snr, false);
                        if (tmp > est)
                                est = tmp;
                }
@@ -2347,7 +2347,7 @@ unsigned int wpas_get_est_tpt(const struct wpa_supplicant *wpa_s,
                ie = get_ie(ies, ies_len, WLAN_EID_HT_OPERATION);
                if (ie && ie[1] >= 2 &&
                    (ie[3] & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK)) {
-                       tmp = max_ht40_rate(snr, 0);
+                       tmp = max_ht40_rate(snr, false);
                        if (tmp > est)
                                est = tmp;
                }
@@ -2357,7 +2357,7 @@ unsigned int wpas_get_est_tpt(const struct wpa_supplicant *wpa_s,
                /* Use +1 to assume VHT is always faster than HT */
                ie = get_ie(ies, ies_len, WLAN_EID_VHT_CAP);
                if (ie) {
-                       tmp = max_ht20_rate(snr, 1) + 1;
+                       tmp = max_ht20_rate(snr, true) + 1;
                        if (tmp > est)
                                est = tmp;
 
@@ -2365,7 +2365,7 @@ unsigned int wpas_get_est_tpt(const struct wpa_supplicant *wpa_s,
                        if (ie && ie[1] >= 2 &&
                            (ie[3] &
                             HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK)) {
-                               tmp = max_ht40_rate(snr, 1) + 1;
+                               tmp = max_ht40_rate(snr, true) + 1;
                                if (tmp > est)
                                        est = tmp;
                        }