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 Attempt at addressing non 2ghz channels.



details:   https://anonhg.NetBSD.org/src-all/rev/6027d9eff993
branches:  trunk
changeset: 375837:6027d9eff993
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Fri Apr 28 02:24:03 2023 +1000

description:
Attempt at addressing non 2ghz channels.

The previous commit 1034533:3e5a2ed756ae broke firmare scanning.

iwn now scans successfully, but it does not connect as yet.

diffstat:

 sys/dev/pci/if_iwn.c |  17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diffs (39 lines):

diff -r c8514ead7c44 -r 6027d9eff993 sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Fri Apr 28 01:16:05 2023 +1000
+++ b/sys/dev/pci/if_iwn.c      Fri Apr 28 02:24:03 2023 +1000
@@ -462,6 +462,7 @@ static void
 iwn_get_radiocaps(struct ieee80211com *ic,
     int maxchans, int *nchans, struct ieee80211_channel chans[])
 {
+       struct iwn_softc *sc = ic->ic_softc;
         uint8_t bands[IEEE80211_MODE_BYTES];
 
         /*
@@ -470,20 +471,18 @@ iwn_get_radiocaps(struct ieee80211com *i
          */
 
         memset(bands, 0, sizeof(bands));
-        setbit(bands, IEEE80211_MODE_11A);
+       if (sc->sc_flags & IWN_FLAG_HAS_5GHZ)
+               setbit(bands, IEEE80211_MODE_11A);
         setbit(bands, IEEE80211_MODE_11B);
         setbit(bands, IEEE80211_MODE_11G);
 #ifndef IEEE80211_NO_HT
        setbit(bands, IEEE80211_MODE_11NG);
-       setbit(bands, IEEE80211_MODE_11NA);
+       if (sc->sc_flags & IWN_FLAG_HAS_5GHZ)
+               setbit(bands, IEEE80211_MODE_11NA);
 #endif
-#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);
+       /* XXX is it still safe to use NULL here as ic channels are populated
+          when firmware is read */
+        ieee80211_init_channels(ic, NULL, bands);
 }
 
 static void



Home | Main Index | Thread Index | Old Index