Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci This driver sleeps during iwm_media_change(), an...



details:   https://anonhg.NetBSD.org/src/rev/6eaf2ec050e2
branches:  trunk
changeset: 933231:6eaf2ec050e2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri May 22 20:27:16 2020 +0000

description:
This driver sleeps during iwm_media_change(), and thus requires an
adaptive mutex for the media lock.

diffstat:

 sys/dev/pci/if_iwm.c    |  11 ++++++++---
 sys/dev/pci/if_iwmvar.h |   4 +++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diffs (50 lines):

diff -r 65e7a34f7afc -r 6eaf2ec050e2 sys/dev/pci/if_iwm.c
--- a/sys/dev/pci/if_iwm.c      Fri May 22 19:46:29 2020 +0000
+++ b/sys/dev/pci/if_iwm.c      Fri May 22 20:27:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwm.c,v 1.84 2020/01/30 06:03:34 thorpej Exp $      */
+/*     $NetBSD: if_iwm.c,v 1.85 2020/05/22 20:27:16 thorpej Exp $      */
 /*     OpenBSD: if_iwm.c,v 1.148 2016/11/19 21:07:08 stsp Exp  */
 #define IEEE80211_NO_HT
 /*
@@ -106,7 +106,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.84 2020/01/30 06:03:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.85 2020/05/22 20:27:16 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -7774,7 +7774,12 @@
        /* Override 802.11 state transition machine. */
        sc->sc_newstate = ic->ic_newstate;
        ic->ic_newstate = iwm_newstate;
-       ieee80211_media_init(ic, iwm_media_change, ieee80211_media_status);
+
+       /* XXX media locking needs revisiting */
+       mutex_init(&sc->sc_media_mtx, MUTEX_DEFAULT, IPL_SOFTNET);
+       ieee80211_media_init_with_lock(ic,
+           iwm_media_change, ieee80211_media_status, &sc->sc_media_mtx);
+
        ieee80211_announce(ic);
 
        iwm_radiotap_attach(sc);
diff -r 65e7a34f7afc -r 6eaf2ec050e2 sys/dev/pci/if_iwmvar.h
--- a/sys/dev/pci/if_iwmvar.h   Fri May 22 19:46:29 2020 +0000
+++ b/sys/dev/pci/if_iwmvar.h   Fri May 22 20:27:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwmvar.h,v 1.19 2019/10/05 23:27:20 mrg Exp $       */
+/*     $NetBSD: if_iwmvar.h,v 1.20 2020/05/22 20:27:16 thorpej Exp $   */
 /*     OpenBSD: if_iwmvar.h,v 1.24 2016/09/21 13:53:18 stsp Exp        */
 
 /*
@@ -499,6 +499,8 @@
 
        struct bpf_if *sc_drvbpf;
 
+       kmutex_t        sc_media_mtx;   /* XXX */
+
        union {
                struct iwm_rx_radiotap_header th;
                uint8_t pad[IEEE80211_RADIOTAP_HDRLEN];



Home | Main Index | Thread Index | Old Index