From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 24 14:02:03 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24C2887C for ; Sat, 24 Nov 2012 14:02:03 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 644578FC14 for ; Sat, 24 Nov 2012 14:02:02 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id AD03E40002 for ; Sat, 24 Nov 2012 15:02:01 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id A299E40004; Sat, 24 Nov 2012 15:02:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 1F83D40002; Sat, 24 Nov 2012 15:02:00 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3Y7wzY6S6rz8hVn; Sat, 24 Nov 2012 15:01:29 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id OpriLiykl7vc; Sat, 24 Nov 2012 15:01:27 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3Y7wzW2mRCz8hVm; Sat, 24 Nov 2012 15:01:27 +0100 (CET) Received: from tifa.daemonic.se (tifa.daemonic.se [IPv6:2001:470:dca9:1::6]) by mail.daemonic.se (Postfix) with ESMTPSA id 3Y7wzW20cdz9Ctj; Sat, 24 Nov 2012 15:01:27 +0100 (CET) Received: from tifa.daemonic.se (localhost [IPv6:::1]) by tifa.daemonic.se (Postfix) with ESMTP id 1EF2822AFA; Sat, 24 Nov 2012 15:01:27 +0100 (CET) Message-ID: <50B0D336.60702@daemonic.se> Date: Sat, 24 Nov 2012 15:01:26 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Hans Petter Selasky Subject: Re: Questions about USB, uhid, ukbd and quirks References: <50B0001C.6050202@daemonic.se> <201211241419.29050.hselasky@c2i.net> <50B0CA77.90501@daemonic.se> <201211241438.20357.hselasky@c2i.net> In-Reply-To: <201211241438.20357.hselasky@c2i.net> Content-Type: multipart/mixed; boundary="------------020400080803070302060101" X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 14:02:03 -0000 This is a multi-part message in MIME format. --------------020400080803070302060101 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit On 11/24/12 14:38, Hans Petter Selasky wrote: > On Saturday 24 November 2012 14:24:07 Niclas Zeising wrote: >> 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! > > Hi, > > You should have one of each, one ukbd, and one uhid. > > If you run "usbconfig show_ifdrv" at what interface is the uhid and ukbd > attached. > > Make sure both uhid and ukbd is loaded. > > Please add a printout, but is_keyboard should be non-zero, before and after my > patch. So uhid is not attaching to the wrong interface, so to speak. Running usbconfig show_ifdrv shows uhid and ukbd both attached to the keyboard, both with and without your patch, and the output looks the same, see attached file. I can't find the is_keyboard flag you're talking about however, but the keyboard works. I guess I'm mostly surprised that the keyboard attaches as a HID as well, so it can be that I'm making a lot of noise about a non-issue. Thanks for helping out though! Regards! -- Niclas --------------020400080803070302060101 Content-Type: text/plain; name="usb.ifdrv.patch.dump" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="usb.ifdrv.patch.dump" ugen2.3: at usbus2, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON ugen2.3.0: ukbd0: ugen2.3.1: uhid0: --------------020400080803070302060101--