remove checks against "!curproc".diff -r1.75 -r1.76 src/sys/dev/usb/if_kue.c
(mrg)
--- src/sys/dev/usb/if_kue.c 2012/02/02 19:43:07 1.75
+++ src/sys/dev/usb/if_kue.c 2012/03/10 23:01:07 1.76
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: if_kue.c,v 1.75 2012/02/02 19:43:07 tls Exp $ */ | 1 | /* $NetBSD: if_kue.c,v 1.76 2012/03/10 23:01:07 mrg Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 1997, 1998, 1999, 2000 | 3 | * Copyright (c) 1997, 1998, 1999, 2000 | |
4 | * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. | 4 | * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | 14 | * 3. All advertising materials mentioning features or use of this software | |
@@ -60,27 +60,27 @@ | @@ -60,27 +60,27 @@ | |||
60 | * powered on and retain its firmware. In this case, we don't need | 60 | * powered on and retain its firmware. In this case, we don't need | |
61 | * to load the firmware a second time. | 61 | * to load the firmware a second time. | |
62 | * | 62 | * | |
63 | * Special thanks to Rob Furr for providing an ADS Technologies | 63 | * Special thanks to Rob Furr for providing an ADS Technologies | |
64 | * adapter for development and testing. No monkeys were harmed during | 64 | * adapter for development and testing. No monkeys were harmed during | |
65 | * the development of this driver. | 65 | * the development of this driver. | |
66 | */ | 66 | */ | |
67 | 67 | |||
68 | /* | 68 | /* | |
69 | * Ported to NetBSD and somewhat rewritten by Lennart Augustsson. | 69 | * Ported to NetBSD and somewhat rewritten by Lennart Augustsson. | |
70 | */ | 70 | */ | |
71 | 71 | |||
72 | #include <sys/cdefs.h> | 72 | #include <sys/cdefs.h> | |
73 | __KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.75 2012/02/02 19:43:07 tls Exp $"); | 73 | __KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.76 2012/03/10 23:01:07 mrg Exp $"); | |
74 | 74 | |||
75 | #include "opt_inet.h" | 75 | #include "opt_inet.h" | |
76 | 76 | |||
77 | #include <sys/param.h> | 77 | #include <sys/param.h> | |
78 | #include <sys/systm.h> | 78 | #include <sys/systm.h> | |
79 | #include <sys/sockio.h> | 79 | #include <sys/sockio.h> | |
80 | #include <sys/mbuf.h> | 80 | #include <sys/mbuf.h> | |
81 | #include <sys/malloc.h> | 81 | #include <sys/malloc.h> | |
82 | #include <sys/kernel.h> | 82 | #include <sys/kernel.h> | |
83 | #include <sys/socket.h> | 83 | #include <sys/socket.h> | |
84 | #include <sys/device.h> | 84 | #include <sys/device.h> | |
85 | #include <sys/proc.h> | 85 | #include <sys/proc.h> | |
86 | 86 | |||
@@ -976,33 +976,26 @@ kue_open_pipes(struct kue_softc *sc) | @@ -976,33 +976,26 @@ kue_open_pipes(struct kue_softc *sc) | |||
976 | static int | 976 | static int | |
977 | kue_ioctl(struct ifnet *ifp, u_long command, void *data) | 977 | kue_ioctl(struct ifnet *ifp, u_long command, void *data) | |
978 | { | 978 | { | |
979 | struct kue_softc *sc = ifp->if_softc; | 979 | struct kue_softc *sc = ifp->if_softc; | |
980 | struct ifaddr *ifa = (struct ifaddr *)data; | 980 | struct ifaddr *ifa = (struct ifaddr *)data; | |
981 | struct ifreq *ifr = (struct ifreq *)data; | 981 | struct ifreq *ifr = (struct ifreq *)data; | |
982 | int s, error = 0; | 982 | int s, error = 0; | |
983 | 983 | |||
984 | DPRINTFN(5,("%s: %s: enter\n", device_xname(sc->kue_dev),__func__)); | 984 | DPRINTFN(5,("%s: %s: enter\n", device_xname(sc->kue_dev),__func__)); | |
985 | 985 | |||
986 | if (sc->kue_dying) | 986 | if (sc->kue_dying) | |
987 | return (EIO); | 987 | return (EIO); | |
988 | 988 | |||
989 | #ifdef DIAGNOSTIC | |||
990 | if (!curproc) { | |||
991 | printf("%s: no proc!!\n", device_xname(sc->kue_dev)); | |||
992 | return EIO; | |||
993 | } | |||
994 | #endif | |||
995 | ||||
996 | s = splnet(); | 989 | s = splnet(); | |
997 | 990 | |||
998 | switch(command) { | 991 | switch(command) { | |
999 | case SIOCINITIFADDR: | 992 | case SIOCINITIFADDR: | |
1000 | ifp->if_flags |= IFF_UP; | 993 | ifp->if_flags |= IFF_UP; | |
1001 | kue_init(sc); | 994 | kue_init(sc); | |
1002 | 995 | |||
1003 | switch (ifa->ifa_addr->sa_family) { | 996 | switch (ifa->ifa_addr->sa_family) { | |
1004 | #ifdef INET | 997 | #ifdef INET | |
1005 | case AF_INET: | 998 | case AF_INET: | |
1006 | arp_ifinit(ifp, ifa); | 999 | arp_ifinit(ifp, ifa); | |
1007 | break; | 1000 | break; | |
1008 | #endif /* INET */ | 1001 | #endif /* INET */ |
--- src/sys/dev/usb/ohci.c 2012/03/06 03:35:29 1.221
+++ src/sys/dev/usb/ohci.c 2012/03/10 23:01:07 1.222
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ohci.c,v 1.221 2012/03/06 03:35:29 mrg Exp $ */ | 1 | /* $NetBSD: ohci.c,v 1.222 2012/03/10 23:01:07 mrg Exp $ */ | |
2 | /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */ | 2 | /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 1998, 2004, 2005 The NetBSD Foundation, Inc. | 5 | * Copyright (c) 1998, 2004, 2005 The NetBSD Foundation, Inc. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to The NetBSD Foundation | 8 | * This code is derived from software contributed to The NetBSD Foundation | |
9 | * by Lennart Augustsson (lennart@augustsson.net) at | 9 | * by Lennart Augustsson (lennart@augustsson.net) at | |
10 | * Carlstedt Research & Technology. | 10 | * Carlstedt Research & Technology. | |
11 | * This code is derived from software contributed to The NetBSD Foundation | 11 | * This code is derived from software contributed to The NetBSD Foundation | |
12 | * by Charles M. Hannum. | 12 | * by Charles M. Hannum. | |
13 | * | 13 | * | |
14 | * Redistribution and use in source and binary forms, with or without | 14 | * Redistribution and use in source and binary forms, with or without | |
@@ -31,27 +31,27 @@ | @@ -31,27 +31,27 @@ | |||
31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
33 | * POSSIBILITY OF SUCH DAMAGE. | 33 | * POSSIBILITY OF SUCH DAMAGE. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | /* | 36 | /* | |
37 | * USB Open Host Controller driver. | 37 | * USB Open Host Controller driver. | |
38 | * | 38 | * | |
39 | * OHCI spec: http://www.compaq.com/productinfo/development/openhci.html | 39 | * OHCI spec: http://www.compaq.com/productinfo/development/openhci.html | |
40 | * USB spec: http://www.usb.org/developers/docs/ | 40 | * USB spec: http://www.usb.org/developers/docs/ | |
41 | */ | 41 | */ | |
42 | 42 | |||
43 | #include <sys/cdefs.h> | 43 | #include <sys/cdefs.h> | |
44 | __KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.221 2012/03/06 03:35:29 mrg Exp $"); | 44 | __KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.222 2012/03/10 23:01:07 mrg Exp $"); | |
45 | 45 | |||
46 | #include "opt_usb.h" | 46 | #include "opt_usb.h" | |
47 | 47 | |||
48 | #include <sys/param.h> | 48 | #include <sys/param.h> | |
49 | #include <sys/systm.h> | 49 | #include <sys/systm.h> | |
50 | #include <sys/malloc.h> | 50 | #include <sys/malloc.h> | |
51 | #include <sys/kernel.h> | 51 | #include <sys/kernel.h> | |
52 | #include <sys/device.h> | 52 | #include <sys/device.h> | |
53 | #include <sys/select.h> | 53 | #include <sys/select.h> | |
54 | #include <sys/proc.h> | 54 | #include <sys/proc.h> | |
55 | #include <sys/queue.h> | 55 | #include <sys/queue.h> | |
56 | 56 | |||
57 | #include <sys/bus.h> | 57 | #include <sys/bus.h> | |
@@ -2230,27 +2230,27 @@ ohci_abort_xfer(usbd_xfer_handle xfer, u | @@ -2230,27 +2230,27 @@ ohci_abort_xfer(usbd_xfer_handle xfer, u | |||
2230 | 2230 | |||
2231 | DPRINTF(("ohci_abort_xfer: xfer=%p pipe=%p sed=%p\n", xfer, opipe,sed)); | 2231 | DPRINTF(("ohci_abort_xfer: xfer=%p pipe=%p sed=%p\n", xfer, opipe,sed)); | |
2232 | 2232 | |||
2233 | if (sc->sc_dying) { | 2233 | if (sc->sc_dying) { | |
2234 | /* If we're dying, just do the software part. */ | 2234 | /* If we're dying, just do the software part. */ | |
2235 | s = splusb(); | 2235 | s = splusb(); | |
2236 | xfer->status = status; /* make software ignore it */ | 2236 | xfer->status = status; /* make software ignore it */ | |
2237 | callout_stop(&xfer->timeout_handle); | 2237 | callout_stop(&xfer->timeout_handle); | |
2238 | usb_transfer_complete(xfer); | 2238 | usb_transfer_complete(xfer); | |
2239 | splx(s); | 2239 | splx(s); | |
2240 | return; | 2240 | return; | |
2241 | } | 2241 | } | |
2242 | 2242 | |||
2243 | if (xfer->device->bus->intr_context || !curproc) | 2243 | if (xfer->device->bus->intr_context) | |
2244 | panic("ohci_abort_xfer: not in process context"); | 2244 | panic("ohci_abort_xfer: not in process context"); | |
2245 | 2245 | |||
2246 | /* | 2246 | /* | |
2247 | * If an abort is already in progress then just wait for it to | 2247 | * If an abort is already in progress then just wait for it to | |
2248 | * complete and return. | 2248 | * complete and return. | |
2249 | */ | 2249 | */ | |
2250 | if (xfer->hcflags & UXFER_ABORTING) { | 2250 | if (xfer->hcflags & UXFER_ABORTING) { | |
2251 | DPRINTFN(2, ("ohci_abort_xfer: already aborting\n")); | 2251 | DPRINTFN(2, ("ohci_abort_xfer: already aborting\n")); | |
2252 | #ifdef DIAGNOSTIC | 2252 | #ifdef DIAGNOSTIC | |
2253 | if (status == USBD_TIMEOUT) | 2253 | if (status == USBD_TIMEOUT) | |
2254 | printf("0hci_abort_xfer: TIMEOUT while aborting\n"); | 2254 | printf("0hci_abort_xfer: TIMEOUT while aborting\n"); | |
2255 | #endif | 2255 | #endif | |
2256 | /* Override the status which might be USBD_TIMEOUT. */ | 2256 | /* Override the status which might be USBD_TIMEOUT. */ |
--- src/sys/dev/usb/uhci.c 2012/03/06 03:35:29 1.245
+++ src/sys/dev/usb/uhci.c 2012/03/10 23:01:07 1.246
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uhci.c,v 1.245 2012/03/06 03:35:29 mrg Exp $ */ | 1 | /* $NetBSD: uhci.c,v 1.246 2012/03/10 23:01:07 mrg Exp $ */ | |
2 | /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ | 2 | /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. | 5 | * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * This code is derived from software contributed to The NetBSD Foundation | 8 | * This code is derived from software contributed to The NetBSD Foundation | |
9 | * by Lennart Augustsson (lennart@augustsson.net) at | 9 | * by Lennart Augustsson (lennart@augustsson.net) at | |
10 | * Carlstedt Research & Technology. | 10 | * Carlstedt Research & Technology. | |
11 | * | 11 | * | |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without | |
13 | * modification, are permitted provided that the following conditions | 13 | * modification, are permitted provided that the following conditions | |
14 | * are met: | 14 | * are met: | |
@@ -32,27 +32,27 @@ | @@ -32,27 +32,27 @@ | |||
32 | */ | 32 | */ | |
33 | 33 | |||
34 | /* | 34 | /* | |
35 | * USB Universal Host Controller driver. | 35 | * USB Universal Host Controller driver. | |
36 | * Handles e.g. PIIX3 and PIIX4. | 36 | * Handles e.g. PIIX3 and PIIX4. | |
37 | * | 37 | * | |
38 | * UHCI spec: http://www.intel.com/technology/usb/spec.htm | 38 | * UHCI spec: http://www.intel.com/technology/usb/spec.htm | |
39 | * USB spec: http://www.usb.org/developers/docs/ | 39 | * USB spec: http://www.usb.org/developers/docs/ | |
40 | * PIIXn spec: ftp://download.intel.com/design/intarch/datashts/29055002.pdf | 40 | * PIIXn spec: ftp://download.intel.com/design/intarch/datashts/29055002.pdf | |
41 | * ftp://download.intel.com/design/intarch/datashts/29056201.pdf | 41 | * ftp://download.intel.com/design/intarch/datashts/29056201.pdf | |
42 | */ | 42 | */ | |
43 | 43 | |||
44 | #include <sys/cdefs.h> | 44 | #include <sys/cdefs.h> | |
45 | __KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.245 2012/03/06 03:35:29 mrg Exp $"); | 45 | __KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.246 2012/03/10 23:01:07 mrg Exp $"); | |
46 | 46 | |||
47 | #include "opt_usb.h" | 47 | #include "opt_usb.h" | |
48 | 48 | |||
49 | #include <sys/param.h> | 49 | #include <sys/param.h> | |
50 | #include <sys/systm.h> | 50 | #include <sys/systm.h> | |
51 | #include <sys/kernel.h> | 51 | #include <sys/kernel.h> | |
52 | #include <sys/malloc.h> | 52 | #include <sys/malloc.h> | |
53 | #include <sys/device.h> | 53 | #include <sys/device.h> | |
54 | #include <sys/select.h> | 54 | #include <sys/select.h> | |
55 | #include <sys/extent.h> | 55 | #include <sys/extent.h> | |
56 | #include <sys/proc.h> | 56 | #include <sys/proc.h> | |
57 | #include <sys/queue.h> | 57 | #include <sys/queue.h> | |
58 | #include <sys/bus.h> | 58 | #include <sys/bus.h> | |
@@ -2068,27 +2068,27 @@ uhci_abort_xfer(usbd_xfer_handle xfer, u | @@ -2068,27 +2068,27 @@ uhci_abort_xfer(usbd_xfer_handle xfer, u | |||
2068 | 2068 | |||
2069 | DPRINTFN(1,("uhci_abort_xfer: xfer=%p, status=%d\n", xfer, status)); | 2069 | DPRINTFN(1,("uhci_abort_xfer: xfer=%p, status=%d\n", xfer, status)); | |
2070 | 2070 | |||
2071 | if (sc->sc_dying) { | 2071 | if (sc->sc_dying) { | |
2072 | /* If we're dying, just do the software part. */ | 2072 | /* If we're dying, just do the software part. */ | |
2073 | s = splusb(); | 2073 | s = splusb(); | |
2074 | xfer->status = status; /* make software ignore it */ | 2074 | xfer->status = status; /* make software ignore it */ | |
2075 | callout_stop(&xfer->timeout_handle); | 2075 | callout_stop(&xfer->timeout_handle); | |
2076 | usb_transfer_complete(xfer); | 2076 | usb_transfer_complete(xfer); | |
2077 | splx(s); | 2077 | splx(s); | |
2078 | return; | 2078 | return; | |
2079 | } | 2079 | } | |
2080 | 2080 | |||
2081 | if (xfer->device->bus->intr_context || !curproc) | 2081 | if (xfer->device->bus->intr_context) | |
2082 | panic("uhci_abort_xfer: not in process context"); | 2082 | panic("uhci_abort_xfer: not in process context"); | |
2083 | 2083 | |||
2084 | /* | 2084 | /* | |
2085 | * If an abort is already in progress then just wait for it to | 2085 | * If an abort is already in progress then just wait for it to | |
2086 | * complete and return. | 2086 | * complete and return. | |
2087 | */ | 2087 | */ | |
2088 | if (xfer->hcflags & UXFER_ABORTING) { | 2088 | if (xfer->hcflags & UXFER_ABORTING) { | |
2089 | DPRINTFN(2, ("uhci_abort_xfer: already aborting\n")); | 2089 | DPRINTFN(2, ("uhci_abort_xfer: already aborting\n")); | |
2090 | #ifdef DIAGNOSTIC | 2090 | #ifdef DIAGNOSTIC | |
2091 | if (status == USBD_TIMEOUT) | 2091 | if (status == USBD_TIMEOUT) | |
2092 | printf("uhci_abort_xfer: TIMEOUT while aborting\n"); | 2092 | printf("uhci_abort_xfer: TIMEOUT while aborting\n"); | |
2093 | #endif | 2093 | #endif | |
2094 | /* Override the status which might be USBD_TIMEOUT. */ | 2094 | /* Override the status which might be USBD_TIMEOUT. */ |