Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/pci Only add 2GHz channels in get_radiocaps fo...



details:   https://anonhg.NetBSD.org/src-all/rev/87d84b9f6fb2
branches:  trunk
changeset: 360308:87d84b9f6fb2
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sat Jan 16 20:06:00 2021 +0100

description:
Only add 2GHz channels in get_radiocaps for now.

We need to respect the "maxchan" limit of the bands array passed
and also set the out parameter *nchans, but it is not clear how
to do that properly with ieee80211_init_channels().

diffstat:

 sys/dev/pci/if_iwm.c |  8 +++++++-
 sys/dev/pci/if_iwn.c |  8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r ea6588aeb47e -r 87d84b9f6fb2 sys/dev/pci/if_iwm.c
--- a/sys/dev/pci/if_iwm.c      Sun Jan 17 04:09:16 2021 +1100
+++ b/sys/dev/pci/if_iwm.c      Sat Jan 16 20:06:00 2021 +0100
@@ -6902,7 +6902,13 @@
        setbit(bands, IEEE80211_MODE_11NG);
        setbit(bands, IEEE80211_MODE_11NA);
 #endif
-        ieee80211_init_channels(ic, NULL, bands);
+#if 0 /* what about non-2ghz channels? but ieee80211_init_channels does not
+        respect an allocation limit "maxchans" */
+       /* XXX get regdomain from FW and pass instead of NULL */
+       ieee80211_init_channels(ic, NULL, bands);
+       *nchans = max(maxchans, ic->ic_nchans);
+#endif
+       ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0);
 }
 
 static int
diff -r ea6588aeb47e -r 87d84b9f6fb2 sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Sun Jan 17 04:09:16 2021 +1100
+++ b/sys/dev/pci/if_iwn.c      Sat Jan 16 20:06:00 2021 +0100
@@ -468,7 +468,13 @@
        setbit(bands, IEEE80211_MODE_11NG);
        setbit(bands, IEEE80211_MODE_11NA);
 #endif
-        ieee80211_init_channels(ic, NULL, bands);
+#if 0 /* what about non-2ghz channels? but ieee80211_init_channels does not
+        respect an allocation limit "maxchans" */
+       /* XXX get regdomain from FW and pass instead of NULL */
+       ieee80211_init_channels(ic, NULL, bands);
+       *nchans = max(maxchans, ic->ic_nchans);
+#endif
+       ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0);
 }
 
 static void



Home | Main Index | Thread Index | Old Index