| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: umodem_common.c,v 1.25 2016/11/25 12:56:29 skrll Exp $ */ | | 1 | /* $NetBSD: umodem_common.c,v 1.26 2019/01/04 17:09:26 tih Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998 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 | * 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 |
| @@ -34,27 +34,27 @@ | | | @@ -34,27 +34,27 @@ |
34 | * Comm Class spec: http://www.usb.org/developers/devclass_docs/usbccs10.pdf | | 34 | * Comm Class spec: http://www.usb.org/developers/devclass_docs/usbccs10.pdf |
35 | * http://www.usb.org/developers/devclass_docs/usbcdc11.pdf | | 35 | * http://www.usb.org/developers/devclass_docs/usbcdc11.pdf |
36 | */ | | 36 | */ |
37 | | | 37 | |
38 | /* | | 38 | /* |
39 | * TODO: | | 39 | * TODO: |
40 | * - Add error recovery in various places; the big problem is what | | 40 | * - Add error recovery in various places; the big problem is what |
41 | * to do in a callback if there is an error. | | 41 | * to do in a callback if there is an error. |
42 | * - Implement a Call Device for modems without multiplexed commands. | | 42 | * - Implement a Call Device for modems without multiplexed commands. |
43 | * | | 43 | * |
44 | */ | | 44 | */ |
45 | | | 45 | |
46 | #include <sys/cdefs.h> | | 46 | #include <sys/cdefs.h> |
47 | __KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.25 2016/11/25 12:56:29 skrll Exp $"); | | 47 | __KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.26 2019/01/04 17:09:26 tih Exp $"); |
48 | | | 48 | |
49 | #ifdef _KERNEL_OPT | | 49 | #ifdef _KERNEL_OPT |
50 | #include "opt_usb.h" | | 50 | #include "opt_usb.h" |
51 | #endif | | 51 | #endif |
52 | | | 52 | |
53 | #include <sys/param.h> | | 53 | #include <sys/param.h> |
54 | #include <sys/systm.h> | | 54 | #include <sys/systm.h> |
55 | #include <sys/kernel.h> | | 55 | #include <sys/kernel.h> |
56 | #include <sys/ioctl.h> | | 56 | #include <sys/ioctl.h> |
57 | #include <sys/conf.h> | | 57 | #include <sys/conf.h> |
58 | #include <sys/tty.h> | | 58 | #include <sys/tty.h> |
59 | #include <sys/file.h> | | 59 | #include <sys/file.h> |
60 | #include <sys/select.h> | | 60 | #include <sys/select.h> |
| @@ -220,27 +220,27 @@ umodem_common_attach(device_t self, stru | | | @@ -220,27 +220,27 @@ umodem_common_attach(device_t self, stru |
220 | */ | | 220 | */ |
221 | | | 221 | |
222 | sc->sc_ctl_notify = -1; | | 222 | sc->sc_ctl_notify = -1; |
223 | sc->sc_notify_pipe = NULL; | | 223 | sc->sc_notify_pipe = NULL; |
224 | | | 224 | |
225 | id = usbd_get_interface_descriptor(sc->sc_ctl_iface); | | 225 | id = usbd_get_interface_descriptor(sc->sc_ctl_iface); |
226 | for (i = 0; i < id->bNumEndpoints; i++) { | | 226 | for (i = 0; i < id->bNumEndpoints; i++) { |
227 | ed = usbd_interface2endpoint_descriptor(sc->sc_ctl_iface, i); | | 227 | ed = usbd_interface2endpoint_descriptor(sc->sc_ctl_iface, i); |
228 | if (ed == NULL) | | 228 | if (ed == NULL) |
229 | continue; | | 229 | continue; |
230 | | | 230 | |
231 | if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && | | 231 | if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && |
232 | (ed->bmAttributes & UE_XFERTYPE) == UE_INTERRUPT) { | | 232 | (ed->bmAttributes & UE_XFERTYPE) == UE_INTERRUPT) { |
233 | aprint_error_dev(self, | | 233 | aprint_verbose_dev(self, |
234 | "status change notification available\n"); | | 234 | "status change notification available\n"); |
235 | sc->sc_ctl_notify = ed->bEndpointAddress; | | 235 | sc->sc_ctl_notify = ed->bEndpointAddress; |
236 | } | | 236 | } |
237 | } | | 237 | } |
238 | | | 238 | |
239 | sc->sc_dtr = -1; | | 239 | sc->sc_dtr = -1; |
240 | | | 240 | |
241 | /* ucaa_bulkin, ucaa_bulkout set above */ | | 241 | /* ucaa_bulkin, ucaa_bulkout set above */ |
242 | ucaa->ucaa_ibufsize = UMODEMIBUFSIZE; | | 242 | ucaa->ucaa_ibufsize = UMODEMIBUFSIZE; |
243 | ucaa->ucaa_obufsize = UMODEMOBUFSIZE; | | 243 | ucaa->ucaa_obufsize = UMODEMOBUFSIZE; |
244 | ucaa->ucaa_ibufsizepad = UMODEMIBUFSIZE; | | 244 | ucaa->ucaa_ibufsizepad = UMODEMIBUFSIZE; |
245 | ucaa->ucaa_opkthdrlen = 0; | | 245 | ucaa->ucaa_opkthdrlen = 0; |
246 | ucaa->ucaa_device = sc->sc_udev; | | 246 | ucaa->ucaa_device = sc->sc_udev; |