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 Initialize channels and media state on reset.



details:   https://anonhg.NetBSD.org/src-all/rev/8bfd34771fa4
branches:  trunk
changeset: 988836:8bfd34771fa4
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sun Aug 16 07:10:29 2020 +1000

description:
Initialize channels and media state on reset.

diffstat:

 sys/dev/usb/if_urtwn.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r e9422f8f5634 -r 8bfd34771fa4 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Sun Aug 16 06:35:38 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Sun Aug 16 07:10:29 2020 +1000
@@ -5847,10 +5847,18 @@
        struct ifnet *ifp = vap->iv_ifp;
        struct urtwn_softc *sc = ifp->if_softc;
        struct ieee80211com *ic = &sc->sc_ic;
+       struct ifmediareq imr;
 
        if (ic->ic_opmode != IEEE80211_M_MONITOR)
                return ENETRESET;
 
+       urtwn_init_channels(ic);
+       ieee80211_chan_init(ic);
+       ieee80211_media_status(ifp, &imr);
+       imr.ifm_active &= ~(IFM_MMASK | IFM_IEEE80211_TURBO);
+       imr.ifm_active |= IFM_AUTO;
+       ifmedia_set(&vap->iv_media, imr.ifm_active);
+
        if (ic->ic_curchan != NULL)
                urtwn_set_chan(sc, ic->ic_curchan);
 



Home | Main Index | Thread Index | Old Index