diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2022-02-14 22:29:38 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2022-02-14 23:48:31 +0000 |
commit | cee56e77d77909df69624cc707a571647651c853 (patch) | |
tree | 121a5f533ac9a337993c87bc4e20ae68a2188483 | |
parent | 24360d83753a085335e66b488a159161a96d5692 (diff) | |
download | src-cee56e77d77909df69624cc707a571647651c853.tar.gz src-cee56e77d77909df69624cc707a571647651c853.zip |
LinuxKPI: 802.11: get rid of lkpi_ic_getradiocaps warnings
Users are seeing warnings about 2 channels (1 per band)
triggered by an ioctl from wpa_supplicant usually:
lkpi_ic_getradiocaps: Adding chan ... returned error 55
This was an early FAQ.
Check the current number of channels against maxchans and the return
code from net80211. In case net80211 reports that we reached the limit
do not print the warning and do not try to add further channels.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_80211.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index beb2b03f0498..c69df86c3fa2 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2579,7 +2579,7 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, #endif channels = hw->wiphy->bands[NL80211_BAND_2GHZ]->channels; - for (i = 0; i < nchans; i++) { + for (i = 0; i < nchans && *n < maxchan; i++) { uint32_t nflags = 0; int cflags = chan_flags; @@ -2606,14 +2606,15 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, channels[i].hw_value, channels[i].center_freq, channels[i].max_power, nflags, bands, chan_flags); - if (error != 0) { + /* net80211::ENOBUFS: *n >= maxchans */ + if (error != 0 && error != ENOBUFS) printf("%s: %s: Adding chan %u/%u/%#x/%#x/%#x/%#x " "returned error %d\n", ic->ic_name, __func__, channels[i].hw_value, channels[i].center_freq, channels[i].flags, nflags, chan_flags, cflags, error); + if (error != 0) break; - } } } @@ -2648,7 +2649,7 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, #endif channels = hw->wiphy->bands[NL80211_BAND_5GHZ]->channels; - for (i = 0; i < nchans; i++) { + for (i = 0; i < nchans && *n < maxchan; i++) { uint32_t nflags = 0; int cflags = chan_flags; @@ -2675,14 +2676,15 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, channels[i].hw_value, channels[i].center_freq, channels[i].max_power, nflags, bands, chan_flags); - if (error != 0) { + /* net80211::ENOBUFS: *n >= maxchans */ + if (error != 0 && error != ENOBUFS) printf("%s: %s: Adding chan %u/%u/%#x/%#x/%#x/%#x " "returned error %d\n", ic->ic_name, __func__, channels[i].hw_value, channels[i].center_freq, channels[i].flags, nflags, chan_flags, cflags, error); + if (error != 0) break; - } } } } |