]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: hidg: register OUT INT endpoint for SET_REPORT
authorDaniel Mack <zonque@gmail.com>
Wed, 13 Jun 2012 10:54:45 +0000 (12:54 +0200)
committerFelipe Balbi <balbi@ti.com>
Fri, 15 Jun 2012 11:34:53 +0000 (14:34 +0300)
commit32b92a24c842bad017f0d46f3ffa1be33fa634cf
tree3a2d6df05e34d908fbd7f459f2d8690fc7f8b619
parent054986e4125ea9e80500c41e18a39197fb419d68
usb: gadget: hidg: register OUT INT endpoint for SET_REPORT

The hidg function driver currently handles its SET_REPORT calls via EP0.
This is the implicit behaviour when no OUT interrupt endpoint is
configured and generally works fine.

The problem is that due to EP0's role in the gadget framework, we cannot
hold back packets and control traffic flow to sync it to the char device,
and hence there's a high risk of loosing packets with this
implementation.

This patch adds an OUT interrupt endpoint to the interface and queues a
fix number of request to catch SET_REPORT events. According to the
specs, host drivers should always use the dedicated OUT endpoint when
present.

The char device's read implementation was rewritten to retrieve data
from the list of completed output requests.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_hid.c