USB device with multiple interfaces, sample code anyone?

Volker volker at
Mon May 29 08:01:30 PDT 2006

Hi hackers,

I'm trying to correctly implement a driver for an USB device which
has multiple (serial) interfaces (at least 3). Each interface should
be seen by the kernel as a tty device entry /dev(/cuaU* or /dev/ttyU*).

After reading the usb kernel sources I'm not quite sure how to deal
with that. As the device entry is being created in ucom.c
(ucom_attach calls ttycreate) I'm not quite sure which code is
responsible for scanning (enumerating) and correctly attaching to
the usb device interfaces or if there's just a wrong enumeration
return code.

I haven't found any usb code which deals with more than 1 interface
per usb device (except sound/pcm/uaudio but while doing a quick read
of that code I do not understand much of uaudio).

Does any of the hackers have a piece of sample code on how to scan
usb device interfaces and attach a device file entry (/dev/) to it?
Or any pseudo-code or graphical explanation on how the usb code is
actually doing device enumeration?



More information about the freebsd-hackers mailing list