Bug 224031 - [usb][ukbd]: The USB keyboard driver does not force the boot protocol
Summary: [usb][ukbd]: The USB keyboard driver does not force the boot protocol
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-02 07:14 UTC by Gergely Nagy
Modified: 2017-12-02 13:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gergely Nagy 2017-12-02 07:14:29 UTC
FreeBSD does not set the protocol to boot for USB keyboards, like it does set it to report for mice. This manifests such that when plugging in a keyboard that supports both, the keyboard stays in report mode, which is the default.

As section 7.2.6 of the Device Class Definition
for Human Interface
Devices (HID) spec (http://www.usb.org/developers/hidpage/HID1_11.pdf) says:

> When initialized, all devices default to report protocol. However the host should
not make any assumptions about the device’s state and should set the desired
protocol whenever initializing a device.

Any keyboard that supports both, and conforms to the spec, will be unusable under FreeBSD's ukbd driver.

I think - but this is as of yet untested - adding "err = usbd_req_set_protocol(uaa->device, NULL, uaa->info.bIfaceIndex, 0);" right after the "usb_test_quirk" call in "ukbd_probe" would do the right thing.

If I have time, I'll prepare a patch in the next day or two, but no guarantees.
Comment 1 Gergely Nagy 2017-12-02 13:00:41 UTC
Oookay, I'm blind. There *is* an `usbd_req_set_protocol` call in ukbd. Not sure why the keyboard doesn't go into boot mode then.

Closing this issue, will open a new one if/when I figure out what is happening.

Sorry for the noise.