mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 21:19:04 -04:00
UPSTREAM: usb: raw-gadget: support stalling/halting/wedging endpoints
Raw Gadget is currently unable to stall/halt/wedge gadget endpoints, which is required for proper emulation of certain USB classes. This patch adds a few more ioctls: - USB_RAW_IOCTL_EP0_STALL allows to stall control endpoint #0 when there's a pending setup request for it. - USB_RAW_IOCTL_SET/CLEAR_HALT/WEDGE allow to set/clear halt/wedge status on non-control non-isochronous endpoints. Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface") Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Felipe Balbi <balbi@kernel.org> Bug: 147413187 (cherry picked from commit c61769bd4777a922952aed0d042a2572e5bd9b74) Change-Id: If3bb63894ff9fec4cc59b5ff04c6caf2898c9600 Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
This commit is contained in:
parent
6f6bff3e02
commit
5261cfe10a
3 changed files with 144 additions and 4 deletions
|
|
@ -231,4 +231,19 @@ struct usb_raw_eps_info {
|
|||
*/
|
||||
#define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info)
|
||||
|
||||
/*
|
||||
* Stalls a pending control request on endpoint 0.
|
||||
* Returns 0 on success or negative error code on failure.
|
||||
*/
|
||||
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
|
||||
|
||||
/*
|
||||
* Sets or clears halt or wedge status of the endpoint.
|
||||
* Accepts endpoint handle as an argument.
|
||||
* Returns 0 on success or negative error code on failure.
|
||||
*/
|
||||
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
|
||||
#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
|
||||
#define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32)
|
||||
|
||||
#endif /* _UAPI__LINUX_USB_RAW_GADGET_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue