mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
ap: use wiphy_get_frequency_info
Replace disabled/supported frequency list with the new wiphy_get_frequency_info()
This commit is contained in:
parent
58383bda0c
commit
cf6c958a97
17
src/ap.c
17
src/ap.c
@ -3174,9 +3174,8 @@ static char **ap_ciphers_to_strv(uint16_t ciphers)
|
|||||||
static bool ap_validate_band_channel(struct ap_state *ap)
|
static bool ap_validate_band_channel(struct ap_state *ap)
|
||||||
{
|
{
|
||||||
struct wiphy *wiphy = netdev_get_wiphy(ap->netdev);
|
struct wiphy *wiphy = netdev_get_wiphy(ap->netdev);
|
||||||
const struct scan_freq_set *supported;
|
|
||||||
const struct scan_freq_set *disabled;
|
|
||||||
uint32_t freq;
|
uint32_t freq;
|
||||||
|
const struct band_freq_attrs *attr;
|
||||||
|
|
||||||
if (!(wiphy_get_supported_bands(wiphy) & ap->band)) {
|
if (!(wiphy_get_supported_bands(wiphy) & ap->band)) {
|
||||||
l_error("AP hardware does not support band");
|
l_error("AP hardware does not support band");
|
||||||
@ -3191,19 +3190,11 @@ static bool ap_validate_band_channel(struct ap_state *ap)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
supported = wiphy_get_supported_freqs(wiphy);
|
attr = wiphy_get_frequency_info(wiphy, freq);
|
||||||
disabled = wiphy_get_disabled_freqs(wiphy);
|
if (!attr || attr->disabled) {
|
||||||
|
l_error("AP frequency %u disabled or unsupported", freq);
|
||||||
if (!scan_freq_set_contains(supported, freq)) {
|
|
||||||
l_error("AP hardware does not support frequency %u", freq);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scan_freq_set_contains(disabled, freq)) {
|
|
||||||
l_error("AP hardware has frequency %u disabled", freq);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user