[USBPORT]
[reactos.git] / reactos / sdk / include / reactos / drivers / usbport / usbmport.h
1 #ifndef USBMPORT_H__
2 #define USBMPORT_H__
3
4 #define USBPORT_HCI_MN 0x10000001
5
6 /* Tranfer types */
7 #define USBPORT_TRANSFER_TYPE_ISOCHRONOUS 0
8 #define USBPORT_TRANSFER_TYPE_CONTROL 1
9 #define USBPORT_TRANSFER_TYPE_BULK 2
10 #define USBPORT_TRANSFER_TYPE_INTERRUPT 3
11
12 /* Endpoint states */
13 #define USBPORT_ENDPOINT_UNKNOWN 0
14 #define USBPORT_ENDPOINT_PAUSED 2
15 #define USBPORT_ENDPOINT_ACTIVE 3
16 #define USBPORT_ENDPOINT_REMOVE 4
17 #define USBPORT_ENDPOINT_CLOSED 5
18
19 /* Endpoint status */
20 #define USBPORT_ENDPOINT_RUN 0
21 #define USBPORT_ENDPOINT_HALT 1
22 #define USBPORT_ENDPOINT_CONTROL 4
23
24 /* Types of resources. For USBPORT_RESOURCES::ResourcesTypes */
25 #define USBPORT_RESOURCES_PORT 1
26 #define USBPORT_RESOURCES_INTERRUPT 2
27 #define USBPORT_RESOURCES_MEMORY 4
28
29 typedef struct _USBPORT_RESOURCES {
30 ULONG ResourcesTypes;
31 ULONG HcFlavor;
32 ULONG InterruptVector;
33 KIRQL InterruptLevel;
34 UCHAR Padded1[3];
35 KAFFINITY InterruptAffinity;
36 BOOLEAN ShareVector;
37 UCHAR Padded2[3];
38 KINTERRUPT_MODE InterruptMode;
39 ULONG Reserved;
40 PVOID ResourceBase;
41 SIZE_T IoSpaceLength;
42 PVOID StartVA;
43 PVOID StartPA;
44 UCHAR LegacySupport;
45 BOOLEAN IsChirpHandled;
46 UCHAR Reserved2;
47 UCHAR Reserved3;
48 } USBPORT_RESOURCES, *PUSBPORT_RESOURCES;
49
50 C_ASSERT(sizeof(USBPORT_RESOURCES) == 52);
51
52 typedef ULONG MPSTATUS; // Miniport status
53 typedef ULONG RHSTATUS; // Roothub status
54
55 #define MP_STATUS_SUCCESS 0
56 #define MP_STATUS_FAILURE 1
57 #define MP_STATUS_NO_RESOURCES 2
58 #define MP_STATUS_NO_BANDWIDTH 3
59 #define MP_STATUS_ERROR 4
60 #define MP_STATUS_RESERVED1 5
61 #define MP_STATUS_NOT_SUPPORTED 6
62 #define MP_STATUS_HW_ERROR 7
63 #define MP_STATUS_UNSUCCESSFUL 8
64
65 #define RH_STATUS_SUCCESS 0
66 #define RH_STATUS_NO_CHANGES 1
67 #define RH_STATUS_UNSUCCESSFUL 2
68
69 typedef USB_20_PORT_CHANGE USB_PORT_STATUS_CHANGE;
70
71 typedef union _USBHUB_PORT_STATUS {
72 struct {
73 USB_PORT_STATUS UsbPortStatus;
74 USB_PORT_STATUS_CHANGE UsbPortStatusChange;
75 };
76 ULONG AsULONG;
77 } USBHUB_PORT_STATUS, *PUSBHUB_PORT_STATUS;
78
79 /* Additional USB Class Codes from USB.org */
80 #define USBC_DEVICE_CLASS_AUDIO_VIDEO 0x10
81 #define USBC_DEVICE_CLASS_BILLBOARD 0x11
82 #define USBC_DEVICE_CLASS_TYPE_C_BRIDGE 0x12
83
84 /* Miniport functions */
85 typedef MPSTATUS
86 (NTAPI *PHCI_OPEN_ENDPOINT)(
87 PVOID,
88 PVOID,
89 PVOID);
90
91 typedef MPSTATUS
92 (NTAPI *PHCI_REOPEN_ENDPOINT)(
93 PVOID,
94 PVOID,
95 PVOID);
96
97 typedef VOID
98 (NTAPI *PHCI_QUERY_ENDPOINT_REQUIREMENTS)(
99 PVOID,
100 PVOID,
101 PULONG);
102
103 typedef VOID
104 (NTAPI *PHCI_CLOSE_ENDPOINT)(
105 PVOID,
106 PVOID,
107 BOOLEAN);
108
109 typedef MPSTATUS
110 (NTAPI *PHCI_START_CONTROLLER)(
111 PVOID,
112 PUSBPORT_RESOURCES);
113
114 typedef VOID
115 (NTAPI *PHCI_STOP_CONTROLLER)(
116 PVOID,
117 BOOLEAN);
118
119 typedef VOID
120 (NTAPI *PHCI_SUSPEND_CONTROLLER)(PVOID);
121
122 typedef MPSTATUS
123 (NTAPI *PHCI_RESUME_CONTROLLER)(PVOID);
124
125 typedef BOOLEAN
126 (NTAPI *PHCI_INTERRUPT_SERVICE)(PVOID);
127
128 typedef VOID
129 (NTAPI *PHCI_INTERRUPT_DPC)(
130 PVOID,
131 BOOLEAN);
132
133 typedef MPSTATUS
134 (NTAPI *PHCI_SUBMIT_TRANSFER)(
135 PVOID,
136 PVOID,
137 PVOID,
138 PVOID,
139 PVOID);
140
141 typedef MPSTATUS
142 (NTAPI *PHCI_SUBMIT_ISO_TRANSFER)(
143 PVOID,
144 PVOID,
145 PVOID,
146 PVOID,
147 PVOID);
148
149 typedef VOID
150 (NTAPI *PHCI_ABORT_TRANSFER)(
151 PVOID,
152 PVOID,
153 PVOID,
154 PULONG);
155
156 typedef ULONG
157 (NTAPI *PHCI_GET_ENDPOINT_STATE)(
158 PVOID,
159 PVOID);
160
161 typedef VOID
162 (NTAPI *PHCI_SET_ENDPOINT_STATE)(
163 PVOID,
164 PVOID,
165 ULONG);
166
167 typedef VOID
168 (NTAPI *PHCI_POLL_ENDPOINT)(
169 PVOID,
170 PVOID);
171
172 typedef VOID
173 (NTAPI *PHCI_CHECK_CONTROLLER)(PVOID);
174
175 typedef ULONG
176 (NTAPI *PHCI_GET_32BIT_FRAME_NUMBER)(PVOID);
177
178 typedef VOID
179 (NTAPI *PHCI_INTERRUPT_NEXT_SOF)(PVOID);
180
181 typedef VOID
182 (NTAPI *PHCI_ENABLE_INTERRUPTS)(PVOID);
183
184 typedef VOID
185 (NTAPI *PHCI_DISABLE_INTERRUPTS)(PVOID);
186
187 typedef VOID
188 (NTAPI *PHCI_POLL_CONTROLLER)(PVOID);
189
190 typedef VOID
191 (NTAPI *PHCI_SET_ENDPOINT_DATA_TOGGLE)(
192 PVOID,
193 PVOID,
194 ULONG);
195
196 typedef ULONG
197 (NTAPI *PHCI_GET_ENDPOINT_STATUS)(
198 PVOID,
199 PVOID);
200
201 typedef VOID
202 (NTAPI *PHCI_SET_ENDPOINT_STATUS)(
203 PVOID,
204 PVOID,
205 ULONG);
206
207 typedef VOID
208 (NTAPI *PHCI_RESET_CONTROLLER)(PVOID);
209
210 /* Roothub functions */
211 typedef VOID
212 (NTAPI *PHCI_RH_GET_ROOT_HUB_DATA)(
213 PVOID,
214 PVOID);
215
216 typedef MPSTATUS
217 (NTAPI *PHCI_RH_GET_STATUS)(
218 PVOID,
219 PUSHORT);
220
221 typedef MPSTATUS
222 (NTAPI *PHCI_RH_GET_PORT_STATUS)(
223 PVOID,
224 USHORT,
225 PUSBHUB_PORT_STATUS);
226
227 typedef MPSTATUS
228 (NTAPI *PHCI_RH_GET_HUB_STATUS)(
229 PVOID,
230 PUSB_HUB_STATUS_AND_CHANGE);
231
232 typedef MPSTATUS
233 (NTAPI *PHCI_RH_SET_FEATURE_PORT_RESET)(
234 PVOID,
235 USHORT);
236
237 typedef MPSTATUS
238 (NTAPI *PHCI_RH_SET_FEATURE_PORT_POWER)(
239 PVOID,
240 USHORT);
241
242 typedef MPSTATUS
243 (NTAPI *PHCI_RH_SET_FEATURE_PORT_ENABLE)(
244 PVOID,
245 USHORT);
246
247 typedef MPSTATUS
248 (NTAPI *PHCI_RH_SET_FEATURE_PORT_SUSPEND)(
249 PVOID,
250 USHORT);
251
252 typedef MPSTATUS
253 (NTAPI *PHCI_RH_CLEAR_FEATURE_PORT_ENABLE)(
254 PVOID,
255 USHORT);
256
257 typedef MPSTATUS
258 (NTAPI *PHCI_RH_CLEAR_FEATURE_PORT_POWER)(
259 PVOID,
260 USHORT);
261
262 typedef MPSTATUS
263 (NTAPI *PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND)(
264 PVOID,
265 USHORT);
266
267 typedef MPSTATUS
268 (NTAPI *PHCI_RH_CLEAR_FEATURE_PORT_ENABLE_CHANGE)(
269 PVOID,
270 USHORT);
271
272 typedef MPSTATUS
273 (NTAPI *PHCI_RH_CLEAR_FEATURE_PORT_CONNECT_CHANGE)(
274 PVOID,
275 USHORT);
276
277 typedef MPSTATUS
278 (NTAPI *PHCI_RH_CLEAR_FEATURE_PORT_RESET_CHANGE)(
279 PVOID,
280 USHORT);
281
282 typedef MPSTATUS
283 (NTAPI *PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND_CHANGE)(
284 PVOID,
285 USHORT);
286
287 typedef MPSTATUS
288 (NTAPI *PHCI_RH_CLEAR_FEATURE_PORT_OVERCURRENT_CHANGE)(
289 PVOID,
290 USHORT);
291
292 typedef VOID
293 (NTAPI *PHCI_RH_DISABLE_IRQ)(PVOID);
294
295 typedef VOID
296 (NTAPI *PHCI_RH_ENABLE_IRQ)(PVOID);
297
298 /* Miniport ioctl functions */
299 typedef MPSTATUS
300 (NTAPI *PHCI_START_SEND_ONE_PACKET)(
301 PVOID,
302 PVOID,
303 PVOID,
304 PULONG,
305 PVOID,
306 PVOID,
307 ULONG,
308 USBD_STATUS *);
309
310 typedef MPSTATUS
311 (NTAPI *PHCI_END_SEND_ONE_PACKET)(
312 PVOID,
313 PVOID,
314 PVOID,
315 PULONG,
316 PVOID,
317 PVOID,
318 ULONG,
319 USBD_STATUS *);
320
321 typedef MPSTATUS
322 (NTAPI *PHCI_PASS_THRU)(
323 PVOID,
324 PVOID,
325 ULONG,
326 PVOID);
327
328 /* Port functions */
329 typedef ULONG
330 (NTAPI *PUSBPORT_DBG_PRINT)(
331 PVOID,
332 ULONG,
333 PCH,
334 ...);
335
336 typedef ULONG
337 (NTAPI *PUSBPORT_TEST_DEBUG_BREAK)(PVOID);
338
339 typedef ULONG
340 (NTAPI *PUSBPORT_ASSERT_FAILURE)(
341 PVOID,
342 PVOID,
343 PVOID,
344 ULONG,
345 PCHAR);
346
347 typedef MPSTATUS
348 (NTAPI *PUSBPORT_GET_MINIPORT_REGISTRY_KEY_VALUE)(
349 PVOID,
350 BOOL,
351 PCWSTR,
352 SIZE_T,
353 PVOID,
354 SIZE_T);
355
356 typedef ULONG
357 (NTAPI *PUSBPORT_INVALIDATE_ROOT_HUB)(PVOID);
358
359 typedef ULONG
360 (NTAPI *PUSBPORT_INVALIDATE_ENDPOINT)(
361 PVOID,
362 PVOID);
363
364 typedef ULONG
365 (NTAPI *PUSBPORT_COMPLETE_TRANSFER)(
366 PVOID,
367 PVOID,
368 PVOID,
369 USBD_STATUS,
370 SIZE_T);
371
372 typedef ULONG
373 (NTAPI *PUSBPORT_COMPLETE_ISO_TRANSFER)(
374 PVOID,
375 PVOID,
376 PVOID,
377 ULONG);
378
379 typedef ULONG
380 (NTAPI *PUSBPORT_LOG_ENTRY)(
381 PVOID,
382 ULONG,
383 ULONG,
384 ULONG,
385 ULONG,
386 ULONG);
387
388 typedef PVOID
389 (NTAPI *PUSBPORT_GET_MAPPED_VIRTUAL_ADDRESS)(
390 PVOID,
391 PVOID,
392 PVOID);
393
394 typedef VOID
395 (NTAPI ASYNC_TIMER_CALLBACK)(
396 IN PVOID MiniportExtension,
397 IN PVOID CallBackContext);
398
399 typedef ULONG
400 (NTAPI *PUSBPORT_REQUEST_ASYNC_CALLBACK)(
401 PVOID,
402 ULONG,
403 PVOID,
404 SIZE_T,
405 ASYNC_TIMER_CALLBACK *);
406
407 typedef MPSTATUS
408 (NTAPI *PUSBPORT_READ_WRITE_CONFIG_SPACE)(
409 PVOID,
410 BOOLEAN,
411 PVOID,
412 ULONG,
413 ULONG);
414
415 typedef NTSTATUS
416 (NTAPI *PUSBPORT_WAIT)(
417 PVOID,
418 ULONG);
419
420 typedef ULONG
421 (NTAPI *PUSBPORT_INVALIDATE_CONTROLLER)(
422 PVOID,
423 ULONG);
424
425 typedef VOID
426 (NTAPI *PUSBPORT_BUG_CHECK)(PVOID);
427
428 typedef ULONG
429 (NTAPI *PUSBPORT_NOTIFY_DOUBLE_BUFFER)(
430 PVOID,
431 PVOID,
432 PVOID,
433 SIZE_T);
434
435 /* Miniport functions */
436 typedef VOID
437 (NTAPI *PHCI_REBALANCE_ENDPOINT)(
438 PVOID,
439 PVOID,
440 PVOID);
441
442 typedef VOID
443 (NTAPI *PHCI_FLUSH_INTERRUPTS)(PVOID);
444
445 typedef MPSTATUS
446 (NTAPI *PHCI_RH_CHIRP_ROOT_PORT)(
447 PVOID,
448 USHORT);
449
450 typedef VOID
451 (NTAPI *PHCI_TAKE_PORT_CONTROL)(PVOID);
452
453 #define USB_MINIPORT_VERSION_OHCI 0x01
454 #define USB_MINIPORT_VERSION_UHCI 0x02
455 #define USB_MINIPORT_VERSION_EHCI 0x03
456
457 #define USB_MINIPORT_FLAGS_INTERRUPT 0x0001
458 #define USB_MINIPORT_FLAGS_PORT_IO 0x0002
459 #define USB_MINIPORT_FLAGS_MEMORY_IO 0x0004
460 #define USB_MINIPORT_FLAGS_USB2 0x0010
461 #define USB_MINIPORT_FLAGS_DISABLE_SS 0x0020
462 #define USB_MINIPORT_FLAGS_NOT_LOCK_INT 0x0040
463 #define USB_MINIPORT_FLAGS_POLLING 0x0080
464 #define USB_MINIPORT_FLAGS_NO_DMA 0x0100
465 #define USB_MINIPORT_FLAGS_WAKE_SUPPORT 0x0200
466
467 typedef struct _USBPORT_REGISTRATION_PACKET {
468 ULONG MiniPortVersion;
469 ULONG MiniPortFlags;
470 ULONG MiniPortBusBandwidth;
471 ULONG Reserved1;
472 SIZE_T MiniPortExtensionSize;
473 SIZE_T MiniPortEndpointSize;
474 SIZE_T MiniPortTransferSize;
475 ULONG Reserved2;
476 ULONG Reserved3;
477 SIZE_T MiniPortResourcesSize;
478
479 /* Miniport */
480 PHCI_OPEN_ENDPOINT OpenEndpoint;
481 PHCI_REOPEN_ENDPOINT ReopenEndpoint;
482 PHCI_QUERY_ENDPOINT_REQUIREMENTS QueryEndpointRequirements;
483 PHCI_CLOSE_ENDPOINT CloseEndpoint;
484 PHCI_START_CONTROLLER StartController;
485 PHCI_STOP_CONTROLLER StopController;
486 PHCI_SUSPEND_CONTROLLER SuspendController;
487 PHCI_RESUME_CONTROLLER ResumeController;
488 PHCI_INTERRUPT_SERVICE InterruptService;
489 PHCI_INTERRUPT_DPC InterruptDpc;
490 PHCI_SUBMIT_TRANSFER SubmitTransfer;
491 PHCI_SUBMIT_ISO_TRANSFER SubmitIsoTransfer;
492 PHCI_ABORT_TRANSFER AbortTransfer;
493 PHCI_GET_ENDPOINT_STATE GetEndpointState;
494 PHCI_SET_ENDPOINT_STATE SetEndpointState;
495 PHCI_POLL_ENDPOINT PollEndpoint;
496 PHCI_CHECK_CONTROLLER CheckController;
497 PHCI_GET_32BIT_FRAME_NUMBER Get32BitFrameNumber;
498 PHCI_INTERRUPT_NEXT_SOF InterruptNextSOF;
499 PHCI_ENABLE_INTERRUPTS EnableInterrupts;
500 PHCI_DISABLE_INTERRUPTS DisableInterrupts;
501 PHCI_POLL_CONTROLLER PollController;
502 PHCI_SET_ENDPOINT_DATA_TOGGLE SetEndpointDataToggle;
503 PHCI_GET_ENDPOINT_STATUS GetEndpointStatus;
504 PHCI_SET_ENDPOINT_STATUS SetEndpointStatus;
505 PHCI_RESET_CONTROLLER ResetController;
506
507 /* Roothub */
508 PHCI_RH_GET_ROOT_HUB_DATA RH_GetRootHubData;
509 PHCI_RH_GET_STATUS RH_GetStatus;
510 PHCI_RH_GET_PORT_STATUS RH_GetPortStatus;
511 PHCI_RH_GET_HUB_STATUS RH_GetHubStatus;
512 PHCI_RH_SET_FEATURE_PORT_RESET RH_SetFeaturePortReset;
513 PHCI_RH_SET_FEATURE_PORT_POWER RH_SetFeaturePortPower;
514 PHCI_RH_SET_FEATURE_PORT_ENABLE RH_SetFeaturePortEnable;
515 PHCI_RH_SET_FEATURE_PORT_SUSPEND RH_SetFeaturePortSuspend;
516 PHCI_RH_CLEAR_FEATURE_PORT_ENABLE RH_ClearFeaturePortEnable;
517 PHCI_RH_CLEAR_FEATURE_PORT_POWER RH_ClearFeaturePortPower;
518 PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND RH_ClearFeaturePortSuspend;
519 PHCI_RH_CLEAR_FEATURE_PORT_ENABLE_CHANGE RH_ClearFeaturePortEnableChange;
520 PHCI_RH_CLEAR_FEATURE_PORT_CONNECT_CHANGE RH_ClearFeaturePortConnectChange;
521 PHCI_RH_CLEAR_FEATURE_PORT_RESET_CHANGE RH_ClearFeaturePortResetChange;
522 PHCI_RH_CLEAR_FEATURE_PORT_SUSPEND_CHANGE RH_ClearFeaturePortSuspendChange;
523 PHCI_RH_CLEAR_FEATURE_PORT_OVERCURRENT_CHANGE RH_ClearFeaturePortOvercurrentChange;
524 PHCI_RH_DISABLE_IRQ RH_DisableIrq;
525 PHCI_RH_ENABLE_IRQ RH_EnableIrq;
526
527 /* Miniport ioctl */
528 PHCI_START_SEND_ONE_PACKET StartSendOnePacket;
529 PHCI_END_SEND_ONE_PACKET EndSendOnePacket;
530 PHCI_PASS_THRU PassThru;
531
532 /* Port */
533 PUSBPORT_DBG_PRINT UsbPortDbgPrint;
534 PUSBPORT_TEST_DEBUG_BREAK UsbPortTestDebugBreak;
535 PUSBPORT_ASSERT_FAILURE UsbPortAssertFailure;
536 PUSBPORT_GET_MINIPORT_REGISTRY_KEY_VALUE UsbPortGetMiniportRegistryKeyValue;
537 PUSBPORT_INVALIDATE_ROOT_HUB UsbPortInvalidateRootHub;
538 PUSBPORT_INVALIDATE_ENDPOINT UsbPortInvalidateEndpoint;
539 PUSBPORT_COMPLETE_TRANSFER UsbPortCompleteTransfer;
540 PUSBPORT_COMPLETE_ISO_TRANSFER UsbPortCompleteIsoTransfer;
541 PUSBPORT_LOG_ENTRY UsbPortLogEntry;
542 PUSBPORT_GET_MAPPED_VIRTUAL_ADDRESS UsbPortGetMappedVirtualAddress;
543 PUSBPORT_REQUEST_ASYNC_CALLBACK UsbPortRequestAsyncCallback;
544 PUSBPORT_READ_WRITE_CONFIG_SPACE UsbPortReadWriteConfigSpace;
545 PUSBPORT_WAIT UsbPortWait;
546 PUSBPORT_INVALIDATE_CONTROLLER UsbPortInvalidateController;
547 PUSBPORT_BUG_CHECK UsbPortBugCheck;
548 PUSBPORT_NOTIFY_DOUBLE_BUFFER UsbPortNotifyDoubleBuffer;
549
550 /* Miniport */
551 PHCI_REBALANCE_ENDPOINT RebalanceEndpoint;
552 PHCI_FLUSH_INTERRUPTS FlushInterrupts;
553 PHCI_RH_CHIRP_ROOT_PORT RH_ChirpRootPort;
554 PHCI_TAKE_PORT_CONTROL TakePortControl;
555 ULONG Reserved4;
556 ULONG Reserved5;
557 } USBPORT_REGISTRATION_PACKET, *PUSBPORT_REGISTRATION_PACKET;
558
559 typedef struct _USBPORT_MINIPORT_INTERFACE {
560 PDRIVER_OBJECT DriverObject;
561 LIST_ENTRY DriverLink;
562 PDRIVER_UNLOAD DriverUnload;
563 ULONG Version;
564 USBPORT_REGISTRATION_PACKET Packet;
565 } USBPORT_MINIPORT_INTERFACE, *PUSBPORT_MINIPORT_INTERFACE;
566
567 C_ASSERT(sizeof(USBPORT_MINIPORT_INTERFACE) == 336);
568
569 typedef struct _USBPORT_ENDPOINT_PROPERTIES {
570 USHORT DeviceAddress;
571 USHORT EndpointAddress;
572 USHORT TotalMaxPacketSize; // TransactionPerMicroframe * MaxPacketSize
573 UCHAR Period;
574 UCHAR Reserved1;
575 USB_DEVICE_SPEED DeviceSpeed;
576 ULONG UsbBandwidth;
577 ULONG ScheduleOffset;
578 ULONG TransferType;
579 ULONG Direction;
580 ULONG_PTR BufferVA;
581 ULONG_PTR BufferPA;
582 ULONG BufferLength;
583 ULONG Reserved3;
584 ULONG MaxTransferSize;
585 USHORT HubAddr;
586 USHORT PortNumber;
587 UCHAR InterruptScheduleMask;
588 UCHAR SplitCompletionMask;
589 UCHAR TransactionPerMicroframe; // 1 + additional transactions. Total: from 1 to 3)
590 UCHAR Reserved4;
591 ULONG MaxPacketSize;
592 ULONG Reserved6;
593 } USBPORT_ENDPOINT_PROPERTIES, *PUSBPORT_ENDPOINT_PROPERTIES;
594
595 C_ASSERT(sizeof(USBPORT_ENDPOINT_PROPERTIES) == 64);
596
597 typedef struct _USBPORT_SCATTER_GATHER_ELEMENT {
598 PHYSICAL_ADDRESS SgPhysicalAddress;
599 ULONG Reserved1;
600 ULONG SgTransferLength;
601 ULONG SgOffset;
602 ULONG Reserved2;
603 } USBPORT_SCATTER_GATHER_ELEMENT, *PUSBPORT_SCATTER_GATHER_ELEMENT;
604
605 C_ASSERT(sizeof(USBPORT_SCATTER_GATHER_ELEMENT) == 24);
606
607 typedef struct _USBPORT_SCATTER_GATHER_LIST {
608 ULONG Flags;
609 ULONG_PTR CurrentVa;
610 PVOID MappedSystemVa;
611 ULONG SgElementCount;
612 USBPORT_SCATTER_GATHER_ELEMENT SgElement[1];
613 } USBPORT_SCATTER_GATHER_LIST, *PUSBPORT_SCATTER_GATHER_LIST;
614
615 C_ASSERT(sizeof(USBPORT_SCATTER_GATHER_LIST) == 40);
616
617 typedef struct _USBPORT_TRANSFER_PARAMETERS {
618 ULONG TransferFlags;
619 ULONG TransferBufferLength;
620 ULONG TransferCounter;
621 ULONG Reserved1;
622 ULONG Reserved2;
623 USB_DEFAULT_PIPE_SETUP_PACKET SetupPacket;
624 } USBPORT_TRANSFER_PARAMETERS, *PUSBPORT_TRANSFER_PARAMETERS;
625
626 C_ASSERT(sizeof(USBPORT_TRANSFER_PARAMETERS) == 28);
627
628 typedef struct _USBPORT_ROOT_HUB_DATA {
629 ULONG NumberOfPorts;
630 ULONG HubCharacteristics;
631 ULONG PowerOnToPowerGood;
632 ULONG HubControlCurrent;
633 } USBPORT_ROOT_HUB_DATA, *PUSBPORT_ROOT_HUB_DATA;
634
635 C_ASSERT(sizeof(USBPORT_ROOT_HUB_DATA) == 16);
636
637 ULONG
638 NTAPI
639 USBPORT_GetHciMn(VOID);
640
641 NTSTATUS
642 NTAPI
643 USBPORT_RegisterUSBPortDriver(
644 IN PDRIVER_OBJECT DriverObject,
645 IN ULONG Version,
646 IN PUSBPORT_REGISTRATION_PACKET RegistrationPacket);
647
648 #endif /* USBMPORT_H__ */