usbdi.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * usbdi.h
  3. *
  4. * USBD and USB device driver definitions
  5. *
  6. * FIXME : Obsolete header.. Use usb.h instead.
  7. *
  8. * This file is part of the mingw-w64 runtime package.
  9. * No warranty is given; refer to the file DISCLAIMER within this package.
  10. *
  11. * This file is based on the ReactOS PSDK file usbdi.h header.
  12. * Original contributed by Casper S. Hornstrup <chorns@users.sourceforge.net>
  13. *
  14. * Added winapi-family check by Kai Tietz.
  15. */
  16. #ifndef __USBDI_H__
  17. #define __USBDI_H__
  18. #include <winapifamily.h>
  19. #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
  20. #include <usb.h>
  21. #include <usbioctl.h>
  22. #define USBD_STATUS_CANCELLING ((USBD_STATUS) 0x00020000)
  23. #define USBD_STATUS_CANCELING ((USBD_STATUS) 0x00020000)
  24. #define USBD_STATUS_NO_MEMORY ((USBD_STATUS) 0x80000100)
  25. #define USBD_STATUS_ERROR ((USBD_STATUS) 0x80000000)
  26. #define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS) 0x80000500)
  27. #define USBD_STATUS_HALTED ((USBD_STATUS) 0xc0000000)
  28. #define USBD_HALTED(Status) ((ULONG) (Status) >> 30 == 3)
  29. #define USBD_STATUS(Status) ((ULONG) (Status) & __MSABI_LONG (0x0fffffff))
  30. #define URB_FUNCTION_RESERVED0 0x0016
  31. #define URB_FUNCTION_RESERVED 0x001d
  32. #define URB_FUNCTION_LAST 0x0029
  33. #define USBD_PF_DOUBLE_BUFFER 0x00000002
  34. #ifdef USBD_PF_VALID_MASK
  35. #undef USBD_PF_VALID_MASK
  36. #endif
  37. #define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | USBD_PF_DOUBLE_BUFFER | USBD_PF_ENABLE_RT_THREAD_ACCESS | USBD_PF_MAP_ADD_TRANSFERS)
  38. #define USBD_TRANSFER_DIRECTION_BIT 0
  39. #define USBD_SHORT_TRANSFER_OK_BIT 1
  40. #define USBD_START_ISO_TRANSFER_ASAP_BIT 2
  41. #ifdef USBD_TRANSFER_DIRECTION
  42. #undef USBD_TRANSFER_DIRECTION
  43. #endif
  44. #define USBD_TRANSFER_DIRECTION(x) ((x) & USBD_TRANSFER_DIRECTION_IN)
  45. #endif
  46. #endif