2 * $NetBSD: uftdi.c,v 1.13 2002/09/23 05:51:23 simonb Exp $
3 * $FreeBSD: src/sys/dev/usb/uftdi.c,v 1.37 2007/06/22 05:53:05 imp Exp $
4 * $DragonFly: src/sys/dev/usbmisc/uftdi/uftdi.c,v 1.16 2007/08/31 13:25:32 hasso Exp $
8 * Copyright (c) 2000 The NetBSD Foundation, Inc.
11 * This code is derived from software contributed to The NetBSD Foundation
12 * by Lennart Augustsson (lennart@augustsson.net).
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. All advertising materials mentioning features or use of this software
23 * must display the following acknowledgement:
24 * This product includes software developed by the NetBSD
25 * Foundation, Inc. and its contributors.
26 * 4. Neither the name of The NetBSD Foundation nor the names of its
27 * contributors may be used to endorse or promote products derived
28 * from this software without specific prior written permission.
30 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
31 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
32 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
34 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 * POSSIBILITY OF SUCH DAMAGE.
44 * FTDI FT8U100AX serial adapter driver
47 #include <sys/cdefs.h>
49 #include <sys/param.h>
50 #include <sys/systm.h>
51 #include <sys/kernel.h>
52 #include <sys/malloc.h>
53 #include <sys/module.h>
55 #include <sys/ioccom.h>
56 #include <sys/fcntl.h>
61 #include <sys/select.h>
63 #include <sys/sysctl.h>
65 #include <bus/usb/usb.h>
66 #include <bus/usb/usbhid.h>
68 #include <bus/usb/usbdi.h>
69 #include <bus/usb/usbdi_util.h>
70 #include <bus/usb/usbdevs.h>
72 #include "../ucom/ucomvar.h"
77 static int uftdidebug
= 0;
78 SYSCTL_NODE(_hw_usb
, OID_AUTO
, uftdi
, CTLFLAG_RW
, 0, "USB uftdi");
79 SYSCTL_INT(_hw_usb_uftdi
, OID_AUTO
, debug
, CTLFLAG_RW
,
80 &uftdidebug
, 0, "uftdi debug level");
81 #define DPRINTF(x) do { \
86 #define DPRINTFN(n, x) do { \
87 if (uftdidebug > (n)) \
96 #define UFTDI_CONFIG_INDEX 0
97 #define UFTDI_IFACE_INDEX 0
100 * These are the maximum number of bytes transferred per frame.
101 * The output buffer size cannot be increased due to the size encoding.
103 #define UFTDIIBUFSIZE 64
104 #define UFTDIOBUFSIZE 64
107 struct ucom_softc sc_ucom
;
108 usbd_interface_handle sc_iface
; /* interface */
109 enum uftdi_type sc_type
;
116 static void uftdi_get_status(void *, int portno
, u_char
*lsr
, u_char
*msr
);
117 static void uftdi_set(void *, int, int, int);
118 static int uftdi_param(void *, int, struct termios
*);
119 static int uftdi_open(void *sc
, int portno
);
120 static void uftdi_read(void *sc
, int portno
, u_char
**ptr
,u_int32_t
*count
);
121 static void uftdi_write(void *sc
, int portno
, u_char
*to
, u_char
*from
,
123 static void uftdi_break(void *sc
, int portno
, int onoff
);
125 struct ucom_callback uftdi_callback
= {
136 static const struct usb_devno uftdi_devs
[] = {
137 { USB_VENDOR_BBELECTRONICS
, USB_PRODUCT_BBELECTRONICS_USOTL4
},
138 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_SERIAL_8U100AX
},
139 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_SERIAL_8U232AM
},
140 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_SERIAL_2232C
},
141 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_SEMC_DSS20
},
142 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_CFA_631
},
143 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_CFA_632
},
144 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_CFA_633
},
145 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_CFA_634
},
146 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_CFA_635
},
147 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_USBSERIAL
},
148 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_MX2_3
},
149 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_MX4_5
},
150 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_LK202
},
151 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_LK204
},
152 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13M
},
153 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13S
},
154 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13U
},
155 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_EISCOU
},
156 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_UOPTBR
},
157 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_EMCU2D
},
158 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_PCMSFU
},
159 { USB_VENDOR_FTDI
, USB_PRODUCT_FTDI_EMCU2H
},
160 { USB_VENDOR_INTREPIDCS
, USB_PRODUCT_INTREPIDCS_VALUECAN
},
161 { USB_VENDOR_INTREPIDCS
, USB_PRODUCT_INTREPIDCS_NEOVI
},
162 { USB_VENDOR_MELCO
, USB_PRODUCT_MELCO_PCOPRS1
},
163 { USB_VENDOR_SIIG2
, USB_PRODUCT_SIIG2_US2308
},
168 uftdi_match(device_t self
)
170 struct usb_attach_arg
*uaa
= device_get_ivars(self
);
174 if (usb_lookup(uftdi_devs
, uaa
->vendor
, uaa
->product
) == NULL
)
175 return (UMATCH_NONE
);
177 /* Get the number of interfaces. */
178 if (uaa
->iface
!= NULL
) {
179 nifaces
= uaa
->nifaces
;
181 err
= usbd_set_config_index(uaa
->device
, UFTDI_CONFIG_INDEX
, 1);
183 return (UMATCH_NONE
);
184 err
= usbd_interface_count(uaa
->device
, &nifaces
);
186 return (UMATCH_NONE
);
187 usbd_set_config_index(uaa
->device
, USB_UNCONFIG_INDEX
, 1);
191 return (UMATCH_VENDOR_PRODUCT
);
194 if (uaa
->iface
!= NULL
)
195 return (UMATCH_VENDOR_IFACESUBCLASS
);
197 return (UMATCH_NONE
);
201 uftdi_attach(device_t self
)
203 struct uftdi_softc
*sc
= device_get_softc(self
);
204 struct usb_attach_arg
*uaa
= device_get_ivars(self
);
205 usbd_device_handle dev
= uaa
->device
;
206 usbd_interface_handle iface
;
207 usb_interface_descriptor_t
*id
;
208 usb_endpoint_descriptor_t
*ed
;
212 struct ucom_softc
*ucom
= &sc
->sc_ucom
;
213 DPRINTFN(10,("\nuftdi_attach: sc=%p\n", sc
));
214 devinfo
= kmalloc(1024, M_USBDEV
, M_INTWAIT
);
219 usbd_devinfo(dev
, 0, devinfo
);
220 device_printf(ucom
->sc_dev
, "%s\n", devinfo
);
221 kfree(devinfo
, M_USBDEV
);
223 if (uaa
->iface
== NULL
) {
224 /* Move the device into the configured state. */
225 err
= usbd_set_config_index(dev
, UFTDI_CONFIG_INDEX
, 1);
227 device_printf(ucom
->sc_dev
,
228 "failed to set configuration, err=%s\n",
233 err
= usbd_device2interface_handle(dev
, UFTDI_IFACE_INDEX
, &iface
);
235 device_printf(ucom
->sc_dev
,
236 "failed to get interface, err=%s\n", usbd_errstr(err
));
243 id
= usbd_get_interface_descriptor(iface
);
244 ucom
->sc_iface
= iface
;
246 if (uaa
->release
< 0x0200) {
247 sc
->sc_type
= UFTDI_TYPE_SIO
;
250 sc
->sc_type
= UFTDI_TYPE_8U232AM
;
254 ucom
->sc_bulkin_no
= ucom
->sc_bulkout_no
= -1;
256 for (i
= 0; i
< id
->bNumEndpoints
; i
++) {
258 ed
= usbd_interface2endpoint_descriptor(iface
, i
);
260 device_printf(ucom
->sc_dev
,
261 "could not read endpoint descriptor\n");
265 addr
= ed
->bEndpointAddress
;
266 dir
= UE_GET_DIR(ed
->bEndpointAddress
);
267 attr
= ed
->bmAttributes
& UE_XFERTYPE
;
268 if (dir
== UE_DIR_IN
&& attr
== UE_BULK
)
269 ucom
->sc_bulkin_no
= addr
;
270 else if (dir
== UE_DIR_OUT
&& attr
== UE_BULK
)
271 ucom
->sc_bulkout_no
= addr
;
273 device_printf(ucom
->sc_dev
, "unexpected endpoint\n");
277 if (ucom
->sc_bulkin_no
== -1) {
278 device_printf(ucom
->sc_dev
, "Could not find data bulk in\n");
281 if (ucom
->sc_bulkout_no
== -1) {
282 device_printf(ucom
->sc_dev
, "Could not find data bulk out\n");
285 ucom
->sc_parent
= sc
;
286 if (uaa
->iface
== NULL
)
287 ucom
->sc_portno
= FTDI_PIT_SIOA
;
289 ucom
->sc_portno
= FTDI_PIT_SIOA
+ id
->bInterfaceNumber
;
290 /* bulkin, bulkout set above */
292 ucom
->sc_ibufsize
= UFTDIIBUFSIZE
;
293 ucom
->sc_obufsize
= UFTDIOBUFSIZE
- sc
->sc_hdrlen
;
294 ucom
->sc_ibufsizepad
= UFTDIIBUFSIZE
;
295 ucom
->sc_opkthdrlen
= sc
->sc_hdrlen
;
298 ucom
->sc_callback
= &uftdi_callback
;
300 usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH
, ucom
->sc_udev
,
303 DPRINTF(("uftdi: in=0x%x out=0x%x\n", ucom
->sc_bulkin_no
, ucom
->sc_bulkout_no
));
304 ucom_attach(&sc
->sc_ucom
);
308 DPRINTF(("uftdi_attach: ATTACH ERROR\n"));
314 uftdi_activate(device_t self
, enum devact act
)
316 struct uftdi_softc
*sc
= (struct uftdi_softc
*)self
;
323 case DVACT_DEACTIVATE
:
324 if (sc
->sc_subdev
!= NULL
)
325 rv
= config_deactivate(sc
->sc_subdev
);
326 sc
->sc_ucom
.sc_dying
= 1;
334 uftdi_detach(device_t self
)
336 struct uftdi_softc
*sc
= device_get_softc(self
);
340 DPRINTF(("uftdi_detach: sc=%p\n", sc
));
341 sc
->sc_ucom
.sc_dying
= 1;
342 rv
= ucom_detach(&sc
->sc_ucom
);
348 uftdi_open(void *vsc
, int portno
)
350 struct uftdi_softc
*sc
= vsc
;
351 struct ucom_softc
*ucom
= &sc
->sc_ucom
;
352 usb_device_request_t req
;
356 DPRINTF(("uftdi_open: sc=%p\n", sc
));
361 /* Perform a full reset on the device */
362 req
.bmRequestType
= UT_WRITE_VENDOR_DEVICE
;
363 req
.bRequest
= FTDI_SIO_RESET
;
364 USETW(req
.wValue
, FTDI_SIO_RESET_SIO
);
365 USETW(req
.wIndex
, portno
);
366 USETW(req
.wLength
, 0);
367 err
= usbd_do_request(ucom
->sc_udev
, &req
, NULL
);
371 /* Set 9600 baud, 2 stop bits, no parity, 8 bits */
373 t
.c_cflag
= CSTOPB
| CS8
;
374 (void)uftdi_param(sc
, portno
, &t
);
376 /* Turn on RTS/CTS flow control */
377 req
.bmRequestType
= UT_WRITE_VENDOR_DEVICE
;
378 req
.bRequest
= FTDI_SIO_SET_FLOW_CTRL
;
379 USETW(req
.wValue
, 0);
380 USETW2(req
.wIndex
, FTDI_SIO_RTS_CTS_HS
, portno
);
381 USETW(req
.wLength
, 0);
382 err
= usbd_do_request(ucom
->sc_udev
, &req
, NULL
);
390 uftdi_read(void *vsc
, int portno
, u_char
**ptr
, u_int32_t
*count
)
392 struct uftdi_softc
*sc
= vsc
;
395 DPRINTFN(15,("uftdi_read: sc=%p, port=%d count=%d\n", sc
, portno
,
398 msr
= FTDI_GET_MSR(*ptr
);
399 lsr
= FTDI_GET_LSR(*ptr
);
403 DPRINTFN(10,("uftdi_read: sc=%p, port=%d count=%d data[0]="
404 "0x%02x\n", sc
, portno
, *count
, (*ptr
)[2]));
407 if (sc
->sc_msr
!= msr
||
408 (sc
->sc_lsr
& FTDI_LSR_MASK
) != (lsr
& FTDI_LSR_MASK
)) {
409 DPRINTF(("uftdi_read: status change msr=0x%02x(0x%02x) "
410 "lsr=0x%02x(0x%02x)\n", msr
, sc
->sc_msr
,
414 ucom_status_change(&sc
->sc_ucom
);
417 /* Pick up status and adjust data part. */
423 uftdi_write(void *vsc
, int portno
, u_char
*to
, u_char
*from
, u_int32_t
*count
)
425 struct uftdi_softc
*sc
= vsc
;
427 DPRINTFN(10,("uftdi_write: sc=%p, port=%d count=%u data[0]=0x%02x\n",
428 vsc
, portno
, *count
, from
[0]));
430 /* Make length tag and copy data */
431 if (sc
->sc_hdrlen
> 0)
432 *to
= FTDI_OUT_TAG(*count
, portno
);
434 memcpy(to
+ sc
->sc_hdrlen
, from
, *count
);
435 *count
+= sc
->sc_hdrlen
;
439 uftdi_set(void *vsc
, int portno
, int reg
, int onoff
)
441 struct uftdi_softc
*sc
= vsc
;
442 struct ucom_softc
*ucom
= vsc
;
443 usb_device_request_t req
;
446 DPRINTF(("uftdi_set: sc=%p, port=%d reg=%d onoff=%d\n", vsc
, portno
,
451 ctl
= onoff
? FTDI_SIO_SET_DTR_HIGH
: FTDI_SIO_SET_DTR_LOW
;
454 ctl
= onoff
? FTDI_SIO_SET_RTS_HIGH
: FTDI_SIO_SET_RTS_LOW
;
457 uftdi_break(sc
, portno
, onoff
);
462 req
.bmRequestType
= UT_WRITE_VENDOR_DEVICE
;
463 req
.bRequest
= FTDI_SIO_MODEM_CTRL
;
464 USETW(req
.wValue
, ctl
);
465 USETW(req
.wIndex
, portno
);
466 USETW(req
.wLength
, 0);
467 DPRINTFN(2,("uftdi_set: reqtype=0x%02x req=0x%02x value=0x%04x "
468 "index=0x%04x len=%d\n", req
.bmRequestType
, req
.bRequest
,
469 UGETW(req
.wValue
), UGETW(req
.wIndex
), UGETW(req
.wLength
)));
470 (void)usbd_do_request(ucom
->sc_udev
, &req
, NULL
);
474 uftdi_param(void *vsc
, int portno
, struct termios
*t
)
476 struct uftdi_softc
*sc
= vsc
;
477 struct ucom_softc
*ucom
= &sc
->sc_ucom
;
478 usb_device_request_t req
;
480 int rate
=0, data
, flow
;
482 DPRINTF(("uftdi_param: sc=%p\n", sc
));
487 switch (sc
->sc_type
) {
489 switch (t
->c_ospeed
) {
490 case 300: rate
= ftdi_sio_b300
; break;
491 case 600: rate
= ftdi_sio_b600
; break;
492 case 1200: rate
= ftdi_sio_b1200
; break;
493 case 2400: rate
= ftdi_sio_b2400
; break;
494 case 4800: rate
= ftdi_sio_b4800
; break;
495 case 9600: rate
= ftdi_sio_b9600
; break;
496 case 19200: rate
= ftdi_sio_b19200
; break;
497 case 38400: rate
= ftdi_sio_b38400
; break;
498 case 57600: rate
= ftdi_sio_b57600
; break;
499 case 115200: rate
= ftdi_sio_b115200
; break;
505 case UFTDI_TYPE_8U232AM
:
506 switch(t
->c_ospeed
) {
507 case 300: rate
= ftdi_8u232am_b300
; break;
508 case 600: rate
= ftdi_8u232am_b600
; break;
509 case 1200: rate
= ftdi_8u232am_b1200
; break;
510 case 2400: rate
= ftdi_8u232am_b2400
; break;
511 case 4800: rate
= ftdi_8u232am_b4800
; break;
512 case 9600: rate
= ftdi_8u232am_b9600
; break;
513 case 19200: rate
= ftdi_8u232am_b19200
; break;
514 case 38400: rate
= ftdi_8u232am_b38400
; break;
515 case 57600: rate
= ftdi_8u232am_b57600
; break;
516 case 115200: rate
= ftdi_8u232am_b115200
; break;
517 case 230400: rate
= ftdi_8u232am_b230400
; break;
518 case 460800: rate
= ftdi_8u232am_b460800
; break;
519 case 921600: rate
= ftdi_8u232am_b921600
; break;
520 case 2000000: rate
= ftdi_8u232am_b2000000
; break;
521 case 3000000: rate
= ftdi_8u232am_b3000000
; break;
527 req
.bmRequestType
= UT_WRITE_VENDOR_DEVICE
;
528 req
.bRequest
= FTDI_SIO_SET_BAUD_RATE
;
529 USETW(req
.wValue
, rate
);
530 USETW(req
.wIndex
, portno
);
531 USETW(req
.wLength
, 0);
532 DPRINTFN(2,("uftdi_param: reqtype=0x%02x req=0x%02x value=0x%04x "
533 "index=0x%04x len=%d\n", req
.bmRequestType
, req
.bRequest
,
534 UGETW(req
.wValue
), UGETW(req
.wIndex
), UGETW(req
.wLength
)));
535 err
= usbd_do_request(ucom
->sc_udev
, &req
, NULL
);
539 if (ISSET(t
->c_cflag
, CSTOPB
))
540 data
= FTDI_SIO_SET_DATA_STOP_BITS_2
;
542 data
= FTDI_SIO_SET_DATA_STOP_BITS_1
;
543 if (ISSET(t
->c_cflag
, PARENB
)) {
544 if (ISSET(t
->c_cflag
, PARODD
))
545 data
|= FTDI_SIO_SET_DATA_PARITY_ODD
;
547 data
|= FTDI_SIO_SET_DATA_PARITY_EVEN
;
549 data
|= FTDI_SIO_SET_DATA_PARITY_NONE
;
550 switch (ISSET(t
->c_cflag
, CSIZE
)) {
552 data
|= FTDI_SIO_SET_DATA_BITS(5);
555 data
|= FTDI_SIO_SET_DATA_BITS(6);
558 data
|= FTDI_SIO_SET_DATA_BITS(7);
561 data
|= FTDI_SIO_SET_DATA_BITS(8);
566 req
.bmRequestType
= UT_WRITE_VENDOR_DEVICE
;
567 req
.bRequest
= FTDI_SIO_SET_DATA
;
568 USETW(req
.wValue
, data
);
569 USETW(req
.wIndex
, portno
);
570 USETW(req
.wLength
, 0);
571 DPRINTFN(2,("uftdi_param: reqtype=0x%02x req=0x%02x value=0x%04x "
572 "index=0x%04x len=%d\n", req
.bmRequestType
, req
.bRequest
,
573 UGETW(req
.wValue
), UGETW(req
.wIndex
), UGETW(req
.wLength
)));
574 err
= usbd_do_request(ucom
->sc_udev
, &req
, NULL
);
578 if (ISSET(t
->c_cflag
, CRTSCTS
)) {
579 flow
= FTDI_SIO_RTS_CTS_HS
;
580 USETW(req
.wValue
, 0);
581 } else if (ISSET(t
->c_iflag
, IXON
|IXOFF
)) {
582 flow
= FTDI_SIO_XON_XOFF_HS
;
583 USETW2(req
.wValue
, t
->c_cc
[VSTOP
], t
->c_cc
[VSTART
]);
585 flow
= FTDI_SIO_DISABLE_FLOW_CTRL
;
586 USETW(req
.wValue
, 0);
588 req
.bmRequestType
= UT_WRITE_VENDOR_DEVICE
;
589 req
.bRequest
= FTDI_SIO_SET_FLOW_CTRL
;
590 USETW2(req
.wIndex
, flow
, portno
);
591 USETW(req
.wLength
, 0);
592 err
= usbd_do_request(ucom
->sc_udev
, &req
, NULL
);
600 uftdi_get_status(void *vsc
, int portno
, u_char
*lsr
, u_char
*msr
)
602 struct uftdi_softc
*sc
= vsc
;
604 DPRINTF(("uftdi_status: msr=0x%02x lsr=0x%02x\n",
605 sc
->sc_msr
, sc
->sc_lsr
));
614 uftdi_break(void *vsc
, int portno
, int onoff
)
616 struct uftdi_softc
*sc
= vsc
;
617 struct ucom_softc
*ucom
= vsc
;
619 usb_device_request_t req
;
622 DPRINTF(("uftdi_break: sc=%p, port=%d onoff=%d\n", vsc
, portno
,
626 data
= sc
->last_lcr
| FTDI_SIO_SET_BREAK
;
631 req
.bmRequestType
= UT_WRITE_VENDOR_DEVICE
;
632 req
.bRequest
= FTDI_SIO_SET_DATA
;
633 USETW(req
.wValue
, data
);
634 USETW(req
.wIndex
, portno
);
635 USETW(req
.wLength
, 0);
636 (void)usbd_do_request(ucom
->sc_udev
, &req
, NULL
);
639 static device_method_t uftdi_methods
[] = {
640 /* Device interface */
641 DEVMETHOD(device_probe
, uftdi_match
),
642 DEVMETHOD(device_attach
, uftdi_attach
),
643 DEVMETHOD(device_detach
, uftdi_detach
),
648 static driver_t uftdi_driver
= {
651 sizeof (struct uftdi_softc
)
654 DRIVER_MODULE(uftdi
, uhub
, uftdi_driver
, ucom_devclass
, usbd_driver_load
, 0);
655 MODULE_DEPEND(uftdi
, usb
, 1, 1, 1);
656 MODULE_DEPEND(uftdi
, ucom
,UCOM_MINVER
, UCOM_PREFVER
, UCOM_MAXVER
);