usb:gadget:hid:Add BOOT mode support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I suggest some changes in the USB HID support of the Linux Gadget kernel 
framework. 

The problem is that several Keyboard and Mouse implementations using 
this 
framework are in fact fully compatible with BOOT mode. They announce in 
the descriptor as "Boot Interface Subclass", but they don't work with 
BIOSes, KVMs and other simple USB implementations because the lack of 
Get_Protocol() & Set_Protocol() functions.

Here the info about the specifications:

- Documentation about USB HID Interfaces:
http://www.usb.org/developers/hidpage/HID1_11.pdf

- Page 73, Appendix F: Legacy Keyboard Implementation:
Any boot device can work as Legacy if it can change to BOOT mode. 
So, this assumes that when the device is initialized it isn't in the 
boot mode, but in the report mode.

- Page 78, Appendix G: HID Request Support Requirements:
If the Report Descriptor of the device is fully compatible with the 
BOOT mode, then the only remaining requirement is the implementation 
of the Get_Protocol and Set_Protocol functions.

- Page 54: 7.2.5 Get_Protocol Request / 7.2.6 Set_Protocol Request
The correct implementation of these functions are change the status 
and report the status, that is a binary value 
(0=Boot Protocol, 1=Report Protocol).

Problem: These functions are miss unimplemented in the kernel...

See file "/drivers/usb/gadget/function/f_hid.c"
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/
drivers/usb/gadget/function/f_hid.c?id=refs/tags/v4.1-rc3

Inside the function:
"static int hidg_setup(struct usb_function *f, 
 const struct usb_ctrlrequest *ctrl)"
the call to set_protocol and get_protocol raises "stall" returning 
NON_SUPPORTED.

Then the solution for solving this problem is always change from Report 
to Boot, and viceversa. Implementing a binary value returned by 
get_protocol (at initialization the correct value is "1"=Report mode).

I suggest that someone responsible of this framework implement this 
change.
I feel it be easy to do, and I hope s/he can do it soon.
Best.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux