[USBAUDIO]
[reactos.git] / reactos / drivers / usb / usbohci / interfaces.h
1 #ifndef INTERFACES_HPP
2 #define INTERFACES_HPP
3
4 struct _OHCI_ENDPOINT_DESCRIPTOR;
5 struct IDMAMemoryManager;
6 struct IUSBQueue;
7
8 //=========================================================================================
9 //
10 // class IUSBHardwareDevice
11 //
12 // Description: This class provides access to the usb hardware controller
13 //
14
15
16 #define DEFINE_ABSTRACT_USBOHCIHARDWARE() \
17 STDMETHOD_(VOID, GetBulkHeadEndpointDescriptor)( THIS_ \
18 IN struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) PURE; \
19 \
20 STDMETHOD_(VOID, GetControlHeadEndpointDescriptor)( THIS_ \
21 IN struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) PURE; \
22 \
23 STDMETHOD_(VOID, GetIsochronousHeadEndpointDescriptor)( THIS_ \
24 IN struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) PURE; \
25 \
26 STDMETHOD_(VOID, GetInterruptEndpointDescriptors)( THIS_ \
27 IN struct _OHCI_ENDPOINT_DESCRIPTOR *** OutDescriptor) PURE; \
28 \
29 STDMETHOD_(VOID, HeadEndpointDescriptorModified)( THIS_ \
30 IN ULONG Type) PURE; \
31 \
32 STDMETHOD_(VOID, GetCurrentFrameNumber)( THIS_ \
33 IN PULONG FrameNumber) PURE;
34
35 #define IMP_IUSBOHCIHARDWAREDEVICE \
36 STDMETHODIMP_(VOID) GetBulkHeadEndpointDescriptor( \
37 IN struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor); \
38 \
39 STDMETHODIMP_(VOID) GetControlHeadEndpointDescriptor( \
40 IN struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor); \
41 \
42 STDMETHODIMP_(VOID) GetIsochronousHeadEndpointDescriptor( \
43 IN struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor); \
44 \
45 STDMETHODIMP_(VOID) GetInterruptEndpointDescriptors( \
46 IN struct _OHCI_ENDPOINT_DESCRIPTOR *** OutDescriptor); \
47 \
48 STDMETHODIMP_(VOID) HeadEndpointDescriptorModified( \
49 IN ULONG Type); \
50 \
51 STDMETHODIMP_(VOID) GetCurrentFrameNumber( \
52 OUT PULONG FrameNumber);
53
54 DECLARE_INTERFACE_(IOHCIHardwareDevice, IUSBHardwareDevice)
55 {
56 DEFINE_ABSTRACT_UNKNOWN()
57 DEFINE_ABSTRACT_USBHARDWAREDEVICE()
58 DEFINE_ABSTRACT_USBOHCIHARDWARE()
59 };
60
61 typedef IOHCIHardwareDevice *POHCIHARDWAREDEVICE;
62
63
64 //=========================================================================================
65 //
66 // class IUSBRequest
67 //
68 // Description: This class is used to issue request to usb controller. The class is
69 // initialized using InitializeXXX methods. You also need to call SetEndpoint to define the endpoint
70 // In addition you can call SetCompletionDetails if you need to wait for the end of
71 // the request or want to complete an irp. You call AddUSBRequest to add the request to the queue.
72 // Once the request is completed the CompletionCallback is invoked. The CompletionCallback
73 // will take care of any completion details which have been set. If the request is cancelled, the
74 // CancelCallback routine is invoked.
75 //
76
77
78 #define DEFINE_ABSTRACT_USBOHCIREQUEST() \
79 STDMETHOD_(NTSTATUS, GetEndpointDescriptor)( THIS_ \
80 IN struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) PURE; \
81 \
82 STDMETHOD_(VOID, CompletionCallback)( THIS) PURE; \
83 \
84 STDMETHOD_(VOID, FreeEndpointDescriptor)( THIS_ \
85 IN struct _OHCI_ENDPOINT_DESCRIPTOR * OutDescriptor) PURE; \
86 \
87 STDMETHOD_(UCHAR, GetInterval)( THIS) PURE;
88
89
90 #define IMP_IOHCIREQUEST \
91 STDMETHODIMP_(NTSTATUS) GetEndpointDescriptor( \
92 IN struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor); \
93 \
94 STDMETHODIMP_(VOID) CompletionCallback(); \
95 \
96 STDMETHODIMP_(VOID) FreeEndpointDescriptor( \
97 IN struct _OHCI_ENDPOINT_DESCRIPTOR * OutDescriptor); \
98 \
99 STDMETHODIMP_(UCHAR) GetInterval();
100
101 DECLARE_INTERFACE_(IOHCIRequest, IUSBRequest)
102 {
103 DEFINE_ABSTRACT_UNKNOWN()
104 DEFINE_ABSTRACT_USBREQUEST()
105 DEFINE_ABSTRACT_USBOHCIREQUEST()
106 };
107
108 typedef IOHCIRequest *POHCIREQUEST;
109
110 //=========================================================================================
111 //
112 // class IUSBQueue
113 //
114 // Description: This class manages pending requests
115 //
116
117 #define DEFINE_ABSTRACT_USBOHCIQUEUE() \
118 STDMETHOD_(VOID, TransferDescriptorCompletionCallback)( THIS_ \
119 IN ULONG TransferDescriptorLogicalAddress) PURE;
120
121 #define IMP_IUSBOHCIQUEUE \
122 STDMETHODIMP_(VOID) TransferDescriptorCompletionCallback( \
123 IN ULONG TransferDescriptorLogicalAddress);
124
125 DECLARE_INTERFACE_(IOHCIQueue, IUSBQueue)
126 {
127 DEFINE_ABSTRACT_UNKNOWN()
128 DEFINE_ABSTRACT_USBQUEUE()
129 DEFINE_ABSTRACT_USBOHCIQUEUE()
130 };
131
132 typedef IOHCIQueue *POHCIQUEUE;
133
134 #endif /* INTERFACES_HPP */