Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.5 KiB

  1. #ifndef __OPAQUE_H__
  2. #define __OPAQUE_H__
  3. // ******************************************************************************
  4. //
  5. // information for each active pipe on a device
  6. //
  7. typedef struct _USBD_PIPE {
  8. ULONG Sig;
  9. USB_ENDPOINT_DESCRIPTOR EndpointDescriptor;
  10. PVOID HcdEndpoint;
  11. ULONG MaxTransferSize;
  12. #if 1
  13. ULONG ScheduleOffset;
  14. ULONG UsbdPipeFlags;
  15. #endif
  16. } USBD_PIPE, *PUSBD_PIPE;
  17. //
  18. // information for each active interface
  19. // for a device
  20. //
  21. typedef struct _USBD_INTERFACE {
  22. ULONG Sig;
  23. BOOLEAN HasAlternateSettings;
  24. UCHAR Pad[3];
  25. USB_INTERFACE_DESCRIPTOR InterfaceDescriptor; // copy of interface descriptor
  26. // copy of interfaceInformation structure, stores user parameters
  27. // for interface in case of failure during alt-interface selection
  28. PUSBD_INTERFACE_INFORMATION InterfaceInformation;
  29. USBD_PIPE PipeHandle[0]; // array of pipe handle structures
  30. } USBD_INTERFACE, *PUSBD_INTERFACE;
  31. //
  32. // informnation for the active configuration
  33. // on a device
  34. //
  35. typedef struct _USBD_CONFIG {
  36. ULONG Sig;
  37. PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
  38. PUSBD_INTERFACE InterfaceHandle[1]; // array of pointers to interface
  39. } USBD_CONFIG, *PUSBD_CONFIG;
  40. typedef struct _USBD_DEVICE_DATA {
  41. ULONG Sig;
  42. USHORT DeviceAddress; // address assigned to the device
  43. UCHAR Pad[2];
  44. PUSBD_CONFIG ConfigurationHandle;
  45. // KTIMER TimeoutTimer;
  46. // KDPC TimeoutDpc;
  47. USBD_PIPE DefaultPipe;
  48. USB_DEVICE_DESCRIPTOR DeviceDescriptor; // a copy of the USB device descriptor
  49. BOOLEAN LowSpeed; // TRUE if the device is low speed
  50. BOOLEAN AcceptingRequests;
  51. } USBD_DEVICE_DATA, *PUSBD_DEVICE_DATA;
  52. DECLSPEC_IMPORT
  53. NTSTATUS
  54. USBD_CreateDevice(
  55. IN OUT PUSBD_DEVICE_DATA *DeviceData,
  56. IN PDEVICE_OBJECT DeviceObject,
  57. IN BOOLEAN DeviceIsLowSpeed,
  58. IN ULONG MaxPacketSize_Endpoint0,
  59. IN OUT PULONG NonCompliantDevice
  60. );
  61. DECLSPEC_IMPORT
  62. NTSTATUS
  63. USBD_InitializeDevice(
  64. IN PUSBD_DEVICE_DATA DeviceData,
  65. IN PDEVICE_OBJECT DeviceObject,
  66. IN OUT PUSB_DEVICE_DESCRIPTOR DeviceDescriptor,
  67. IN ULONG DeviceDescriptorLength,
  68. IN OUT PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor,
  69. IN ULONG ConfigDescriptorLength
  70. );
  71. DECLSPEC_IMPORT
  72. NTSTATUS
  73. USBD_RemoveDevice(
  74. IN PUSBD_DEVICE_DATA DeviceData,
  75. IN PDEVICE_OBJECT DeviceObject,
  76. IN UCHAR Flags
  77. );
  78. // END OF OPAQUE INFO ***********************************************************
  79. #endif