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.

116 lines
2.8 KiB

  1. /**************************************************************************************************************************
  2. * IRUSB.H SigmaTel STIR4200 USB specific definitions
  3. **************************************************************************************************************************
  4. * (C) Unpublished Copyright of Sigmatel, Inc. All Rights Reserved.
  5. *
  6. *
  7. * Created: 04/06/2000
  8. * Version 0.9
  9. * Edited: 04/27/2000
  10. * Version 0.92
  11. * Edited: 08/09/2000
  12. * Version 1.02
  13. *
  14. *
  15. **************************************************************************************************************************/
  16. #ifndef USB_H
  17. #define USB_H
  18. //
  19. // Send and Read/Write register structure
  20. // Most of the buffers have been moved to IRCOMMON.H and made global to save memory
  21. // This will only work if the main thread is serialized
  22. //
  23. typedef struct _IRUSB_CONTEXT {
  24. PIR_DEVICE pThisDev;
  25. PVOID pPacket;
  26. PIRP pIrp;
  27. LIST_ENTRY ListEntry; // This will be used to do the queueing
  28. LARGE_INTEGER TimeReceived; // For enforcing turnaround time
  29. CONTEXT_TYPE ContextType; // To gear up/down
  30. } IRUSB_CONTEXT, *PIRUSB_CONTEXT, **PPIRUSB_CONTEXT;
  31. typedef struct _IRUSB_USB_INFO
  32. {
  33. // USB configuration handle and ptr for the configuration the
  34. // device is currently in
  35. USBD_CONFIGURATION_HANDLE UsbConfigurationHandle;
  36. PUSB_CONFIGURATION_DESCRIPTOR UsbConfigurationDescriptor;
  37. PIRP IrpSubmitUrb;
  38. PIRP IrpSubmitIoCtl;
  39. // ptr to the USB device descriptor
  40. // for this device
  41. PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor;
  42. // we support one interface
  43. // this is a copy of the info structure
  44. // returned from select_configuration or
  45. // select_interface
  46. PUSBD_INTERFACE_INFORMATION UsbInterface;
  47. // urb for control descriptor request
  48. struct _URB_CONTROL_DESCRIPTOR_REQUEST DescriptorUrb;
  49. // urb to use for control/status requests to USBD
  50. struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST ClassUrb;
  51. } IRUSB_USB_INFO, *PIRUSB_USB_INFO;
  52. //
  53. // Prototypes
  54. //
  55. NTSTATUS
  56. UsbIoCompleteControl(
  57. IN PDEVICE_OBJECT pUsbDevObj,
  58. IN PIRP pIrp,
  59. IN PVOID Context
  60. );
  61. NTSTATUS
  62. MyIoCallDriver(
  63. IN PIR_DEVICE pThisDev,
  64. IN PDEVICE_OBJECT pDeviceObject,
  65. IN OUT PIRP pIrp
  66. );
  67. NTSTATUS
  68. IrUsb_CallUSBD(
  69. IN PIR_DEVICE pThisDev,
  70. IN PURB pUrb
  71. );
  72. NTSTATUS
  73. IrUsb_ResetUSBD(
  74. IN PIR_DEVICE pThisDev,
  75. BOOLEAN ForceUnload
  76. );
  77. BOOLEAN
  78. IrUsb_CancelIo(
  79. IN PIR_DEVICE pThisDev,
  80. IN PIRP pIrpToCancel,
  81. IN PKEVENT pEventToClear
  82. );
  83. NTSTATUS
  84. IrUsb_SelectInterface(
  85. IN OUT PIR_DEVICE pThisDev,
  86. IN PUSB_CONFIGURATION_DESCRIPTOR pConfigurationDescriptor
  87. );
  88. NTSTATUS
  89. MyKeWaitForSingleObject(
  90. IN PIR_DEVICE pThisDev,
  91. IN PVOID pEventWaitingFor,
  92. IN OUT PIRP pIrpWaitingFor,
  93. LONGLONG timeout100ns
  94. );
  95. #endif // USB_H