New USB ums driver returns incorrect value on probe

Hans Petter Selasky hselasky at c2i.net
Mon Jan 11 08:10:15 UTC 2010


On Monday 11 January 2010 07:40:26 Michael Grant wrote:
> Good day,
> 
> I am trying to port an excellent driver for a HID peripheral to the new USB
>  stack on 8.0 and noticed some strange behaviour: The device, by default,
>  operates as a mouse and only once a sensible driver communicates to it
>  will the device enter an extended mode.  The interesting thing is that
>  this device is never given to the driver to be probed.
> 
> I notice in the DEVICE_PROBE(9) man page: "If a success code of zero is
>  returned, the driver can assume that it will be the one attached".
> 
> Now looking in /usr/src/sys/dev/usb/input/ums.c
> 
> if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) &&
>   (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))
>     return (0);
> 
> I think the return value should be BUS_PROBE_DEFAULT and not 0, after all
>  the ums driver is generic.
> 
> I have not submitted a PR, should I do that as well or is a post to this
>  list sufficient?
> 

        if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) &&
            (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))
                return (BUS_PROBE_GENERIC);

This has been fixed in newer source code, 8+9 I believe.

--HPS


More information about the freebsd-bugs mailing list