usbip.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * usbip.h
  4. *
  5. * USBIP uapi defines and function prototypes etc.
  6. */
  7. #ifndef _UAPI_LINUX_USBIP_H
  8. #define _UAPI_LINUX_USBIP_H
  9. /* usbip device status - exported in usbip device sysfs status */
  10. enum usbip_device_status {
  11. /* sdev is available. */
  12. SDEV_ST_AVAILABLE = 0x01,
  13. /* sdev is now used. */
  14. SDEV_ST_USED,
  15. /* sdev is unusable because of a fatal error. */
  16. SDEV_ST_ERROR,
  17. /* vdev does not connect a remote device. */
  18. VDEV_ST_NULL,
  19. /* vdev is used, but the USB address is not assigned yet */
  20. VDEV_ST_NOTASSIGNED,
  21. VDEV_ST_USED,
  22. VDEV_ST_ERROR
  23. };
  24. /* USB URB Transfer flags:
  25. *
  26. * USBIP server and client (vchi) pack URBs in TCP packets. The following
  27. * are the transfer type defines used in USBIP protocol.
  28. */
  29. #define USBIP_URB_SHORT_NOT_OK 0x0001
  30. #define USBIP_URB_ISO_ASAP 0x0002
  31. #define USBIP_URB_NO_TRANSFER_DMA_MAP 0x0004
  32. #define USBIP_URB_ZERO_PACKET 0x0040
  33. #define USBIP_URB_NO_INTERRUPT 0x0080
  34. #define USBIP_URB_FREE_BUFFER 0x0100
  35. #define USBIP_URB_DIR_IN 0x0200
  36. #define USBIP_URB_DIR_OUT 0
  37. #define USBIP_URB_DIR_MASK USBIP_URB_DIR_IN
  38. #define USBIP_URB_DMA_MAP_SINGLE 0x00010000
  39. #define USBIP_URB_DMA_MAP_PAGE 0x00020000
  40. #define USBIP_URB_DMA_MAP_SG 0x00040000
  41. #define USBIP_URB_MAP_LOCAL 0x00080000
  42. #define USBIP_URB_SETUP_MAP_SINGLE 0x00100000
  43. #define USBIP_URB_SETUP_MAP_LOCAL 0x00200000
  44. #define USBIP_URB_DMA_SG_COMBINED 0x00400000
  45. #define USBIP_URB_ALIGNED_TEMP_BUFFER 0x00800000
  46. #endif /* _UAPI_LINUX_USBIP_H */