mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 23:09:34 +01:00
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:
parent
f902c7019d
commit
78b9328db6
@ -115,7 +115,7 @@ int band_estimate_nonht_rate(const struct band *band,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!max_rate)
|
if (!max_rate)
|
||||||
return -EINVAL;
|
return -ENETUNREACH;
|
||||||
|
|
||||||
*out_data_rate = max_rate * 500000;
|
*out_data_rate = max_rate * 500000;
|
||||||
return 0;
|
return 0;
|
||||||
@ -306,7 +306,7 @@ int band_estimate_ht_rx_rate(const struct band *band,
|
|||||||
rssi, sgi, out_data_rate))
|
rssi, sgi, out_data_rate))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -EINVAL;
|
return -ENETUNREACH;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool find_best_mcs_vht(uint8_t max_index, enum ofdm_channel_width width,
|
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))
|
rssi, nss, sgi, out_data_rate))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -EINVAL;
|
return -ENETUNREACH;
|
||||||
}
|
}
|
||||||
|
@ -1235,11 +1235,15 @@ static struct scan_bss *scan_parse_attr_bss(struct l_genl_attr *attr,
|
|||||||
bss->data_rate = 2000000;
|
bss->data_rate = 2000000;
|
||||||
|
|
||||||
if (ies) {
|
if (ies) {
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!scan_parse_bss_information_elements(bss, ies, ies_len))
|
if (!scan_parse_bss_information_elements(bss, ies, ies_len))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
L_WARN_ON(wiphy_estimate_data_rate(wiphy, ies, ies_len, bss,
|
ret = wiphy_estimate_data_rate(wiphy, ies, ies_len, bss,
|
||||||
&bss->data_rate) < 0);
|
&bss->data_rate);
|
||||||
|
if (ret < 0 && ret != -ENETUNREACH)
|
||||||
|
l_warn("wiphy_estimate_data_rate() failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
return bss;
|
return bss;
|
||||||
|
@ -771,13 +771,10 @@ int wiphy_estimate_data_rate(struct wiphy *wiphy,
|
|||||||
out_data_rate))
|
out_data_rate))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!band_estimate_nonht_rate(bandp, supported_rates,
|
return band_estimate_nonht_rate(bandp, supported_rates,
|
||||||
ext_supported_rates,
|
ext_supported_rates,
|
||||||
bss->signal_strength / 100,
|
bss->signal_strength / 100,
|
||||||
out_data_rate))
|
out_data_rate);
|
||||||
return 0;
|
|
||||||
|
|
||||||
return -ENOTSUP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t wiphy_state_watch_add(struct wiphy *wiphy,
|
uint32_t wiphy_state_watch_add(struct wiphy *wiphy,
|
||||||
|
Loading…
Reference in New Issue
Block a user