scan: Quiet down warning

Under certain conditions, access points with very low signal could be
detected.  This signal is too low to estimate a data rate and causes
this L_WARN to fire.  Fix this by returning a -ENETUNREACH error code in
case the signal is too low for any of the supported rates.
This commit is contained in:
Denis Kenzior 2021-07-28 09:53:21 -05:00
parent f902c7019d
commit 78b9328db6
3 changed files with 11 additions and 10 deletions

View File

@ -115,7 +115,7 @@ int band_estimate_nonht_rate(const struct band *band,
}
if (!max_rate)
return -EINVAL;
return -ENETUNREACH;
*out_data_rate = max_rate * 500000;
return 0;
@ -306,7 +306,7 @@ int band_estimate_ht_rx_rate(const struct band *band,
rssi, sgi, out_data_rate))
return 0;
return -EINVAL;
return -ENETUNREACH;
}
static bool find_best_mcs_vht(uint8_t max_index, enum ofdm_channel_width width,
@ -463,5 +463,5 @@ try_vht80:
rssi, nss, sgi, out_data_rate))
return 0;
return -EINVAL;
return -ENETUNREACH;
}

View File

@ -1235,11 +1235,15 @@ static struct scan_bss *scan_parse_attr_bss(struct l_genl_attr *attr,
bss->data_rate = 2000000;
if (ies) {
int ret;
if (!scan_parse_bss_information_elements(bss, ies, ies_len))
goto fail;
L_WARN_ON(wiphy_estimate_data_rate(wiphy, ies, ies_len, bss,
&bss->data_rate) < 0);
ret = wiphy_estimate_data_rate(wiphy, ies, ies_len, bss,
&bss->data_rate);
if (ret < 0 && ret != -ENETUNREACH)
l_warn("wiphy_estimate_data_rate() failed");
}
return bss;

View File

@ -771,13 +771,10 @@ int wiphy_estimate_data_rate(struct wiphy *wiphy,
out_data_rate))
return 0;
if (!band_estimate_nonht_rate(bandp, supported_rates,
return band_estimate_nonht_rate(bandp, supported_rates,
ext_supported_rates,
bss->signal_strength / 100,
out_data_rate))
return 0;
return -ENOTSUP;
out_data_rate);
}
uint32_t wiphy_state_watch_add(struct wiphy *wiphy,