From owner-freebsd-usb@FreeBSD.ORG Tue Jun 9 08:36:10 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4769106571A for ; Tue, 9 Jun 2009 08:36:10 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 222378FC1B for ; Tue, 9 Jun 2009 08:36:09 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=j+k/Ze5hWUCaCztCgEjzDQ==:17 a=dT19lrtdAAAA:8 a=voVFGzz_05Kb500bRSMA:9 a=0J1PSuyi44W_F2Q4xZMA:7 a=nTK3FuduglPDIEsHWLPhI5QF8QoA:4 Received: from [81.191.55.181] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1255755224; Tue, 09 Jun 2009 09:36:04 +0200 From: Hans Petter Selasky To: Jeremy Faulkner Date: Tue, 9 Jun 2009 09:40:14 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-CURRENT; KDE/4.2.4; i386; ; ) References: <200906082127.35793.hselasky@c2i.net> <4A2D8EB7.4050305@gmail.com> In-Reply-To: <4A2D8EB7.4050305@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906090940.15488.hselasky@c2i.net> Cc: usb@freebsd.org Subject: Re: Yubikey - cont'd X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2009 08:36:11 -0000 On Tuesday 09 June 2009 00:20:39 Jeremy Faulkner wrote: > Hans Petter Selasky wrote: > > On Monday 08 June 2009 02:07:32 Jeremy Faulkner wrote: > >> Thanks for the reply Hans. I can't reply to the original thread as I > >> wasn't subscribed to usb@ and didn't mention that in my previous > >> email. I'm subscribed now. > >> > >> I assume you meant 'cat /dev/usb/5.5.1 | hexdump -C' as 'hexdump C' > >> expects C to be a file. I've attached the output of hexdump when the > >> Yubikey is triggered. > > > > Your Yubikey input looks like the input of a keyboard. I'm a little bit > > busy at the moment. What needs to be done is to search for Yubikey in the > > NetBSD ukbd.c driver (sys/dev/usb) and port those changes to the FreeBSD > > ukbd.c driver (sys/dev/usb/input). Is that something you can do? > > > > You might find the following link useful: > > > > http://fxr.watson.org > > > > --HPS > > There were no occurances of Yubikey in fxr.watson.org so I checked the > FreeBSD ukbd.c to see if it was rejecting the Yubikey for some reason. I > found in ukbd_probe() that it required that the keyboard have > InterfaceSubClass == UISUBCLASS_BOOT and InterfaceProtocol == > UPROTO_BOOT_KEYBOARD in order to attach. > > I don't know what they're for but the Yubikey has no subclass or > interface protocol set. To test this I hacked it to return 0 if the > idVendor is that of Yubico (0x1050) and it attached as ukbd0 (kbd2) and > worked. Perhaps it would be better to create a USB Quirk for forced ukbd > attach than to have the Yubico vendor id in ukbd_probe() > > Also, I don't know what the difference between UPROTO_BOOT_KEYBOARD > (defined in ukbd.c) and UIPROTO_BOOT_KEYBOARD (defined in usb.h) > Then you need to compare the ukbd.c in NetBSD anb the ukbd.c in FreeBSD. You can use usbconfig dump_device_desc to get the fields that are matched against. --HPS