Questions about USB, uhid, ukbd and quirks

Niclas Zeising zeising+freebsd at daemonic.se
Fri Nov 23 23:00:52 UTC 2012


Hi!
I have a couple of questions about USB.
I recently bought a new USB keyboard, a Logitech K120.  When attaching 
this to a FreeBSD system, however, it is detected as a hid device 
(attaching to uhid) rather than a keyboard (attaching to ukbd).  The 
keyboard works fine, but I'm just curious as to why it doesn't use ukbd.
The output from usbconfig for this keyboard is:

ugen2.3: <USB Keyboard Logitech> at usbus2, cfg=0 md=HOST spd=LOW 
(1.5Mbps) pwr=ON

   bLength = 0x0012
   bDescriptorType = 0x0001
   bcdUSB = 0x0110
   bDeviceClass = 0x0000
   bDeviceSubClass = 0x0000
   bDeviceProtocol = 0x0000
   bMaxPacketSize0 = 0x0008
   idVendor = 0x046d
   idProduct = 0xc31c
   bcdDevice = 0x6400
   iManufacturer = 0x0001  <Logitech>
   iProduct = 0x0002  <USB Keyboard>
   iSerialNumber = 0x0000  <no string>
   bNumConfigurations = 0x0001

If I add the qurik UQ_HID_IGNORE, it attaches with ukbd and works fine. 
  I don't know if this is appropriate to add to the general quriks though.

I have another keyboard, also Logitech, but older.  This one attaches to 
ukbd, but the manufacture string says LITEON.  Is this string fetched 
from the device, or is it somehow stored in the usb drivers?
The output from usbconfig for this keyboard is:

ugen4.2: <USB Multimedia Keyboard LITEON Technology> at usbus4, cfg=0 
md=HOST spd=LOW (1.5Mbps) pwr=ON

   bLength = 0x0012
   bDescriptorType = 0x0001
   bcdUSB = 0x0110
   bDeviceClass = 0x0000
   bDeviceSubClass = 0x0000
   bDeviceProtocol = 0x0000
   bMaxPacketSize0 = 0x0008
   idVendor = 0x046d
   idProduct = 0xc312
   bcdDevice = 0x0101
   iManufacturer = 0x0001  <LITEON Technology>
   iProduct = 0x0002  <USB Multimedia Keyboard>
   iSerialNumber = 0x0000  <no string>
   bNumConfigurations = 0x0001

These issues probably have natural explanations, but it's making me 
slightly confused, so I hope someone can shed some light on them.
Regards!
-- 
Niclas


More information about the freebsd-hackers mailing list