summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-10-29 10:01:21 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-10-29 10:01:21 +0000
commitdeba945e52dc51700b9b5a2041182ed809ba30d1 (patch)
treeb89454bdaf5b40659c8d05d670caf3927b31a0aa /sys/dev/usb
parent2dd11e9c0c382e8c04af802fbf28c36a2a865505 (diff)
Kill sc_attached, attach and detach events for USB devices are triggered
by the same explore task and cannot happen in parallel.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/if_cdcef.c4
-rw-r--r--sys/dev/usb/if_upl.c9
-rw-r--r--sys/dev/usb/if_urndis.c7
-rw-r--r--sys/dev/usb/if_urndisreg.h3
4 files changed, 4 insertions, 19 deletions
diff --git a/sys/dev/usb/if_cdcef.c b/sys/dev/usb/if_cdcef.c
index 6197282c7bc..74434d102de 100644
--- a/sys/dev/usb/if_cdcef.c
+++ b/sys/dev/usb/if_cdcef.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cdcef.c,v 1.29 2013/08/07 01:06:41 bluhm Exp $ */
+/* $OpenBSD: if_cdcef.c,v 1.30 2013/10/29 10:01:20 mpi Exp $ */
/*
* Copyright (c) 2007 Dale Rahn <drahn@openbsd.org>
@@ -80,7 +80,6 @@ struct cdcef_softc {
int sc_rxeof_errors;
int sc_unit;
- int sc_attached;
int sc_listening;
};
@@ -261,7 +260,6 @@ cdcef_attach(struct device *parent, struct device *self, void *aux)
if_attach(ifp);
ether_ifattach(ifp);
- sc->sc_attached = 1;
splx(s);
}
diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c
index e3d01846d2c..cacbeba7b9c 100644
--- a/sys/dev/usb/if_upl.c
+++ b/sys/dev/usb/if_upl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upl.c,v 1.52 2013/08/07 01:06:42 bluhm Exp $ */
+/* $OpenBSD: if_upl.c,v 1.53 2013/10/29 10:01:20 mpi Exp $ */
/* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -139,7 +139,6 @@ struct upl_softc {
uByte sc_ibuf;
char sc_dying;
- char sc_attached;
u_int sc_rx_errs;
struct timeval sc_rx_notice;
u_int sc_intr_errs;
@@ -297,7 +296,6 @@ upl_attach(struct device *parent, struct device *self, void *aux)
if_attach(ifp);
if_alloc_sadl(ifp);
- sc->sc_attached = 1;
splx(s);
}
@@ -310,10 +308,6 @@ upl_detach(struct device *self, int flags)
DPRINTFN(2,("%s: %s: enter\n", sc->sc_dev.dv_xname, __func__));
- /* Detached before attached finished, so just bail out. */
- if (!sc->sc_attached)
- return (0);
-
s = splusb();
if (ifp->if_flags & IFF_RUNNING)
@@ -330,7 +324,6 @@ upl_detach(struct device *self, int flags)
sc->sc_dev.dv_xname);
#endif
- sc->sc_attached = 0;
splx(s);
return (0);
diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c
index 0feba71bef3..2f75796ed59 100644
--- a/sys/dev/usb/if_urndis.c
+++ b/sys/dev/usb/if_urndis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urndis.c,v 1.40 2013/10/01 20:06:03 sf Exp $ */
+/* $OpenBSD: if_urndis.c,v 1.41 2013/10/29 10:01:20 mpi Exp $ */
/*
* Copyright (c) 2010 Jonathan Armani <armani@openbsd.org>
@@ -1493,7 +1493,6 @@ urndis_attach(struct device *parent, struct device *self, void *aux)
if_attach(ifp);
ether_ifattach(ifp);
- sc->sc_attached = 1;
splx(s);
}
@@ -1509,9 +1508,6 @@ urndis_detach(struct device *self, int flags)
DPRINTF(("urndis_detach: %s flags %u\n", DEVNAME(sc),
flags));
-
- if (!sc->sc_attached)
- return 0;
s = splusb();
@@ -1523,7 +1519,6 @@ urndis_detach(struct device *self, int flags)
}
urndis_stop(sc);
- sc->sc_attached = 0;
splx(s);
diff --git a/sys/dev/usb/if_urndisreg.h b/sys/dev/usb/if_urndisreg.h
index 608a89bdf49..15b355db917 100644
--- a/sys/dev/usb/if_urndisreg.h
+++ b/sys/dev/usb/if_urndisreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_urndisreg.h,v 1.16 2013/04/15 09:23:01 mglocker Exp $ */
+/* $OpenBSD: if_urndisreg.h,v 1.17 2013/10/29 10:01:20 mpi Exp $ */
/*
* Copyright (c) 2010 Jonathan Armani <armani@openbsd.org>
@@ -41,7 +41,6 @@ struct urndis_cdata {
struct urndis_softc {
struct device sc_dev;
- char sc_attached;
int sc_dying;
struct arpcom sc_arpcom;