4 //---------------------------------------------------------------------------
7 // --------------------------------------------------------------------
8 // | IRootHCDController |
9 // | IHCDController Intel USB Universal Host Controller - 3A37 |
10 // | IHCDController - Intel USB Universal HostController - 3A38 |
11 // | IHCDController - Intel USB Universal HostController - 3A38 |
12 // |------------------------------------------------------------------|
15 // IHCDController Intel USB Universal Host Controller - 3A37
19 // IUSBQueue <- interacts with -> IUSBRequest
22 // Each IHCDController creates an IUSBHardwareDevice class upon initialization. The
23 // IUSBHardwareDevice class is used to abstract usb controller specifics. The IHubController
24 // manages all attached devices and handles hub control ioctl requests.
26 // Each IUSBHardwareDevice has one IDMAMemoryManager and one IUSBQueue. The IDMAMemoryManager
27 // is used to handle dma memory allocations. The IUSBQueue manages requests which are send to the
28 // usb hardware. See IUSBRequest class for details.
32 struct _UHCI_QUEUE_HEAD
;
33 struct IDMAMemoryManager
;
36 //=========================================================================================
38 // class IUSBHardwareDevice
40 // Description: This class provides access to the usb hardware controller
43 #define DEFINE_ABSTRACT_USBUHCIHARDWAREDEVICE() \
44 STDMETHOD_(VOID, GetQueueHead)( THIS_ \
45 IN ULONG QueueHeadIndex, \
46 IN struct _UHCI_QUEUE_HEAD **OutQueueHead) PURE;
48 #define IMP_IUHCIHARDWAREDEVICE \
49 STDMETHODIMP_(VOID) GetQueueHead( \
50 IN ULONG QueueHeadIndex, \
51 IN struct _UHCI_QUEUE_HEAD **OutQueueHead);
53 DECLARE_INTERFACE_(IUHCIHardwareDevice
, IUSBHardwareDevice
)
55 DEFINE_ABSTRACT_UNKNOWN()
56 DEFINE_ABSTRACT_USBHARDWAREDEVICE()
57 DEFINE_ABSTRACT_USBUHCIHARDWAREDEVICE()
60 typedef IUHCIHardwareDevice
*PUHCIHARDWAREDEVICE
;
62 //=========================================================================================
66 // Description: This class is used to issue request to usb controller. The class is
67 // initialized using InitializeXXX methods. You also need to call SetEndpoint to define the endpoint
68 // In addition you can call SetCompletionDetails if you need to wait for the end of
69 // the request or want to complete an irp. You call AddUSBRequest to add the request to the queue.
70 // Once the request is completed the CompletionCallback is invoked. The CompletionCallback
71 // will take care of any completion details which have been set. If the request is cancelled, the
72 // CancelCallback routine is invoked.
77 #define DEFINE_ABSTRACT_USBUHCIREQUEST() \
78 STDMETHOD_(NTSTATUS, GetEndpointDescriptor)( THIS_ \
79 IN struct _UHCI_QUEUE_HEAD**OutDescriptor) PURE; \
81 STDMETHOD_(UCHAR, GetInterval)( THIS) PURE; \
83 STDMETHOD_(USB_DEVICE_SPEED, GetDeviceSpeed)( THIS) PURE; \
85 STDMETHOD_(VOID, CompletionCallback)( THIS) PURE; \
87 STDMETHOD_(VOID, FreeEndpointDescriptor)( THIS_ \
88 IN struct _UHCI_QUEUE_HEAD *OutDescriptor) PURE;
91 #define IMP_IUHCIREQUEST \
92 STDMETHODIMP_(NTSTATUS) GetEndpointDescriptor(THIS_ \
93 IN struct _UHCI_QUEUE_HEAD**OutDescriptor); \
95 STDMETHODIMP_(UCHAR) GetInterval(THIS); \
97 STDMETHODIMP_(USB_DEVICE_SPEED) GetDeviceSpeed(THIS); \
99 STDMETHODIMP_(VOID) CompletionCallback(THIS); \
101 STDMETHODIMP_(VOID) FreeEndpointDescriptor(THIS_ \
102 IN struct _UHCI_QUEUE_HEAD * OutDescriptor);
104 DECLARE_INTERFACE_(IUHCIRequest
, IUSBRequest
)
106 DEFINE_ABSTRACT_UNKNOWN()
107 DEFINE_ABSTRACT_USBREQUEST()
108 DEFINE_ABSTRACT_USBUHCIREQUEST()
112 typedef IUHCIRequest
*PUHCIREQUEST
;
114 //=========================================================================================
118 // Description: This class manages pending requests
121 #define DEFINE_ABSTRACT_USBUHCIQUEUE() \
122 STDMETHOD_(VOID, TransferInterrupt)( \
123 IN UCHAR ErrorInterrupt) PURE;
125 #define IMP_IUHCIQUEUE \
126 STDMETHODIMP_(VOID) TransferInterrupt( \
127 IN UCHAR ErrorInterrupt);
129 DECLARE_INTERFACE_(IUHCIQueue
, IUSBQueue
)
131 DEFINE_ABSTRACT_UNKNOWN()
132 DEFINE_ABSTRACT_USBQUEUE()
133 DEFINE_ABSTRACT_USBUHCIQUEUE()
136 typedef IUHCIQueue
*PUHCIQUEUE
;
138 #endif /* INTERFACES_HPP */