Module Name:    src
Committed By:   sevan
Date:           Fri Mar 20 17:19:25 UTC 2020

Modified Files:
        src/sys/dev/pci: if_wpi.c if_wpivar.h

Log Message:
Apply the same change as for if_iwi.c r1.114 here.

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


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pci/if_wpi.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/if_wpivar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wpi.c
diff -u src/sys/dev/pci/if_wpi.c:1.88 src/sys/dev/pci/if_wpi.c:1.89
--- src/sys/dev/pci/if_wpi.c:1.88	Thu Jan 30 06:10:26 2020
+++ src/sys/dev/pci/if_wpi.c	Fri Mar 20 17:19:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wpi.c,v 1.88 2020/01/30 06:10:26 thorpej Exp $	*/
+/*	$NetBSD: if_wpi.c,v 1.89 2020/03/20 17:19:25 sevan Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.88 2020/01/30 06:10:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.89 2020/03/20 17:19:25 sevan Exp $");
 
 /*
  * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
@@ -387,7 +387,11 @@ wpi_attach(device_t parent __unused, dev
 	/* override state transition machine */
 	sc->sc_newstate = ic->ic_newstate;
 	ic->ic_newstate = wpi_newstate;
-	ieee80211_media_init(ic, wpi_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,
+	    wpi_media_change, ieee80211_media_status, &sc->sc_media_mtx);
 
 	sc->amrr.amrr_min_success_threshold =  1;
 	sc->amrr.amrr_max_success_threshold = 15;

Index: src/sys/dev/pci/if_wpivar.h
diff -u src/sys/dev/pci/if_wpivar.h:1.22 src/sys/dev/pci/if_wpivar.h:1.23
--- src/sys/dev/pci/if_wpivar.h:1.22	Mon Aug 20 04:50:56 2018
+++ src/sys/dev/pci/if_wpivar.h	Fri Mar 20 17:19:25 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_wpivar.h,v 1.22 2018/08/20 04:50:56 riastradh Exp $    */
+/*  $NetBSD: if_wpivar.h,v 1.23 2020/03/20 17:19:25 sevan Exp $    */
 
 /*-
  * Copyright (c) 2006
@@ -172,6 +172,8 @@ struct wpi_softc {
 
 	struct bpf_if *		sc_drvbpf;
 
+	kmutex_t 		sc_media_mtx;	/* XXX */
+
 	union {
 		struct wpi_rx_radiotap_header th;
 		uint8_t pad[IEEE80211_RADIOTAP_HDRLEN];

Reply via email to