KNFdiff -r1.6.32.5 -r1.6.32.6 src/sys/dev/usb/auvitek_video.c
(skrll)
--- src/sys/dev/usb/auvitek_video.c 2015/12/28 09:26:33 1.6.32.5
+++ src/sys/dev/usb/auvitek_video.c 2017/01/29 15:58:14 1.6.32.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: auvitek_video.c,v 1.6.32.5 2015/12/28 09:26:33 skrll Exp $ */ | 1 | /* $NetBSD: auvitek_video.c,v 1.6.32.6 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2010 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. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
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 | /* | 29 | /* | |
30 | * Auvitek AU0828 USB controller | 30 | * Auvitek AU0828 USB controller | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: auvitek_video.c,v 1.6.32.5 2015/12/28 09:26:33 skrll Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: auvitek_video.c,v 1.6.32.6 2017/01/29 15:58:14 skrll Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | #include <sys/conf.h> | 39 | #include <sys/conf.h> | |
40 | #include <sys/kmem.h> | 40 | #include <sys/kmem.h> | |
41 | #include <sys/bus.h> | 41 | #include <sys/bus.h> | |
42 | 42 | |||
43 | #include <dev/usb/usb.h> | 43 | #include <dev/usb/usb.h> | |
44 | #include <dev/usb/usbdi.h> | 44 | #include <dev/usb/usbdi.h> | |
45 | #include <dev/usb/usbdivar.h> | 45 | #include <dev/usb/usbdivar.h> | |
46 | #include <dev/usb/usbdi_util.h> | 46 | #include <dev/usb/usbdi_util.h> | |
47 | #include <dev/usb/usbdevs.h> | 47 | #include <dev/usb/usbdevs.h> | |
@@ -124,27 +124,27 @@ static const struct video_hw_if auvitek_ | @@ -124,27 +124,27 @@ static const struct video_hw_if auvitek_ | |||
124 | .set_input = auvitek_set_input, | 124 | .set_input = auvitek_set_input, | |
125 | .get_frequency = auvitek_get_frequency, | 125 | .get_frequency = auvitek_get_frequency, | |
126 | .set_frequency = auvitek_set_frequency, | 126 | .set_frequency = auvitek_set_frequency, | |
127 | }; | 127 | }; | |
128 | 128 | |||
129 | int | 129 | int | |
130 | auvitek_video_attach(struct auvitek_softc *sc) | 130 | auvitek_video_attach(struct auvitek_softc *sc) | |
131 | { | 131 | { | |
132 | snprintf(sc->sc_businfo, sizeof(sc->sc_businfo), "usb:%08x", | 132 | snprintf(sc->sc_businfo, sizeof(sc->sc_businfo), "usb:%08x", | |
133 | sc->sc_udev->ud_cookie.cookie); | 133 | sc->sc_udev->ud_cookie.cookie); | |
134 | 134 | |||
135 | auvitek_video_rescan(sc, NULL, NULL); | 135 | auvitek_video_rescan(sc, NULL, NULL); | |
136 | 136 | |||
137 | return (sc->sc_videodev != NULL); | 137 | return sc->sc_videodev != NULL; | |
138 | } | 138 | } | |
139 | 139 | |||
140 | int | 140 | int | |
141 | auvitek_video_detach(struct auvitek_softc *sc, int flags) | 141 | auvitek_video_detach(struct auvitek_softc *sc, int flags) | |
142 | { | 142 | { | |
143 | if (sc->sc_videodev != NULL) { | 143 | if (sc->sc_videodev != NULL) { | |
144 | config_detach(sc->sc_videodev, flags); | 144 | config_detach(sc->sc_videodev, flags); | |
145 | sc->sc_videodev = NULL; | 145 | sc->sc_videodev = NULL; | |
146 | } | 146 | } | |
147 | 147 | |||
148 | return 0; | 148 | return 0; | |
149 | } | 149 | } | |
150 | 150 |
--- src/sys/dev/usb/if_run.c 2016/12/05 10:55:18 1.10.6.12
+++ src/sys/dev/usb/if_run.c 2017/01/29 15:58:14 1.10.6.13
@@ -1,39 +1,39 @@ | @@ -1,39 +1,39 @@ | |||
1 | /* $NetBSD: if_run.c,v 1.10.6.12 2016/12/05 10:55:18 skrll Exp $ */ | 1 | /* $NetBSD: if_run.c,v 1.10.6.13 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | /* $OpenBSD: if_run.c,v 1.90 2012/03/24 15:11:04 jsg Exp $ */ | 2 | /* $OpenBSD: if_run.c,v 1.90 2012/03/24 15:11:04 jsg Exp $ */ | |
3 | 3 | |||
4 | /*- | 4 | /*- | |
5 | * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> | 5 | * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> | |
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 | /*- | 20 | /*- | |
21 | * Ralink Technology RT2700U/RT2800U/RT3000U chipset driver. | 21 | * Ralink Technology RT2700U/RT2800U/RT3000U chipset driver. | |
22 | * http://www.ralinktech.com/ | 22 | * http://www.ralinktech.com/ | |
23 | */ | 23 | */ | |
24 | 24 | |||
25 | #include <sys/cdefs.h> | 25 | #include <sys/cdefs.h> | |
26 | __KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.10.6.12 2016/12/05 10:55:18 skrll Exp $"); | 26 | __KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.10.6.13 2017/01/29 15:58:14 skrll Exp $"); | |
27 | 27 | |||
28 | #ifdef _KERNEL_OPT | 28 | #ifdef _KERNEL_OPT | |
29 | #include "opt_usb.h" | 29 | #include "opt_usb.h" | |
30 | #endif | 30 | #endif | |
31 | 31 | |||
32 | #include <sys/param.h> | 32 | #include <sys/param.h> | |
33 | #include <sys/sockio.h> | 33 | #include <sys/sockio.h> | |
34 | #include <sys/sysctl.h> | 34 | #include <sys/sysctl.h> | |
35 | #include <sys/mbuf.h> | 35 | #include <sys/mbuf.h> | |
36 | #include <sys/kernel.h> | 36 | #include <sys/kernel.h> | |
37 | #include <sys/socket.h> | 37 | #include <sys/socket.h> | |
38 | #include <sys/systm.h> | 38 | #include <sys/systm.h> | |
39 | #include <sys/malloc.h> | 39 | #include <sys/malloc.h> | |
@@ -1100,27 +1100,27 @@ run_efuse_read(struct run_softc *sc, uin | @@ -1100,27 +1100,27 @@ run_efuse_read(struct run_softc *sc, uin | |||
1100 | /* determine to which 32-bit register our 16-bit word belongs */ | 1100 | /* determine to which 32-bit register our 16-bit word belongs */ | |
1101 | reg = RT3070_EFUSE_DATA3 - (addr & 0xc); | 1101 | reg = RT3070_EFUSE_DATA3 - (addr & 0xc); | |
1102 | if ((error = run_read(sc, reg, &tmp)) != 0) | 1102 | if ((error = run_read(sc, reg, &tmp)) != 0) | |
1103 | return error; | 1103 | return error; | |
1104 | 1104 | |||
1105 | *val = (addr & 1) ? tmp >> 16 : tmp & 0xffff; | 1105 | *val = (addr & 1) ? tmp >> 16 : tmp & 0xffff; | |
1106 | return 0; | 1106 | return 0; | |
1107 | } | 1107 | } | |
1108 | 1108 | |||
1109 | /* Read 16-bit from eFUSE ROM for RT3xxxx. */ | 1109 | /* Read 16-bit from eFUSE ROM for RT3xxxx. */ | |
1110 | static int | 1110 | static int | |
1111 | run_efuse_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) | 1111 | run_efuse_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) | |
1112 | { | 1112 | { | |
1113 | return (run_efuse_read(sc, addr, val, 2)); | 1113 | return run_efuse_read(sc, addr, val, 2); | |
1114 | } | 1114 | } | |
1115 | 1115 | |||
1116 | static int | 1116 | static int | |
1117 | run_eeprom_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) | 1117 | run_eeprom_read_2(struct run_softc *sc, uint16_t addr, uint16_t *val) | |
1118 | { | 1118 | { | |
1119 | usb_device_request_t req; | 1119 | usb_device_request_t req; | |
1120 | uint16_t tmp; | 1120 | uint16_t tmp; | |
1121 | int error; | 1121 | int error; | |
1122 | 1122 | |||
1123 | addr *= 2; | 1123 | addr *= 2; | |
1124 | req.bmRequestType = UT_READ_VENDOR_DEVICE; | 1124 | req.bmRequestType = UT_READ_VENDOR_DEVICE; | |
1125 | req.bRequest = RT2870_EEPROM_READ; | 1125 | req.bRequest = RT2870_EEPROM_READ; | |
1126 | USETW(req.wValue, 0); | 1126 | USETW(req.wValue, 0); | |
@@ -4090,27 +4090,27 @@ run_rt3593_rf_init(struct run_softc *sc) | @@ -4090,27 +4090,27 @@ run_rt3593_rf_init(struct run_softc *sc) | |||
4090 | usbd_delay_ms(sc->sc_udev, 1); | 4090 | usbd_delay_ms(sc->sc_udev, 1); | |
4091 | tmp = (tmp & ~0x1f000000) | 0x01000000; | 4091 | tmp = (tmp & ~0x1f000000) | 0x01000000; | |
4092 | run_write(sc, RT3070_LDO_CFG0, tmp); | 4092 | run_write(sc, RT3070_LDO_CFG0, tmp); | |
4093 | 4093 | |||
4094 | sc->rf24_20mhz = 0x1f; | 4094 | sc->rf24_20mhz = 0x1f; | |
4095 | sc->rf24_40mhz = 0x2f; | 4095 | sc->rf24_40mhz = 0x2f; | |
4096 | 4096 | |||
4097 | /* Save default BBP registers 25 and 26 values. */ | 4097 | /* Save default BBP registers 25 and 26 values. */ | |
4098 | run_bbp_read(sc, 25, &sc->bbp25); | 4098 | run_bbp_read(sc, 25, &sc->bbp25); | |
4099 | run_bbp_read(sc, 26, &sc->bbp26); | 4099 | run_bbp_read(sc, 26, &sc->bbp26); | |
4100 | 4100 | |||
4101 | run_read(sc, RT3070_OPT_14, &tmp); | 4101 | run_read(sc, RT3070_OPT_14, &tmp); | |
4102 | run_write(sc, RT3070_OPT_14, tmp | 1); | 4102 | run_write(sc, RT3070_OPT_14, tmp | 1); | |
4103 | return (0); | 4103 | return 0; | |
4104 | } | 4104 | } | |
4105 | 4105 | |||
4106 | static int | 4106 | static int | |
4107 | run_rt5390_rf_init(struct run_softc *sc) | 4107 | run_rt5390_rf_init(struct run_softc *sc) | |
4108 | { | 4108 | { | |
4109 | uint32_t tmp; | 4109 | uint32_t tmp; | |
4110 | uint8_t rf; | 4110 | uint8_t rf; | |
4111 | int i; | 4111 | int i; | |
4112 | 4112 | |||
4113 | /* Toggle RF R2 to initiate calibration. */ | 4113 | /* Toggle RF R2 to initiate calibration. */ | |
4114 | if (sc->mac_ver == 0x5390) { | 4114 | if (sc->mac_ver == 0x5390) { | |
4115 | run_rt3070_rf_read(sc, 2, &rf); | 4115 | run_rt3070_rf_read(sc, 2, &rf); | |
4116 | run_rt3070_rf_write(sc, 2, rf | RT5390_RESCAL); | 4116 | run_rt3070_rf_write(sc, 2, rf | RT5390_RESCAL); | |
@@ -4155,27 +4155,27 @@ run_rt5390_rf_init(struct run_softc *sc) | @@ -4155,27 +4155,27 @@ run_rt5390_rf_init(struct run_softc *sc) | |||
4155 | run_rt3070_rf_write(sc, 56, 0x42); | 4155 | run_rt3070_rf_write(sc, 56, 0x42); | |
4156 | run_rt3070_rf_write(sc, 61, 0xd1); | 4156 | run_rt3070_rf_write(sc, 61, 0xd1); | |
4157 | } | 4157 | } | |
4158 | } | 4158 | } | |
4159 | 4159 | |||
4160 | sc->rf24_20mhz = 0x1f; /* default value */ | 4160 | sc->rf24_20mhz = 0x1f; /* default value */ | |
4161 | sc->rf24_40mhz = (sc->mac_ver == 0x5592) ? 0 : 0x2f; | 4161 | sc->rf24_40mhz = (sc->mac_ver == 0x5592) ? 0 : 0x2f; | |
4162 | 4162 | |||
4163 | if (sc->mac_rev < 0x0211) | 4163 | if (sc->mac_rev < 0x0211) | |
4164 | run_rt3070_rf_write(sc, 27, 0x3); | 4164 | run_rt3070_rf_write(sc, 27, 0x3); | |
4165 | 4165 | |||
4166 | run_read(sc, RT3070_OPT_14, &tmp); | 4166 | run_read(sc, RT3070_OPT_14, &tmp); | |
4167 | run_write(sc, RT3070_OPT_14, tmp | 1); | 4167 | run_write(sc, RT3070_OPT_14, tmp | 1); | |
4168 | return (0); | 4168 | return 0; | |
4169 | } | 4169 | } | |
4170 | 4170 | |||
4171 | static int | 4171 | static int | |
4172 | run_rt3070_filter_calib(struct run_softc *sc, uint8_t init, uint8_t target, | 4172 | run_rt3070_filter_calib(struct run_softc *sc, uint8_t init, uint8_t target, | |
4173 | uint8_t *val) | 4173 | uint8_t *val) | |
4174 | { | 4174 | { | |
4175 | uint8_t rf22, rf24; | 4175 | uint8_t rf22, rf24; | |
4176 | uint8_t bbp55_pb, bbp55_sb, delta; | 4176 | uint8_t bbp55_pb, bbp55_sb, delta; | |
4177 | int ntries; | 4177 | int ntries; | |
4178 | 4178 | |||
4179 | /* program filter */ | 4179 | /* program filter */ | |
4180 | run_rt3070_rf_read(sc, 24, &rf24); | 4180 | run_rt3070_rf_read(sc, 24, &rf24); | |
4181 | rf24 = (rf24 & 0xc0) | init; /* initial filter value */ | 4181 | rf24 = (rf24 & 0xc0) | init; /* initial filter value */ | |
@@ -4476,27 +4476,27 @@ run_txrx_enable(struct run_softc *sc) | @@ -4476,27 +4476,27 @@ run_txrx_enable(struct run_softc *sc) | |||
4476 | static int | 4476 | static int | |
4477 | run_adjust_freq_offset(struct run_softc *sc) | 4477 | run_adjust_freq_offset(struct run_softc *sc) | |
4478 | { | 4478 | { | |
4479 | uint8_t rf, tmp; | 4479 | uint8_t rf, tmp; | |
4480 | 4480 | |||
4481 | run_rt3070_rf_read(sc, 17, &rf); | 4481 | run_rt3070_rf_read(sc, 17, &rf); | |
4482 | tmp = rf; | 4482 | tmp = rf; | |
4483 | rf = (rf & ~0x7f) | (sc->freq & 0x7f); | 4483 | rf = (rf & ~0x7f) | (sc->freq & 0x7f); | |
4484 | rf = MIN(rf, 0x5f); | 4484 | rf = MIN(rf, 0x5f); | |
4485 | 4485 | |||
4486 | if (tmp != rf) | 4486 | if (tmp != rf) | |
4487 | run_mcu_cmd(sc, 0x74, (tmp << 8 ) | rf); | 4487 | run_mcu_cmd(sc, 0x74, (tmp << 8 ) | rf); | |
4488 | 4488 | |||
4489 | return (0); | 4489 | return 0; | |
4490 | } | 4490 | } | |
4491 | 4491 | |||
4492 | static int | 4492 | static int | |
4493 | run_init(struct ifnet *ifp) | 4493 | run_init(struct ifnet *ifp) | |
4494 | { | 4494 | { | |
4495 | struct run_softc *sc = ifp->if_softc; | 4495 | struct run_softc *sc = ifp->if_softc; | |
4496 | struct ieee80211com *ic = &sc->sc_ic; | 4496 | struct ieee80211com *ic = &sc->sc_ic; | |
4497 | uint32_t tmp; | 4497 | uint32_t tmp; | |
4498 | uint8_t bbp1, bbp3; | 4498 | uint8_t bbp1, bbp3; | |
4499 | int i, error, qid, ridx, ntries; | 4499 | int i, error, qid, ridx, ntries; | |
4500 | 4500 | |||
4501 | for (ntries = 0; ntries < 100; ntries++) { | 4501 | for (ntries = 0; ntries < 100; ntries++) { | |
4502 | if ((error = run_read(sc, RT2860_ASIC_VER_ID, &tmp)) != 0) | 4502 | if ((error = run_read(sc, RT2860_ASIC_VER_ID, &tmp)) != 0) |
--- src/sys/dev/usb/slurm.c 2016/07/09 20:25:16 1.1.18.5
+++ src/sys/dev/usb/slurm.c 2017/01/29 15:58:14 1.1.18.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: slurm.c,v 1.1.18.5 2016/07/09 20:25:16 skrll Exp $ */ | 1 | /* $NetBSD: slurm.c,v 1.1.18.6 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2012 Jonathan A. Kollasch | 4 | * Copyright (c) 2012 Jonathan A. Kollasch | |
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,27 +17,27 @@ | @@ -17,27 +17,27 @@ | |||
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 COPYRIGHT HOLDER OR | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR | |
20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | __KERNEL_RCSID(0, "$NetBSD: slurm.c,v 1.1.18.5 2016/07/09 20:25:16 skrll Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: slurm.c,v 1.1.18.6 2017/01/29 15:58:14 skrll Exp $"); | |
31 | 31 | |||
32 | #include <sys/param.h> | 32 | #include <sys/param.h> | |
33 | #include <sys/proc.h> | 33 | #include <sys/proc.h> | |
34 | #include <sys/systm.h> | 34 | #include <sys/systm.h> | |
35 | #include <sys/kernel.h> | 35 | #include <sys/kernel.h> | |
36 | #include <sys/device.h> | 36 | #include <sys/device.h> | |
37 | #include <sys/conf.h> | 37 | #include <sys/conf.h> | |
38 | 38 | |||
39 | #include <dev/usb/usb.h> | 39 | #include <dev/usb/usb.h> | |
40 | #include <dev/usb/usbdi.h> | 40 | #include <dev/usb/usbdi.h> | |
41 | #include <dev/usb/usbdivar.h> | 41 | #include <dev/usb/usbdivar.h> | |
42 | #include <dev/usb/usbdi_util.h> | 42 | #include <dev/usb/usbdi_util.h> | |
43 | #include <dev/usb/usbdevs.h> | 43 | #include <dev/usb/usbdevs.h> | |
@@ -146,27 +146,27 @@ slurm_attach(device_t parent, device_t s | @@ -146,27 +146,27 @@ slurm_attach(device_t parent, device_t s | |||
146 | } | 146 | } | |
147 | 147 | |||
148 | static int | 148 | static int | |
149 | slurm_detach(device_t self, int flags) | 149 | slurm_detach(device_t self, int flags) | |
150 | { | 150 | { | |
151 | struct slurm_softc * const sc = device_private(self); | 151 | struct slurm_softc * const sc = device_private(self); | |
152 | int rv = 0; | 152 | int rv = 0; | |
153 | 153 | |||
154 | if ((rv = config_detach_children(self, flags)) != 0) | 154 | if ((rv = config_detach_children(self, flags)) != 0) | |
155 | return rv; | 155 | return rv; | |
156 | 156 | |||
157 | usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); | 157 | usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); | |
158 | 158 | |||
159 | return (rv); | 159 | return rv; | |
160 | } | 160 | } | |
161 | 161 | |||
162 | static int | 162 | static int | |
163 | slurm_get_info(void *v, struct radio_info *ri) | 163 | slurm_get_info(void *v, struct radio_info *ri) | |
164 | { | 164 | { | |
165 | struct slurm_softc * const sc = v; | 165 | struct slurm_softc * const sc = v; | |
166 | uint16_t powercfg, sysconfig2, readchannel, statusrssi; | 166 | uint16_t powercfg, sysconfig2, readchannel, statusrssi; | |
167 | 167 | |||
168 | slurm_getreg(sc, SI470X_POWERCFG, &powercfg); | 168 | slurm_getreg(sc, SI470X_POWERCFG, &powercfg); | |
169 | slurm_getreg(sc, SI470X_SYSCONFIG2, &sysconfig2); | 169 | slurm_getreg(sc, SI470X_SYSCONFIG2, &sysconfig2); | |
170 | slurm_getreg(sc, SI470X_STATUSRSSI, &statusrssi); | 170 | slurm_getreg(sc, SI470X_STATUSRSSI, &statusrssi); | |
171 | slurm_getreg(sc, SI470X_READCHANNEL, &readchannel); | 171 | slurm_getreg(sc, SI470X_READCHANNEL, &readchannel); | |
172 | 172 |
--- src/sys/dev/usb/uark.c 2016/12/05 10:55:18 1.6.14.8
+++ src/sys/dev/usb/uark.c 2017/01/29 15:58:14 1.6.14.9
@@ -1,34 +1,34 @@ | @@ -1,34 +1,34 @@ | |||
1 | /* $NetBSD: uark.c,v 1.6.14.8 2016/12/05 10:55:18 skrll Exp $ */ | 1 | /* $NetBSD: uark.c,v 1.6.14.9 2017/01/29 15:58:14 skrll 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 | |
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: uark.c,v 1.6.14.8 2016/12/05 10:55:18 skrll Exp $"); | 21 | __KERNEL_RCSID(0, "$NetBSD: uark.c,v 1.6.14.9 2017/01/29 15:58:14 skrll Exp $"); | |
22 | 22 | |||
23 | #ifdef _KERNEL_OPT | 23 | #ifdef _KERNEL_OPT | |
24 | #include "opt_usb.h" | 24 | #include "opt_usb.h" | |
25 | #endif | 25 | #endif | |
26 | 26 | |||
27 | #include <sys/param.h> | 27 | #include <sys/param.h> | |
28 | #include <sys/systm.h> | 28 | #include <sys/systm.h> | |
29 | #include <sys/kernel.h> | 29 | #include <sys/kernel.h> | |
30 | #include <sys/conf.h> | 30 | #include <sys/conf.h> | |
31 | #include <sys/tty.h> | 31 | #include <sys/tty.h> | |
32 | #include <sys/device.h> | 32 | #include <sys/device.h> | |
33 | 33 | |||
34 | #include <dev/usb/usb.h> | 34 | #include <dev/usb/usb.h> | |
@@ -219,27 +219,27 @@ uark_detach(device_t self, int flags) | @@ -219,27 +219,27 @@ uark_detach(device_t self, int flags) | |||
219 | int | 219 | int | |
220 | uark_activate(device_t self, enum devact act) | 220 | uark_activate(device_t self, enum devact act) | |
221 | { | 221 | { | |
222 | struct uark_softc *sc = device_private(self); | 222 | struct uark_softc *sc = device_private(self); | |
223 | int rv = 0; | 223 | int rv = 0; | |
224 | 224 | |||
225 | switch (act) { | 225 | switch (act) { | |
226 | case DVACT_DEACTIVATE: | 226 | case DVACT_DEACTIVATE: | |
227 | if (sc->sc_subdev != NULL) | 227 | if (sc->sc_subdev != NULL) | |
228 | rv = config_deactivate(sc->sc_subdev); | 228 | rv = config_deactivate(sc->sc_subdev); | |
229 | sc->sc_dying = 1; | 229 | sc->sc_dying = 1; | |
230 | break; | 230 | break; | |
231 | } | 231 | } | |
232 | return (rv); | 232 | return rv; | |
233 | } | 233 | } | |
234 | 234 | |||
235 | void | 235 | void | |
236 | uark_set(void *vsc, int portno, int reg, int onoff) | 236 | uark_set(void *vsc, int portno, int reg, int onoff) | |
237 | { | 237 | { | |
238 | struct uark_softc *sc = vsc; | 238 | struct uark_softc *sc = vsc; | |
239 | 239 | |||
240 | switch (reg) { | 240 | switch (reg) { | |
241 | case UCOM_SET_BREAK: | 241 | case UCOM_SET_BREAK: | |
242 | uark_break(sc, portno, onoff); | 242 | uark_break(sc, portno, onoff); | |
243 | return; | 243 | return; | |
244 | case UCOM_SET_DTR: | 244 | case UCOM_SET_DTR: | |
245 | case UCOM_SET_RTS: | 245 | case UCOM_SET_RTS: | |
@@ -262,27 +262,27 @@ uark_param(void *vsc, int portno, struct | @@ -262,27 +262,27 @@ uark_param(void *vsc, int portno, struct | |||
262 | case 2400: | 262 | case 2400: | |
263 | case 4800: | 263 | case 4800: | |
264 | case 9600: | 264 | case 9600: | |
265 | case 19200: | 265 | case 19200: | |
266 | case 38400: | 266 | case 38400: | |
267 | case 57600: | 267 | case 57600: | |
268 | case 115200: | 268 | case 115200: | |
269 | uark_cmd(sc, 3, 0x83); | 269 | uark_cmd(sc, 3, 0x83); | |
270 | uark_cmd(sc, 0, (UARK_BAUD_REF / t->c_ospeed) & 0xFF); | 270 | uark_cmd(sc, 0, (UARK_BAUD_REF / t->c_ospeed) & 0xFF); | |
271 | uark_cmd(sc, 1, (UARK_BAUD_REF / t->c_ospeed) >> 8); | 271 | uark_cmd(sc, 1, (UARK_BAUD_REF / t->c_ospeed) >> 8); | |
272 | uark_cmd(sc, 3, 0x03); | 272 | uark_cmd(sc, 3, 0x03); | |
273 | break; | 273 | break; | |
274 | default: | 274 | default: | |
275 | return (EINVAL); | 275 | return EINVAL; | |
276 | } | 276 | } | |
277 | 277 | |||
278 | if (ISSET(t->c_cflag, CSTOPB)) | 278 | if (ISSET(t->c_cflag, CSTOPB)) | |
279 | data = UARK_STOP_BITS_2; | 279 | data = UARK_STOP_BITS_2; | |
280 | else | 280 | else | |
281 | data = UARK_STOP_BITS_1; | 281 | data = UARK_STOP_BITS_1; | |
282 | 282 | |||
283 | if (ISSET(t->c_cflag, PARENB)) { | 283 | if (ISSET(t->c_cflag, PARENB)) { | |
284 | if (ISSET(t->c_cflag, PARODD)) | 284 | if (ISSET(t->c_cflag, PARODD)) | |
285 | data |= UARK_PARITY_ODD; | 285 | data |= UARK_PARITY_ODD; | |
286 | else | 286 | else | |
287 | data |= UARK_PARITY_EVEN; | 287 | data |= UARK_PARITY_EVEN; | |
288 | } else | 288 | } else | |
@@ -307,27 +307,27 @@ uark_param(void *vsc, int portno, struct | @@ -307,27 +307,27 @@ uark_param(void *vsc, int portno, struct | |||
307 | uark_cmd(sc, 3, data); | 307 | uark_cmd(sc, 3, data); | |
308 | 308 | |||
309 | #if 0 | 309 | #if 0 | |
310 | /* XXX flow control */ | 310 | /* XXX flow control */ | |
311 | if (ISSET(t->c_cflag, CRTSCTS)) | 311 | if (ISSET(t->c_cflag, CRTSCTS)) | |
312 | /* rts/cts flow ctl */ | 312 | /* rts/cts flow ctl */ | |
313 | } else if (ISSET(t->c_iflag, IXON|IXOFF)) { | 313 | } else if (ISSET(t->c_iflag, IXON|IXOFF)) { | |
314 | /* xon/xoff flow ctl */ | 314 | /* xon/xoff flow ctl */ | |
315 | } else { | 315 | } else { | |
316 | /* disable flow ctl */ | 316 | /* disable flow ctl */ | |
317 | } | 317 | } | |
318 | #endif | 318 | #endif | |
319 | 319 | |||
320 | return (0); | 320 | return 0; | |
321 | } | 321 | } | |
322 | 322 | |||
323 | void | 323 | void | |
324 | uark_get_status(void *vsc, int portno, u_char *lsr, u_char *msr) | 324 | uark_get_status(void *vsc, int portno, u_char *lsr, u_char *msr) | |
325 | { | 325 | { | |
326 | struct uark_softc *sc = vsc; | 326 | struct uark_softc *sc = vsc; | |
327 | 327 | |||
328 | if (msr != NULL) | 328 | if (msr != NULL) | |
329 | *msr = sc->sc_msr; | 329 | *msr = sc->sc_msr; | |
330 | if (lsr != NULL) | 330 | if (lsr != NULL) | |
331 | *lsr = sc->sc_lsr; | 331 | *lsr = sc->sc_lsr; | |
332 | } | 332 | } | |
333 | 333 | |||
@@ -353,17 +353,17 @@ int | @@ -353,17 +353,17 @@ int | |||
353 | uark_cmd(struct uark_softc *sc, uint16_t index, uint16_t value) | 353 | uark_cmd(struct uark_softc *sc, uint16_t index, uint16_t value) | |
354 | { | 354 | { | |
355 | usb_device_request_t req; | 355 | usb_device_request_t req; | |
356 | usbd_status err; | 356 | usbd_status err; | |
357 | 357 | |||
358 | req.bmRequestType = UARK_WRITE; | 358 | req.bmRequestType = UARK_WRITE; | |
359 | req.bRequest = UARK_REQUEST; | 359 | req.bRequest = UARK_REQUEST; | |
360 | USETW(req.wValue, value); | 360 | USETW(req.wValue, value); | |
361 | USETW(req.wIndex, index); | 361 | USETW(req.wIndex, index); | |
362 | USETW(req.wLength, 0); | 362 | USETW(req.wLength, 0); | |
363 | err = usbd_do_request(sc->sc_udev, &req, NULL); | 363 | err = usbd_do_request(sc->sc_udev, &req, NULL); | |
364 | 364 | |||
365 | if (err) | 365 | if (err) | |
366 | return (EIO); | 366 | return EIO; | |
367 | 367 | |||
368 | return (0); | 368 | return 0; | |
369 | } | 369 | } |
--- src/sys/dev/usb/uatp.c 2016/12/05 10:55:18 1.10.4.8
+++ src/sys/dev/usb/uatp.c 2017/01/29 15:58:14 1.10.4.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uatp.c,v 1.10.4.8 2016/12/05 10:55:18 skrll Exp $ */ | 1 | /* $NetBSD: uatp.c,v 1.10.4.9 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011-2014 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011-2014 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 Taylor R. Campbell. | 8 | * by Taylor R. Campbell. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -136,27 +136,27 @@ | @@ -136,27 +136,27 @@ | |||
136 | * - What devices split packets in chunks? | 136 | * - What devices split packets in chunks? | |
137 | * `partial packet: ... bytes' | 137 | * `partial packet: ... bytes' | |
138 | * | 138 | * | |
139 | * - What devices develop large sensor readouts? | 139 | * - What devices develop large sensor readouts? | |
140 | * `large sensor readout: ...' | 140 | * `large sensor readout: ...' | |
141 | * | 141 | * | |
142 | * - What devices have the wrong number of sensors? Are there parts of | 142 | * - What devices have the wrong number of sensors? Are there parts of | |
143 | * your trackpad that the system doesn't seem to notice? You can | 143 | * your trackpad that the system doesn't seem to notice? You can | |
144 | * tweak hw.uatp0.x_sensors and hw.uatp0.y_sensors, up to a maximum | 144 | * tweak hw.uatp0.x_sensors and hw.uatp0.y_sensors, up to a maximum | |
145 | * of 32 for each value. | 145 | * of 32 for each value. | |
146 | */ | 146 | */ | |
147 | 147 | |||
148 | #include <sys/cdefs.h> | 148 | #include <sys/cdefs.h> | |
149 | __KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.10.4.8 2016/12/05 10:55:18 skrll Exp $"); | 149 | __KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.10.4.9 2017/01/29 15:58:14 skrll Exp $"); | |
150 | 150 | |||
151 | #ifdef _KERNEL_OPT | 151 | #ifdef _KERNEL_OPT | |
152 | #include "opt_usb.h" | 152 | #include "opt_usb.h" | |
153 | #endif | 153 | #endif | |
154 | 154 | |||
155 | #include <sys/types.h> | 155 | #include <sys/types.h> | |
156 | #include <sys/param.h> | 156 | #include <sys/param.h> | |
157 | #include <sys/atomic.h> | 157 | #include <sys/atomic.h> | |
158 | #include <sys/device.h> | 158 | #include <sys/device.h> | |
159 | #include <sys/errno.h> | 159 | #include <sys/errno.h> | |
160 | #include <sys/ioctl.h> | 160 | #include <sys/ioctl.h> | |
161 | #include <sys/kernel.h> | 161 | #include <sys/kernel.h> | |
162 | #include <sys/module.h> | 162 | #include <sys/module.h> | |
@@ -824,27 +824,27 @@ scale_motion(const struct uatp_softc *sc | @@ -824,27 +824,27 @@ scale_motion(const struct uatp_softc *sc | |||
824 | % ((int) (*divisor))))); | 824 | % ((int) (*divisor))))); | |
825 | 825 | |||
826 | if (sc->sc_knobs.motion_remainder) | 826 | if (sc->sc_knobs.motion_remainder) | |
827 | delta += *remainder; | 827 | delta += *remainder; | |
828 | *remainder = 0; | 828 | *remainder = 0; | |
829 | 829 | |||
830 | if (((*multiplier) == 0) || | 830 | if (((*multiplier) == 0) || | |
831 | ((*multiplier) > UATP_MAX_MOTION_MULTIPLIER) || | 831 | ((*multiplier) > UATP_MAX_MOTION_MULTIPLIER) || | |
832 | ((*divisor) == 0)) | 832 | ((*divisor) == 0)) | |
833 | return delta; | 833 | return delta; | |
834 | 834 | |||
835 | product = (delta * ((int) (*multiplier))); | 835 | product = (delta * ((int) (*multiplier))); | |
836 | *remainder = (product % ((int) (*divisor))); | 836 | *remainder = (product % ((int) (*divisor))); | |
837 | return (product / ((int) (*divisor))); | 837 | return product / ((int) (*divisor)); | |
838 | } | 838 | } | |
839 | 839 | |||
840 | static int | 840 | static int | |
841 | uatp_scale_motion(const struct uatp_softc *sc, int delta, int *remainder) | 841 | uatp_scale_motion(const struct uatp_softc *sc, int delta, int *remainder) | |
842 | { | 842 | { | |
843 | return scale_motion(sc, delta, remainder, | 843 | return scale_motion(sc, delta, remainder, | |
844 | &sc->sc_knobs.motion_multiplier, | 844 | &sc->sc_knobs.motion_multiplier, | |
845 | &sc->sc_knobs.motion_divisor); | 845 | &sc->sc_knobs.motion_divisor); | |
846 | } | 846 | } | |
847 | 847 | |||
848 | static int | 848 | static int | |
849 | uatp_scale_fast_motion(const struct uatp_softc *sc, int delta, int *remainder) | 849 | uatp_scale_fast_motion(const struct uatp_softc *sc, int delta, int *remainder) | |
850 | { | 850 | { | |
@@ -2617,27 +2617,27 @@ motion_below_threshold(struct uatp_softc | @@ -2617,27 +2617,27 @@ motion_below_threshold(struct uatp_softc | |||
2617 | { | 2617 | { | |
2618 | unsigned int x_squared, y_squared; | 2618 | unsigned int x_squared, y_squared; | |
2619 | 2619 | |||
2620 | /* Caller guarantees the multiplication will not overflow. */ | 2620 | /* Caller guarantees the multiplication will not overflow. */ | |
2621 | KASSERT(-UATP_MAX_POSITION <= x); | 2621 | KASSERT(-UATP_MAX_POSITION <= x); | |
2622 | KASSERT(-UATP_MAX_POSITION <= y); | 2622 | KASSERT(-UATP_MAX_POSITION <= y); | |
2623 | KASSERT(x <= UATP_MAX_POSITION); | 2623 | KASSERT(x <= UATP_MAX_POSITION); | |
2624 | KASSERT(y <= UATP_MAX_POSITION); | 2624 | KASSERT(y <= UATP_MAX_POSITION); | |
2625 | __CTASSERT(0x12000000 == (2 * UATP_MAX_POSITION * UATP_MAX_POSITION)); | 2625 | __CTASSERT(0x12000000 == (2 * UATP_MAX_POSITION * UATP_MAX_POSITION)); | |
2626 | 2626 | |||
2627 | x_squared = (x * x); | 2627 | x_squared = (x * x); | |
2628 | y_squared = (y * y); | 2628 | y_squared = (y * y); | |
2629 | 2629 | |||
2630 | return ((x_squared + y_squared) < threshold); | 2630 | return (x_squared + y_squared) < threshold; | |
2631 | } | 2631 | } | |
2632 | 2632 | |||
2633 | static int | 2633 | static int | |
2634 | accelerate(struct uatp_softc *sc, unsigned int old_raw, unsigned int raw, | 2634 | accelerate(struct uatp_softc *sc, unsigned int old_raw, unsigned int raw, | |
2635 | unsigned int old_smoothed, unsigned int smoothed, bool fast, | 2635 | unsigned int old_smoothed, unsigned int smoothed, bool fast, | |
2636 | int *remainder) | 2636 | int *remainder) | |
2637 | { | 2637 | { | |
2638 | #define CHECK_(condition) CHECK(condition, return 0) | 2638 | #define CHECK_(condition) CHECK(condition, return 0) | |
2639 | 2639 | |||
2640 | /* Guarantee that the scaling won't overflow. */ | 2640 | /* Guarantee that the scaling won't overflow. */ | |
2641 | __CTASSERT(0x30000 == | 2641 | __CTASSERT(0x30000 == | |
2642 | (UATP_MAX_POSITION * UATP_MAX_MOTION_MULTIPLIER)); | 2642 | (UATP_MAX_POSITION * UATP_MAX_MOTION_MULTIPLIER)); | |
2643 | 2643 |
--- src/sys/dev/usb/uberry.c 2016/12/05 10:55:18 1.9.14.5
+++ src/sys/dev/usb/uberry.c 2017/01/29 15:58:14 1.9.14.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uberry.c,v 1.9.14.5 2016/12/05 10:55:18 skrll Exp $ */ | 1 | /* $NetBSD: uberry.c,v 1.9.14.6 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2008 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 Christos Zoulas. | 8 | * by Christos Zoulas. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -27,27 +27,27 @@ | @@ -27,27 +27,27 @@ | |||
27 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 27 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 28 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
30 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 30 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
31 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 31 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
36 | * POSSIBILITY OF SUCH DAMAGE. | 36 | * POSSIBILITY OF SUCH DAMAGE. | |
37 | */ | 37 | */ | |
38 | 38 | |||
39 | #include <sys/cdefs.h> | 39 | #include <sys/cdefs.h> | |
40 | __KERNEL_RCSID(0, "$NetBSD: uberry.c,v 1.9.14.5 2016/12/05 10:55:18 skrll Exp $"); | 40 | __KERNEL_RCSID(0, "$NetBSD: uberry.c,v 1.9.14.6 2017/01/29 15:58:14 skrll Exp $"); | |
41 | 41 | |||
42 | #ifdef _KERNEL_OPT | 42 | #ifdef _KERNEL_OPT | |
43 | #include "opt_usb.h" | 43 | #include "opt_usb.h" | |
44 | #endif | 44 | #endif | |
45 | 45 | |||
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #include <sys/systm.h> | 47 | #include <sys/systm.h> | |
48 | #include <sys/kernel.h> | 48 | #include <sys/kernel.h> | |
49 | #include <sys/device.h> | 49 | #include <sys/device.h> | |
50 | #include <sys/ioctl.h> | 50 | #include <sys/ioctl.h> | |
51 | #include <sys/conf.h> | 51 | #include <sys/conf.h> | |
52 | #include <sys/file.h> | 52 | #include <sys/file.h> | |
53 | #include <sys/select.h> | 53 | #include <sys/select.h> | |
@@ -199,15 +199,15 @@ uberry_attach(device_t parent, device_t | @@ -199,15 +199,15 @@ uberry_attach(device_t parent, device_t | |||
199 | return; | 199 | return; | |
200 | } | 200 | } | |
201 | 201 | |||
202 | int | 202 | int | |
203 | uberry_detach(device_t self, int flags) | 203 | uberry_detach(device_t self, int flags) | |
204 | { | 204 | { | |
205 | struct uberry_softc *sc = device_private(self); | 205 | struct uberry_softc *sc = device_private(self); | |
206 | DPRINTF(("uberry_detach: sc=%p flags=%d\n", sc, flags)); | 206 | DPRINTF(("uberry_detach: sc=%p flags=%d\n", sc, flags)); | |
207 | 207 | |||
208 | pmf_device_deregister(self); | 208 | pmf_device_deregister(self); | |
209 | 209 | |||
210 | usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); | 210 | usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); | |
211 | 211 | |||
212 | return (0); | 212 | return 0; | |
213 | } | 213 | } |
--- src/sys/dev/usb/ubsa.c 2016/12/05 10:55:18 1.30.16.9
+++ src/sys/dev/usb/ubsa.c 2017/01/29 15:58:14 1.30.16.10
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ubsa.c,v 1.30.16.9 2016/12/05 10:55:18 skrll Exp $ */ | 1 | /* $NetBSD: ubsa.c,v 1.30.16.10 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>. | 3 | * Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>. | |
4 | * All rights reserved. | 4 | * 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 | * | 14 | * | |
@@ -44,27 +44,27 @@ | @@ -44,27 +44,27 @@ | |||
44 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 44 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
45 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 45 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
46 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 46 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
47 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 47 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
48 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 48 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
49 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 49 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
50 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 50 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
51 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 51 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
52 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 52 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
53 | * POSSIBILITY OF SUCH DAMAGE. | 53 | * POSSIBILITY OF SUCH DAMAGE. | |
54 | */ | 54 | */ | |
55 | 55 | |||
56 | #include <sys/cdefs.h> | 56 | #include <sys/cdefs.h> | |
57 | __KERNEL_RCSID(0, "$NetBSD: ubsa.c,v 1.30.16.9 2016/12/05 10:55:18 skrll Exp $"); | 57 | __KERNEL_RCSID(0, "$NetBSD: ubsa.c,v 1.30.16.10 2017/01/29 15:58:14 skrll Exp $"); | |
58 | 58 | |||
59 | #ifdef _KERNEL_OPT | 59 | #ifdef _KERNEL_OPT | |
60 | #include "opt_usb.h" | 60 | #include "opt_usb.h" | |
61 | #endif | 61 | #endif | |
62 | 62 | |||
63 | #include <sys/param.h> | 63 | #include <sys/param.h> | |
64 | #include <sys/systm.h> | 64 | #include <sys/systm.h> | |
65 | #include <sys/kernel.h> | 65 | #include <sys/kernel.h> | |
66 | #include <sys/kmem.h> | 66 | #include <sys/kmem.h> | |
67 | #include <sys/ioccom.h> | 67 | #include <sys/ioccom.h> | |
68 | #include <sys/fcntl.h> | 68 | #include <sys/fcntl.h> | |
69 | #include <sys/conf.h> | 69 | #include <sys/conf.h> | |
70 | #include <sys/tty.h> | 70 | #include <sys/tty.h> | |
@@ -331,27 +331,27 @@ ubsa_detach(device_t self, int flags) | @@ -331,27 +331,27 @@ ubsa_detach(device_t self, int flags) | |||
331 | usbd_close_pipe(sc->sc_intr_pipe); | 331 | usbd_close_pipe(sc->sc_intr_pipe); | |
332 | kmem_free(sc->sc_intr_buf, sc->sc_isize); | 332 | kmem_free(sc->sc_intr_buf, sc->sc_isize); | |
333 | sc->sc_intr_pipe = NULL; | 333 | sc->sc_intr_pipe = NULL; | |
334 | } | 334 | } | |
335 | 335 | |||
336 | sc->sc_dying = 1; | 336 | sc->sc_dying = 1; | |
337 | for (i = 0; i < sc->sc_numif; i++) { | 337 | for (i = 0; i < sc->sc_numif; i++) { | |
338 | if (sc->sc_subdevs[i] != NULL) | 338 | if (sc->sc_subdevs[i] != NULL) | |
339 | rv |= config_detach(sc->sc_subdevs[i], flags); | 339 | rv |= config_detach(sc->sc_subdevs[i], flags); | |
340 | } | 340 | } | |
341 | 341 | |||
342 | usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); | 342 | usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); | |
343 | 343 | |||
344 | return (rv); | 344 | return rv; | |
345 | } | 345 | } | |
346 | 346 | |||
347 | int | 347 | int | |
348 | ubsa_activate(device_t self, enum devact act) | 348 | ubsa_activate(device_t self, enum devact act) | |
349 | { | 349 | { | |
350 | struct ubsa_softc *sc = device_private(self); | 350 | struct ubsa_softc *sc = device_private(self); | |
351 | 351 | |||
352 | switch (act) { | 352 | switch (act) { | |
353 | case DVACT_DEACTIVATE: | 353 | case DVACT_DEACTIVATE: | |
354 | sc->sc_dying = 1; | 354 | sc->sc_dying = 1; | |
355 | return 0; | 355 | return 0; | |
356 | default: | 356 | default: | |
357 | return EOPNOTSUPP; | 357 | return EOPNOTSUPP; |
--- src/sys/dev/usb/udsir.c 2016/07/09 20:25:16 1.1.14.10
+++ src/sys/dev/usb/udsir.c 2017/01/29 15:58:14 1.1.14.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: udsir.c,v 1.1.14.10 2016/07/09 20:25:16 skrll Exp $ */ | 1 | /* $NetBSD: udsir.c,v 1.1.14.11 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2001 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 David Sainty <David.Sainty@dtsp.co.nz> | 8 | * by David Sainty <David.Sainty@dtsp.co.nz> | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: udsir.c,v 1.1.14.10 2016/07/09 20:25:16 skrll Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: udsir.c,v 1.1.14.11 2017/01/29 15:58:14 skrll Exp $"); | |
34 | 34 | |||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> | |
36 | #include <sys/device.h> | 36 | #include <sys/device.h> | |
37 | #include <sys/errno.h> | 37 | #include <sys/errno.h> | |
38 | #include <sys/systm.h> | 38 | #include <sys/systm.h> | |
39 | #include <sys/kernel.h> | 39 | #include <sys/kernel.h> | |
40 | #include <sys/kmem.h> | 40 | #include <sys/kmem.h> | |
41 | #include <sys/conf.h> | 41 | #include <sys/conf.h> | |
42 | #include <sys/file.h> | 42 | #include <sys/file.h> | |
43 | #include <sys/poll.h> | 43 | #include <sys/poll.h> | |
44 | #include <sys/select.h> | 44 | #include <sys/select.h> | |
45 | #include <sys/proc.h> | 45 | #include <sys/proc.h> | |
46 | #include <sys/kthread.h> | 46 | #include <sys/kthread.h> | |
@@ -679,36 +679,36 @@ udsir_kqfilter(void *h, struct knote *kn | @@ -679,36 +679,36 @@ udsir_kqfilter(void *h, struct knote *kn | |||
679 | struct klist *klist; | 679 | struct klist *klist; | |
680 | int s; | 680 | int s; | |
681 | 681 | |||
682 | switch (kn->kn_filter) { | 682 | switch (kn->kn_filter) { | |
683 | case EVFILT_READ: | 683 | case EVFILT_READ: | |
684 | klist = &sc->sc_rd_sel.sel_klist; | 684 | klist = &sc->sc_rd_sel.sel_klist; | |
685 | kn->kn_fop = &udsirread_filtops; | 685 | kn->kn_fop = &udsirread_filtops; | |
686 | break; | 686 | break; | |
687 | case EVFILT_WRITE: | 687 | case EVFILT_WRITE: | |
688 | klist = &sc->sc_wr_sel.sel_klist; | 688 | klist = &sc->sc_wr_sel.sel_klist; | |
689 | kn->kn_fop = &udsirwrite_filtops; | 689 | kn->kn_fop = &udsirwrite_filtops; | |
690 | break; | 690 | break; | |
691 | default: | 691 | default: | |
692 | return (EINVAL); | 692 | return EINVAL; | |
693 | } | 693 | } | |
694 | 694 | |||
695 | kn->kn_hook = sc; | 695 | kn->kn_hook = sc; | |
696 | 696 | |||
697 | s = splusb(); | 697 | s = splusb(); | |
698 | SLIST_INSERT_HEAD(klist, kn, kn_selnext); | 698 | SLIST_INSERT_HEAD(klist, kn, kn_selnext); | |
699 | splx(s); | 699 | splx(s); | |
700 | 700 | |||
701 | return (0); | 701 | return 0; | |
702 | } | 702 | } | |
703 | 703 | |||
704 | static int | 704 | static int | |
705 | udsir_set_params(void *h, struct irda_params *p) | 705 | udsir_set_params(void *h, struct irda_params *p) | |
706 | { | 706 | { | |
707 | struct udsir_softc *sc = h; | 707 | struct udsir_softc *sc = h; | |
708 | 708 | |||
709 | DPRINTFN(0, ("%s: sc=%p, speed=%d ebofs=%d maxsize=%d\n", | 709 | DPRINTFN(0, ("%s: sc=%p, speed=%d ebofs=%d maxsize=%d\n", | |
710 | __func__, sc, p->speed, p->ebofs, p->maxsize)); | 710 | __func__, sc, p->speed, p->ebofs, p->maxsize)); | |
711 | 711 | |||
712 | if (sc->sc_dying) | 712 | if (sc->sc_dying) | |
713 | return EIO; | 713 | return EIO; | |
714 | 714 | |||
@@ -769,48 +769,48 @@ filt_udsirrdetach(struct knote *kn) | @@ -769,48 +769,48 @@ filt_udsirrdetach(struct knote *kn) | |||
769 | 769 | |||
770 | s = splusb(); | 770 | s = splusb(); | |
771 | SLIST_REMOVE(&sc->sc_rd_sel.sel_klist, kn, knote, kn_selnext); | 771 | SLIST_REMOVE(&sc->sc_rd_sel.sel_klist, kn, knote, kn_selnext); | |
772 | splx(s); | 772 | splx(s); | |
773 | } | 773 | } | |
774 | 774 | |||
775 | /* ARGSUSED */ | 775 | /* ARGSUSED */ | |
776 | static int | 776 | static int | |
777 | filt_udsirread(struct knote *kn, long hint) | 777 | filt_udsirread(struct knote *kn, long hint) | |
778 | { | 778 | { | |
779 | struct udsir_softc *sc = kn->kn_hook; | 779 | struct udsir_softc *sc = kn->kn_hook; | |
780 | 780 | |||
781 | kn->kn_data = sc->sc_ur_framelen; | 781 | kn->kn_data = sc->sc_ur_framelen; | |
782 | return (kn->kn_data > 0); | 782 | return kn->kn_data > 0; | |
783 | } | 783 | } | |
784 | 784 | |||
785 | static void | 785 | static void | |
786 | filt_udsirwdetach(struct knote *kn) | 786 | filt_udsirwdetach(struct knote *kn) | |
787 | { | 787 | { | |
788 | struct udsir_softc *sc = kn->kn_hook; | 788 | struct udsir_softc *sc = kn->kn_hook; | |
789 | int s; | 789 | int s; | |
790 | 790 | |||
791 | s = splusb(); | 791 | s = splusb(); | |
792 | SLIST_REMOVE(&sc->sc_wr_sel.sel_klist, kn, knote, kn_selnext); | 792 | SLIST_REMOVE(&sc->sc_wr_sel.sel_klist, kn, knote, kn_selnext); | |
793 | splx(s); | 793 | splx(s); | |
794 | } | 794 | } | |
795 | 795 | |||
796 | /* ARGSUSED */ | 796 | /* ARGSUSED */ | |
797 | static int | 797 | static int | |
798 | filt_udsirwrite(struct knote *kn, long hint) | 798 | filt_udsirwrite(struct knote *kn, long hint) | |
799 | { | 799 | { | |
800 | struct udsir_softc *sc = kn->kn_hook; | 800 | struct udsir_softc *sc = kn->kn_hook; | |
801 | 801 | |||
802 | kn->kn_data = 0; | 802 | kn->kn_data = 0; | |
803 | return (sc->sc_direction != udir_input); | 803 | return sc->sc_direction != udir_input; | |
804 | } | 804 | } | |
805 | 805 | |||
806 | 806 | |||
807 | static void | 807 | static void | |
808 | udsir_thread(void *arg) | 808 | udsir_thread(void *arg) | |
809 | { | 809 | { | |
810 | struct udsir_softc *sc = arg; | 810 | struct udsir_softc *sc = arg; | |
811 | int error; | 811 | int error; | |
812 | 812 | |||
813 | DPRINTFN(20, ("%s: starting polling thread\n", __func__)); | 813 | DPRINTFN(20, ("%s: starting polling thread\n", __func__)); | |
814 | 814 | |||
815 | while (!sc->sc_closing) { | 815 | while (!sc->sc_closing) { | |
816 | if (!sc->sc_rd_readinprogress && !UDSIR_BLOCK_RX_DATA(sc)) | 816 | if (!sc->sc_rd_readinprogress && !UDSIR_BLOCK_RX_DATA(sc)) |
--- src/sys/dev/usb/uhso.c 2016/12/05 10:55:18 1.17.2.12
+++ src/sys/dev/usb/uhso.c 2017/01/29 15:58:14 1.17.2.13
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uhso.c,v 1.17.2.12 2016/12/05 10:55:18 skrll Exp $ */ | 1 | /* $NetBSD: uhso.c,v 1.17.2.13 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2009 Iain Hibbert | 4 | * Copyright (c) 2009 Iain Hibbert | |
5 | * Copyright (c) 2008 Fredrik Lindberg | 5 | * Copyright (c) 2008 Fredrik Lindberg | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -27,27 +27,27 @@ | @@ -27,27 +27,27 @@ | |||
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* | 29 | /* | |
30 | * This driver originated as the hso module for FreeBSD written by | 30 | * This driver originated as the hso module for FreeBSD written by | |
31 | * Fredrik Lindberg[1]. It has been rewritten almost completely for | 31 | * Fredrik Lindberg[1]. It has been rewritten almost completely for | |
32 | * NetBSD, and to support more devices with information extracted from | 32 | * NetBSD, and to support more devices with information extracted from | |
33 | * the Linux hso driver provided by Option N.V.[2] | 33 | * the Linux hso driver provided by Option N.V.[2] | |
34 | * | 34 | * | |
35 | * [1] http://www.shapeshifter.se/code/hso | 35 | * [1] http://www.shapeshifter.se/code/hso | |
36 | * [2] http://www.pharscape.org/hso.htm | 36 | * [2] http://www.pharscape.org/hso.htm | |
37 | */ | 37 | */ | |
38 | 38 | |||
39 | #include <sys/cdefs.h> | 39 | #include <sys/cdefs.h> | |
40 | __KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.17.2.12 2016/12/05 10:55:18 skrll Exp $"); | 40 | __KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.17.2.13 2017/01/29 15:58:14 skrll Exp $"); | |
41 | 41 | |||
42 | #ifdef _KERNEL_OPT | 42 | #ifdef _KERNEL_OPT | |
43 | #include "opt_inet.h" | 43 | #include "opt_inet.h" | |
44 | #include "opt_usb.h" | 44 | #include "opt_usb.h" | |
45 | #endif | 45 | #endif | |
46 | 46 | |||
47 | #include <sys/param.h> | 47 | #include <sys/param.h> | |
48 | #include <sys/conf.h> | 48 | #include <sys/conf.h> | |
49 | #include <sys/fcntl.h> | 49 | #include <sys/fcntl.h> | |
50 | #include <sys/kauth.h> | 50 | #include <sys/kauth.h> | |
51 | #include <sys/kernel.h> | 51 | #include <sys/kernel.h> | |
52 | #include <sys/kmem.h> | 52 | #include <sys/kmem.h> | |
53 | #include <sys/mbuf.h> | 53 | #include <sys/mbuf.h> | |
@@ -615,27 +615,27 @@ uhso_switch_mode(struct usbd_device *ude | @@ -615,27 +615,27 @@ uhso_switch_mode(struct usbd_device *ude | |||
615 | cmd.bCDBLength = 6; | 615 | cmd.bCDBLength = 6; | |
616 | 616 | |||
617 | memset(&cmd.CBWCDB, 0, CBWCDBLENGTH); | 617 | memset(&cmd.CBWCDB, 0, CBWCDBLENGTH); | |
618 | cmd.CBWCDB[0] = SCSI_REZERO_UNIT; | 618 | cmd.CBWCDB[0] = SCSI_REZERO_UNIT; | |
619 | 619 | |||
620 | usbd_setup_xfer(xfer, NULL, &cmd, sizeof(cmd), | 620 | usbd_setup_xfer(xfer, NULL, &cmd, sizeof(cmd), | |
621 | USBD_SYNCHRONOUS, USBD_DEFAULT_TIMEOUT, NULL); | 621 | USBD_SYNCHRONOUS, USBD_DEFAULT_TIMEOUT, NULL); | |
622 | 622 | |||
623 | status = usbd_transfer(xfer); | 623 | status = usbd_transfer(xfer); | |
624 | 624 | |||
625 | usbd_destroy_xfer(xfer); | 625 | usbd_destroy_xfer(xfer); | |
626 | usbd_close_pipe(pipe); | 626 | usbd_close_pipe(pipe); | |
627 | 627 | |||
628 | return (status == USBD_NORMAL_COMPLETION ? 0 : EIO); | 628 | return status == USBD_NORMAL_COMPLETION ? 0 : EIO; | |
629 | } | 629 | } | |
630 | 630 | |||
631 | Static int | 631 | Static int | |
632 | uhso_get_iface_spec(struct usb_attach_arg *uaa, uint8_t ifnum, uint8_t *spec) | 632 | uhso_get_iface_spec(struct usb_attach_arg *uaa, uint8_t ifnum, uint8_t *spec) | |
633 | { | 633 | { | |
634 | const struct uhso_dev *hd; | 634 | const struct uhso_dev *hd; | |
635 | uint8_t config[17]; | 635 | uint8_t config[17]; | |
636 | usb_device_request_t req; | 636 | usb_device_request_t req; | |
637 | usbd_status status; | 637 | usbd_status status; | |
638 | 638 | |||
639 | hd = uhso_lookup(uaa->uaa_vendor, uaa->uaa_product); | 639 | hd = uhso_lookup(uaa->uaa_vendor, uaa->uaa_product); | |
640 | KASSERT(hd != NULL); | 640 | KASSERT(hd != NULL); | |
641 | 641 |
--- src/sys/dev/usb/ukyopon.c 2016/12/05 10:55:18 1.16.16.8
+++ src/sys/dev/usb/ukyopon.c 2017/01/29 15:58:14 1.16.16.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ukyopon.c,v 1.16.16.8 2016/12/05 10:55:18 skrll Exp $ */ | 1 | /* $NetBSD: ukyopon.c,v 1.16.16.9 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1998, 2005 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998, 2005 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. | 9 | * Carlstedt Research & Technology. | |
10 | * | 10 | * | |
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 ITOH Yasufumi. | 12 | * by ITOH Yasufumi. | |
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 | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 24 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
25 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 25 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
26 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 26 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
27 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 27 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
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 | #include <sys/cdefs.h> | 36 | #include <sys/cdefs.h> | |
37 | __KERNEL_RCSID(0, "$NetBSD: ukyopon.c,v 1.16.16.8 2016/12/05 10:55:18 skrll Exp $"); | 37 | __KERNEL_RCSID(0, "$NetBSD: ukyopon.c,v 1.16.16.9 2017/01/29 15:58:14 skrll Exp $"); | |
38 | 38 | |||
39 | #ifdef _KERNEL_OPT | 39 | #ifdef _KERNEL_OPT | |
40 | #include "opt_usb.h" | 40 | #include "opt_usb.h" | |
41 | #endif | 41 | #endif | |
42 | 42 | |||
43 | #include <sys/param.h> | 43 | #include <sys/param.h> | |
44 | #include <sys/systm.h> | 44 | #include <sys/systm.h> | |
45 | #include <sys/kernel.h> | 45 | #include <sys/kernel.h> | |
46 | #include <sys/ioctl.h> | 46 | #include <sys/ioctl.h> | |
47 | #include <sys/conf.h> | 47 | #include <sys/conf.h> | |
48 | #include <sys/tty.h> | 48 | #include <sys/tty.h> | |
49 | #include <sys/file.h> | 49 | #include <sys/file.h> | |
50 | #include <sys/select.h> | 50 | #include <sys/select.h> | |
@@ -107,29 +107,29 @@ int ukyopon_activate(device_t, enum dev | @@ -107,29 +107,29 @@ int ukyopon_activate(device_t, enum dev | |||
107 | extern struct cfdriver ukyopon_cd; | 107 | extern struct cfdriver ukyopon_cd; | |
108 | CFATTACH_DECL_NEW(ukyopon, sizeof(struct ukyopon_softc), ukyopon_match, | 108 | CFATTACH_DECL_NEW(ukyopon, sizeof(struct ukyopon_softc), ukyopon_match, | |
109 | ukyopon_attach, ukyopon_detach, ukyopon_activate); | 109 | ukyopon_attach, ukyopon_detach, ukyopon_activate); | |
110 | 110 | |||
111 | int | 111 | int | |
112 | ukyopon_match(device_t parent, cfdata_t match, void *aux) | 112 | ukyopon_match(device_t parent, cfdata_t match, void *aux) | |
113 | { | 113 | { | |
114 | struct usbif_attach_arg *uiaa = aux; | 114 | struct usbif_attach_arg *uiaa = aux; | |
115 | 115 | |||
116 | if (uiaa->uiaa_vendor == USB_VENDOR_KYOCERA && | 116 | if (uiaa->uiaa_vendor == USB_VENDOR_KYOCERA && | |
117 | uiaa->uiaa_product == USB_PRODUCT_KYOCERA_AHK3001V && | 117 | uiaa->uiaa_product == USB_PRODUCT_KYOCERA_AHK3001V && | |
118 | (uiaa->uiaa_ifaceno == UKYOPON_MODEM_IFACE_INDEX || | 118 | (uiaa->uiaa_ifaceno == UKYOPON_MODEM_IFACE_INDEX || | |
119 | uiaa->uiaa_ifaceno == UKYOPON_DATA_IFACE_INDEX)) | 119 | uiaa->uiaa_ifaceno == UKYOPON_DATA_IFACE_INDEX)) | |
120 | return (UMATCH_VENDOR_PRODUCT); | 120 | return UMATCH_VENDOR_PRODUCT; | |
121 | 121 | |||
122 | return (UMATCH_NONE); | 122 | return UMATCH_NONE; | |
123 | } | 123 | } | |
124 | 124 | |||
125 | void | 125 | void | |
126 | ukyopon_attach(device_t parent, device_t self, void *aux) | 126 | ukyopon_attach(device_t parent, device_t self, void *aux) | |
127 | { | 127 | { | |
128 | struct ukyopon_softc *sc = device_private(self); | 128 | struct ukyopon_softc *sc = device_private(self); | |
129 | struct usbif_attach_arg *uiaa = aux; | 129 | struct usbif_attach_arg *uiaa = aux; | |
130 | struct ucom_attach_args ucaa; | 130 | struct ucom_attach_args ucaa; | |
131 | 131 | |||
132 | ucaa.ucaa_portno = (uiaa->uiaa_ifaceno == UKYOPON_MODEM_IFACE_INDEX) ? | 132 | ucaa.ucaa_portno = (uiaa->uiaa_ifaceno == UKYOPON_MODEM_IFACE_INDEX) ? | |
133 | UKYOPON_PORT_MODEM : UKYOPON_PORT_DATA; | 133 | UKYOPON_PORT_MODEM : UKYOPON_PORT_DATA; | |
134 | ucaa.ucaa_methods = &ukyopon_methods; | 134 | ucaa.ucaa_methods = &ukyopon_methods; | |
135 | ucaa.ucaa_info = (uiaa->uiaa_ifaceno == UKYOPON_MODEM_IFACE_INDEX) ? | 135 | ucaa.ucaa_info = (uiaa->uiaa_ifaceno == UKYOPON_MODEM_IFACE_INDEX) ? | |
@@ -168,27 +168,27 @@ ukyopon_ioctl(void *addr, int portno, u_ | @@ -168,27 +168,27 @@ ukyopon_ioctl(void *addr, int portno, u_ | |||
168 | strncpy(arg_id->ui_name, UKYOPON_NAME, sizeof(arg_id->ui_name)); | 168 | strncpy(arg_id->ui_name, UKYOPON_NAME, sizeof(arg_id->ui_name)); | |
169 | arg_id->ui_busno = | 169 | arg_id->ui_busno = | |
170 | device_unit(sc->sc_umodem.sc_udev->ud_bus->ub_usbctl); | 170 | device_unit(sc->sc_umodem.sc_udev->ud_bus->ub_usbctl); | |
171 | arg_id->ui_address = sc->sc_umodem.sc_udev->ud_addr; | 171 | arg_id->ui_address = sc->sc_umodem.sc_udev->ud_addr; | |
172 | arg_id->ui_model = UKYOPON_MODEL_UNKNOWN; | 172 | arg_id->ui_model = UKYOPON_MODEL_UNKNOWN; | |
173 | arg_id->ui_porttype = portno; | 173 | arg_id->ui_porttype = portno; | |
174 | break; | 174 | break; | |
175 | 175 | |||
176 | default: | 176 | default: | |
177 | error = umodem_ioctl(addr, portno, cmd, data, flag, p); | 177 | error = umodem_ioctl(addr, portno, cmd, data, flag, p); | |
178 | break; | 178 | break; | |
179 | } | 179 | } | |
180 | 180 | |||
181 | return (error); | 181 | return error; | |
182 | } | 182 | } | |
183 | 183 | |||
184 | int | 184 | int | |
185 | ukyopon_activate(device_t self, enum devact act) | 185 | ukyopon_activate(device_t self, enum devact act) | |
186 | { | 186 | { | |
187 | struct ukyopon_softc *sc = device_private(self); | 187 | struct ukyopon_softc *sc = device_private(self); | |
188 | 188 | |||
189 | return umodem_common_activate(&sc->sc_umodem, act); | 189 | return umodem_common_activate(&sc->sc_umodem, act); | |
190 | } | 190 | } | |
191 | 191 | |||
192 | int | 192 | int | |
193 | ukyopon_detach(device_t self, int flags) | 193 | ukyopon_detach(device_t self, int flags) | |
194 | { | 194 | { |
--- src/sys/dev/usb/usbdi_util.c 2016/10/27 07:46:19 1.63.2.14
+++ src/sys/dev/usb/usbdi_util.c 2017/01/29 15:58:14 1.63.2.15
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: usbdi_util.c,v 1.63.2.14 2016/10/27 07:46:19 skrll Exp $ */ | 1 | /* $NetBSD: usbdi_util.c,v 1.63.2.15 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998, 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 and Matthew R. Green (mrg@eterna.com.au). | 9 | * Carlstedt Research & Technology and Matthew R. Green (mrg@eterna.com.au). | |
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,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
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: usbdi_util.c,v 1.63.2.14 2016/10/27 07:46:19 skrll Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.63.2.15 2017/01/29 15:58:14 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 <sys/param.h> | 40 | #include <sys/param.h> | |
41 | #include <sys/systm.h> | 41 | #include <sys/systm.h> | |
42 | #include <sys/kernel.h> | 42 | #include <sys/kernel.h> | |
43 | #include <sys/kmem.h> | 43 | #include <sys/kmem.h> | |
44 | #include <sys/proc.h> | 44 | #include <sys/proc.h> | |
45 | #include <sys/device.h> | 45 | #include <sys/device.h> | |
46 | #include <sys/bus.h> | 46 | #include <sys/bus.h> | |
47 | 47 | |||
@@ -102,27 +102,27 @@ usbd_get_config_desc_full(struct usbd_de | @@ -102,27 +102,27 @@ usbd_get_config_desc_full(struct usbd_de | |||
102 | } | 102 | } | |
103 | 103 | |||
104 | usbd_status | 104 | usbd_status | |
105 | usbd_get_bos_desc(struct usbd_device *dev, int confidx, | 105 | usbd_get_bos_desc(struct usbd_device *dev, int confidx, | |
106 | usb_bos_descriptor_t *d) | 106 | usb_bos_descriptor_t *d) | |
107 | { | 107 | { | |
108 | USBHIST_FUNC(); USBHIST_CALLED(usbdebug); | 108 | USBHIST_FUNC(); USBHIST_CALLED(usbdebug); | |
109 | usbd_status err; | 109 | usbd_status err; | |
110 | 110 | |||
111 | DPRINTFN(3, "confidx=%d", confidx, 0, 0, 0); | 111 | DPRINTFN(3, "confidx=%d", confidx, 0, 0, 0); | |
112 | err = usbd_get_desc(dev, UDESC_BOS, confidx, | 112 | err = usbd_get_desc(dev, UDESC_BOS, confidx, | |
113 | USB_BOS_DESCRIPTOR_SIZE, d); | 113 | USB_BOS_DESCRIPTOR_SIZE, d); | |
114 | if (err) | 114 | if (err) | |
115 | return (err); | 115 | return err; | |
116 | if (d->bDescriptorType != UDESC_BOS) { | 116 | if (d->bDescriptorType != UDESC_BOS) { | |
117 | DPRINTFN(1, "confidx=%d, bad desc len=%d type=%d", | 117 | DPRINTFN(1, "confidx=%d, bad desc len=%d type=%d", | |
118 | confidx, d->bLength, d->bDescriptorType, 0); | 118 | confidx, d->bLength, d->bDescriptorType, 0); | |
119 | return USBD_INVAL; | 119 | return USBD_INVAL; | |
120 | } | 120 | } | |
121 | return USBD_NORMAL_COMPLETION; | 121 | return USBD_NORMAL_COMPLETION; | |
122 | } | 122 | } | |
123 | 123 | |||
124 | usbd_status | 124 | usbd_status | |
125 | usbd_get_bos_desc_full(struct usbd_device *dev, int conf, void *d, int size) | 125 | usbd_get_bos_desc_full(struct usbd_device *dev, int conf, void *d, int size) | |
126 | { | 126 | { | |
127 | USBHIST_FUNC(); USBHIST_CALLED(usbdebug); | 127 | USBHIST_FUNC(); USBHIST_CALLED(usbdebug); | |
128 | 128 | |||
@@ -202,27 +202,27 @@ usbd_get_port_status(struct usbd_device | @@ -202,27 +202,27 @@ usbd_get_port_status(struct usbd_device | |||
202 | usbd_status | 202 | usbd_status | |
203 | usbd_get_port_status_ext(struct usbd_device *dev, int port, | 203 | usbd_get_port_status_ext(struct usbd_device *dev, int port, | |
204 | usb_port_status_ext_t *pse) | 204 | usb_port_status_ext_t *pse) | |
205 | { | 205 | { | |
206 | USBHIST_FUNC(); USBHIST_CALLED(usbdebug); | 206 | USBHIST_FUNC(); USBHIST_CALLED(usbdebug); | |
207 | usb_device_request_t req; | 207 | usb_device_request_t req; | |
208 | 208 | |||
209 | DPRINTF("dev %p port %d", dev, port, 0, 0); | 209 | DPRINTF("dev %p port %d", dev, port, 0, 0); | |
210 | req.bmRequestType = UT_READ_CLASS_OTHER; | 210 | req.bmRequestType = UT_READ_CLASS_OTHER; | |
211 | req.bRequest = UR_GET_STATUS; | 211 | req.bRequest = UR_GET_STATUS; | |
212 | USETW2(req.wValue, 0, UR_PST_EXT_PORT_STATUS); | 212 | USETW2(req.wValue, 0, UR_PST_EXT_PORT_STATUS); | |
213 | USETW(req.wIndex, port); | 213 | USETW(req.wIndex, port); | |
214 | USETW(req.wLength, sizeof(*pse)); | 214 | USETW(req.wLength, sizeof(*pse)); | |
215 | return (usbd_do_request(dev, &req, pse)); | 215 | return usbd_do_request(dev, &req, pse); | |
216 | } | 216 | } | |
217 | 217 | |||
218 | usbd_status | 218 | usbd_status | |
219 | usbd_clear_hub_feature(struct usbd_device *dev, int sel) | 219 | usbd_clear_hub_feature(struct usbd_device *dev, int sel) | |
220 | { | 220 | { | |
221 | USBHIST_FUNC(); USBHIST_CALLED(usbdebug); | 221 | USBHIST_FUNC(); USBHIST_CALLED(usbdebug); | |
222 | usb_device_request_t req; | 222 | usb_device_request_t req; | |
223 | 223 | |||
224 | DPRINTF("dev %p sel %d", dev, sel, 0, 0); | 224 | DPRINTF("dev %p sel %d", dev, sel, 0, 0); | |
225 | req.bmRequestType = UT_WRITE_CLASS_DEVICE; | 225 | req.bmRequestType = UT_WRITE_CLASS_DEVICE; | |
226 | req.bRequest = UR_CLEAR_FEATURE; | 226 | req.bRequest = UR_CLEAR_FEATURE; | |
227 | USETW(req.wValue, sel); | 227 | USETW(req.wValue, sel); | |
228 | USETW(req.wIndex, 0); | 228 | USETW(req.wIndex, 0); |
--- src/sys/dev/usb/uslsa.c 2016/12/05 10:55:20 1.19.6.6
+++ src/sys/dev/usb/uslsa.c 2017/01/29 15:58:14 1.19.6.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uslsa.c,v 1.19.6.6 2016/12/05 10:55:20 skrll Exp $ */ | 1 | /* $NetBSD: uslsa.c,v 1.19.6.7 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /* from ugensa.c */ | 3 | /* from ugensa.c */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc. | 6 | * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc. | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
8 | * | 8 | * | |
9 | * This code is derived from software contributed to The NetBSD Foundation | 9 | * This code is derived from software contributed to The NetBSD Foundation | |
10 | * by Roland C. Dowdeswell <elric@netbsd.org>. | 10 | * by Roland C. Dowdeswell <elric@netbsd.org>. | |
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: | |
@@ -48,27 +48,27 @@ | @@ -48,27 +48,27 @@ | |||
48 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 48 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
49 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 49 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
50 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 50 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
51 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 51 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
52 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 52 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
53 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 53 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
54 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 54 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
55 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 55 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
56 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 56 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
57 | * | 57 | * | |
58 | */ | 58 | */ | |
59 | 59 | |||
60 | #include <sys/cdefs.h> | 60 | #include <sys/cdefs.h> | |
61 | __KERNEL_RCSID(0, "$NetBSD: uslsa.c,v 1.19.6.6 2016/12/05 10:55:20 skrll Exp $"); | 61 | __KERNEL_RCSID(0, "$NetBSD: uslsa.c,v 1.19.6.7 2017/01/29 15:58:14 skrll Exp $"); | |
62 | 62 | |||
63 | #ifdef _KERNEL_OPT | 63 | #ifdef _KERNEL_OPT | |
64 | #include "opt_usb.h" | 64 | #include "opt_usb.h" | |
65 | #endif | 65 | #endif | |
66 | 66 | |||
67 | #include <sys/param.h> | 67 | #include <sys/param.h> | |
68 | #include <sys/systm.h> | 68 | #include <sys/systm.h> | |
69 | #include <sys/kernel.h> | 69 | #include <sys/kernel.h> | |
70 | #include <sys/device.h> | 70 | #include <sys/device.h> | |
71 | #include <sys/conf.h> | 71 | #include <sys/conf.h> | |
72 | #include <sys/tty.h> | 72 | #include <sys/tty.h> | |
73 | 73 | |||
74 | #include <dev/usb/usb.h> | 74 | #include <dev/usb/usb.h> | |
@@ -273,27 +273,27 @@ uslsa_detach(device_t self, int flags) | @@ -273,27 +273,27 @@ uslsa_detach(device_t self, int flags) | |||
273 | struct uslsa_softc *sc = device_private(self); | 273 | struct uslsa_softc *sc = device_private(self); | |
274 | int rv = 0; | 274 | int rv = 0; | |
275 | 275 | |||
276 | DPRINTF((self, "%s(%p, %#x)\n", __func__, self, flags)); | 276 | DPRINTF((self, "%s(%p, %#x)\n", __func__, self, flags)); | |
277 | 277 | |||
278 | sc->sc_dying = true; | 278 | sc->sc_dying = true; | |
279 | 279 | |||
280 | if (sc->sc_subdev != NULL) { | 280 | if (sc->sc_subdev != NULL) { | |
281 | rv = config_detach(sc->sc_subdev, flags); | 281 | rv = config_detach(sc->sc_subdev, flags); | |
282 | } | 282 | } | |
283 | 283 | |||
284 | usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); | 284 | usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev); | |
285 | 285 | |||
286 | return (rv); | 286 | return rv; | |
287 | } | 287 | } | |
288 | 288 | |||
289 | static int | 289 | static int | |
290 | uslsa_usbd_errno(usbd_status status) | 290 | uslsa_usbd_errno(usbd_status status) | |
291 | { | 291 | { | |
292 | switch (status) { | 292 | switch (status) { | |
293 | case USBD_NORMAL_COMPLETION: | 293 | case USBD_NORMAL_COMPLETION: | |
294 | return 0; | 294 | return 0; | |
295 | case USBD_STALLED: | 295 | case USBD_STALLED: | |
296 | return EINVAL; | 296 | return EINVAL; | |
297 | default: | 297 | default: | |
298 | return EIO; | 298 | return EIO; | |
299 | } | 299 | } |
--- src/sys/dev/usb/Attic/uyap.c 2016/10/05 20:55:59 1.19.24.4
+++ src/sys/dev/usb/Attic/uyap.c 2017/01/29 15:58:14 1.19.24.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uyap.c,v 1.19.24.4 2016/10/05 20:55:59 skrll Exp $ */ | 1 | /* $NetBSD: uyap.c,v 1.19.24.5 2017/01/29 15:58:14 skrll Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2000 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2000 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>. | 8 | * by Lennart Augustsson <lennart@augustsson.net>. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: uyap.c,v 1.19.24.4 2016/10/05 20:55:59 skrll Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: uyap.c,v 1.19.24.5 2017/01/29 15:58:14 skrll Exp $"); | |
34 | 34 | |||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> | |
36 | #include <sys/systm.h> | 36 | #include <sys/systm.h> | |
37 | #include <sys/kernel.h> | 37 | #include <sys/kernel.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | #include <sys/conf.h> | 39 | #include <sys/conf.h> | |
40 | 40 | |||
41 | #include <dev/usb/usb.h> | 41 | #include <dev/usb/usb.h> | |
42 | #include <dev/usb/usbdi.h> | 42 | #include <dev/usb/usbdi.h> | |
43 | #include <dev/usb/usbdevs.h> | 43 | #include <dev/usb/usbdevs.h> | |
44 | 44 | |||
45 | #include <dev/usb/ezload.h> | 45 | #include <dev/usb/ezload.h> | |
46 | 46 | |||
@@ -59,29 +59,29 @@ int uyap_detach(device_t, int); | @@ -59,29 +59,29 @@ int uyap_detach(device_t, int); | |||
59 | int uyap_activate(device_t, enum devact); | 59 | int uyap_activate(device_t, enum devact); | |
60 | extern struct cfdriver uyap_cd; | 60 | extern struct cfdriver uyap_cd; | |
61 | CFATTACH_DECL_NEW(uyap, sizeof(struct uyap_softc), uyap_match, uyap_attach, | 61 | CFATTACH_DECL_NEW(uyap, sizeof(struct uyap_softc), uyap_match, uyap_attach, | |
62 | uyap_detach, uyap_activate); | 62 | uyap_detach, uyap_activate); | |
63 | 63 | |||
64 | int | 64 | int | |
65 | uyap_match(device_t parent, cfdata_t match, void *aux) | 65 | uyap_match(device_t parent, cfdata_t match, void *aux) | |
66 | { | 66 | { | |
67 | struct usb_attach_arg *uaa = aux; | 67 | struct usb_attach_arg *uaa = aux; | |
68 | 68 | |||
69 | /* Match the boot device. */ | 69 | /* Match the boot device. */ | |
70 | if (uaa->uaa_vendor == USB_VENDOR_SILICONPORTALS && | 70 | if (uaa->uaa_vendor == USB_VENDOR_SILICONPORTALS && | |
71 | uaa->uaa_product == USB_PRODUCT_SILICONPORTALS_YAPPH_NF) | 71 | uaa->uaa_product == USB_PRODUCT_SILICONPORTALS_YAPPH_NF) | |
72 | return (UMATCH_VENDOR_PRODUCT); | 72 | return UMATCH_VENDOR_PRODUCT; | |
73 | 73 | |||
74 | return (UMATCH_NONE); | 74 | return UMATCH_NONE; | |
75 | } | 75 | } | |
76 | 76 | |||
77 | void | 77 | void | |
78 | uyap_attach(device_t parent, device_t self, void *aux) | 78 | uyap_attach(device_t parent, device_t self, void *aux) | |
79 | { | 79 | { | |
80 | struct uyap_softc *sc = device_private(self); | 80 | struct uyap_softc *sc = device_private(self); | |
81 | struct usb_attach_arg *uaa = aux; | 81 | struct usb_attach_arg *uaa = aux; | |
82 | struct usbd_device *dev = uaa->uaa_device; | 82 | struct usbd_device *dev = uaa->uaa_device; | |
83 | usbd_status err; | 83 | usbd_status err; | |
84 | char *devinfop; | 84 | char *devinfop; | |
85 | 85 | |||
86 | sc->sc_dev = self; | 86 | sc->sc_dev = self; | |
87 | 87 | |||
@@ -103,21 +103,21 @@ uyap_attach(device_t parent, device_t se | @@ -103,21 +103,21 @@ uyap_attach(device_t parent, device_t se | |||
103 | 103 | |||
104 | aprint_verbose_dev(self, | 104 | aprint_verbose_dev(self, | |
105 | "firmware download complete, disconnecting.\n"); | 105 | "firmware download complete, disconnecting.\n"); | |
106 | return; | 106 | return; | |
107 | } | 107 | } | |
108 | 108 | |||
109 | int | 109 | int | |
110 | uyap_detach(device_t self, int flags) | 110 | uyap_detach(device_t self, int flags) | |
111 | { | 111 | { | |
112 | #if 0 | 112 | #if 0 | |
113 | struct uyap_softc *sc = device_private(self); | 113 | struct uyap_softc *sc = device_private(self); | |
114 | #endif | 114 | #endif | |
115 | 115 | |||
116 | return (0); | 116 | return 0; | |
117 | } | 117 | } | |
118 | 118 | |||
119 | int | 119 | int | |
120 | uyap_activate(device_t self, enum devact act) | 120 | uyap_activate(device_t self, enum devact act) | |
121 | { | 121 | { | |
122 | return 0; | 122 | return 0; | |
123 | } | 123 | } |