usb: raw-gadget: support stalling/halting/wedging endpoints
authorAndrey Konovalov <andreyknvl@google.com>
Thu, 7 May 2020 17:06:57 +0000 (19:06 +0200)
committerFelipe Balbi <balbi@kernel.org>
Thu, 14 May 2020 09:30:18 +0000 (12:30 +0300)
commitc61769bd4777a922952aed0d042a2572e5bd9b74
treefe490ffcffdad1d0a4a0c264372cb4c1fd2e6f6c
parent97df5e5758f7d1dd0ca97e3210696818fc45bdb3
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>
Documentation/usb/raw-gadget.rst
drivers/usb/gadget/legacy/raw_gadget.c
include/uapi/linux/usb/raw_gadget.h