ReactOS 0.4.16-dev-250-g3ecd236
usbohci.h File Reference
#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"
Include dependency graph for usbohci.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _OHCI_HCD_TD
 
struct  _OHCI_HCD_ED
 
struct  _OHCI_STATIC_ED
 
struct  _OHCI_HC_RESOURCES
 
struct  _OHCI_ENDPOINT
 
struct  _OHCI_TRANSFER
 
struct  _OHCI_EXTENSION
 

Macros

#define OHCI_HCD_ED_FLAG_CONTROL   0x00000001
 
#define OHCI_HCD_ED_FLAG_RESET_ON_HALT   0x00000008
 
#define OHCI_HCD_ED_FLAG_NOT_ACCESSED   0x00000010
 
#define OHCI_HCD_TD_FLAG_ALLOCATED   0x00000001
 
#define OHCI_HCD_TD_FLAG_PROCESSED   0x00000002
 
#define OHCI_HCD_TD_FLAG_CONTROL_STATUS   0x00000004
 
#define OHCI_HCD_TD_FLAG_DONE   0x00000008
 
#define OHCI_HCD_TD_FLAG_NOT_ACCESSED   0x00000010
 
#define OHCI_MAX_ISO_TRANSFER_SIZE   0x10000
 
#define OHCI_MAX_CONTROL_TRANSFER_SIZE   0x10000
 
#define OHCI_MAX_BULK_TRANSFER_SIZE   0x40000
 
#define OHCI_MAX_INTERRUPT_TRANSFER_SIZE   0x1000
 
#define OHCI_MAX_ISO_TD_COUNT   64
 
#define OHCI_MAX_CONTROL_TD_COUNT   38
 
#define OHCI_MAX_BULK_TD_COUNT   68
 
#define OHCI_MAX_INTERRUPT_TD_COUNT   4
 
#define OHCI_NON_DATA_CONTROL_TDS   2
 
#define OHCI_TRANSFER_FLAGS_SHORT_TRANSFER_OK   1
 
#define OHCI_STATIC_ED_TYPE_INTERRUPT   0
 
#define OHCI_STATIC_ED_TYPE_CONTROL   1
 
#define OHCI_STATIC_ED_TYPE_BULK   2
 

Typedefs

typedef struct _OHCI_TRANSFERPOHCI_TRANSFER
 
typedef struct _OHCI_HCD_TD OHCI_HCD_TD
 
typedef struct _OHCI_HCD_TDPOHCI_HCD_TD
 
typedef struct _OHCI_HCD_ED OHCI_HCD_ED
 
typedef struct _OHCI_HCD_EDPOHCI_HCD_ED
 
typedef struct _OHCI_STATIC_ED OHCI_STATIC_ED
 
typedef struct _OHCI_STATIC_EDPOHCI_STATIC_ED
 
typedef struct _OHCI_HC_RESOURCES OHCI_HC_RESOURCES
 
typedef struct _OHCI_HC_RESOURCESPOHCI_HC_RESOURCES
 
typedef struct _OHCI_ENDPOINT OHCI_ENDPOINT
 
typedef struct _OHCI_ENDPOINTPOHCI_ENDPOINT
 
typedef struct _OHCI_TRANSFER OHCI_TRANSFER
 
typedef struct _OHCI_EXTENSION OHCI_EXTENSION
 
typedef struct _OHCI_EXTENSIONPOHCI_EXTENSION
 

Functions

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)
 

Variables

USBPORT_REGISTRATION_PACKET RegPacket
 
 OHCI_HW_TRANSFER_DESCRIPTOR
 
POHCI_HW_TRANSFER_DESCRIPTOR
 

Macro Definition Documentation

◆ OHCI_HCD_ED_FLAG_CONTROL

#define OHCI_HCD_ED_FLAG_CONTROL   0x00000001

Definition at line 22 of file usbohci.h.

◆ OHCI_HCD_ED_FLAG_NOT_ACCESSED

#define OHCI_HCD_ED_FLAG_NOT_ACCESSED   0x00000010

Definition at line 24 of file usbohci.h.

◆ OHCI_HCD_ED_FLAG_RESET_ON_HALT

#define OHCI_HCD_ED_FLAG_RESET_ON_HALT   0x00000008

Definition at line 23 of file usbohci.h.

◆ OHCI_HCD_TD_FLAG_ALLOCATED

#define OHCI_HCD_TD_FLAG_ALLOCATED   0x00000001

Definition at line 26 of file usbohci.h.

◆ OHCI_HCD_TD_FLAG_CONTROL_STATUS

#define OHCI_HCD_TD_FLAG_CONTROL_STATUS   0x00000004

Definition at line 28 of file usbohci.h.

◆ OHCI_HCD_TD_FLAG_DONE

#define OHCI_HCD_TD_FLAG_DONE   0x00000008

Definition at line 29 of file usbohci.h.

◆ OHCI_HCD_TD_FLAG_NOT_ACCESSED

#define OHCI_HCD_TD_FLAG_NOT_ACCESSED   0x00000010

Definition at line 30 of file usbohci.h.

◆ OHCI_HCD_TD_FLAG_PROCESSED

#define OHCI_HCD_TD_FLAG_PROCESSED   0x00000002

Definition at line 27 of file usbohci.h.

◆ OHCI_MAX_BULK_TD_COUNT

#define OHCI_MAX_BULK_TD_COUNT   68

Definition at line 39 of file usbohci.h.

◆ OHCI_MAX_BULK_TRANSFER_SIZE

#define OHCI_MAX_BULK_TRANSFER_SIZE   0x40000

Definition at line 34 of file usbohci.h.

◆ OHCI_MAX_CONTROL_TD_COUNT

#define OHCI_MAX_CONTROL_TD_COUNT   38

Definition at line 38 of file usbohci.h.

◆ OHCI_MAX_CONTROL_TRANSFER_SIZE

#define OHCI_MAX_CONTROL_TRANSFER_SIZE   0x10000

Definition at line 33 of file usbohci.h.

◆ OHCI_MAX_INTERRUPT_TD_COUNT

#define OHCI_MAX_INTERRUPT_TD_COUNT   4

Definition at line 40 of file usbohci.h.

◆ OHCI_MAX_INTERRUPT_TRANSFER_SIZE

#define OHCI_MAX_INTERRUPT_TRANSFER_SIZE   0x1000

Definition at line 35 of file usbohci.h.

◆ OHCI_MAX_ISO_TD_COUNT

#define OHCI_MAX_ISO_TD_COUNT   64

Definition at line 37 of file usbohci.h.

◆ OHCI_MAX_ISO_TRANSFER_SIZE

#define OHCI_MAX_ISO_TRANSFER_SIZE   0x10000

Definition at line 32 of file usbohci.h.

◆ OHCI_NON_DATA_CONTROL_TDS

#define OHCI_NON_DATA_CONTROL_TDS   2

Definition at line 42 of file usbohci.h.

◆ OHCI_STATIC_ED_TYPE_BULK

#define OHCI_STATIC_ED_TYPE_BULK   2

Definition at line 99 of file usbohci.h.

◆ OHCI_STATIC_ED_TYPE_CONTROL

#define OHCI_STATIC_ED_TYPE_CONTROL   1

Definition at line 98 of file usbohci.h.

◆ OHCI_STATIC_ED_TYPE_INTERRUPT

#define OHCI_STATIC_ED_TYPE_INTERRUPT   0

Definition at line 97 of file usbohci.h.

◆ OHCI_TRANSFER_FLAGS_SHORT_TRANSFER_OK

#define OHCI_TRANSFER_FLAGS_SHORT_TRANSFER_OK   1

Definition at line 44 of file usbohci.h.

Typedef Documentation

◆ 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

Definition at line 46 of file usbohci.h.

Function Documentation

◆ C_ASSERT() [1/4]

C_ASSERT ( __alignof(OHCI_HW_TRANSFER_DESCRIPTOR = =32)

◆ C_ASSERT() [2/4]

C_ASSERT ( sizeof(OHCI_HCD_ED = =64)

◆ C_ASSERT() [3/4]

C_ASSERT ( sizeof(OHCI_HCD_TD = =64)

◆ C_ASSERT() [4/4]

C_ASSERT ( sizeof(OHCI_HW_TRANSFER_DESCRIPTOR = =32)

◆ DECLSPEC_ALIGN()

union DECLSPEC_ALIGN ( 32  )

Definition at line 46 of file usbohci.h.

48 {
49 struct {
50 OHCI_TRANSFER_DESCRIPTOR gTD; // must be aligned to a 16-byte boundary
52 ULONG Padded[2];
53 };
54 struct {
55 OHCI_ISO_TRANSFER_DESCRIPTOR iTD; // must be aligned to a 32-byte boundary
56 };
uint32_t ULONG
Definition: typedefs.h:59
* POHCI_HW_TRANSFER_DESCRIPTOR
Definition: usbohci.h:57
OHCI_HW_TRANSFER_DESCRIPTOR
Definition: usbohci.h:57
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET SetupPacket
Definition: wdfusb.h:1337

◆ OHCI_ReadRhDescriptorA()

OHCI_REG_RH_DESCRIPTORA NTAPI OHCI_ReadRhDescriptorA ( IN POHCI_EXTENSION  OhciExtension)

Definition at line 15 of file roothub.c.

16{
17 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
18 OHCI_REG_RH_DESCRIPTORA DescriptorA;
19 PULONG DescriptorAReg;
20 ULONG ix;
21
22 OperationalRegs = OhciExtension->OperationalRegs;
23 DescriptorAReg = (PULONG)&OperationalRegs->HcRhDescriptorA;
24
25 DPRINT("OHCI_ReadRhDescriptorA: OhciExtension - %p\n", OhciExtension);
26
27 for (ix = 0; ix < 10; ix++)
28 {
29 DescriptorA.AsULONG = READ_REGISTER_ULONG(DescriptorAReg);
30
31 if (DescriptorA.AsULONG != 0 &&
32 DescriptorA.Reserved == 0 &&
34 {
35 break;
36 }
37
38 DPRINT1("OHCI_ReadRhDescriptorA: DescriptorA - %lX, ix - %d\n",
39 DescriptorA.AsULONG, ix);
40
42 }
43
44 return DescriptorA;
45}
#define READ_REGISTER_ULONG(r)
Definition: arm.h:26
#define DPRINT1
Definition: precomp.h:8
#define OHCI_MAX_PORT_COUNT
Definition: hardware.h:9
#define KeStallExecutionProcessor(MicroSeconds)
Definition: precomp.h:27
#define DPRINT
Definition: sndvol32.h:73
OHCI_REG_RH_DESCRIPTORA HcRhDescriptorA
Definition: hardware.h:329
uint32_t * PULONG
Definition: typedefs.h:59

Referenced by OHCI_ResetController(), and OHCI_RH_GetRootHubData().

◆ OHCI_RH_ClearFeaturePortConnectChange()

MPSTATUS NTAPI OHCI_RH_ClearFeaturePortConnectChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 421 of file roothub.c.

423{
424 POHCI_EXTENSION OhciExtension;
425 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
426 PULONG PortStatusReg;
428
429 OhciExtension = ohciExtension;
430
431 DPRINT("OHCI_RH_ClearFeaturePortConnectChange: OhciExtension - %p, Port - %x\n",
432 OhciExtension,
433 Port);
434
435 ASSERT(Port > 0);
436
437 OperationalRegs = OhciExtension->OperationalRegs;
438 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
439
440 PortStatus.AsULONG = 0;
441 PortStatus.ConnectStatusChange = 1;
442
443 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
444
445 return MP_STATUS_SUCCESS;
446}
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:27
CPPORT Port[4]
Definition: headless.c:35
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
Definition: hubbusif.h:42
#define ASSERT(a)
Definition: mode.c:44
POHCI_OPERATIONAL_REGISTERS OperationalRegs
Definition: usbohci.h:149
OHCI_REG_RH_PORT_STATUS HcRhPortStatus[OHCI_MAX_PORT_COUNT]
Definition: hardware.h:332
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ OHCI_RH_ClearFeaturePortEnable()

MPSTATUS NTAPI OHCI_RH_ClearFeaturePortEnable ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 305 of file roothub.c.

307{
308 POHCI_EXTENSION OhciExtension;
309 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
310 PULONG PortStatusReg;
312
313 OhciExtension = ohciExtension;
314
315 DPRINT("OHCI_RH_ClearFeaturePortEnable: OhciExtension - %p, Port - %x\n",
316 OhciExtension,
317 Port);
318
319 ASSERT(Port > 0);
320
321 OperationalRegs = OhciExtension->OperationalRegs;
322 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
323
324 PortStatus.AsULONG = 0;
325 PortStatus.ClearPortEnable = 1;
326
327 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
328
329 return MP_STATUS_SUCCESS;
330}

Referenced by DriverEntry().

◆ OHCI_RH_ClearFeaturePortEnableChange()

MPSTATUS NTAPI OHCI_RH_ClearFeaturePortEnableChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 392 of file roothub.c.

394{
395 POHCI_EXTENSION OhciExtension;
396 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
397 PULONG PortStatusReg;
399
400 OhciExtension = ohciExtension;
401
402 DPRINT("OHCI_RH_ClearFeaturePortEnableChange: ohciExtension - %p, Port - %x\n",
403 ohciExtension,
404 Port);
405
406 ASSERT(Port > 0);
407
408 OperationalRegs = OhciExtension->OperationalRegs;
409 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
410
411 PortStatus.AsULONG = 0;
412 PortStatus.PortEnableStatusChange = 1;
413
414 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
415
416 return MP_STATUS_SUCCESS;
417}

Referenced by DriverEntry().

◆ OHCI_RH_ClearFeaturePortOvercurrentChange()

MPSTATUS NTAPI OHCI_RH_ClearFeaturePortOvercurrentChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 508 of file roothub.c.

510{
511 POHCI_EXTENSION OhciExtension;
512 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
513 PULONG PortStatusReg;
514 PULONG RhStatusReg;
516 OHCI_REG_RH_STATUS RhStatus;
517
518 OhciExtension = ohciExtension;
519
520 DPRINT("OHCI_RH_ClearFeaturePortOvercurrentChange: OhciExtension - %p, Port - %x\n",
521 OhciExtension,
522 Port);
523
524 OperationalRegs = OhciExtension->OperationalRegs;
525
526 if (Port)
527 {
528 /* USBPORT_RECIPIENT_PORT */
529 PortStatus.AsULONG = 0;
530 PortStatus.PortOverCurrentIndicatorChange = 1;
531
532 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
533 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
534 }
535 else
536 {
537 /* USBPORT_RECIPIENT_HUB */
538 RhStatus.AsULONG = 0;
539 RhStatus.OverCurrentIndicatorChangeW = 1;
540
541 RhStatusReg = (PULONG)&OperationalRegs->HcRhStatus;
542 WRITE_REGISTER_ULONG(RhStatusReg, RhStatus.AsULONG);
543 }
544
545 return MP_STATUS_SUCCESS;
546}
OHCI_REG_RH_STATUS HcRhStatus
Definition: hardware.h:331
ULONG OverCurrentIndicatorChangeW
Definition: hardware.h:262

Referenced by DriverEntry().

◆ OHCI_RH_ClearFeaturePortPower()

MPSTATUS NTAPI OHCI_RH_ClearFeaturePortPower ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 334 of file roothub.c.

336{
337 POHCI_EXTENSION OhciExtension;
338 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
339 PULONG PortStatusReg;
341
342 OhciExtension = ohciExtension;
343
344 DPRINT("OHCI_RH_ClearFeaturePortPower: OhciExtension - %p, Port - %x\n",
345 OhciExtension,
346 Port);
347
348 ASSERT(Port > 0);
349
350 OperationalRegs = OhciExtension->OperationalRegs;
351 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
352
353 PortStatus.AsULONG = 0;
354 PortStatus.ClearPortPower = 1;
355
356 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
357
358 return MP_STATUS_SUCCESS;
359}

Referenced by DriverEntry().

◆ OHCI_RH_ClearFeaturePortResetChange()

MPSTATUS NTAPI OHCI_RH_ClearFeaturePortResetChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 450 of file roothub.c.

452{
453 POHCI_EXTENSION OhciExtension;
454 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
455 PULONG PortStatusReg;
457
458 OhciExtension = ohciExtension;
459
460 DPRINT("OHCI_RH_ClearFeaturePortResetChange: OhciExtension - %p, Port - %x\n",
461 OhciExtension,
462 Port);
463
464 ASSERT(Port > 0);
465
466 OperationalRegs = OhciExtension->OperationalRegs;
467 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
468
469 PortStatus.AsULONG = 0;
470 PortStatus.PortResetStatusChange = 1;
471
472 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
473
474 return MP_STATUS_SUCCESS;
475}

Referenced by DriverEntry().

◆ OHCI_RH_ClearFeaturePortSuspend()

MPSTATUS NTAPI OHCI_RH_ClearFeaturePortSuspend ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 363 of file roothub.c.

365{
366 POHCI_EXTENSION OhciExtension;
367 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
368 PULONG PortStatusReg;
370
371 OhciExtension = ohciExtension;
372
373 DPRINT("OHCI_RH_ClearFeaturePortSuspend: OhciExtension - %p, Port - %x\n",
374 OhciExtension,
375 Port);
376
377 ASSERT(Port > 0);
378
379 OperationalRegs = OhciExtension->OperationalRegs;
380 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
381
382 PortStatus.AsULONG = 0;
383 PortStatus.ClearSuspendStatus = 1;
384
385 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
386
387 return MP_STATUS_SUCCESS;
388}

Referenced by DriverEntry().

◆ OHCI_RH_ClearFeaturePortSuspendChange()

MPSTATUS NTAPI OHCI_RH_ClearFeaturePortSuspendChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 479 of file roothub.c.

481{
482 POHCI_EXTENSION OhciExtension;
483 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
484 PULONG PortStatusReg;
486
487 OhciExtension = ohciExtension;
488
489 DPRINT("OHCI_RH_ClearFeaturePortSuspendChange: OhciExtension - %p, Port - %x\n",
490 OhciExtension,
491 Port);
492
493 ASSERT(Port > 0);
494
495 OperationalRegs = OhciExtension->OperationalRegs;
496 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
497
498 PortStatus.AsULONG = 0;
499 PortStatus.PortSuspendStatusChange = 1;
500
501 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
502
503 return MP_STATUS_SUCCESS;
504}

Referenced by DriverEntry().

◆ OHCI_RH_DisableIrq()

VOID NTAPI OHCI_RH_DisableIrq ( IN PVOID  ohciExtension)

Definition at line 550 of file roothub.c.

551{
552 POHCI_EXTENSION OhciExtension = ohciExtension;
553 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
554 PULONG InterruptDisableReg;
555 OHCI_REG_INTERRUPT_ENABLE_DISABLE InterruptDisable;
556
557 DPRINT("OHCI_RH_DisableIrq: OhciExtension - %p\n", OhciExtension);
558
559 OperationalRegs = OhciExtension->OperationalRegs;
560 InterruptDisableReg = (PULONG)&OperationalRegs->HcInterruptDisable;
561
562 InterruptDisable.AsULONG = 0;
563 InterruptDisable.RootHubStatusChange = 1;
564
565 WRITE_REGISTER_ULONG(InterruptDisableReg, InterruptDisable.AsULONG);
566}
OHCI_REG_INTERRUPT_ENABLE_DISABLE HcInterruptDisable
Definition: hardware.h:316

Referenced by DriverEntry().

◆ OHCI_RH_EnableIrq()

VOID NTAPI OHCI_RH_EnableIrq ( IN PVOID  ohciExtension)

Definition at line 570 of file roothub.c.

571{
572 POHCI_EXTENSION OhciExtension = ohciExtension;
573 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
574 PULONG InterruptEnableReg;
575 OHCI_REG_INTERRUPT_ENABLE_DISABLE InterruptEnable;
576
577 DPRINT("OHCI_RH_EnableIrq: OhciExtension - %p\n", OhciExtension);
578
579 OperationalRegs = OhciExtension->OperationalRegs;
580 InterruptEnableReg = (PULONG)&OperationalRegs->HcInterruptEnable;
581
582 InterruptEnable.AsULONG = 0;
583 InterruptEnable.RootHubStatusChange = 1;
584
585 WRITE_REGISTER_ULONG(InterruptEnableReg, InterruptEnable.AsULONG);
586}
OHCI_REG_INTERRUPT_ENABLE_DISABLE HcInterruptEnable
Definition: hardware.h:315

Referenced by DriverEntry().

◆ OHCI_RH_GetHubStatus()

MPSTATUS NTAPI OHCI_RH_GetHubStatus ( IN PVOID  ohciExtension,
IN PUSB_HUB_STATUS_AND_CHANGE  HubStatus 
)

Definition at line 159 of file roothub.c.

161{
162 POHCI_EXTENSION OhciExtension;
163 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
164 PULONG RhStatusReg;
165 OHCI_REG_RH_STATUS HcRhStatus;
166
167 OhciExtension = ohciExtension;
168
169 DPRINT("OHCI_RH_GetHubStatus: ohciExtension - %p, HubStatus - %lX\n",
170 ohciExtension,
171 HubStatus->AsUlong32);
172
173 OperationalRegs = OhciExtension->OperationalRegs;
174 RhStatusReg = (PULONG)&OperationalRegs->HcRhStatus;
175
176 HcRhStatus.AsULONG = READ_REGISTER_ULONG(RhStatusReg);
177
178 HubStatus->HubStatus.LocalPowerLost = HcRhStatus.LocalPowerStatus;
179 HubStatus->HubChange.LocalPowerChange = HcRhStatus.LocalPowerStatusChange;
180
181 HubStatus->HubStatus.OverCurrent = HcRhStatus.OverCurrentIndicator;
182 HubStatus->HubChange.OverCurrentChange = HcRhStatus.OverCurrentIndicatorChangeR;
183
184 return MP_STATUS_SUCCESS;
185}
ULONG OverCurrentIndicatorChangeR
Definition: hardware.h:254
ULONG LocalPowerStatusChange
Definition: hardware.h:253
ULONG LocalPowerStatus
Definition: hardware.h:249
ULONG OverCurrentIndicator
Definition: hardware.h:250

Referenced by DriverEntry().

◆ OHCI_RH_GetPortStatus()

MPSTATUS NTAPI OHCI_RH_GetPortStatus ( IN PVOID  ohciExtension,
IN USHORT  Port,
IN PUSB_PORT_STATUS_AND_CHANGE  PortStatus 
)

Definition at line 113 of file roothub.c.

116{
117 POHCI_EXTENSION OhciExtension;
118 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
119 PULONG PortStatusReg;
120 OHCI_REG_RH_PORT_STATUS OhciPortStatus;
121 ULONG ix;
123
124 OhciExtension = ohciExtension;
125
126 DPRINT("OHCI_RH_GetPortStatus: OhciExtension - %p, Port - %x, PortStatus - %lX\n",
127 OhciExtension,
128 Port,
129 PortStatus->AsUlong32);
130
131 ASSERT(Port > 0);
132
133 OperationalRegs = OhciExtension->OperationalRegs;
134 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
135
136 for (ix = 0; ix < 10; ix++)
137 {
138 OhciPortStatus.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
139
140 Reserved = OhciPortStatus.Reserved1r |
141 OhciPortStatus.Reserved2r |
142 OhciPortStatus.Reserved3;
143
144 if (OhciPortStatus.AsULONG && !Reserved)
145 break;
146
147 DPRINT("OHCI_RH_GetPortStatus: OhciPortStatus - %X\n", OhciPortStatus.AsULONG);
148
150 }
151
152 PortStatus->AsUlong32 = OhciPortStatus.AsULONG;
153
154 return MP_STATUS_SUCCESS;
155}
#define for
Definition: utility.h:88
_Reserved_ PVOID Reserved
Definition: winddi.h:3974

Referenced by DriverEntry().

◆ OHCI_RH_GetRootHubData()

VOID NTAPI OHCI_RH_GetRootHubData ( IN PVOID  ohciExtension,
IN PVOID  rootHubData 
)

Definition at line 49 of file roothub.c.

51{
52 POHCI_EXTENSION OhciExtension;
53 PUSBPORT_ROOT_HUB_DATA RootHubData;
54 OHCI_REG_RH_DESCRIPTORA DescriptorA;
55 UCHAR PowerOnToPowerGoodTime;
56 USBPORT_HUB_11_CHARACTERISTICS HubCharacteristics;
57
58 OhciExtension = ohciExtension;
59
60 DPRINT("OHCI_RH_GetRootHubData: OhciExtension - %p, rootHubData - %p\n",
61 OhciExtension,
62 rootHubData);
63
64 RootHubData = rootHubData;
65 DescriptorA = OHCI_ReadRhDescriptorA(OhciExtension);
66
67 RootHubData->NumberOfPorts = DescriptorA.NumberDownstreamPorts;
68
69 /* Waiting time (in 2 ms intervals) */
70 PowerOnToPowerGoodTime = DescriptorA.PowerOnToPowerGoodTime;
71 if (PowerOnToPowerGoodTime <= OHCI_MINIMAL_POTPGT)
72 PowerOnToPowerGoodTime = OHCI_MINIMAL_POTPGT;
73 RootHubData->PowerOnToPowerGood = PowerOnToPowerGoodTime;
74
75 HubCharacteristics.AsUSHORT = 0;
76
77 if (DescriptorA.PowerSwitchingMode)
78 {
79 /* Individual port power switching */
80 HubCharacteristics.PowerControlMode = 1;
81 }
82 else
83 {
84 /* Ganged power switching */
85 HubCharacteristics.PowerControlMode = 0;
86 }
87
88 HubCharacteristics.NoPowerSwitching = 0;
89
90 /* always 0 (OHCI RH is not a compound device) */
91 ASSERT(DescriptorA.DeviceType == 0);
92 HubCharacteristics.PartOfCompoundDevice = DescriptorA.DeviceType;
93
94 HubCharacteristics.OverCurrentProtectionMode = DescriptorA.OverCurrentProtectionMode;
95 HubCharacteristics.NoOverCurrentProtection = DescriptorA.NoOverCurrentProtection;
96
97 RootHubData->HubCharacteristics.Usb11HubCharacteristics = HubCharacteristics;
98 RootHubData->HubControlCurrent = 0;
99}
#define OHCI_MINIMAL_POTPGT
Definition: hardware.h:13
USBPORT_HUB_CHARACTERISTICS HubCharacteristics
Definition: usbmport.h:697
USBPORT_HUB_11_CHARACTERISTICS Usb11HubCharacteristics
Definition: usbmport.h:688
OHCI_REG_RH_DESCRIPTORA NTAPI OHCI_ReadRhDescriptorA(IN POHCI_EXTENSION OhciExtension)
Definition: roothub.c:15
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by DriverEntry().

◆ OHCI_RH_GetStatus()

MPSTATUS NTAPI OHCI_RH_GetStatus ( IN PVOID  ohciExtension,
IN PUSHORT  Status 
)

Definition at line 103 of file roothub.c.

105{
106 DPRINT("OHCI_RH_GetStatus: \n");
108 return MP_STATUS_SUCCESS;
109}
Status
Definition: gdiplustypes.h:25
#define USB_GETSTATUS_SELF_POWERED
Definition: usb100.h:45

Referenced by DriverEntry().

◆ OHCI_RH_SetFeaturePortEnable()

MPSTATUS NTAPI OHCI_RH_SetFeaturePortEnable ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 247 of file roothub.c.

249{
250 POHCI_EXTENSION OhciExtension;
251 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
252 PULONG PortStatusReg;
254
255 OhciExtension = ohciExtension;
256
257 DPRINT("OHCI_RH_SetFeaturePortEnable: OhciExtension - %p, Port - %x\n",
258 OhciExtension,
259 Port);
260
261 ASSERT(Port > 0);
262
263 OperationalRegs = OhciExtension->OperationalRegs;
264 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
265
266 PortStatus.AsULONG = 0;
267 PortStatus.SetPortEnable = 1;
268
269 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
270
271 return MP_STATUS_SUCCESS;
272}

Referenced by DriverEntry().

◆ OHCI_RH_SetFeaturePortPower()

MPSTATUS NTAPI OHCI_RH_SetFeaturePortPower ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 218 of file roothub.c.

220{
221 POHCI_EXTENSION OhciExtension;
222 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
223 PULONG PortStatusReg;
225
226 OhciExtension = ohciExtension;
227
228 DPRINT("OHCI_RH_SetFeaturePortPower: OhciExtension - %p, Port - %x\n",
229 OhciExtension,
230 Port);
231
232 ASSERT(Port > 0);
233
234 OperationalRegs = OhciExtension->OperationalRegs;
235 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
236
237 PortStatus.AsULONG = 0;
238 PortStatus.SetPortPower = 1;
239
240 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
241
242 return MP_STATUS_SUCCESS;
243}

Referenced by DriverEntry().

◆ OHCI_RH_SetFeaturePortReset()

MPSTATUS NTAPI OHCI_RH_SetFeaturePortReset ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 189 of file roothub.c.

191{
192 POHCI_EXTENSION OhciExtension;
193 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
194 PULONG PortStatusReg;
196
197 OhciExtension = ohciExtension;
198
199 DPRINT("OHCI_RH_SetFeaturePortReset: OhciExtension - %p, Port - %x\n",
200 OhciExtension,
201 Port);
202
203 ASSERT(Port > 0);
204
205 OperationalRegs = OhciExtension->OperationalRegs;
206 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
207
208 PortStatus.AsULONG = 0;
209 PortStatus.SetPortReset = 1;
210
211 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
212
213 return MP_STATUS_SUCCESS;
214}

Referenced by DriverEntry().

◆ OHCI_RH_SetFeaturePortSuspend()

MPSTATUS NTAPI OHCI_RH_SetFeaturePortSuspend ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 276 of file roothub.c.

278{
279 POHCI_EXTENSION OhciExtension;
280 POHCI_OPERATIONAL_REGISTERS OperationalRegs;
281 PULONG PortStatusReg;
283
284 OhciExtension = ohciExtension;
285
286 DPRINT("OHCI_RH_SetFeaturePortSuspend: OhciExtension - %p, Port - %x\n",
287 OhciExtension,
288 Port);
289
290 ASSERT(Port > 0);
291
292 OperationalRegs = OhciExtension->OperationalRegs;
293 PortStatusReg = (PULONG)&OperationalRegs->HcRhPortStatus[Port-1];
294
295 PortStatus.AsULONG = 0;
296 PortStatus.SetPortSuspend = 1;
297
298 WRITE_REGISTER_ULONG(PortStatusReg, PortStatus.AsULONG);
299
300 return MP_STATUS_SUCCESS;
301}

Referenced by DriverEntry().

Variable Documentation

◆ OHCI_HW_TRANSFER_DESCRIPTOR

OHCI_HW_TRANSFER_DESCRIPTOR

Definition at line 57 of file usbohci.h.

◆ POHCI_HW_TRANSFER_DESCRIPTOR

* POHCI_HW_TRANSFER_DESCRIPTOR

Definition at line 57 of file usbohci.h.

◆ RegPacket

USBPORT_REGISTRATION_PACKET RegPacket
extern

Definition at line 16 of file usbehci.c.