#include <ntddk.h>
#include <windef.h>
#include <stdio.h>
#include <hubbusif.h>
#include <usbbusif.h>
#include <usbdlib.h>
#include <drivers/usbport/usbmport.h>
#include "hardware.h"
Go to the source code of this file.
|
union | DECLSPEC_ALIGN (32) _OHCI_HW_TRANSFER_DESCRIPTOR |
|
| C_ASSERT (sizeof(OHCI_HW_TRANSFER_DESCRIPTOR)==32) |
|
| C_ASSERT (__alignof(OHCI_HW_TRANSFER_DESCRIPTOR)==32) |
|
| C_ASSERT (sizeof(OHCI_HCD_TD)==64) |
|
| C_ASSERT (sizeof(OHCI_HCD_ED)==64) |
|
VOID NTAPI | OHCI_RH_GetRootHubData (IN PVOID ohciExtension, IN PVOID rootHubData) |
|
MPSTATUS NTAPI | OHCI_RH_GetStatus (IN PVOID ohciExtension, IN PUSHORT Status) |
|
MPSTATUS NTAPI | OHCI_RH_GetPortStatus (IN PVOID ohciExtension, IN USHORT Port, IN PUSB_PORT_STATUS_AND_CHANGE PortStatus) |
|
MPSTATUS NTAPI | OHCI_RH_GetHubStatus (IN PVOID ohciExtension, IN PUSB_HUB_STATUS_AND_CHANGE HubStatus) |
|
MPSTATUS NTAPI | OHCI_RH_SetFeaturePortReset (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_SetFeaturePortPower (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_SetFeaturePortEnable (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_SetFeaturePortSuspend (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_ClearFeaturePortEnable (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_ClearFeaturePortPower (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_ClearFeaturePortSuspend (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_ClearFeaturePortEnableChange (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_ClearFeaturePortConnectChange (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_ClearFeaturePortResetChange (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_ClearFeaturePortSuspendChange (IN PVOID ohciExtension, IN USHORT Port) |
|
MPSTATUS NTAPI | OHCI_RH_ClearFeaturePortOvercurrentChange (IN PVOID ohciExtension, IN USHORT Port) |
|
VOID NTAPI | OHCI_RH_DisableIrq (IN PVOID ohciExtension) |
|
VOID NTAPI | OHCI_RH_EnableIrq (IN PVOID ohciExtension) |
|
OHCI_REG_RH_DESCRIPTORA NTAPI | OHCI_ReadRhDescriptorA (IN POHCI_EXTENSION OhciExtension) |
|
◆ OHCI_HCD_ED_FLAG_CONTROL
#define OHCI_HCD_ED_FLAG_CONTROL 0x00000001 |
◆ OHCI_HCD_ED_FLAG_NOT_ACCESSED
#define OHCI_HCD_ED_FLAG_NOT_ACCESSED 0x00000010 |
◆ OHCI_HCD_ED_FLAG_RESET_ON_HALT
#define OHCI_HCD_ED_FLAG_RESET_ON_HALT 0x00000008 |
◆ OHCI_HCD_TD_FLAG_ALLOCATED
#define OHCI_HCD_TD_FLAG_ALLOCATED 0x00000001 |
◆ OHCI_HCD_TD_FLAG_CONTROL_STATUS
#define OHCI_HCD_TD_FLAG_CONTROL_STATUS 0x00000004 |
◆ OHCI_HCD_TD_FLAG_DONE
#define OHCI_HCD_TD_FLAG_DONE 0x00000008 |
◆ OHCI_HCD_TD_FLAG_NOT_ACCESSED
#define OHCI_HCD_TD_FLAG_NOT_ACCESSED 0x00000010 |
◆ OHCI_HCD_TD_FLAG_PROCESSED
#define OHCI_HCD_TD_FLAG_PROCESSED 0x00000002 |
◆ OHCI_MAX_BULK_TD_COUNT
#define OHCI_MAX_BULK_TD_COUNT 68 |
◆ OHCI_MAX_BULK_TRANSFER_SIZE
#define OHCI_MAX_BULK_TRANSFER_SIZE 0x40000 |
◆ OHCI_MAX_CONTROL_TD_COUNT
#define OHCI_MAX_CONTROL_TD_COUNT 38 |
◆ OHCI_MAX_CONTROL_TRANSFER_SIZE
#define OHCI_MAX_CONTROL_TRANSFER_SIZE 0x10000 |
◆ OHCI_MAX_INTERRUPT_TD_COUNT
#define OHCI_MAX_INTERRUPT_TD_COUNT 4 |
◆ OHCI_MAX_INTERRUPT_TRANSFER_SIZE
#define OHCI_MAX_INTERRUPT_TRANSFER_SIZE 0x1000 |
◆ OHCI_MAX_ISO_TD_COUNT
#define OHCI_MAX_ISO_TD_COUNT 64 |
◆ OHCI_MAX_ISO_TRANSFER_SIZE
#define OHCI_MAX_ISO_TRANSFER_SIZE 0x10000 |
◆ OHCI_NON_DATA_CONTROL_TDS
#define OHCI_NON_DATA_CONTROL_TDS 2 |
◆ OHCI_STATIC_ED_TYPE_BULK
#define OHCI_STATIC_ED_TYPE_BULK 2 |
◆ OHCI_STATIC_ED_TYPE_CONTROL
#define OHCI_STATIC_ED_TYPE_CONTROL 1 |
◆ OHCI_STATIC_ED_TYPE_INTERRUPT
#define OHCI_STATIC_ED_TYPE_INTERRUPT 0 |
◆ OHCI_TRANSFER_FLAGS_SHORT_TRANSFER_OK
#define OHCI_TRANSFER_FLAGS_SHORT_TRANSFER_OK 1 |
◆ OHCI_ENDPOINT
◆ OHCI_EXTENSION
◆ OHCI_HC_RESOURCES
◆ OHCI_HCD_ED
◆ OHCI_HCD_TD
◆ OHCI_STATIC_ED
◆ OHCI_TRANSFER
◆ POHCI_ENDPOINT
◆ POHCI_EXTENSION
◆ POHCI_HC_RESOURCES
◆ POHCI_HCD_ED
◆ POHCI_HCD_TD
◆ POHCI_STATIC_ED
◆ POHCI_TRANSFER
◆ C_ASSERT() [1/4]
◆ C_ASSERT() [2/4]
◆ C_ASSERT() [3/4]
◆ C_ASSERT() [4/4]
◆ DECLSPEC_ALIGN()
union DECLSPEC_ALIGN |
( |
32 |
| ) |
|
Definition at line 46 of file usbohci.h.
48 {
49 struct {
53 };
54 struct {
56 };
* POHCI_HW_TRANSFER_DESCRIPTOR
OHCI_HW_TRANSFER_DESCRIPTOR
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET SetupPacket
◆ OHCI_ReadRhDescriptorA()
Definition at line 15 of file roothub.c.
16{
21
22 OperationalRegs = OhciExtension->OperationalRegs;
24
25 DPRINT(
"OHCI_ReadRhDescriptorA: OhciExtension - %p\n", OhciExtension);
26
27 for (ix = 0; ix < 10; ix++)
28 {
30
34 {
35 break;
36 }
37
38 DPRINT1(
"OHCI_ReadRhDescriptorA: DescriptorA - %lX, ix - %d\n",
40
42 }
43
44 return DescriptorA;
45}
#define READ_REGISTER_ULONG(r)
#define OHCI_MAX_PORT_COUNT
#define KeStallExecutionProcessor(MicroSeconds)
OHCI_REG_RH_DESCRIPTORA HcRhDescriptorA
ULONG NumberDownstreamPorts
Referenced by OHCI_ResetController(), and OHCI_RH_GetRootHubData().
◆ OHCI_RH_ClearFeaturePortConnectChange()
Definition at line 421 of file roothub.c.
423{
428
429 OhciExtension = ohciExtension;
430
431 DPRINT(
"OHCI_RH_ClearFeaturePortConnectChange: OhciExtension - %p, Port - %x\n",
432 OhciExtension,
434
436
439
442
444
446}
#define WRITE_REGISTER_ULONG(r, v)
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
POHCI_OPERATIONAL_REGISTERS OperationalRegs
OHCI_REG_RH_PORT_STATUS HcRhPortStatus[OHCI_MAX_PORT_COUNT]
#define MP_STATUS_SUCCESS
Referenced by DriverEntry().
◆ OHCI_RH_ClearFeaturePortEnable()
Definition at line 305 of file roothub.c.
307{
312
313 OhciExtension = ohciExtension;
314
315 DPRINT(
"OHCI_RH_ClearFeaturePortEnable: OhciExtension - %p, Port - %x\n",
316 OhciExtension,
318
320
323
326
328
330}
Referenced by DriverEntry().
◆ OHCI_RH_ClearFeaturePortEnableChange()
Definition at line 392 of file roothub.c.
394{
399
400 OhciExtension = ohciExtension;
401
402 DPRINT(
"OHCI_RH_ClearFeaturePortEnableChange: ohciExtension - %p, Port - %x\n",
403 ohciExtension,
405
407
410
413
415
417}
Referenced by DriverEntry().
◆ OHCI_RH_ClearFeaturePortOvercurrentChange()
Definition at line 508 of file roothub.c.
510{
517
518 OhciExtension = ohciExtension;
519
520 DPRINT(
"OHCI_RH_ClearFeaturePortOvercurrentChange: OhciExtension - %p, Port - %x\n",
521 OhciExtension,
523
525
527 {
528
530 PortStatus.PortOverCurrentIndicatorChange = 1;
531
534 }
535 else
536 {
537
540
543 }
544
546}
OHCI_REG_RH_STATUS HcRhStatus
ULONG OverCurrentIndicatorChangeW
Referenced by DriverEntry().
◆ OHCI_RH_ClearFeaturePortPower()
Definition at line 334 of file roothub.c.
336{
341
342 OhciExtension = ohciExtension;
343
344 DPRINT(
"OHCI_RH_ClearFeaturePortPower: OhciExtension - %p, Port - %x\n",
345 OhciExtension,
347
349
352
355
357
359}
Referenced by DriverEntry().
◆ OHCI_RH_ClearFeaturePortResetChange()
Definition at line 450 of file roothub.c.
452{
457
458 OhciExtension = ohciExtension;
459
460 DPRINT(
"OHCI_RH_ClearFeaturePortResetChange: OhciExtension - %p, Port - %x\n",
461 OhciExtension,
463
465
468
471
473
475}
Referenced by DriverEntry().
◆ OHCI_RH_ClearFeaturePortSuspend()
Definition at line 363 of file roothub.c.
365{
370
371 OhciExtension = ohciExtension;
372
373 DPRINT(
"OHCI_RH_ClearFeaturePortSuspend: OhciExtension - %p, Port - %x\n",
374 OhciExtension,
376
378
381
384
386
388}
Referenced by DriverEntry().
◆ OHCI_RH_ClearFeaturePortSuspendChange()
Definition at line 479 of file roothub.c.
481{
486
487 OhciExtension = ohciExtension;
488
489 DPRINT(
"OHCI_RH_ClearFeaturePortSuspendChange: OhciExtension - %p, Port - %x\n",
490 OhciExtension,
492
494
497
500
502
504}
Referenced by DriverEntry().
◆ OHCI_RH_DisableIrq()
Definition at line 550 of file roothub.c.
551{
554 PULONG InterruptDisableReg;
556
557 DPRINT(
"OHCI_RH_DisableIrq: OhciExtension - %p\n", OhciExtension);
558
561
564
566}
OHCI_REG_INTERRUPT_ENABLE_DISABLE HcInterruptDisable
ULONG RootHubStatusChange
Referenced by DriverEntry().
◆ OHCI_RH_EnableIrq()
Definition at line 570 of file roothub.c.
571{
574 PULONG InterruptEnableReg;
576
577 DPRINT(
"OHCI_RH_EnableIrq: OhciExtension - %p\n", OhciExtension);
578
581
584
586}
OHCI_REG_INTERRUPT_ENABLE_DISABLE HcInterruptEnable
Referenced by DriverEntry().
◆ OHCI_RH_GetHubStatus()
Definition at line 159 of file roothub.c.
161{
166
167 OhciExtension = ohciExtension;
168
169 DPRINT(
"OHCI_RH_GetHubStatus: ohciExtension - %p, HubStatus - %lX\n",
170 ohciExtension,
171 HubStatus->AsUlong32);
172
175
177
180
183
185}
ULONG OverCurrentIndicatorChangeR
ULONG LocalPowerStatusChange
ULONG OverCurrentIndicator
Referenced by DriverEntry().
◆ OHCI_RH_GetPortStatus()
Definition at line 113 of file roothub.c.
116{
123
124 OhciExtension = ohciExtension;
125
126 DPRINT(
"OHCI_RH_GetPortStatus: OhciExtension - %p, Port - %x, PortStatus - %lX\n",
127 OhciExtension,
130
132
135
136 for (ix = 0; ix < 10; ix++)
137 {
139
143
145 break;
146
147 DPRINT(
"OHCI_RH_GetPortStatus: OhciPortStatus - %X\n", OhciPortStatus.
AsULONG);
148
150 }
151
153
155}
_Reserved_ PVOID Reserved
Referenced by DriverEntry().
◆ OHCI_RH_GetRootHubData()
Definition at line 49 of file roothub.c.
51{
55 UCHAR PowerOnToPowerGoodTime;
57
58 OhciExtension = ohciExtension;
59
60 DPRINT(
"OHCI_RH_GetRootHubData: OhciExtension - %p, rootHubData - %p\n",
61 OhciExtension,
62 rootHubData);
63
64 RootHubData = rootHubData;
66
68
69
74
76
78 {
79
81 }
82 else
83 {
84
86 }
87
89
90
93
96
99}
#define OHCI_MINIMAL_POTPGT
USBPORT_HUB_CHARACTERISTICS HubCharacteristics
ULONG PowerOnToPowerGoodTime
ULONG NoOverCurrentProtection
ULONG OverCurrentProtectionMode
USHORT PartOfCompoundDevice
USHORT OverCurrentProtectionMode
USHORT NoOverCurrentProtection
USBPORT_HUB_11_CHARACTERISTICS Usb11HubCharacteristics
OHCI_REG_RH_DESCRIPTORA NTAPI OHCI_ReadRhDescriptorA(IN POHCI_EXTENSION OhciExtension)
Referenced by DriverEntry().
◆ OHCI_RH_GetStatus()
◆ OHCI_RH_SetFeaturePortEnable()
Definition at line 247 of file roothub.c.
249{
254
255 OhciExtension = ohciExtension;
256
257 DPRINT(
"OHCI_RH_SetFeaturePortEnable: OhciExtension - %p, Port - %x\n",
258 OhciExtension,
260
262
265
268
270
272}
Referenced by DriverEntry().
◆ OHCI_RH_SetFeaturePortPower()
Definition at line 218 of file roothub.c.
220{
225
226 OhciExtension = ohciExtension;
227
228 DPRINT(
"OHCI_RH_SetFeaturePortPower: OhciExtension - %p, Port - %x\n",
229 OhciExtension,
231
233
236
239
241
243}
Referenced by DriverEntry().
◆ OHCI_RH_SetFeaturePortReset()
Definition at line 189 of file roothub.c.
191{
196
197 OhciExtension = ohciExtension;
198
199 DPRINT(
"OHCI_RH_SetFeaturePortReset: OhciExtension - %p, Port - %x\n",
200 OhciExtension,
202
204
207
210
212
214}
Referenced by DriverEntry().
◆ OHCI_RH_SetFeaturePortSuspend()
Definition at line 276 of file roothub.c.
278{
283
284 OhciExtension = ohciExtension;
285
286 DPRINT(
"OHCI_RH_SetFeaturePortSuspend: OhciExtension - %p, Port - %x\n",
287 OhciExtension,
289
291
294
297
299
301}
Referenced by DriverEntry().
◆ OHCI_HW_TRANSFER_DESCRIPTOR
OHCI_HW_TRANSFER_DESCRIPTOR |
◆ POHCI_HW_TRANSFER_DESCRIPTOR
* POHCI_HW_TRANSFER_DESCRIPTOR |
◆ RegPacket