Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Nov 2012 14:24:07 +0100
From:      Niclas Zeising <zeising+freebsd@daemonic.se>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Questions about USB, uhid, ukbd and quirks
Message-ID:  <50B0CA77.90501@daemonic.se>
In-Reply-To: <201211241419.29050.hselasky@c2i.net>
References:  <50B0001C.6050202@daemonic.se> <50B0BC44.2090609@daemonic.se> <50B0C395.8060809@daemonic.se> <201211241419.29050.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060407040706040803090501
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 11/24/12 14:19, Hans Petter Selasky wrote:
> On Saturday 24 November 2012 13:54:45 Niclas Zeising wrote:
>> On 11/24/12 13:23, Niclas Zeising wrote:
>>> On 11/24/12 13:17, Hans Petter Selasky wrote:
>>>> On Saturday 24 November 2012 12:13:49 Hans Petter Selasky wrote:
>>>>> On Saturday 24 November 2012 00:00:44 Niclas Zeising wrote:
>>>>>> 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:
>>>>> Hi,
>>>>>
>>>>> It seems the UHID driver needs to be synced with UMS and UKBD
>>>>> regarding the
>>>>> detection logic. Can you try the attached patch and report back.
>>>>>
>>>>> --HPS
>>>>
>>>> One more thing to check:
>>>>
>>>> /etc/devd/usb.conf
>>>>
>>>> Is perhaps auto-loading uhid before ukbd, and that might also be part
>>>> of the
>>>> issue.
>>>
>>> Hi!
>>> Having ukbd in the kernel, and not uhid, makes uhid load as a module
>>> during boot and attach to the keyboard, even with your patch. I'm
>>> recompiling the kernel now with uhid as part of the kernel to see if it
>>> makes a difference. I'm not too confortable hacking /etc/devd/usb.conf,
>>> but if you can point me in the right direction I'll have a go at it.
>>> Regards!
>>
>> Having uhid in the kernel did not make a difference, it attached to the
>> keyboard (or rather, the keyboard attached to the uhid driver, I guess).
>> Regards!
>
> Could you dump the configuration descriptor of your device using usbconfig?
>
> usbconfig -d X.Y dump_curr_config_desc
>
> --HPS

Attached patch contains the dump.  From my reading of the USB spec, it 
seems that this keyboard has two interfaces, one that detects as a 
keyboard, and might be the boot device, and one that's just a regular 
hid.  I might also be very wrong in this. :)
I have a dump from a keyboard that only attaches to ukbd, if you need 
something to compare to.  That keyboard, however, believes it's a liteon 
keyboard, rather than a logitech keyboard.  That, however, is probably 
Logitech's fault.
Thank you for helping out!
Regards!
-- 
Niclas

--------------060407040706040803090501
Content-Type: text/plain;
 name="usbkeyboard.dump"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="usbkeyboard.dump"

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


 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x003b 
    bNumInterfaces = 0x0002 
    bConfigurationValue = 0x0001 
    iConfiguration = 0x0003  <U64.00_B0001>
    bmAttributes = 0x00a0 
    bMaxPower = 0x002d 

    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0001 
      bInterfaceClass = 0x0003 
      bInterfaceSubClass = 0x0001 
      bInterfaceProtocol = 0x0001 
      iInterface = 0x0002  <USB Keyboard>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x10
       RAW dump: 
       0x00 | 0x09, 0x21, 0x10, 0x01, 0x00, 0x01, 0x22, 0x41, 
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008 
        bInterval = 0x000a 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 


    Interface 1
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0001 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0001 
      bInterfaceClass = 0x0003 
      bInterfaceSubClass = 0x0000 
      bInterfaceProtocol = 0x0000 
      iInterface = 0x0002  <USB Keyboard>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x10
       RAW dump: 
       0x00 | 0x09, 0x21, 0x10, 0x01, 0x00, 0x01, 0x22, 0x9f, 
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0082  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0004 
        bInterval = 0x00ff 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

--------------060407040706040803090501--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50B0CA77.90501>