]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/usb/uftdi.c
This commit was generated by cvs2svn to compensate for changes in r104912,
[FreeBSD/FreeBSD.git] / sys / dev / usb / uftdi.c
1 /*      $NetBSD: uftdi.c,v 1.12 2002/07/18 14:44:10 scw Exp $   */
2 /*      $FreeBSD$       */
3
4 /*
5  * Copyright (c) 2000 The NetBSD Foundation, Inc.
6  * All rights reserved.
7  *
8  * This code is derived from software contributed to The NetBSD Foundation
9  * by Lennart Augustsson (lennart@augustsson.net).
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. All advertising materials mentioning features or use of this software
20  *    must display the following acknowledgement:
21  *        This product includes software developed by the NetBSD
22  *        Foundation, Inc. and its contributors.
23  * 4. Neither the name of The NetBSD Foundation nor the names of its
24  *    contributors may be used to endorse or promote products derived
25  *    from this software without specific prior written permission.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37  * POSSIBILITY OF SUCH DAMAGE.
38  */
39
40 /*
41  * FTDI FT8U100AX serial adapter driver
42  */
43
44 /*
45  * XXX This driver will not support multiple serial ports.
46  * XXX The ucom layer needs to be extended first.
47  */
48
49 #include <sys/cdefs.h>
50
51 #include <sys/param.h>
52 #include <sys/systm.h>
53 #include <sys/kernel.h>
54 #include <sys/malloc.h>
55 #include <sys/bus.h>
56 #include <sys/ioccom.h>
57 #include <sys/fcntl.h>
58 #include <sys/conf.h>
59 #include <sys/tty.h>
60 #include <sys/file.h>
61
62 #if __FreeBSD_version >= 500014
63 #include <sys/selinfo.h>
64 #else
65 #include <sys/select.h>
66 #endif
67
68 #include <dev/usb/usb.h>
69 #include <dev/usb/usbhid.h>
70
71 #include <dev/usb/usbdi.h>
72 #include <dev/usb/usbdi_util.h>
73 #include <dev/usb/usbdevs.h>
74
75 #include <dev/usb/ucomvar.h>
76
77 #include <dev/usb/uftdireg.h>
78
79 #ifdef UFTDI_DEBUG
80 #define DPRINTF(x)      if (uftdidebug) printf x
81 #define DPRINTFN(n,x)   if (uftdidebug>(n)) printf x
82 int uftdidebug = 0;
83 #else
84 #define DPRINTF(x)
85 #define DPRINTFN(n,x)
86 #endif
87
88 #define UFTDI_CONFIG_INDEX      0
89 #define UFTDI_IFACE_INDEX       0
90
91
92 /*
93  * These are the maximum number of bytes transferred per frame.
94  * The output buffer size cannot be increased due to the size encoding.
95  */
96 #define UFTDIIBUFSIZE 64
97 #define UFTDIOBUFSIZE 64
98
99 struct uftdi_softc {
100         struct ucom_softc       sc_ucom;
101     
102         usbd_interface_handle   sc_iface;       /* interface */
103
104         enum uftdi_type         sc_type;
105         u_int                   sc_hdrlen;
106
107         u_char                  sc_msr;
108         u_char                  sc_lsr;
109
110         u_char                  sc_dying;
111
112         u_int                   last_lcr;
113 };
114
115 Static void     uftdi_get_status(void *, int portno, u_char *lsr, u_char *msr);
116 Static void     uftdi_set(void *, int, int, int);
117 Static int      uftdi_param(void *, int, struct termios *);
118 Static int      uftdi_open(void *sc, int portno);
119 Static void     uftdi_read(void *sc, int portno, u_char **ptr,u_int32_t *count);
120 Static void     uftdi_write(void *sc, int portno, u_char *to, u_char *from,
121                             u_int32_t *count);
122 Static void     uftdi_break(void *sc, int portno, int onoff);
123
124 struct ucom_callback uftdi_callback = {
125         uftdi_get_status,
126         uftdi_set,
127         uftdi_param,
128         NULL,
129         uftdi_open,
130         NULL,
131         uftdi_read,
132         uftdi_write,
133 };
134
135 USB_MATCH(uftdi)
136 {
137         USB_MATCH_START(uftdi, uaa);
138
139         if (uaa->iface != NULL)
140                 return (UMATCH_NONE);
141
142         DPRINTFN(20,("uftdi: vendor=0x%x, product=0x%x\n",
143                      uaa->vendor, uaa->product));
144
145         if (uaa->vendor == USB_VENDOR_FTDI &&
146             (uaa->product == USB_PRODUCT_FTDI_SERIAL_8U100AX ||
147              uaa->product == USB_PRODUCT_FTDI_SERIAL_8U232AM))
148                 return (UMATCH_VENDOR_PRODUCT);
149
150         return (UMATCH_NONE);
151 }
152
153 USB_ATTACH(uftdi)
154 {
155         USB_ATTACH_START(uftdi, sc, uaa);
156         usbd_device_handle dev = uaa->device;
157         usbd_interface_handle iface;
158         usb_interface_descriptor_t *id;
159         usb_endpoint_descriptor_t *ed;
160         char *devinfo;
161         const char *devname;
162         int i;
163         usbd_status err;
164         struct ucom_softc *ucom = &sc->sc_ucom;
165         DPRINTFN(10,("\nuftdi_attach: sc=%p\n", sc));
166         devinfo = malloc(1024, M_USBDEV, M_WAITOK);
167
168         ucom->sc_dev = self;
169         ucom->sc_udev = dev;
170
171         devname = USBDEVNAME(ucom->sc_dev);
172
173         /* Move the device into the configured state. */
174         err = usbd_set_config_index(dev, UFTDI_CONFIG_INDEX, 1);
175         if (err) {
176                 printf("\n%s: failed to set configuration, err=%s\n",
177                        devname, usbd_errstr(err));
178                 goto bad;
179         }
180
181         err = usbd_device2interface_handle(dev, UFTDI_IFACE_INDEX, &iface);
182         if (err) {
183                 printf("\n%s: failed to get interface, err=%s\n",
184                        devname, usbd_errstr(err));
185                 goto bad;
186         }
187
188         usbd_devinfo(dev, 0, devinfo);
189         /*      USB_ATTACH_SETUP;*/
190         printf("%s: %s\n", devname, devinfo);
191
192         id = usbd_get_interface_descriptor(iface);
193         ucom->sc_iface = iface;
194         switch( uaa->product ){
195         case USB_PRODUCT_FTDI_SERIAL_8U100AX:
196                 sc->sc_type = UFTDI_TYPE_SIO;
197                 sc->sc_hdrlen = 1;
198                 break;
199         case USB_PRODUCT_FTDI_SERIAL_8U232AM:
200                 sc->sc_type = UFTDI_TYPE_8U232AM;
201                 sc->sc_hdrlen = 0;
202                 break;
203
204         default:                /* Can't happen */
205                 goto bad;
206         }
207         
208         ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1;
209         
210         for (i = 0; i < id->bNumEndpoints; i++) {
211                 int addr, dir, attr;
212                 ed = usbd_interface2endpoint_descriptor(iface, i);
213                 if (ed == NULL) {
214                         printf("%s: could not read endpoint descriptor"
215                                ": %s\n", devname, usbd_errstr(err));
216                         goto bad;
217                 }
218                 
219                 addr = ed->bEndpointAddress;
220                 dir = UE_GET_DIR(ed->bEndpointAddress);
221                 attr = ed->bmAttributes & UE_XFERTYPE;
222                 if (dir == UE_DIR_IN && attr == UE_BULK)
223                   ucom->sc_bulkin_no = addr;
224                 else if (dir == UE_DIR_OUT && attr == UE_BULK)
225                   ucom->sc_bulkout_no = addr;
226                 else {
227                   printf("%s: unexpected endpoint\n", devname);
228                   goto bad;
229                 }
230         }
231         if (ucom->sc_bulkin_no == -1) {
232                 printf("%s: Could not find data bulk in\n",
233                        devname);
234                 goto bad;
235         }
236         if (ucom->sc_bulkout_no == -1) {
237                 printf("%s: Could not find data bulk out\n",
238                        devname);
239                 goto bad;
240         }
241         ucom->sc_parent  = sc;
242         ucom->sc_portno = FTDI_PIT_SIOA;
243         /* bulkin, bulkout set above */
244
245         ucom->sc_ibufsize = UFTDIIBUFSIZE;
246         ucom->sc_obufsize = UFTDIOBUFSIZE - sc->sc_hdrlen;
247         ucom->sc_ibufsizepad = UFTDIIBUFSIZE;
248         ucom->sc_opkthdrlen = sc->sc_hdrlen;
249
250
251         ucom->sc_callback = &uftdi_callback;
252 #if 0
253         usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, ucom->sc_udev,
254                            USBDEV(ucom->sc_dev));
255 #endif
256         DPRINTF(("uftdi: in=0x%x out=0x%x\n", ucom->sc_bulkin_no, ucom->sc_bulkout_no));
257         ucom_attach(&sc->sc_ucom);
258         free(devinfo, M_USBDEV);
259                 
260         USB_ATTACH_SUCCESS_RETURN;
261
262 bad:
263         DPRINTF(("uftdi_attach: ATTACH ERROR\n"));
264         ucom->sc_dying = 1;
265         free(devinfo, M_USBDEV);
266
267         USB_ATTACH_ERROR_RETURN;
268 }
269 #if 0
270 int
271 uftdi_activate(device_ptr_t self, enum devact act)
272 {
273         struct uftdi_softc *sc = (struct uftdi_softc *)self;
274         int rv = 0;
275
276         switch (act) {
277         case DVACT_ACTIVATE:
278                 return (EOPNOTSUPP);
279                 break;
280
281         case DVACT_DEACTIVATE:
282                 if (sc->sc_subdev != NULL)
283                         rv = config_deactivate(sc->sc_subdev);
284                 sc->sc_dying = 1;
285                 break;
286         }
287         return (rv);
288 }
289 #endif
290 #if 1
291 USB_DETACH(uftdi)
292 {
293         USB_DETACH_START(uftdi, sc);
294  
295         int rv = 0;
296
297         DPRINTF(("uftdi_detach: sc=%p flags=%d\n", sc, flags));
298         sc->sc_dying = 1;
299         rv = ucom_detach(&sc->sc_ucom);
300
301         return rv;
302 }
303 #endif
304 Static int
305 uftdi_open(void *vsc, int portno)
306 {
307         struct uftdi_softc *sc = vsc;
308         struct ucom_softc *ucom = (struct ucom_softc *) vsc;
309         usb_device_request_t req;
310         usbd_status err;
311         struct termios t;
312
313         DPRINTF(("uftdi_open: sc=%p\n", sc));
314
315         if (sc->sc_dying)
316                 return (EIO);
317
318         /* Perform a full reset on the device */
319         req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
320         req.bRequest = FTDI_SIO_RESET;
321         USETW(req.wValue, FTDI_SIO_RESET_SIO);
322         USETW(req.wIndex, portno);
323         USETW(req.wLength, 0);
324         err = usbd_do_request(ucom->sc_udev, &req, NULL);
325         if (err)
326                 return (EIO);
327
328         /* Set 9600 baud, 2 stop bits, no parity, 8 bits */
329         t.c_ospeed = 9600;
330         t.c_cflag = CSTOPB | CS8;
331         (void)uftdi_param(sc, portno, &t);
332
333         /* Turn on RTS/CTS flow control */
334         req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
335         req.bRequest = FTDI_SIO_SET_FLOW_CTRL;
336         USETW(req.wValue, 0);
337         USETW2(req.wIndex, FTDI_SIO_RTS_CTS_HS, portno);
338         USETW(req.wLength, 0);
339         err = usbd_do_request(ucom->sc_udev, &req, NULL);
340         if (err)
341                 return (EIO);
342
343         return (0);
344 }
345
346 Static void
347 uftdi_read(void *vsc, int portno, u_char **ptr, u_int32_t *count)
348 {
349         struct uftdi_softc *sc = vsc;
350         u_char msr, lsr;
351
352         DPRINTFN(15,("uftdi_read: sc=%p, port=%d count=%d\n", sc, portno,
353                      *count));
354
355         msr = FTDI_GET_MSR(*ptr);
356         lsr = FTDI_GET_LSR(*ptr);
357
358 #ifdef UFTDI_DEBUG
359         if (*count != 2)
360                 DPRINTFN(10,("uftdi_read: sc=%p, port=%d count=%d data[0]="
361                             "0x%02x\n", sc, portno, *count, (*ptr)[2]));
362 #endif
363
364         if (sc->sc_msr != msr ||
365             (sc->sc_lsr & FTDI_LSR_MASK) != (lsr & FTDI_LSR_MASK)) {
366                 DPRINTF(("uftdi_read: status change msr=0x%02x(0x%02x) "
367                          "lsr=0x%02x(0x%02x)\n", msr, sc->sc_msr,
368                          lsr, sc->sc_lsr));
369                 sc->sc_msr = msr;
370                 sc->sc_lsr = lsr;
371                 ucom_status_change(&sc->sc_ucom);
372         }
373
374         /* Pick up status and adjust data part. */
375         *ptr += 2;
376         *count -= 2;
377 }
378
379 Static void
380 uftdi_write(void *vsc, int portno, u_char *to, u_char *from, u_int32_t *count)
381 {
382         struct uftdi_softc *sc = vsc;
383
384         DPRINTFN(10,("uftdi_write: sc=%p, port=%d count=%u data[0]=0x%02x\n",
385                      vsc, portno, *count, from[0]));
386
387         /* Make length tag and copy data */
388         if (sc->sc_hdrlen > 0)
389                 *to = FTDI_OUT_TAG(*count, portno);
390
391         memcpy(to + sc->sc_hdrlen, from, *count);
392         *count += sc->sc_hdrlen;
393 }
394
395 Static void
396 uftdi_set(void *vsc, int portno, int reg, int onoff)
397 {
398         struct uftdi_softc *sc = vsc;
399         struct ucom_softc *ucom = vsc;
400         usb_device_request_t req;
401         int ctl;
402
403         DPRINTF(("uftdi_set: sc=%p, port=%d reg=%d onoff=%d\n", vsc, portno,
404                  reg, onoff));
405
406         switch (reg) {
407         case UCOM_SET_DTR:
408                 ctl = onoff ? FTDI_SIO_SET_DTR_HIGH : FTDI_SIO_SET_DTR_LOW;
409                 break;
410         case UCOM_SET_RTS:
411                 ctl = onoff ? FTDI_SIO_SET_RTS_HIGH : FTDI_SIO_SET_RTS_LOW;
412                 break;
413         case UCOM_SET_BREAK:
414                 uftdi_break(sc, portno, onoff);
415                 return;
416         default:
417                 return;
418         }
419         req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
420         req.bRequest = FTDI_SIO_MODEM_CTRL;
421         USETW(req.wValue, ctl);
422         USETW(req.wIndex, portno);
423         USETW(req.wLength, 0);
424         DPRINTFN(2,("uftdi_set: reqtype=0x%02x req=0x%02x value=0x%04x "
425                     "index=0x%04x len=%d\n", req.bmRequestType, req.bRequest,
426                     UGETW(req.wValue), UGETW(req.wIndex), UGETW(req.wLength)));
427         (void)usbd_do_request(ucom->sc_udev, &req, NULL);
428 }
429
430 Static int
431 uftdi_param(void *vsc, int portno, struct termios *t)
432 {
433         struct uftdi_softc *sc = vsc;
434         struct ucom_softc *ucom = vsc;
435         usb_device_request_t req;
436         usbd_status err;
437         int rate=0, data, flow;
438
439         DPRINTF(("uftdi_param: sc=%p\n", sc));
440
441         if (sc->sc_dying)
442                 return (EIO);
443
444         switch (sc->sc_type) {
445         case UFTDI_TYPE_SIO:
446                 switch (t->c_ospeed) {
447                 case 300: rate = ftdi_sio_b300; break;
448                 case 600: rate = ftdi_sio_b600; break;
449                 case 1200: rate = ftdi_sio_b1200; break;
450                 case 2400: rate = ftdi_sio_b2400; break;
451                 case 4800: rate = ftdi_sio_b4800; break;
452                 case 9600: rate = ftdi_sio_b9600; break;
453                 case 19200: rate = ftdi_sio_b19200; break;
454                 case 38400: rate = ftdi_sio_b38400; break;
455                 case 57600: rate = ftdi_sio_b57600; break;
456                 case 115200: rate = ftdi_sio_b115200; break;
457                 default:
458                         return (EINVAL);
459                 }
460                 break;
461
462         case UFTDI_TYPE_8U232AM:
463                 switch(t->c_ospeed) {
464                 case 300: rate = ftdi_8u232am_b300; break;
465                 case 600: rate = ftdi_8u232am_b600; break;
466                 case 1200: rate = ftdi_8u232am_b1200; break;
467                 case 2400: rate = ftdi_8u232am_b2400; break;
468                 case 4800: rate = ftdi_8u232am_b4800; break;
469                 case 9600: rate = ftdi_8u232am_b9600; break;
470                 case 19200: rate = ftdi_8u232am_b19200; break;
471                 case 38400: rate = ftdi_8u232am_b38400; break;
472                 case 57600: rate = ftdi_8u232am_b57600; break;
473                 case 115200: rate = ftdi_8u232am_b115200; break;
474                 case 230400: rate = ftdi_8u232am_b230400; break;
475                 case 460800: rate = ftdi_8u232am_b460800; break;
476                 case 921600: rate = ftdi_8u232am_b921600; break;
477                 default:
478                         return (EINVAL);
479                 }
480                 break;
481         }
482         req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
483         req.bRequest = FTDI_SIO_SET_BAUD_RATE;
484         USETW(req.wValue, rate);
485         USETW(req.wIndex, portno);
486         USETW(req.wLength, 0);
487         DPRINTFN(2,("uftdi_param: reqtype=0x%02x req=0x%02x value=0x%04x "
488                     "index=0x%04x len=%d\n", req.bmRequestType, req.bRequest,
489                     UGETW(req.wValue), UGETW(req.wIndex), UGETW(req.wLength)));
490         err = usbd_do_request(ucom->sc_udev, &req, NULL);
491         if (err)
492                 return (EIO);
493
494         if (ISSET(t->c_cflag, CSTOPB))
495                 data = FTDI_SIO_SET_DATA_STOP_BITS_2;
496         else
497                 data = FTDI_SIO_SET_DATA_STOP_BITS_1;
498         if (ISSET(t->c_cflag, PARENB)) {
499                 if (ISSET(t->c_cflag, PARODD))
500                         data |= FTDI_SIO_SET_DATA_PARITY_ODD;
501                 else
502                         data |= FTDI_SIO_SET_DATA_PARITY_EVEN;
503         } else
504                 data |= FTDI_SIO_SET_DATA_PARITY_NONE;
505         switch (ISSET(t->c_cflag, CSIZE)) {
506         case CS5:
507                 data |= FTDI_SIO_SET_DATA_BITS(5);
508                 break;
509         case CS6:
510                 data |= FTDI_SIO_SET_DATA_BITS(6);
511                 break;
512         case CS7:
513                 data |= FTDI_SIO_SET_DATA_BITS(7);
514                 break;
515         case CS8:
516                 data |= FTDI_SIO_SET_DATA_BITS(8);
517                 break;
518         }
519         sc->last_lcr = data;
520
521         req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
522         req.bRequest = FTDI_SIO_SET_DATA;
523         USETW(req.wValue, data);
524         USETW(req.wIndex, portno);
525         USETW(req.wLength, 0);
526         DPRINTFN(2,("uftdi_param: reqtype=0x%02x req=0x%02x value=0x%04x "
527                     "index=0x%04x len=%d\n", req.bmRequestType, req.bRequest,
528                     UGETW(req.wValue), UGETW(req.wIndex), UGETW(req.wLength)));
529         err = usbd_do_request(ucom->sc_udev, &req, NULL);
530         if (err)
531                 return (EIO);
532
533         if (ISSET(t->c_cflag, CRTSCTS)) {
534                 flow = FTDI_SIO_RTS_CTS_HS;
535                 USETW(req.wValue, 0);
536         } else if (ISSET(t->c_iflag, IXON|IXOFF)) {
537                 flow = FTDI_SIO_XON_XOFF_HS;
538                 USETW2(req.wValue, t->c_cc[VSTOP], t->c_cc[VSTART]);
539         } else {
540                 flow = FTDI_SIO_DISABLE_FLOW_CTRL;
541                 USETW(req.wValue, 0);
542         }
543         req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
544         req.bRequest = FTDI_SIO_SET_FLOW_CTRL;
545         USETW2(req.wIndex, flow, portno);
546         USETW(req.wLength, 0);
547         err = usbd_do_request(ucom->sc_udev, &req, NULL);
548         if (err)
549                 return (EIO);
550
551         return (0);
552 }
553
554 void
555 uftdi_get_status(void *vsc, int portno, u_char *lsr, u_char *msr)
556 {
557         struct uftdi_softc *sc = vsc;
558
559         DPRINTF(("uftdi_status: msr=0x%02x lsr=0x%02x\n",
560                  sc->sc_msr, sc->sc_lsr));
561
562         if (msr != NULL)
563                 *msr = sc->sc_msr;
564         if (lsr != NULL)
565                 *lsr = sc->sc_lsr;
566 }
567
568 void
569 uftdi_break(void *vsc, int portno, int onoff)
570 {
571         struct uftdi_softc *sc = vsc;
572         struct ucom_softc *ucom = vsc;
573
574         usb_device_request_t req;
575         int data;
576
577         DPRINTF(("uftdi_break: sc=%p, port=%d onoff=%d\n", vsc, portno,
578                   onoff));
579
580         if (onoff) {
581                 data = sc->last_lcr | FTDI_SIO_SET_BREAK;
582         } else {
583                 data = sc->last_lcr;
584         }
585
586         req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
587         req.bRequest = FTDI_SIO_SET_DATA;
588         USETW(req.wValue, data);
589         USETW(req.wIndex, portno);
590         USETW(req.wLength, 0);
591         (void)usbd_do_request(ucom->sc_udev, &req, NULL);
592 }
593
594 Static device_method_t uftdi_methods[] = {
595         /* Device interface */
596         DEVMETHOD(device_probe, uftdi_match),
597         DEVMETHOD(device_attach, uftdi_attach),
598         DEVMETHOD(device_detach, uftdi_detach),
599
600         { 0, 0 }
601 };
602
603 Static driver_t uftdi_driver = {
604         "uftdi",
605         uftdi_methods,
606         sizeof (struct uftdi_softc)
607 };
608
609 DRIVER_MODULE(uftdi, uhub, uftdi_driver, ucom_devclass, usbd_driver_load, 0);
610 MODULE_DEPEND(uftdi, usb, 1, 1, 1);
611 MODULE_DEPEND(uftdi, ucom,UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER);