Leaked source code of windows server 2003
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.

110 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. PURB pUrb; // urb allocated by irp send routine, deallocated
  28. UINT UrbLen; // by irp completion handler
  29. LIST_ENTRY ListEntry; // This will be used to do the queueing
  30. LARGE_INTEGER TimeReceived; // For enforcing turnaround time
  31. CONTEXT_TYPE ContextType; // To gear up/down
  32. } IRUSB_CONTEXT, *PIRUSB_CONTEXT, **PPIRUSB_CONTEXT;
  33. typedef struct _IRUSB_USB_INFO
  34. {
  35. // USB configuration handle and ptr for the configuration the
  36. // device is currently in
  37. USBD_CONFIGURATION_HANDLE UsbConfigurationHandle;
  38. PUSB_CONFIGURATION_DESCRIPTOR UsbConfigurationDescriptor;
  39. PIRP IrpSubmitUrb;
  40. PIRP IrpSubmitIoCtl;
  41. // ptr to the USB device descriptor
  42. // for this device
  43. PUSB_DEVICE_DESCRIPTOR UsbDeviceDescriptor;
  44. // we support one interface
  45. // this is a copy of the info structure
  46. // returned from select_configuration or
  47. // select_interface
  48. PUSBD_INTERFACE_INFORMATION UsbInterface;
  49. // urb for control descriptor request
  50. struct _URB_CONTROL_DESCRIPTOR_REQUEST DescriptorUrb;
  51. // urb to use for control/status requests to USBD
  52. struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST ClassUrb;
  53. } IRUSB_USB_INFO, *PIRUSB_USB_INFO;
  54. //
  55. // Prototypes
  56. //
  57. NTSTATUS
  58. UsbIoCompleteControl(
  59. IN PDEVICE_OBJECT pUsbDevObj,
  60. IN PIRP pIrp,
  61. IN PVOID Context
  62. );
  63. NTSTATUS
  64. MyIoCallDriver(
  65. IN PIR_DEVICE pThisDev,
  66. IN PDEVICE_OBJECT pDeviceObject,
  67. IN OUT PIRP pIrp
  68. );
  69. NTSTATUS
  70. IrUsb_CallUSBD(
  71. IN PIR_DEVICE pThisDev,
  72. IN PURB pUrb
  73. );
  74. NTSTATUS
  75. IrUsb_ResetUSBD(
  76. IN PIR_DEVICE pThisDev,
  77. BOOLEAN ForceUnload
  78. );
  79. NTSTATUS
  80. IrUsb_SelectInterface(
  81. IN OUT PIR_DEVICE pThisDev,
  82. IN PUSB_CONFIGURATION_DESCRIPTOR pConfigurationDescriptor
  83. );
  84. NTSTATUS
  85. MyKeWaitForSingleObject(
  86. IN PIR_DEVICE pThisDev,
  87. IN PVOID pEventWaitingFor,
  88. LONGLONG timeout100ns
  89. );
  90. #endif // USB_H