现在的位置: 首页 > 综合 > 正文

USB HID class: Difference between report protocol and boot protocol?(设计USB键盘进入BIOS会用到)

2012年02月22日 ⁄ 综合 ⁄ 共 1766字 ⁄ 字号 评论关闭

> 1- For USB-HID class: What is the difference between report protocol and boot protocol?

In short, boot protocol is used on BIOS, report protocol is used on OS.

The device capability of boot protocol is shown at the interface triad,
(interfaceClass, interfaceSubclass, interfaceProtocol) field on the
HID interface descriptor.
(interfaceClass, interfaceSubclass, interfaceProtocol) = (3, 1, 1):
boot keyboard
(interfaceClass, interfaceSubclass, interfaceProtocol) = (3, 1, 2):
boot mouse

BIOS checks just this triad, and it recognizes the device
(interface) as specified.
BIOS doesn't actually read out report descriptor from the device;
It assumes that the device has "standard" keyboard or mouse report
descriptor (*1) while the device in boot protocol.
After enumeration, BIOS puts Set_Protocol( BOOT ) to switch the
device into boot protocol, if the device has boot capability. While
BIOS is running, the device works as keyboard or mouse.
If the device doesn't have boot capability, BIOS doesn't enumerate
the device.

At the start up of OS after BIOS, OS puts bus reset. The device
gets back to default report protocol.
Usually, OS doesn't put any Set_Protocol, the device is held in
report protocol.
On the enumeration, OS reads out report descriptor of the device,
and it determines the type of HID device, regardless of above
subclass-protocol field.

(*1) see HID spec Appendix B: Boot Interface Descriptors


>2- For keyboard: the input report format is unique for both
report/boot protocol?

As I wrote above,
For boot protocol, the report format is fixed one.
For report protocol, you can define any report format on the report
descriptor.


>3- When Host send Request(GET_DESCRIPTOR) specifying the report
descriptor type, Will Device return the report descriptor including
the input report data(i.e: 8-byte for keyboard) ? OR Host need to
send Request GET_REPORT to get the input report?

Device returns just the report descriptor, when host puts
Get_Descriptor().
Actual input report is sent for Get_Report( input ) request, or for
IN transfer over the interrupt IN endpoint.

Tsune

抱歉!评论已关闭.