Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/usb Init channel list only once.



details:   https://anonhg.NetBSD.org/src-all/rev/a2f4a6083509
branches:  trunk
changeset: 932891:a2f4a6083509
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Wed May 13 00:19:20 2020 +1000

description:
Init channel list only once.
Do not override the default getradiocaps set by regdomain_attach.

diffstat:

 sys/dev/usb/if_urtwn.c |  13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diffs (51 lines):

diff -r 5ea2dcd1ed25 -r a2f4a6083509 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Tue May 12 21:31:55 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Wed May 13 00:19:20 2020 +1000
@@ -341,8 +341,7 @@
 static void    urtwn_vap_delete(struct ieee80211vap *);
 static int     urtwn_ioctl(struct ifnet *, u_long, void *);
 static void    urtwn_parent(struct ieee80211com *);
-static void    urtwn_getradiocaps(struct ieee80211com *, int, int *,
-                   struct ieee80211_channel []);
+static void    urtwn_init_channels(struct ieee80211com *);
 static void    urtwn_scan_start(struct ieee80211com *);
 static void    urtwn_scan_end(struct ieee80211com *);
 static void    urtwn_set_channel(struct ieee80211com *);
@@ -550,8 +549,7 @@
                    IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ;
        }
 #else
-       urtwn_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, 
-           ic->ic_channels);
+       urtwn_init_channels(ic);
 #endif
        /* XXX issues here ...  Figure out proper attach and vap creation */
        ieee80211_ifattach(ic);
@@ -568,7 +566,6 @@
        ic->ic_transmit = urtwn_transmit;
        // ic->ic_send_mgmt = urtwn_send_mgmt;
        ic->ic_raw_xmit = urtwn_raw_xmit;
-       ic->ic_getradiocaps = urtwn_getradiocaps;
        
        sc->sc_rxtap_len = sizeof(sc->sc_rxtapu);
        sc->sc_rxtap.wr_ihdr.it_len = htole16(sc->sc_rxtap_len);
@@ -3753,8 +3750,7 @@
 }
 
 static void
-urtwn_getradiocaps(struct ieee80211com *ic,
-    int maxchans, int *nchans, struct ieee80211_channel chans[])
+urtwn_init_channels(struct ieee80211com *ic)
 {
        uint8_t bands[IEEE80211_MODE_BYTES];
 
@@ -5755,8 +5751,7 @@
                ieee80211_new_state(vap, IEEE80211_S_SCAN, -1);
        urtwn_wait_async(sc);
 
-       urtwn_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans,
-           ic->ic_channels);
+       urtwn_init_channels(ic);
        ieee80211_chan_init(ic);
        ieee80211_media_status(ifp, &imr);
        imr.ifm_active &= ~(IFM_MMASK | IFM_IEEE80211_TURBO);



Home | Main Index | Thread Index | Old Index