mirror_ubuntu-kernels/include/uapi/linux/usb
Paul Cercueil 7b07a2a7ca usb: gadget: functionfs: Add DMABUF import interface
This patch introduces three new ioctls. They all should be called on a
data endpoint (ie. not ep0). They are:

- FUNCTIONFS_DMABUF_ATTACH, which takes the file descriptor of a DMABUF
  object to attach to the endpoint.

- FUNCTIONFS_DMABUF_DETACH, which takes the file descriptor of the
  DMABUF to detach from the endpoint. Note that closing the endpoint's
  file descriptor will automatically detach all attached DMABUFs.

- FUNCTIONFS_DMABUF_TRANSFER, which requests a data transfer from / to
  the given DMABUF. Its argument is a structure that packs the DMABUF's
  file descriptor, the size in bytes to transfer (which should generally
  be set to the size of the DMABUF), and a 'flags' field which is unused
  for now.
  Before this ioctl can be used, the related DMABUF must be attached
  with FUNCTIONFS_DMABUF_ATTACH.

These three ioctls enable the FunctionFS code to transfer data between
the USB stack and a DMABUF object, which can be provided by a driver
from a completely different subsystem, in a zero-copy fashion.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20240130122340.54813-4-paul@crapouillou.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-17 17:00:09 +01:00
..
audio.h treewide: uapi: Replace zero-length arrays with flexible-array members 2022-06-28 21:26:05 +02:00
cdc-wdm.h
cdc.h USB / Thunderbolt changes for 6.0-rc1 2022-08-04 11:41:28 -07:00
ch9.h USB: uapi: OTG 3.0 2024-01-27 16:41:00 -08:00
ch11.h USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
charger.h usb: charger: assign specific number for enum value 2020-02-10 11:08:30 -08:00
functionfs.h usb: gadget: functionfs: Add DMABUF import interface 2024-02-17 17:00:09 +01:00
g_printer.h
g_uvc.h usb: gadget: uvc: default the ctrl request interface offsets 2022-10-22 13:22:40 +02:00
gadgetfs.h
midi.h
raw_gadget.h usb: raw-gadget: report suspend, resume, reset, and disconnect events 2023-10-27 12:58:16 +02:00
tmc.h USB: usbtmc: Add separate USBTMC_IOCTL_GET_SRQ_STB 2020-12-28 15:50:30 +01:00
video.h usb: uvc: Enumerate valid values for color matching 2023-02-06 13:46:42 +01:00