[USB-BRINGUP-TRUNK]
[reactos.git] / drivers / usb / usbohci / interfaces.h
1
2 #ifndef INTERFACES_HPP
3 #define INTERFACES_HPP
4
5 //---------------------------------------------------------------------------
6 //
7 // Object Hierachy
8 // --------------------------------------------------------------------
9 // | IRootHCDController |
10 // | IHCDController Intel USB Universal Host Controller - 3A37 |
11 // | IHCDController - Intel USB Universal HostController - 3A38 |
12 // | IHCDController - Intel USB Universal HostController - 3A38 |
13 // |------------------------------------------------------------------|
14 //
15 //
16 // IHCDController Intel USB Universal Host Controller - 3A37
17 // IHubController
18 // IUSBHardwareDevice
19 // IDMAMemoryManager
20 // IUSBQueue <- interacts with -> IUSBRequest
21 //
22 //
23 // Each IHCDController creates an IUSBHardwareDevice class upon initialization. The
24 // IUSBHardwardeDevice class is used to abstract usb controller specifics. The IHubController
25 // manages all attached devices and handles hub control ioctl requests.
26 //
27 // Each IUSBHardwareDevice has one IDMAMemoryManager and one IUSBQueue. The IDMAMemoryManager
28 // is used to handle dma memory allocations. The IUSBQueue manages requests which are send to the
29 // usb hardware. See IUSBRequest class for details.
30 //
31
32
33 //=========================================================================================
34 //
35 // class IRootHCDController
36 //
37 // Description: This class serves as the root host controller. The host controller mantains
38 // a list of registered controllers and provides support functions for the host controllers
39
40 struct IHCDController;
41
42 DECLARE_INTERFACE_(IRootHCDController, IUnknown)
43 {
44 DEFINE_ABSTRACT_UNKNOWN()
45
46 //-----------------------------------------------------------------------------------------
47 //
48 // Initialize
49 //
50 // Description: This function initializes the root host controller. It allocates the resources
51 // required to manage the registered controllers
52
53 virtual NTSTATUS Initialize() = 0;
54
55 //-----------------------------------------------------------------------------------------
56 //
57 // RegisterHCD
58 //
59 // Description: this function registers a host controller with the root host controller
60
61 virtual NTSTATUS RegisterHCD(struct IHCDController * Controller) = 0;
62
63 //-----------------------------------------------------------------------------------------
64 //
65 // UnregisterHCD
66 //
67 // Description: this function unregistes a host controller
68
69 virtual NTSTATUS UnregisterHCD(struct IHCDController * Controller) = 0;
70
71 //-----------------------------------------------------------------------------------------
72 //
73 // GetControllerCount
74 //
75 // Description: returns the number of host controllers registered
76
77 virtual ULONG GetControllerCount() = 0;
78
79 };
80
81 typedef IRootHCDController *PROOTHDCCONTROLLER;
82
83 //=========================================================================================
84 //
85 // class IHCDController
86 //
87 // Description: This class is used to manage a single USB host controller
88 //
89
90 DECLARE_INTERFACE_(IHCDController, IUnknown)
91 {
92 DEFINE_ABSTRACT_UNKNOWN()
93
94 //-----------------------------------------------------------------------------------------
95 //
96 // Initialize
97 //
98 // Description: This function initializes the IHCDController implementation.
99 // It creates an IUSBHardwareDevice object and initializes it. It also registeres itself with
100 // the IRootHCDController
101 //
102 virtual NTSTATUS Initialize(IN PROOTHDCCONTROLLER RootHCDController,
103 IN PDRIVER_OBJECT DriverObject,
104 IN PDEVICE_OBJECT PhysicalDeviceObject) = 0;
105
106 };
107
108 typedef IHCDController *PHCDCONTROLLER;
109
110 struct _OHCI_ENDPOINT_DESCRIPTOR;
111 //=========================================================================================
112 //
113 // class IUSBHardwareDevice
114 //
115 // Description: This class provides access to the usb hardware controller
116 //
117
118 struct IDMAMemoryManager;
119 struct IUSBQueue;
120
121 DECLARE_INTERFACE_(IUSBHardwareDevice, IUnknown)
122 {
123 DEFINE_ABSTRACT_UNKNOWN()
124
125 //-----------------------------------------------------------------------------------------
126 //
127 // Initialize
128 //
129 // Description: Initializes the usb device controller
130
131 virtual NTSTATUS Initialize(PDRIVER_OBJECT DriverObject,
132 PDEVICE_OBJECT FunctionalDeviceObject,
133 PDEVICE_OBJECT PhysicalDeviceObject,
134 PDEVICE_OBJECT LowerDeviceObject) = 0;
135
136 //-----------------------------------------------------------------------------------------
137 //
138 // PnpStart
139 //
140 // Description: handles pnp start request from device. It registeres the interrupt,
141 // sets up the ports and prepares the device. It then starts the controller
142
143 virtual NTSTATUS PnpStart(PCM_RESOURCE_LIST RawResources,
144 PCM_RESOURCE_LIST TranslatedResources) = 0;
145
146 //-----------------------------------------------------------------------------------------
147 //
148 // PnpStop
149 //
150 // Description: handles pnp stop request from device. It unregisteres the interrupt, releases ports and dma object.
151
152 virtual NTSTATUS PnpStop(void) = 0;
153
154 //-----------------------------------------------------------------------------------------
155 //
156 // GetDeviceDetails
157 //
158 // Description: returns the device details such as vendor id, device id, number of ports and speed
159
160 virtual NTSTATUS GetDeviceDetails(OUT OPTIONAL PUSHORT VendorId,
161 OUT OPTIONAL PUSHORT DeviceId,
162 OUT OPTIONAL PULONG NumberOfPorts,
163 OUT OPTIONAL PULONG Speed) = 0;
164
165 //-----------------------------------------------------------------------------------------
166 //
167 // GetUSBQueue
168 //
169 // Description: returns interface to internal IUSBQueue
170 // Interface is reference counted, you need to call release method when you are done with it
171 // Do not call Initialize on IUSBQueue, the object is already initialized
172
173 virtual NTSTATUS GetUSBQueue(OUT struct IUSBQueue **OutUsbQueue) = 0;
174
175 //-----------------------------------------------------------------------------------------
176 //
177 // GetBulkHeadEndpointDescriptor
178 //
179 // Description: returns the bulk head endpoint descriptor
180
181 virtual NTSTATUS GetBulkHeadEndpointDescriptor(struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) = 0;
182
183 //-----------------------------------------------------------------------------------------
184 //
185 // GetControlHeadEndpointDescriptor
186 //
187 // Description: returns the control head endpoint descriptor
188
189 virtual NTSTATUS GetControlHeadEndpointDescriptor(struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) = 0;
190
191 //-----------------------------------------------------------------------------------------
192 //
193 // GetIsochronousHeadEndpointDescriptor
194 //
195 // Description: returns the control head endpoint descriptor
196
197 virtual NTSTATUS GetIsochronousHeadEndpointDescriptor(struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) = 0;
198
199
200 //-----------------------------------------------------------------------------------------
201 //
202 // GetInterruptEndpointDescriptors
203 //
204 // Description: returns interrupt endpoint descriptors
205
206 virtual NTSTATUS GetInterruptEndpointDescriptors(struct _OHCI_ENDPOINT_DESCRIPTOR *** OutDescriptorArray) = 0;
207
208 //-----------------------------------------------------------------------------------------
209 //
210 // HeadEndpointDescriptorModified
211 //
212 // Description: notifies the hardware that an endpoint descriptor was added to head endpoint descriptor
213
214 virtual VOID HeadEndpointDescriptorModified(ULONG HeadType) = 0;
215
216
217
218
219 //-----------------------------------------------------------------------------------------
220 //
221 // GetDMA
222 //
223 // Description: returns the DMA object which can be used to allocate memory from the common buffer
224
225 virtual NTSTATUS GetDMA(OUT struct IDMAMemoryManager **OutDMAMemoryManager) = 0;
226
227
228 //-----------------------------------------------------------------------------------------
229 //
230 // ResetController()
231 //
232 // Description: this function resets the controller
233 // Returns STATUS_SUCCESS when the controller was successfully reset
234
235 virtual NTSTATUS ResetController() = 0;
236
237 //-----------------------------------------------------------------------------------------
238 //
239 // StartController
240 //
241 // Description: this functions starts controller allowing interrupts for device connects/removal, and execution of
242 // Periodic and Asynchronous Schedules.
243 //
244
245 virtual NTSTATUS StartController() = 0;
246
247 //-----------------------------------------------------------------------------------------
248 //
249 // StopController
250 //
251 // Description: this functions stops controller disabling interrupts for device connects/removal, and execution of
252 // Periodic and Asynchronous Schedules.
253 //
254
255 virtual NTSTATUS StopController() = 0;
256
257 //-----------------------------------------------------------------------------------------
258 //
259 // ResetPort
260 //
261 // Description: this functions resets the port on the controller
262 //
263
264 virtual NTSTATUS ResetPort(ULONG PortNumber) = 0;
265
266 //-----------------------------------------------------------------------------------------
267 //
268 // GetPortStatus
269 //
270 // Description: this functions return status and change state of port
271 //
272 virtual NTSTATUS GetPortStatus(ULONG PortId, OUT USHORT *PortStatus, OUT USHORT *PortChange) = 0;
273
274 //-----------------------------------------------------------------------------------------
275 //
276 // ClearPortStatus
277 //
278 // Description: Clears Status of Port, for example Connection, Enable and Reset
279 //
280 virtual NTSTATUS ClearPortStatus(ULONG PortId, ULONG Status) = 0;
281
282 //-----------------------------------------------------------------------------------------
283 //
284 // SetPortFeature
285 //
286 // Description: this functions Sets Feature on Port, for example Enable, Power and Reset
287 //
288 virtual NTSTATUS SetPortFeature(ULONG PortId, ULONG Feature) = 0;
289
290 //-----------------------------------------------------------------------------------------
291 //
292 // SetStatusChangeEndpointCallBack
293 //
294 // Description: Used to callback to the hub controller when SCE detected
295 //
296 virtual VOID SetStatusChangeEndpointCallBack(PVOID CallBack,PVOID Context) = 0;
297
298 //-----------------------------------------------------------------------------------------
299 //
300 // AcquireDeviceLock
301 //
302 // Description: acquires the device lock
303
304 virtual KIRQL AcquireDeviceLock(void) = 0;
305
306 //-----------------------------------------------------------------------------------------
307 //
308 // ReleaseLock
309 //
310 // Description: releases the device lock
311
312 virtual void ReleaseDeviceLock(KIRQL OldLevel) = 0;
313
314 //----------------------------------------------------------------------------------------
315 //
316 // GetCurrentFrameNumber
317 //
318 // Description: returns the current frame number
319
320 virtual VOID GetCurrentFrameNumber(PULONG FrameNumber) = 0;
321 };
322
323 typedef IUSBHardwareDevice *PUSBHARDWAREDEVICE;
324
325
326 //=========================================================================================
327 //
328 // class IDMAMemoryManager
329 //
330 // Description: This class provides access to the dma buffer. It provides methods to
331 // allocate and free from the dma buffer
332 //
333
334 DECLARE_INTERFACE_(IDMAMemoryManager, IUnknown)
335 {
336 DEFINE_ABSTRACT_UNKNOWN()
337
338 //-----------------------------------------------------------------------------------------
339 //
340 // Initialize
341 //
342 // Description: initializes the memory manager
343
344 virtual NTSTATUS Initialize(IN PUSBHARDWAREDEVICE Device,
345 IN PKSPIN_LOCK Lock,
346 IN ULONG DmaBufferSize,
347 IN PVOID VirtualBase,
348 IN PHYSICAL_ADDRESS PhysicalAddress,
349 IN ULONG DefaultBlockSize) = 0;
350
351 //-----------------------------------------------------------------------------------------
352 //
353 // Allocate
354 //
355 // Description: allocates block of memory from allocator
356
357 virtual NTSTATUS Allocate(IN ULONG Size,
358 OUT PVOID *OutVirtualBase,
359 OUT PPHYSICAL_ADDRESS OutPhysicalAddress) = 0;
360
361
362 //-----------------------------------------------------------------------------------------
363 //
364 // Free
365 //
366 // Description: releases memory block
367
368 virtual NTSTATUS Release(IN PVOID VirtualBase,
369 IN ULONG Size) = 0;
370
371 };
372
373 typedef IDMAMemoryManager *PDMAMEMORYMANAGER;
374
375
376 //=========================================================================================
377 //
378 // class IUSBRequest
379 //
380 // Description: This class is used to issue request to usb controller. The class is
381 // initialized using InitializeXXX methods. You also need to call SetEndpoint to define the endpoint
382 // In addition you can call SetCompletionDetails if you need to wait for the end of
383 // the request or want to complete an irp. You call AddUSBRequest to add the request to the queue.
384 // Once the request is completed the CompletionCallback is invoked. The CompletionCallback
385 // will take care of any completion details which have been set. If the request is cancelled, the
386 // CancelCallback routine is invoked.
387 //
388
389 DECLARE_INTERFACE_(IUSBRequest, IUnknown)
390 {
391 DEFINE_ABSTRACT_UNKNOWN()
392
393 //-----------------------------------------------------------------------------------------
394 //
395 // InitializeWithSetupPacket
396 //
397 // Description: initializes the request packet with an setup packet
398 // If there is a TransferBuffer, the TransferBufferLength contains the length of the buffer
399
400
401 virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager,
402 IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
403 IN UCHAR DeviceAddress,
404 IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor,
405 IN OUT ULONG TransferBufferLength,
406 IN OUT PMDL TransferBuffer) = 0;
407
408 //-----------------------------------------------------------------------------------------
409 //
410 // InitializeWithIrp
411 //
412 // Description: initializes the request with an IRP
413 // The irp contains an URB block which contains all necessary information
414
415 virtual NTSTATUS InitializeWithIrp(IN PDMAMEMORYMANAGER DmaManager,
416 IN OUT PIRP Irp) = 0;
417
418 //-----------------------------------------------------------------------------------------
419 //
420 // IsRequestComplete
421 //
422 // Description: returns true when the request has been completed
423 // Should be called after the CompletionCallback has been invoked
424 // This function is called by IUSBQueue after queue head has been completed
425 // If the function returns true, IUSBQueue will then call ShouldReleaseRequestAfterCompletion
426 // If that function returns also true, it calls Release() to delete the IUSBRequest
427
428 virtual BOOLEAN IsRequestComplete() = 0;
429
430 //-----------------------------------------------------------------------------------------
431 //
432 // GetTransferType
433 //
434 // Description: returns the type of the request: control, bulk, iso, interrupt
435
436 virtual ULONG GetTransferType() = 0;
437
438 //-----------------------------------------------------------------------------------------
439 //
440 // GetEndpointDescriptor
441 //
442 // Description: returns the general transfer descriptor
443
444 virtual NTSTATUS GetEndpointDescriptor(struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) = 0;
445
446 //-----------------------------------------------------------------------------------------
447 //
448 // GetResultStatus
449 //
450 // Description: returns the status code of the result
451 // Note: this function will block the caller untill the request has been completed
452
453 virtual VOID GetResultStatus(OUT OPTIONAL NTSTATUS * NtStatusCode,
454 OUT OPTIONAL PULONG UrbStatusCode) = 0;
455
456 //-----------------------------------------------------------------------------------------
457 //
458 // IsRequestInitialized
459 //
460 // Description: returns true when the request has been successfully initialized using InitializeXXX methods
461
462 virtual BOOLEAN IsRequestInitialized() = 0;
463
464 //-----------------------------------------------------------------------------------------
465 //
466 // CompletionCallback
467 //
468 // Description: notifies request that the endpoint descriptor is complete
469
470 virtual VOID CompletionCallback(struct _OHCI_ENDPOINT_DESCRIPTOR * OutDescriptor) = 0;
471
472 //-----------------------------------------------------------------------------------------
473 //
474 // FreeEndpointDescriptor
475 //
476 // Description: frees the associated endpoint descriptor and its general descriptors
477
478 virtual VOID FreeEndpointDescriptor(struct _OHCI_ENDPOINT_DESCRIPTOR * OutDescriptor) = 0;
479
480 //-----------------------------------------------------------------------------------------
481 //
482 // GetInterruptInterval
483 //
484 // Description: returns interval of the iso / interrupt
485
486 virtual UCHAR GetInterval() = 0;
487
488 };
489
490
491 typedef IUSBRequest *PUSBREQUEST;
492
493 //=========================================================================================
494 //
495 // class IUSBQueue
496 //
497 // Description: This class manages pending requests
498 //
499
500 DECLARE_INTERFACE_(IUSBQueue, IUnknown)
501 {
502 DEFINE_ABSTRACT_UNKNOWN()
503
504 //-----------------------------------------------------------------------------------------
505 //
506 // Initialize
507 //
508 // Description: initializes the object
509
510 virtual NTSTATUS Initialize(IN PUSBHARDWAREDEVICE Hardware,
511 IN PDMA_ADAPTER AdapterObject,
512 IN PDMAMEMORYMANAGER MemManager,
513 IN OPTIONAL PKSPIN_LOCK Lock) = 0;
514
515 //-----------------------------------------------------------------------------------------
516 //
517 // GetPendingRequestCount
518 //
519 // Description: returns the number of pending requests true from IsRequestComplete
520
521 virtual ULONG GetPendingRequestCount() = 0;
522
523 //-----------------------------------------------------------------------------------------
524 //
525 // AddUSBRequest
526 //
527 // Description: adds an usb request to the queue.
528 // Returns status success when successful
529
530 virtual NTSTATUS AddUSBRequest(IUSBRequest * Request) = 0;
531
532 //-----------------------------------------------------------------------------------------
533 //
534 // CancelRequests()
535 //
536 // Description: cancels all requests
537
538 virtual NTSTATUS CancelRequests() = 0;
539
540 //-----------------------------------------------------------------------------------------
541 //
542 // CreateUSBRequest
543 //
544 // Description: creates an usb request
545
546 virtual NTSTATUS CreateUSBRequest(IUSBRequest **OutRequest) = 0;
547
548 //-----------------------------------------------------------------------------------------
549 //
550 // TransferDescriptorCompletionCallback
551 //
552 // Description: notifies the queue that a transfer was completed
553
554 virtual VOID TransferDescriptorCompletionCallback(ULONG TransferDescriptorLogicalAddress) = 0;
555
556 };
557
558 typedef IUSBQueue *PUSBQUEUE;
559
560 //=========================================================================================
561 //
562 // class IHubController
563 //
564 // Description: This class implements a hub controller
565 //
566
567 DECLARE_INTERFACE_(IHubController, IUnknown)
568 {
569 DEFINE_ABSTRACT_UNKNOWN()
570
571 //----------------------------------------------------------------------------------------
572 //
573 // Initialize
574 //
575 // Description: Initializes the hub controller
576
577 virtual NTSTATUS Initialize(IN PDRIVER_OBJECT DriverObject,
578 IN PHCDCONTROLLER Controller,
579 IN PUSBHARDWAREDEVICE Device,
580 IN BOOLEAN IsRootHubDevice,
581 IN ULONG DeviceAddress) = 0;
582
583 //----------------------------------------------------------------------------------------
584 //
585 // GetHubControllerDeviceObject
586 //
587 // Description: Returns the hub controller device object
588
589 virtual NTSTATUS GetHubControllerDeviceObject(PDEVICE_OBJECT * HubDeviceObject) = 0;
590
591 //----------------------------------------------------------------------------------------
592 //
593 // GetHubControllerSymbolicLink
594 //
595 // Description: Returns the symbolic link of the root hub
596
597 virtual NTSTATUS GetHubControllerSymbolicLink(ULONG BufferLength, PVOID Buffer, PULONG RequiredLength) = 0;
598
599
600 };
601
602 typedef IHubController *PHUBCONTROLLER;
603
604 //=========================================================================================
605 //
606 // class IDispatchIrp
607 //
608 // Description: This class is used to handle irp dispatch requests
609 //
610
611 DECLARE_INTERFACE_(IDispatchIrp, IUnknown)
612 {
613 DEFINE_ABSTRACT_UNKNOWN()
614
615 //-----------------------------------------------------------------------------------------
616 //
617 // HandlePnp
618 //
619 // Description: This function handles all pnp requests
620
621 virtual NTSTATUS HandlePnp(IN PDEVICE_OBJECT DeviceObject,
622 IN OUT PIRP Irp) = 0;
623
624 //-----------------------------------------------------------------------------------------
625 //
626 // HandlePower
627 //
628 // Description: This function handles all power pnp requests
629 //
630 virtual NTSTATUS HandlePower(IN PDEVICE_OBJECT DeviceObject,
631 IN OUT PIRP Irp) = 0;
632
633 //-----------------------------------------------------------------------------------------
634 //
635 // HandleDeviceControl
636 //
637 // Description: handles device io control requests
638
639 virtual NTSTATUS HandleDeviceControl(IN PDEVICE_OBJECT DeviceObject,
640 IN OUT PIRP Irp) = 0;
641 };
642
643 typedef IDispatchIrp *PDISPATCHIRP;
644
645 //=========================================================================================
646 //
647 // class IUSBDevice
648 //
649 // Description: This class is used to abstract details of a usb device
650 //
651
652 DECLARE_INTERFACE_(IUSBDevice, IUnknown)
653 {
654 DEFINE_ABSTRACT_UNKNOWN()
655
656 //----------------------------------------------------------------------------------------
657 //
658 // Initialize
659 //
660 // Description: Initializes the usb device
661
662 virtual NTSTATUS Initialize(IN PHUBCONTROLLER HubController,
663 IN PUSBHARDWAREDEVICE Device,
664 IN PVOID Parent,
665 IN ULONG Port,
666 IN ULONG PortStatus) = 0;
667
668 //-----------------------------------------------------------------------------------------
669 //
670 // IsHub
671 //
672 // Description: returns true when device is a hub
673
674 virtual BOOLEAN IsHub() = 0;
675
676 //-----------------------------------------------------------------------------------------
677 //
678 // GetParent
679 //
680 // Description: gets the parent device of the this device
681
682 virtual NTSTATUS GetParent(PVOID * Parent) = 0;
683
684 //-----------------------------------------------------------------------------------------
685 //
686 // GetDeviceAddress
687 //
688 // Description: gets the device address of the this device
689
690 virtual UCHAR GetDeviceAddress() = 0;
691
692
693 //-----------------------------------------------------------------------------------------
694 //
695 // GetPort
696 //
697 // Description: gets the port to which this device is connected
698
699 virtual ULONG GetPort() = 0;
700
701 //-----------------------------------------------------------------------------------------
702 //
703 // GetSpeed
704 //
705 // Description: gets the speed of the device
706
707 virtual USB_DEVICE_SPEED GetSpeed() = 0;
708
709 //-----------------------------------------------------------------------------------------
710 //
711 // GetType
712 //
713 // Description: gets the type of the device, either 1.1 or 2.0 device
714
715 virtual USB_DEVICE_TYPE GetType() = 0;
716
717 //-----------------------------------------------------------------------------------------
718 //
719 // GetState
720 //
721 // Description: gets the device state
722
723 virtual ULONG GetState() = 0;
724
725 //-----------------------------------------------------------------------------------------
726 //
727 // SetDeviceHandleData
728 //
729 // Description: sets device handle data
730
731 virtual void SetDeviceHandleData(PVOID Data) = 0;
732
733 //-----------------------------------------------------------------------------------------
734 //
735 // SetDeviceAddress
736 //
737 // Description: sets device handle data
738
739 virtual NTSTATUS SetDeviceAddress(UCHAR DeviceAddress) = 0;
740
741 //-----------------------------------------------------------------------------------------
742 //
743 // GetDeviceDescriptor
744 //
745 // Description: sets device handle data
746
747 virtual void GetDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) = 0;
748
749 //-----------------------------------------------------------------------------------------
750 //
751 // GetConfigurationValue
752 //
753 // Description: gets current selected configuration index
754
755 virtual UCHAR GetConfigurationValue() = 0;
756
757 //-----------------------------------------------------------------------------------------
758 //
759 // SubmitIrp
760 //
761 // Description: submits an irp containing an urb
762
763 virtual NTSTATUS SubmitIrp(PIRP Irp) = 0;
764
765 //-----------------------------------------------------------------------------------------
766 //
767 // GetConfigurationDescriptors
768 //
769 // Description: returns one or more configuration descriptors
770
771 virtual VOID GetConfigurationDescriptors(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptorBuffer,
772 IN ULONG BufferLength,
773 OUT PULONG OutBufferLength) = 0;
774
775 //-----------------------------------------------------------------------------------------
776 //
777 // Description: returns length of configuration descriptors
778 //
779 virtual ULONG GetConfigurationDescriptorsLength() = 0;
780
781 //-----------------------------------------------------------------------------------------
782 //
783 // SubmitSetupPacket
784 //
785 // Description: submits an setup packet. The usb device will then create an usb request from it and submit it to the queue
786
787 virtual NTSTATUS SubmitSetupPacket(IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
788 IN OUT ULONG BufferLength,
789 OUT PVOID Buffer) = 0;
790
791 //-----------------------------------------------------------------------------------------
792 //
793 // SelectConfiguration
794 //
795 // Description: selects a configuration
796
797 virtual NTSTATUS SelectConfiguration(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
798 IN PUSBD_INTERFACE_INFORMATION Interface,
799 OUT USBD_CONFIGURATION_HANDLE *ConfigurationHandle) = 0;
800
801 //-----------------------------------------------------------------------------------------
802 //
803 // SelectConfiguration
804 //
805 // Description: selects a interface of an configuration
806
807 virtual NTSTATUS SelectInterface(IN USBD_CONFIGURATION_HANDLE ConfigurationHandle,
808 IN OUT PUSBD_INTERFACE_INFORMATION Interface) = 0;
809 };
810
811 typedef IUSBDevice *PUSBDEVICE;
812
813 #endif