usbd.conf: detach ukbd
Hans Petter Selasky
hselasky at c2i.net
Thu Jun 9 20:24:01 GMT 2005
On Thursday 09 June 2005 17:50, Maksim Yevmenkin wrote:
> > when running usbd (under FreeBSD 4.11) with
> > -dv switches I can see that a usb keyboard
> > correctly attaches as ukbd0,
> > but detaches as fall-through "USB device".
> does something like
> device "USB keyboard"
> devname "ukbd[0-9]+"
> attach "foo"
> detach "bar"
I'm not sure if detach is supported like that, because the "ukbd" device name
will not be passed to "usbd" during detach. Then one needs to match against
the class/subclass of the USB-keyboard:
device "USB keyboard"
detach "xxxx ukbd0"
Else if devd is not available on 4.11 you will have to change some code and
compile a new kernel, from what I can see.
To the file /sys/dev/usb/ukbd.c add this:
struct usb_event ue;
device_get_nameunit(self), USB_MAX_DEVNAMELEN) ;
This will make the suggestion from Maksim work.
A generic solution would be to call "usbd_add_device_detach_event()" from the
"bus_child_detached" method of uhub, which must be added.
Also one can change "usb_disconnect_port()" to generate the event before the
sub-devices are detached, but that might not work in all cases.
More information about the freebsd-hackers