Remove temporary #inclusion of <dev/usb/usb_port.h>.diff -r1.4 -r1.5 src/sys/dev/usb/moscom.c
(dyoung)
--- src/sys/dev/usb/Attic/moscom.c 2010/11/03 23:46:35 1.4
+++ src/sys/dev/usb/Attic/moscom.c 2010/11/04 01:58:07 1.5
@@ -1,52 +1,50 @@ | @@ -1,52 +1,50 @@ | |||
1 | /* $NetBSD: moscom.c,v 1.4 2010/11/03 23:46:35 dyoung Exp $ */ | 1 | /* $NetBSD: moscom.c,v 1.5 2010/11/04 01:58:07 dyoung Exp $ */ | |
2 | /* $OpenBSD: moscom.c,v 1.11 2007/10/11 18:33:14 deraadt Exp $ */ | 2 | /* $OpenBSD: moscom.c,v 1.11 2007/10/11 18:33:14 deraadt Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org> | 5 | * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org> | |
6 | * | 6 | * | |
7 | * Permission to use, copy, modify, and distribute this software for any | 7 | * Permission to use, copy, modify, and distribute this software for any | |
8 | * purpose with or without fee is hereby granted, provided that the above | 8 | * purpose with or without fee is hereby granted, provided that the above | |
9 | * copyright notice and this permission notice appear in all copies. | 9 | * copyright notice and this permission notice appear in all copies. | |
10 | * | 10 | * | |
11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
15 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 15 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
16 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 16 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
17 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 17 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
18 | */ | 18 | */ | |
19 | 19 | |||
20 | #include <sys/cdefs.h> | 20 | #include <sys/cdefs.h> | |
21 | __KERNEL_RCSID(0, "$NetBSD: moscom.c,v 1.4 2010/11/03 23:46:35 dyoung Exp $"); | 21 | __KERNEL_RCSID(0, "$NetBSD: moscom.c,v 1.5 2010/11/04 01:58:07 dyoung Exp $"); | |
22 | 22 | |||
23 | #include <sys/param.h> | 23 | #include <sys/param.h> | |
24 | #include <sys/systm.h> | 24 | #include <sys/systm.h> | |
25 | #include <sys/kernel.h> | 25 | #include <sys/kernel.h> | |
26 | #include <sys/conf.h> | 26 | #include <sys/conf.h> | |
27 | #include <sys/tty.h> | 27 | #include <sys/tty.h> | |
28 | #include <sys/device.h> | 28 | #include <sys/device.h> | |
29 | 29 | |||
30 | #include <dev/usb/usb.h> | 30 | #include <dev/usb/usb.h> | |
31 | #include <dev/usb/usbdi.h> | 31 | #include <dev/usb/usbdi.h> | |
32 | #include <dev/usb/usbdi_util.h> | 32 | #include <dev/usb/usbdi_util.h> | |
33 | #include <dev/usb/usbdevs.h> | 33 | #include <dev/usb/usbdevs.h> | |
34 | 34 | |||
35 | #include <dev/usb/usbdevs.h> | 35 | #include <dev/usb/usbdevs.h> | |
36 | #include <dev/usb/ucomvar.h> | 36 | #include <dev/usb/ucomvar.h> | |
37 | 37 | |||
38 | #include <dev/usb/usb_port.h> | |||
39 | ||||
40 | #define MOSCOMBUFSZ 256 | 38 | #define MOSCOMBUFSZ 256 | |
41 | #define MOSCOM_CONFIG_NO 0 | 39 | #define MOSCOM_CONFIG_NO 0 | |
42 | #define MOSCOM_IFACE_NO 0 | 40 | #define MOSCOM_IFACE_NO 0 | |
43 | 41 | |||
44 | #define MOSCOM_READ 0x0d | 42 | #define MOSCOM_READ 0x0d | |
45 | #define MOSCOM_WRITE 0x0e | 43 | #define MOSCOM_WRITE 0x0e | |
46 | #define MOSCOM_UART_REG 0x0300 | 44 | #define MOSCOM_UART_REG 0x0300 | |
47 | #define MOSCOM_VEND_REG 0x0000 | 45 | #define MOSCOM_VEND_REG 0x0000 | |
48 | 46 | |||
49 | #define MOSCOM_TXBUF 0x00 /* Write */ | 47 | #define MOSCOM_TXBUF 0x00 /* Write */ | |
50 | #define MOSCOM_RXBUF 0x00 /* Read */ | 48 | #define MOSCOM_RXBUF 0x00 /* Read */ | |
51 | #define MOSCOM_INT 0x01 | 49 | #define MOSCOM_INT 0x01 | |
52 | #define MOSCOM_FIFO 0x02 /* Write */ | 50 | #define MOSCOM_FIFO 0x02 /* Write */ |
--- src/sys/dev/usb/uark.c 2010/11/03 23:46:35 1.2
+++ src/sys/dev/usb/uark.c 2010/11/04 01:58:07 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uark.c,v 1.2 2010/11/03 23:46:35 dyoung Exp $ */ | 1 | /* $NetBSD: uark.c,v 1.3 2010/11/04 01:58:07 dyoung Exp $ */ | |
2 | /* $OpenBSD: uark.c,v 1.13 2009/10/13 19:33:17 pirofti Exp $ */ | 2 | /* $OpenBSD: uark.c,v 1.13 2009/10/13 19:33:17 pirofti Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org> | 5 | * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org> | |
6 | * | 6 | * | |
7 | * Permission to use, copy, modify, and distribute this software for any | 7 | * Permission to use, copy, modify, and distribute this software for any | |
8 | * purpose with or without fee is hereby granted, provided that the above | 8 | * purpose with or without fee is hereby granted, provided that the above | |
9 | * copyright notice and this permission notice appear in all copies. | 9 | * copyright notice and this permission notice appear in all copies. | |
10 | * | 10 | * | |
11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
@@ -21,28 +21,26 @@ | @@ -21,28 +21,26 @@ | |||
21 | #include <sys/systm.h> | 21 | #include <sys/systm.h> | |
22 | #include <sys/kernel.h> | 22 | #include <sys/kernel.h> | |
23 | #include <sys/conf.h> | 23 | #include <sys/conf.h> | |
24 | #include <sys/tty.h> | 24 | #include <sys/tty.h> | |
25 | #include <sys/device.h> | 25 | #include <sys/device.h> | |
26 | 26 | |||
27 | #include <dev/usb/usb.h> | 27 | #include <dev/usb/usb.h> | |
28 | #include <dev/usb/usbdi.h> | 28 | #include <dev/usb/usbdi.h> | |
29 | #include <dev/usb/usbdi_util.h> | 29 | #include <dev/usb/usbdi_util.h> | |
30 | #include <dev/usb/usbdevs.h> | 30 | #include <dev/usb/usbdevs.h> | |
31 | 31 | |||
32 | #include <dev/usb/ucomvar.h> | 32 | #include <dev/usb/ucomvar.h> | |
33 | 33 | |||
34 | #include <dev/usb/usb_port.h> | |||
35 | ||||
36 | #ifdef UARK_DEBUG | 34 | #ifdef UARK_DEBUG | |
37 | #define DPRINTFN(n, x) do { if (uarkdebug > (n)) printf x; } while (0) | 35 | #define DPRINTFN(n, x) do { if (uarkdebug > (n)) printf x; } while (0) | |
38 | int uarkebug = 0; | 36 | int uarkebug = 0; | |
39 | #else | 37 | #else | |
40 | #define DPRINTFN(n, x) | 38 | #define DPRINTFN(n, x) | |
41 | #endif | 39 | #endif | |
42 | #define DPRINTF(x) DPRINTFN(0, x) | 40 | #define DPRINTF(x) DPRINTFN(0, x) | |
43 | 41 | |||
44 | #define UARKBUFSZ 256 | 42 | #define UARKBUFSZ 256 | |
45 | #define UARK_CONFIG_NO 0 | 43 | #define UARK_CONFIG_NO 0 | |
46 | #define UARK_IFACE_NO 0 | 44 | #define UARK_IFACE_NO 0 | |
47 | 45 | |||
48 | #define UARK_SET_DATA_BITS(x) (x - 5) | 46 | #define UARK_SET_DATA_BITS(x) (x - 5) |
--- src/sys/dev/usb/uhmodem.c 2010/11/03 23:46:35 1.10
+++ src/sys/dev/usb/uhmodem.c 2010/11/04 01:58:07 1.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uhmodem.c,v 1.10 2010/11/03 23:46:35 dyoung Exp $ */ | 1 | /* $NetBSD: uhmodem.c,v 1.11 2010/11/04 01:58:07 dyoung Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2008 Yojiro UO <yuo@nui.org>. | 4 | * Copyright (c) 2008 Yojiro UO <yuo@nui.org>. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Permission to use, copy, modify, and distribute this software for any | 7 | * Permission to use, copy, modify, and distribute this software for any | |
8 | * purpose with or without fee is hereby granted, provided that the above | 8 | * purpose with or without fee is hereby granted, provided that the above | |
9 | * copyright notice and this permission notice appear in all copies. | 9 | * copyright notice and this permission notice appear in all copies. | |
10 | * | 10 | * | |
11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
@@ -61,51 +61,49 @@ | @@ -61,51 +61,49 @@ | |||
61 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 61 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
62 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 62 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
63 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 63 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
64 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 64 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
65 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 65 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
66 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 66 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
67 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 67 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
68 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 68 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
69 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 69 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
70 | * POSSIBILITY OF SUCH DAMAGE. | 70 | * POSSIBILITY OF SUCH DAMAGE. | |
71 | */ | 71 | */ | |
72 | 72 | |||
73 | #include <sys/cdefs.h> | 73 | #include <sys/cdefs.h> | |
74 | __KERNEL_RCSID(0, "$NetBSD: uhmodem.c,v 1.10 2010/11/03 23:46:35 dyoung Exp $"); | 74 | __KERNEL_RCSID(0, "$NetBSD: uhmodem.c,v 1.11 2010/11/04 01:58:07 dyoung Exp $"); | |
75 | 75 | |||
76 | #include <sys/param.h> | 76 | #include <sys/param.h> | |
77 | #include <sys/systm.h> | 77 | #include <sys/systm.h> | |
78 | #include <sys/kernel.h> | 78 | #include <sys/kernel.h> | |
79 | #include <sys/malloc.h> | 79 | #include <sys/malloc.h> | |
80 | #include <sys/ioccom.h> | 80 | #include <sys/ioccom.h> | |
81 | #include <sys/fcntl.h> | 81 | #include <sys/fcntl.h> | |
82 | #include <sys/conf.h> | 82 | #include <sys/conf.h> | |
83 | #include <sys/tty.h> | 83 | #include <sys/tty.h> | |
84 | #include <sys/file.h> | 84 | #include <sys/file.h> | |
85 | #include <sys/select.h> | 85 | #include <sys/select.h> | |
86 | #include <sys/proc.h> | 86 | #include <sys/proc.h> | |
87 | #include <sys/device.h> | 87 | #include <sys/device.h> | |
88 | #include <sys/poll.h> | 88 | #include <sys/poll.h> | |
89 | #include <sys/sysctl.h> | 89 | #include <sys/sysctl.h> | |
90 | #include <sys/bus.h> | 90 | #include <sys/bus.h> | |
91 | 91 | |||
92 | #include <dev/usb/usb.h> | 92 | #include <dev/usb/usb.h> | |
93 | #include <dev/usb/usbdi.h> | 93 | #include <dev/usb/usbdi.h> | |
94 | #include <dev/usb/usbdi_util.h> | 94 | #include <dev/usb/usbdi_util.h> | |
95 | #include <dev/usb/usbdivar.h> | 95 | #include <dev/usb/usbdivar.h> | |
96 | 96 | |||
97 | #include <dev/usb/usb_port.h> | |||
98 | ||||
99 | #include <dev/usb/usbcdc.h> | 97 | #include <dev/usb/usbcdc.h> | |
100 | #include <dev/usb/usbdevs.h> | 98 | #include <dev/usb/usbdevs.h> | |
101 | #include <dev/usb/usb_quirks.h> | 99 | #include <dev/usb/usb_quirks.h> | |
102 | #include <dev/usb/ucomvar.h> | 100 | #include <dev/usb/ucomvar.h> | |
103 | #include <dev/usb/ubsavar.h> | 101 | #include <dev/usb/ubsavar.h> | |
104 | 102 | |||
105 | /* vendor specific bRequest */ | 103 | /* vendor specific bRequest */ | |
106 | #define UHMODEM_REGWRITE 0x20 | 104 | #define UHMODEM_REGWRITE 0x20 | |
107 | #define UHMODEM_REGREAD 0x21 | 105 | #define UHMODEM_REGREAD 0x21 | |
108 | #define UHMODEM_SETUP 0x22 | 106 | #define UHMODEM_SETUP 0x22 | |
109 | 107 | |||
110 | #define UHMODEMIBUFSIZE 4096 | 108 | #define UHMODEMIBUFSIZE 4096 | |
111 | #define UHMODEMOBUFSIZE 4096 | 109 | #define UHMODEMOBUFSIZE 4096 |
--- src/sys/dev/usb/Attic/uyurex.c 2010/11/03 23:46:35 1.3
+++ src/sys/dev/usb/Attic/uyurex.c 2010/11/04 01:58:07 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uyurex.c,v 1.3 2010/11/03 23:46:35 dyoung Exp $ */ | 1 | /* $NetBSD: uyurex.c,v 1.4 2010/11/04 01:58:07 dyoung Exp $ */ | |
2 | /* $OpenBSD: uyurex.c,v 1.3 2010/03/04 03:47:22 deraadt Exp $ */ | 2 | /* $OpenBSD: uyurex.c,v 1.3 2010/03/04 03:47:22 deraadt Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 2010 Yojiro UO <yuo@nui.org> | 5 | * Copyright (c) 2010 Yojiro UO <yuo@nui.org> | |
6 | * | 6 | * | |
7 | * Permission to use, copy, modify, and distribute this software for any | 7 | * Permission to use, copy, modify, and distribute this software for any | |
8 | * purpose with or without fee is hereby granted, provided that the above | 8 | * purpose with or without fee is hereby granted, provided that the above | |
9 | * copyright notice and this permission notice appear in all copies. | 9 | * copyright notice and this permission notice appear in all copies. | |
10 | * | 10 | * | |
11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCAIMS ALL WARRANTIES | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCAIMS ALL WARRANTIES | |
12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
@@ -28,28 +28,26 @@ | @@ -28,28 +28,26 @@ | |||
28 | #include <sys/conf.h> | 28 | #include <sys/conf.h> | |
29 | #include <sys/envsys.h> | 29 | #include <sys/envsys.h> | |
30 | 30 | |||
31 | #include <dev/sysmon/sysmonvar.h> | 31 | #include <dev/sysmon/sysmonvar.h> | |
32 | 32 | |||
33 | #include <dev/usb/usb.h> | 33 | #include <dev/usb/usb.h> | |
34 | #include <dev/usb/usbhid.h> | 34 | #include <dev/usb/usbhid.h> | |
35 | #include <dev/usb/usbdi.h> | 35 | #include <dev/usb/usbdi.h> | |
36 | #include <dev/usb/usbdi_util.h> | 36 | #include <dev/usb/usbdi_util.h> | |
37 | #include <dev/usb/usbdevs.h> | 37 | #include <dev/usb/usbdevs.h> | |
38 | #include <dev/usb/uhidev.h> | 38 | #include <dev/usb/uhidev.h> | |
39 | #include <dev/usb/hid.h> | 39 | #include <dev/usb/hid.h> | |
40 | 40 | |||
41 | #include <dev/usb/usb_port.h> | |||
42 | ||||
43 | #ifdef USB_DEBUG | 41 | #ifdef USB_DEBUG | |
44 | #define UYUREX_DEBUG | 42 | #define UYUREX_DEBUG | |
45 | #endif | 43 | #endif | |
46 | 44 | |||
47 | #define CMD_NONE 0xf0 | 45 | #define CMD_NONE 0xf0 | |
48 | #define CMD_EOF 0x0d | 46 | #define CMD_EOF 0x0d | |
49 | #define CMD_ACK 0x21 | 47 | #define CMD_ACK 0x21 | |
50 | #define CMD_MODE 0x41 /* XXX */ | 48 | #define CMD_MODE 0x41 /* XXX */ | |
51 | #define CMD_VALUE 0x43 | 49 | #define CMD_VALUE 0x43 | |
52 | #define CMD_READ 0x52 | 50 | #define CMD_READ 0x52 | |
53 | #define CMD_WRITE 0x53 | 51 | #define CMD_WRITE 0x53 | |
54 | #define CMD_PADDING 0xff | 52 | #define CMD_PADDING 0xff | |
55 | 53 |
--- src/sys/dev/usb/Attic/xboxcontroller.c 2010/11/03 23:46:35 1.13
+++ src/sys/dev/usb/Attic/xboxcontroller.c 2010/11/04 01:58:07 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: xboxcontroller.c,v 1.13 2010/11/03 23:46:35 dyoung Exp $ */ | 1 | /* $NetBSD: xboxcontroller.c,v 1.14 2010/11/04 01:58:07 dyoung Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -17,45 +17,43 @@ | @@ -17,45 +17,43 @@ | |||
17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | __KERNEL_RCSID(0, "$NetBSD: xboxcontroller.c,v 1.13 2010/11/03 23:46:35 dyoung Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: xboxcontroller.c,v 1.14 2010/11/04 01:58:07 dyoung Exp $"); | |
31 | 31 | |||
32 | #include <sys/param.h> | 32 | #include <sys/param.h> | |
33 | #include <sys/systm.h> | 33 | #include <sys/systm.h> | |
34 | #include <sys/device.h> | 34 | #include <sys/device.h> | |
35 | #include <sys/malloc.h> | 35 | #include <sys/malloc.h> | |
36 | 36 | |||
37 | #include <sys/bus.h> | 37 | #include <sys/bus.h> | |
38 | 38 | |||
39 | #include <dev/wscons/wsconsio.h> | 39 | #include <dev/wscons/wsconsio.h> | |
40 | #include <dev/wscons/wsmousevar.h> | 40 | #include <dev/wscons/wsmousevar.h> | |
41 | 41 | |||
42 | #include <dev/usb/usb.h> | 42 | #include <dev/usb/usb.h> | |
43 | #include <dev/usb/usbdi.h> | 43 | #include <dev/usb/usbdi.h> | |
44 | #include <dev/usb/usbdi_util.h> | 44 | #include <dev/usb/usbdi_util.h> | |
45 | #include <dev/usb/usbdevs.h> | 45 | #include <dev/usb/usbdevs.h> | |
46 | 46 | |||
47 | #include <dev/usb/usb_port.h> | |||
48 | ||||
49 | #define XBOX_CONTROLLER_BUFSZ 32 | 47 | #define XBOX_CONTROLLER_BUFSZ 32 | |
50 | 48 | |||
51 | struct xboxcontroller_softc { | 49 | struct xboxcontroller_softc { | |
52 | device_t sc_dev; | 50 | device_t sc_dev; | |
53 | 51 | |||
54 | usbd_device_handle sc_udev; | 52 | usbd_device_handle sc_udev; | |
55 | usbd_interface_handle sc_iface; | 53 | usbd_interface_handle sc_iface; | |
56 | int sc_ed; | 54 | int sc_ed; | |
57 | usbd_pipe_handle sc_ep; | 55 | usbd_pipe_handle sc_ep; | |
58 | unsigned char *sc_buf; | 56 | unsigned char *sc_buf; | |
59 | 57 | |||
60 | int sc_drvmode; | 58 | int sc_drvmode; | |
61 | #define XBOX_CONTROLLER_MODE_MOUSE 1 | 59 | #define XBOX_CONTROLLER_MODE_MOUSE 1 |