usb/116947: [ukbd] [patch] [regression] enable boot protocol
on the USB keyboards
Tom Judge
tom at tomjudge.com
Wed Sep 23 22:50:03 UTC 2009
The following reply was made to PR usb/116947; it has been noted by GNATS.
From: Tom Judge <tom at tomjudge.com>
To: bug-followup at FreeBSD.org, rea-fbsd at 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--
More information about the freebsd-usb
mailing list