Are usbhidctl/usbhidaction working?

Hans Petter Selasky hselasky at c2i.net
Fri Apr 17 14:06:17 UTC 2009


On Friday 17 April 2009, Alexander Motin wrote:
> Hi.
>
> I have tried to configure multimedia buttons of my Logitech/BTC keyboard
> on 8-CURRENT from March 26 and found that it is not working.
>
> Keyboard detected as:
> ugen0.2: <BTC> at usbus0
> ukbd0: <BTC USB Multimedia Keyboard, class 0/0, rev 1.10/1.00, addr 2>
> on usbus0
> kbd2 at ukbd0
> kbd2: ukbd0, generic (0), config:0x0, flags:0x3d0000
> uhid0: <BTC USB Multimedia Keyboard, class 0/0, rev 1.10/1.00, addr 2>
> on usbus0
>
> As I have found keyboard supports 3 reports: #1, #2 and #3, while tools
> only trying to use report #0 and fail.
>
> I have tried to hack tools to use report 2, which is most interesting
> for me, but I have found that data read from uhid device are preceded
> with 0x02 byte (I think it may be report id) which confuses
> usbhidaction. Here is some debug I have got from it after just stripping
> first byte to make it work:
>
> read 3 bytes: 02 02 00
> 2 Consumer:Volume_Decrement 1 0 echo 'Volume_Decrement' >>/qqq 1
> system 'echo 'Volume_Decrement' >>/qqq'
> read 1 bytes: 00
> read 3 bytes: 02 00 00
> read 1 bytes: 00
> read 3 bytes: 02 01 00
> 1 Consumer:Volume_Increment 1 0 echo 'Volume_Increment' >>/qqq 1
> system 'echo 'Volume_Increment' >>/qqq'
> read 1 bytes: 00
> read 3 bytes: 02 00 00
> read 1 bytes: 00
>
> So I have a questions:
>  - Are these tools are working at least for somebody now?
>  - Are these tools able to work with several report ids?

Some answers:

The uhid driver in the kernel is filtering all the descriptors from the 
interrupt endpoint. The uhid driver needs to be updated, maybe by an ioctl 
where you can get un-filtered messages.

Else use libusb, which should be fairly trivial.

Also the hid-descriptor parsing in the user-land hid library needs to get 
synched with the kernel version. I have no plans for that, hence I have my 
hands full.

>  - Am I right that 0x02 by preceded before report is report id and
> usbhidaction tool should parse/strip it?
>  - Is it expected way to use uhid with libusd by reading /dev/uhidX
> device directly?

--HPS


More information about the freebsd-usb mailing list