aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-06-22 00:10:22 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-06-22 01:21:38 +0000
commitd4a529ad0d5638ad3e8d27815948b0a7c4628e3f (patch)
treeff9478b78ab5035a5d8739057d4b2a8eddf7f2f9
parent08a78a296c840aa95ec13895c3c9bf1349becbae (diff)
LinuxKPI: 802.11: add 11g check to lkpi_ic_getradiocaps()
Replace an early comment with code and add a (simplified) 11g check. We make use of the annotated bitrate flags we added (see lkpi_wiphy_band_annotate()) and check if on the 2GHz band there are any bitrates which are 11g. Upon the first one found we do set the IEEE80211_MODE_11G to announce to net80211 that the 2.4Ghz channels may operate on 11g as well. Sponsored by: The FreeBSD Foundation MFC after: 3 days
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 6f5e2756f421..95385474840a 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -6732,18 +6732,28 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan,
if (hw->wiphy->bands[NL80211_BAND_2GHZ] != NULL)
nchans = hw->wiphy->bands[NL80211_BAND_2GHZ]->n_channels;
if (nchans > 0) {
+ struct ieee80211_supported_band *supband;
+
memset(bands, 0, sizeof(bands));
chan_flags = 0;
setbit(bands, IEEE80211_MODE_11B);
- /* XXX-BZ unclear how to check for 11g. */
+
+ /* Check for 11g (simplified). */
+ supband = hw->wiphy->bands[NL80211_BAND_2GHZ];
+ for (i = 0; i < supband->n_bitrates; i++) {
+ if ((supband->bitrates[i].flags &
+ IEEE80211_RATE_MANDATORY_G) != 0) {
+ setbit(bands, IEEE80211_MODE_11G);
+ break;
+ }
+ }
IMPROVE("the bitrates may have flags?");
- setbit(bands, IEEE80211_MODE_11G);
lkpi_ic_getradiocaps_ht(ic, hw, bands, &chan_flags,
NL80211_BAND_2GHZ);
- channels = hw->wiphy->bands[NL80211_BAND_2GHZ]->channels;
+ channels = supband->channels;
for (i = 0; i < nchans && *n < maxchan; i++) {
uint32_t nflags = 0;
int cflags = chan_flags;