usb match() function

Peter B pb at ludd.ltu.se
Fri Aug 22 20:02:46 UTC 2008


Within the usb drivers (/usr/src/sys/dev/usb/u*.c) there's an matching routine
where the 'uaa->iface' is supposed to be assigned before the routine is called.

However for a new device or class this doesn't seem to work. Instead 'uaa'
is set like for an generic device (two interfaces, no "default" in my case).

So how is one supposed to make the kernel fill in 'uaa->iface' ..?

Code excerpt (v7.x):
  static int
  *_match(device_t self)
  {
        struct usb_attach_arg *uaa = device_get_ivars(self);
        usb_interface_descriptor_t *id;

        DPRINTFN(10,("*_match\n"));
        if (uaa->iface == NULL)
                return (UMATCH_NONE);



More information about the freebsd-hackers mailing list