From owner-freebsd-usb@FreeBSD.ORG Wed Sep 23 22:50:03 2009 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3260C1065679 for ; Wed, 23 Sep 2009 22:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 21F978FC1D for ; Wed, 23 Sep 2009 22:50:03 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8NMo26a037853 for ; Wed, 23 Sep 2009 22:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8NMo2UC037852; Wed, 23 Sep 2009 22:50:02 GMT (envelope-from gnats) Date: Wed, 23 Sep 2009 22:50:02 GMT Message-Id: <200909232250.n8NMo2UC037852@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Tom Judge Cc: Subject: Re: usb/116947: [ukbd] [patch] [regression] enable boot protocol on the USB keyboards X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Tom Judge List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 22:50:03 -0000 The following reply was made to PR usb/116947; it has been noted by GNATS. From: Tom Judge To: bug-followup@FreeBSD.org, rea-fbsd@codelabs.ru Cc: Subject: Re: usb/116947: [ukbd] [patch] [regression] enable boot protocol on the USB keyboards Date: Wed, 23 Sep 2009 22:22:16 +0000 This is a multi-part message in MIME format. --------------070601060402040600080702 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Here is a simple patch against 8.0 Beta 3 to make the Function keys work. This adds a quirk UQ_KBD_BOOTPROTO, than can be set to force the keyboard to use the boot protocol. --------------070601060402040600080702 Content-Type: text/plain; name="usb-natural4000.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="usb-natural4000.patch" Index: quirk/usb_quirk.c =================================================================== --- quirk/usb_quirk.c (revision 196574) +++ quirk/usb_quirk.c (working copy) @@ -122,6 +122,7 @@ {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY1B, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_TENX, USB_PRODUCT_TENX_UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR, UQ_NONE)}, /* MS keyboards do weird things */ + {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_NATURAL4000, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, 0x0000, 0xFFFF, UQ_MS_LEADING_BYTE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, }; @@ -138,6 +139,7 @@ [UQ_BUS_POWERED] = "UQ_BUS_POWERED", [UQ_HID_IGNORE] = "UQ_HID_IGNORE", [UQ_KBD_IGNORE] = "UQ_KBD_IGNORE", + [UQ_KBD_BOOTPROTO] = "UQ_KBD_BOOTPROTO", [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS", [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", [UQ_MS_REVZ] = "UQ_MS_REVZ", Index: quirk/usb_quirk.h =================================================================== --- quirk/usb_quirk.h (revision 196574) +++ quirk/usb_quirk.h (working copy) @@ -40,6 +40,7 @@ UQ_BUS_POWERED, /* device is bus powered, despite claim */ UQ_HID_IGNORE, /* device should be ignored by hid class */ UQ_KBD_IGNORE, /* device should be ignored by kbd class */ + UQ_KBD_BOOTPROTO, /* kbd should use the boot proto. */ UQ_MS_BAD_CLASS, /* doesn't identify properly */ UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ UQ_MS_REVZ, /* mouse has Z-axis reversed */ Index: input/ukbd.c =================================================================== --- input/ukbd.c (revision 196574) +++ input/ukbd.c (working copy) @@ -789,6 +789,17 @@ * according to the BIOS data? */ KBD_PROBE_DONE(kbd); + /* + * Set boot protocol if we need the quirk. + */ + + if (usb_test_quirk(uaa, UQ_KBD_BOOTPROTO)) { + err = usbd_req_set_protocol(sc->sc_udev, &Giant, sc->sc_iface_index, 0); + if (err != USB_ERR_NORMAL_COMPLETION) { + DPRINTF("set protocol error=%s\n", usbd_errstr(err)); + goto detach; + } + } /* figure out if there is an ID byte in the data */ err = usbd_req_get_hid_desc(uaa->device, NULL, &hid_ptr, Index: usbdevs =================================================================== --- usbdevs (revision 196574) +++ usbdevs (working copy) @@ -1751,6 +1751,7 @@ product MICROSOFT WLNOTEBOOK3 0x00d2 Wireless Optical Mouse 3000 (Model 1049) product MICROSOFT WLUSBMOUSE 0x00b9 Wireless USB Mouse product MICROSOFT XBOX360 0x0292 XBOX 360 WLAN +product MICROSOFT NATURAL4000 0x00db Natural Ergonomic Keyboard 4000 /* Microtech products */ product MICROTECH SCSIDB25 0x0004 USB-SCSI-DB25 --------------070601060402040600080702--