2012-02-21 15:49:08 +00:00
|
|
|
#ifndef INTERFACES_HPP
|
|
|
|
#define INTERFACES_HPP
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Object Hierachy
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// | IRootHCDController |
|
|
|
|
// | IHCDController Intel USB Universal Host Controller - 3A37 |
|
|
|
|
// | IHCDController - Intel USB Universal HostController - 3A38 |
|
|
|
|
// | IHCDController - Intel USB Universal HostController - 3A38 |
|
|
|
|
// |------------------------------------------------------------------|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// IHCDController Intel USB Universal Host Controller - 3A37
|
|
|
|
// IHubController
|
|
|
|
// IUSBHardwareDevice
|
|
|
|
// IDMAMemoryManager
|
|
|
|
// IUSBQueue <- interacts with -> IUSBRequest
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Each IHCDController creates an IUSBHardwareDevice class upon initialization. The
|
|
|
|
// IUSBHardwardeDevice class is used to abstract usb controller specifics. The IHubController
|
|
|
|
// manages all attached devices and handles hub control ioctl requests.
|
|
|
|
//
|
|
|
|
// Each IUSBHardwareDevice has one IDMAMemoryManager and one IUSBQueue. The IDMAMemoryManager
|
|
|
|
// is used to handle dma memory allocations. The IUSBQueue manages requests which are send to the
|
|
|
|
// usb hardware. See IUSBRequest class for details.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
2012-02-21 18:19:24 +00:00
|
|
|
struct _UHCI_QUEUE_HEAD;
|
2012-02-21 15:49:08 +00:00
|
|
|
struct IDMAMemoryManager;
|
|
|
|
struct IUSBQueue;
|
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
//=========================================================================================
|
2012-02-21 15:49:08 +00:00
|
|
|
//
|
2012-02-28 22:09:57 +00:00
|
|
|
// class IUSBHardwareDevice
|
2012-02-21 15:49:08 +00:00
|
|
|
//
|
2012-02-28 22:09:57 +00:00
|
|
|
// Description: This class provides access to the usb hardware controller
|
2012-02-21 15:49:08 +00:00
|
|
|
//
|
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
#define DEFINE_ABSTRACT_USBUHCIHARDWAREDEVICE() \
|
|
|
|
STDMETHOD_(VOID, GetQueueHead)( THIS_ \
|
|
|
|
IN ULONG QueueHeadIndex, \
|
|
|
|
IN struct _UHCI_QUEUE_HEAD **OutQueueHead) PURE;
|
2012-02-21 15:49:08 +00:00
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
#define IMP_IUHCIHARDWAREDEVICE \
|
|
|
|
STDMETHODIMP_(VOID) GetQueueHead( \
|
|
|
|
IN ULONG QueueHeadIndex, \
|
|
|
|
IN struct _UHCI_QUEUE_HEAD **OutQueueHead);
|
2012-02-21 15:49:08 +00:00
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
DECLARE_INTERFACE_(IUHCIHardwareDevice, IUSBHardwareDevice)
|
2012-02-21 15:49:08 +00:00
|
|
|
{
|
|
|
|
DEFINE_ABSTRACT_UNKNOWN()
|
2012-02-28 22:09:57 +00:00
|
|
|
DEFINE_ABSTRACT_USBHARDWAREDEVICE()
|
|
|
|
DEFINE_ABSTRACT_USBUHCIHARDWAREDEVICE()
|
2012-02-21 15:49:08 +00:00
|
|
|
};
|
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
typedef IUHCIHardwareDevice *PUHCIHARDWAREDEVICE;
|
2012-02-21 15:49:08 +00:00
|
|
|
|
|
|
|
//=========================================================================================
|
|
|
|
//
|
|
|
|
// class IUSBRequest
|
|
|
|
//
|
|
|
|
// Description: This class is used to issue request to usb controller. The class is
|
|
|
|
// initialized using InitializeXXX methods. You also need to call SetEndpoint to define the endpoint
|
|
|
|
// In addition you can call SetCompletionDetails if you need to wait for the end of
|
|
|
|
// the request or want to complete an irp. You call AddUSBRequest to add the request to the queue.
|
|
|
|
// Once the request is completed the CompletionCallback is invoked. The CompletionCallback
|
|
|
|
// will take care of any completion details which have been set. If the request is cancelled, the
|
|
|
|
// CancelCallback routine is invoked.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
2012-02-21 18:19:24 +00:00
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
#define DEFINE_ABSTRACT_USBUHCIREQUEST() \
|
|
|
|
STDMETHOD_(NTSTATUS, GetEndpointDescriptor)( THIS_ \
|
|
|
|
IN struct _UHCI_QUEUE_HEAD**OutDescriptor) PURE; \
|
|
|
|
\
|
|
|
|
STDMETHOD_(UCHAR, GetInterval)( THIS) PURE; \
|
|
|
|
\
|
|
|
|
STDMETHOD_(USB_DEVICE_SPEED, GetDeviceSpeed)( THIS) PURE; \
|
|
|
|
\
|
|
|
|
STDMETHOD_(VOID, CompletionCallback)( THIS) PURE; \
|
|
|
|
\
|
|
|
|
STDMETHOD_(VOID, FreeEndpointDescriptor)( THIS_ \
|
|
|
|
IN struct _UHCI_QUEUE_HEAD *OutDescriptor) PURE;
|
|
|
|
|
|
|
|
|
|
|
|
#define IMP_IUHCIREQUEST \
|
|
|
|
STDMETHODIMP_(NTSTATUS) GetEndpointDescriptor(THIS_ \
|
|
|
|
IN struct _UHCI_QUEUE_HEAD**OutDescriptor); \
|
|
|
|
\
|
|
|
|
STDMETHODIMP_(UCHAR) GetInterval(THIS); \
|
|
|
|
\
|
|
|
|
STDMETHODIMP_(USB_DEVICE_SPEED) GetDeviceSpeed(THIS); \
|
|
|
|
\
|
|
|
|
STDMETHODIMP_(VOID) CompletionCallback(THIS); \
|
|
|
|
\
|
|
|
|
STDMETHODIMP_(VOID) FreeEndpointDescriptor(THIS_ \
|
|
|
|
IN struct _UHCI_QUEUE_HEAD * OutDescriptor);
|
|
|
|
|
|
|
|
DECLARE_INTERFACE_(IUHCIRequest, IUSBRequest)
|
2012-02-21 15:49:08 +00:00
|
|
|
{
|
|
|
|
DEFINE_ABSTRACT_UNKNOWN()
|
2012-02-28 22:09:57 +00:00
|
|
|
DEFINE_ABSTRACT_USBREQUEST()
|
|
|
|
DEFINE_ABSTRACT_USBUHCIREQUEST()
|
2012-02-21 15:49:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
typedef IUHCIRequest *PUHCIREQUEST;
|
2012-02-21 15:49:08 +00:00
|
|
|
|
|
|
|
//=========================================================================================
|
|
|
|
//
|
2012-02-28 22:09:57 +00:00
|
|
|
// class IUSBQueue
|
2012-02-21 15:49:08 +00:00
|
|
|
//
|
2012-02-28 22:09:57 +00:00
|
|
|
// Description: This class manages pending requests
|
2012-02-21 15:49:08 +00:00
|
|
|
//
|
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
#define DEFINE_ABSTRACT_USBUHCIQUEUE() \
|
|
|
|
STDMETHOD_(VOID, TransferInterrupt)( \
|
|
|
|
IN UCHAR ErrorInterrupt) PURE;
|
2012-02-21 15:49:08 +00:00
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
#define IMP_IUHCIQUEUE \
|
|
|
|
STDMETHODIMP_(VOID) TransferInterrupt( \
|
|
|
|
IN UCHAR ErrorInterrupt);
|
2012-02-21 15:49:08 +00:00
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
DECLARE_INTERFACE_(IUHCIQueue, IUSBQueue)
|
2012-02-21 15:49:08 +00:00
|
|
|
{
|
|
|
|
DEFINE_ABSTRACT_UNKNOWN()
|
2012-02-28 22:09:57 +00:00
|
|
|
DEFINE_ABSTRACT_USBQUEUE()
|
|
|
|
DEFINE_ABSTRACT_USBUHCIQUEUE()
|
2012-02-21 15:49:08 +00:00
|
|
|
};
|
|
|
|
|
2012-02-28 22:09:57 +00:00
|
|
|
typedef IUHCIQueue *PUHCIQUEUE;
|
2012-02-21 15:49:08 +00:00
|
|
|
|
2014-01-03 19:20:35 +00:00
|
|
|
#endif /* INTERFACES_HPP */
|