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