[USB]
[reactos.git] / reactos / 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 USB_DEVICE_SPEED DeviceSpeed,
406 IN OUT ULONG TransferBufferLength,
407 IN OUT PMDL TransferBuffer) = 0;
408
409 //-----------------------------------------------------------------------------------------
410 //
411 // InitializeWithIrp
412 //
413 // Description: initializes the request with an IRP
414 // The irp contains an URB block which contains all necessary information
415 // contains the device speed (FullSpeed / LowSpeed)
416
417 virtual NTSTATUS InitializeWithIrp(IN PDMAMEMORYMANAGER DmaManager,
418 IN OUT PIRP Irp,
419 IN USB_DEVICE_SPEED DeviceSpeed) = 0;
420
421 //-----------------------------------------------------------------------------------------
422 //
423 // IsRequestComplete
424 //
425 // Description: returns true when the request has been completed
426 // Should be called after the CompletionCallback has been invoked
427 // This function is called by IUSBQueue after queue head has been completed
428 // If the function returns true, IUSBQueue will then call ShouldReleaseRequestAfterCompletion
429 // If that function returns also true, it calls Release() to delete the IUSBRequest
430
431 virtual BOOLEAN IsRequestComplete() = 0;
432
433 //-----------------------------------------------------------------------------------------
434 //
435 // GetTransferType
436 //
437 // Description: returns the type of the request: control, bulk, iso, interrupt
438
439 virtual ULONG GetTransferType() = 0;
440
441 //-----------------------------------------------------------------------------------------
442 //
443 // GetEndpointDescriptor
444 //
445 // Description: returns the general transfer descriptor
446
447 virtual NTSTATUS GetEndpointDescriptor(struct _OHCI_ENDPOINT_DESCRIPTOR ** OutDescriptor) = 0;
448
449 //-----------------------------------------------------------------------------------------
450 //
451 // GetResultStatus
452 //
453 // Description: returns the status code of the result
454 // Note: this function will block the caller untill the request has been completed
455
456 virtual VOID GetResultStatus(OUT OPTIONAL NTSTATUS * NtStatusCode,
457 OUT OPTIONAL PULONG UrbStatusCode) = 0;
458
459 //-----------------------------------------------------------------------------------------
460 //
461 // IsRequestInitialized
462 //
463 // Description: returns true when the request has been successfully initialized using InitializeXXX methods
464
465 virtual BOOLEAN IsRequestInitialized() = 0;
466
467 //-----------------------------------------------------------------------------------------
468 //
469 // CompletionCallback
470 //
471 // Description: notifies request that the endpoint descriptor is complete
472
473 virtual VOID CompletionCallback(struct _OHCI_ENDPOINT_DESCRIPTOR * OutDescriptor) = 0;
474
475 //-----------------------------------------------------------------------------------------
476 //
477 // FreeEndpointDescriptor
478 //
479 // Description: frees the associated endpoint descriptor and its general descriptors
480
481 virtual VOID FreeEndpointDescriptor(struct _OHCI_ENDPOINT_DESCRIPTOR * OutDescriptor) = 0;
482
483 //-----------------------------------------------------------------------------------------
484 //
485 // GetInterruptInterval
486 //
487 // Description: returns interval of the iso / interrupt
488
489 virtual UCHAR GetInterval() = 0;
490
491 };
492
493
494 typedef IUSBRequest *PUSBREQUEST;
495
496 //=========================================================================================
497 //
498 // class IUSBQueue
499 //
500 // Description: This class manages pending requests
501 //
502
503 DECLARE_INTERFACE_(IUSBQueue, IUnknown)
504 {
505 DEFINE_ABSTRACT_UNKNOWN()
506
507 //-----------------------------------------------------------------------------------------
508 //
509 // Initialize
510 //
511 // Description: initializes the object
512
513 virtual NTSTATUS Initialize(IN PUSBHARDWAREDEVICE Hardware,
514 IN PDMA_ADAPTER AdapterObject,
515 IN PDMAMEMORYMANAGER MemManager,
516 IN OPTIONAL PKSPIN_LOCK Lock) = 0;
517
518 //-----------------------------------------------------------------------------------------
519 //
520 // GetPendingRequestCount
521 //
522 // Description: returns the number of pending requests true from IsRequestComplete
523
524 virtual ULONG GetPendingRequestCount() = 0;
525
526 //-----------------------------------------------------------------------------------------
527 //
528 // AddUSBRequest
529 //
530 // Description: adds an usb request to the queue.
531 // Returns status success when successful
532
533 virtual NTSTATUS AddUSBRequest(IUSBRequest * Request) = 0;
534
535 //-----------------------------------------------------------------------------------------
536 //
537 // CancelRequests()
538 //
539 // Description: cancels all requests
540
541 virtual NTSTATUS CancelRequests() = 0;
542
543 //-----------------------------------------------------------------------------------------
544 //
545 // CreateUSBRequest
546 //
547 // Description: creates an usb request
548
549 virtual NTSTATUS CreateUSBRequest(IUSBRequest **OutRequest) = 0;
550
551 //-----------------------------------------------------------------------------------------
552 //
553 // TransferDescriptorCompletionCallback
554 //
555 // Description: notifies the queue that a transfer was completed
556
557 virtual VOID TransferDescriptorCompletionCallback(ULONG TransferDescriptorLogicalAddress) = 0;
558
559
560 //-----------------------------------------------------------------------------------------
561 //
562 // AbortDevicePipe
563 //
564 // Description: aborts all pending requsts of an device
565
566 virtual NTSTATUS AbortDevicePipe(UCHAR DeviceAddress, IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor) = 0;
567 };
568
569 typedef IUSBQueue *PUSBQUEUE;
570
571 //=========================================================================================
572 //
573 // class IHubController
574 //
575 // Description: This class implements a hub controller
576 //
577
578 DECLARE_INTERFACE_(IHubController, IUnknown)
579 {
580 DEFINE_ABSTRACT_UNKNOWN()
581
582 //----------------------------------------------------------------------------------------
583 //
584 // Initialize
585 //
586 // Description: Initializes the hub controller
587
588 virtual NTSTATUS Initialize(IN PDRIVER_OBJECT DriverObject,
589 IN PHCDCONTROLLER Controller,
590 IN PUSBHARDWAREDEVICE Device,
591 IN BOOLEAN IsRootHubDevice,
592 IN ULONG DeviceAddress) = 0;
593
594 //----------------------------------------------------------------------------------------
595 //
596 // GetHubControllerDeviceObject
597 //
598 // Description: Returns the hub controller device object
599
600 virtual NTSTATUS GetHubControllerDeviceObject(PDEVICE_OBJECT * HubDeviceObject) = 0;
601
602 //----------------------------------------------------------------------------------------
603 //
604 // GetHubControllerSymbolicLink
605 //
606 // Description: Returns the symbolic link of the root hub
607
608 virtual NTSTATUS GetHubControllerSymbolicLink(ULONG BufferLength, PVOID Buffer, PULONG RequiredLength) = 0;
609
610
611 };
612
613 typedef IHubController *PHUBCONTROLLER;
614
615 //=========================================================================================
616 //
617 // class IDispatchIrp
618 //
619 // Description: This class is used to handle irp dispatch requests
620 //
621
622 DECLARE_INTERFACE_(IDispatchIrp, IUnknown)
623 {
624 DEFINE_ABSTRACT_UNKNOWN()
625
626 //-----------------------------------------------------------------------------------------
627 //
628 // HandlePnp
629 //
630 // Description: This function handles all pnp requests
631
632 virtual NTSTATUS HandlePnp(IN PDEVICE_OBJECT DeviceObject,
633 IN OUT PIRP Irp) = 0;
634
635 //-----------------------------------------------------------------------------------------
636 //
637 // HandlePower
638 //
639 // Description: This function handles all power pnp requests
640 //
641 virtual NTSTATUS HandlePower(IN PDEVICE_OBJECT DeviceObject,
642 IN OUT PIRP Irp) = 0;
643
644 //-----------------------------------------------------------------------------------------
645 //
646 // HandleDeviceControl
647 //
648 // Description: handles device io control requests
649
650 virtual NTSTATUS HandleDeviceControl(IN PDEVICE_OBJECT DeviceObject,
651 IN OUT PIRP Irp) = 0;
652 };
653
654 typedef IDispatchIrp *PDISPATCHIRP;
655
656 //=========================================================================================
657 //
658 // class IUSBDevice
659 //
660 // Description: This class is used to abstract details of a usb device
661 //
662
663 DECLARE_INTERFACE_(IUSBDevice, IUnknown)
664 {
665 DEFINE_ABSTRACT_UNKNOWN()
666
667 //----------------------------------------------------------------------------------------
668 //
669 // Initialize
670 //
671 // Description: Initializes the usb device
672
673 virtual NTSTATUS Initialize(IN PHUBCONTROLLER HubController,
674 IN PUSBHARDWAREDEVICE Device,
675 IN PVOID Parent,
676 IN ULONG Port,
677 IN ULONG PortStatus) = 0;
678
679 //-----------------------------------------------------------------------------------------
680 //
681 // IsHub
682 //
683 // Description: returns true when device is a hub
684
685 virtual BOOLEAN IsHub() = 0;
686
687 //-----------------------------------------------------------------------------------------
688 //
689 // GetParent
690 //
691 // Description: gets the parent device of the this device
692
693 virtual NTSTATUS GetParent(PVOID * Parent) = 0;
694
695 //-----------------------------------------------------------------------------------------
696 //
697 // GetDeviceAddress
698 //
699 // Description: gets the device address of the this device
700
701 virtual UCHAR GetDeviceAddress() = 0;
702
703
704 //-----------------------------------------------------------------------------------------
705 //
706 // GetPort
707 //
708 // Description: gets the port to which this device is connected
709
710 virtual ULONG GetPort() = 0;
711
712 //-----------------------------------------------------------------------------------------
713 //
714 // GetSpeed
715 //
716 // Description: gets the speed of the device
717
718 virtual USB_DEVICE_SPEED GetSpeed() = 0;
719
720 //-----------------------------------------------------------------------------------------
721 //
722 // GetType
723 //
724 // Description: gets the type of the device, either 1.1 or 2.0 device
725
726 virtual USB_DEVICE_TYPE GetType() = 0;
727
728 //-----------------------------------------------------------------------------------------
729 //
730 // GetState
731 //
732 // Description: gets the device state
733
734 virtual ULONG GetState() = 0;
735
736 //-----------------------------------------------------------------------------------------
737 //
738 // SetDeviceHandleData
739 //
740 // Description: sets device handle data
741
742 virtual void SetDeviceHandleData(PVOID Data) = 0;
743
744 //-----------------------------------------------------------------------------------------
745 //
746 // SetDeviceAddress
747 //
748 // Description: sets device handle data
749
750 virtual NTSTATUS SetDeviceAddress(UCHAR DeviceAddress) = 0;
751
752 //-----------------------------------------------------------------------------------------
753 //
754 // GetDeviceDescriptor
755 //
756 // Description: sets device handle data
757
758 virtual void GetDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor) = 0;
759
760 //-----------------------------------------------------------------------------------------
761 //
762 // GetConfigurationValue
763 //
764 // Description: gets current selected configuration index
765
766 virtual UCHAR GetConfigurationValue() = 0;
767
768 //-----------------------------------------------------------------------------------------
769 //
770 // SubmitIrp
771 //
772 // Description: submits an irp containing an urb
773
774 virtual NTSTATUS SubmitIrp(PIRP Irp) = 0;
775
776 //-----------------------------------------------------------------------------------------
777 //
778 // GetConfigurationDescriptors
779 //
780 // Description: returns one or more configuration descriptors
781
782 virtual VOID GetConfigurationDescriptors(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptorBuffer,
783 IN ULONG BufferLength,
784 OUT PULONG OutBufferLength) = 0;
785
786 //-----------------------------------------------------------------------------------------
787 //
788 // Description: returns length of configuration descriptors
789 //
790 virtual ULONG GetConfigurationDescriptorsLength() = 0;
791
792 //-----------------------------------------------------------------------------------------
793 //
794 // SubmitSetupPacket
795 //
796 // Description: submits an setup packet. The usb device will then create an usb request from it and submit it to the queue
797
798 virtual NTSTATUS SubmitSetupPacket(IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
799 IN OUT ULONG BufferLength,
800 OUT PVOID Buffer) = 0;
801
802 //-----------------------------------------------------------------------------------------
803 //
804 // SelectConfiguration
805 //
806 // Description: selects a configuration
807
808 virtual NTSTATUS SelectConfiguration(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
809 IN PUSBD_INTERFACE_INFORMATION Interface,
810 OUT USBD_CONFIGURATION_HANDLE *ConfigurationHandle) = 0;
811
812 //-----------------------------------------------------------------------------------------
813 //
814 // SelectConfiguration
815 //
816 // Description: selects a interface of an configuration
817
818 virtual NTSTATUS SelectInterface(IN USBD_CONFIGURATION_HANDLE ConfigurationHandle,
819 IN OUT PUSBD_INTERFACE_INFORMATION Interface) = 0;
820
821
822 //-----------------------------------------------------------------------------------------
823 //
824 // AbortPipe
825 //
826 // Description: aborts all pending requsts
827
828 virtual NTSTATUS AbortPipe(IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor) = 0;
829
830 };
831
832 typedef IUSBDevice *PUSBDEVICE;
833
834 #endif