| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: umass_scsipi.c,v 1.49.2.9 2017/01/29 10:16:09 skrll Exp $ */ | | 1 | /* $NetBSD: umass_scsipi.c,v 1.49.2.10 2017/02/05 09:02:38 skrll Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2001, 2003, 2012 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2001, 2003, 2012 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Lennart Augustsson (lennart@augustsson.net) at | | 8 | * by Lennart Augustsson (lennart@augustsson.net) at |
9 | * Carlstedt Research & Technology, Charles M. Hamnnum and Matthew R. Green. | | 9 | * Carlstedt Research & Technology, Charles M. Hamnnum and Matthew R. Green. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -21,43 +21,44 @@ | | | @@ -21,43 +21,44 @@ |
21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30 | * POSSIBILITY OF SUCH DAMAGE. | | 30 | * POSSIBILITY OF SUCH DAMAGE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.49.2.9 2017/01/29 10:16:09 skrll Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.49.2.10 2017/02/05 09:02:38 skrll Exp $"); |
35 | | | 35 | |
36 | #ifdef _KERNEL_OPT | | 36 | #ifdef _KERNEL_OPT |
37 | #include "opt_usb.h" | | 37 | #include "opt_usb.h" |
38 | #endif | | 38 | #endif |
39 | | | 39 | |
40 | #include "atapibus.h" | | 40 | #include "atapibus.h" |
41 | #include "scsibus.h" | | 41 | #include "scsibus.h" |
42 | | | 42 | |
43 | #include <sys/param.h> | | 43 | #include <sys/param.h> |
44 | #include <sys/buf.h> | | 44 | #include <sys/buf.h> |
45 | #include <sys/bufq.h> | | 45 | #include <sys/bufq.h> |
46 | #include <sys/conf.h> | | 46 | #include <sys/conf.h> |
47 | #include <sys/device.h> | | 47 | #include <sys/device.h> |
48 | #include <sys/disk.h> /* XXX */ | | 48 | #include <sys/disk.h> /* XXX */ |
49 | #include <sys/ioctl.h> | | 49 | #include <sys/ioctl.h> |
50 | #include <sys/kernel.h> | | 50 | #include <sys/kernel.h> |
| | | 51 | #include <sys/kmem.h> |
51 | #include <sys/lwp.h> | | 52 | #include <sys/lwp.h> |
52 | #include <sys/malloc.h> | | 53 | #include <sys/malloc.h> |
53 | #include <sys/systm.h> | | 54 | #include <sys/systm.h> |
54 | | | 55 | |
55 | /* SCSI & ATAPI */ | | 56 | /* SCSI & ATAPI */ |
56 | #include <sys/scsiio.h> | | 57 | #include <sys/scsiio.h> |
57 | #include <dev/scsipi/scsi_spc.h> | | 58 | #include <dev/scsipi/scsi_spc.h> |
58 | #include <dev/scsipi/scsi_all.h> | | 59 | #include <dev/scsipi/scsi_all.h> |
59 | #include <dev/scsipi/scsipi_all.h> | | 60 | #include <dev/scsipi/scsipi_all.h> |
60 | #include <dev/scsipi/scsiconf.h> | | 61 | #include <dev/scsipi/scsiconf.h> |
61 | | | 62 | |
62 | #include <dev/scsipi/atapiconf.h> | | 63 | #include <dev/scsipi/atapiconf.h> |
63 | | | 64 | |