Skip to content
This repository was archived by the owner on Dec 17, 2017. It is now read-only.

[USBOHCI_NEW] Bring-in the USB OHCI miniport driver created by Vadim Galyant.#30

Open
AmineKhaldi wants to merge 196 commits intoreactos:usbohci_newfrom
vgalnt:usbohci_new
Open

[USBOHCI_NEW] Bring-in the USB OHCI miniport driver created by Vadim Galyant.#30
AmineKhaldi wants to merge 196 commits intoreactos:usbohci_newfrom
vgalnt:usbohci_new

Conversation

@AmineKhaldi
Copy link
Copy Markdown
Member

No description provided.

@AmineKhaldi AmineKhaldi changed the base branch from usbohci_new to master July 1, 2017 11:48
@AmineKhaldi AmineKhaldi changed the base branch from master to usbohci_new July 1, 2017 11:48
// &OperationalRegs->HcRhPortStatus[Port-1].AsULONG);

if ( portStatus && !(portStatus & 0xFFE0FCE0) )
break;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is status 0xFFE0FCE0 ?

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
2);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a constant for this

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
4);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a constant for this

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
1);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use a constant for this

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
0x200);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use a constant for this

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
8);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use a constant for this

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
0x20000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use a constant for this

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
0x10000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use a constant for this

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
0x100000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use a constant for this

OperationalRegs = OhciExtension->OperationalRegs;

WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
0x40000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use a constant for this

if (Port)
{
WRITE_REGISTER_ULONG(&OperationalRegs->HcRhPortStatus[Port-1].AsULONG,
0x80000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constant

else
{
WRITE_REGISTER_ULONG(&OperationalRegs->HcRhStatus.AsULONG,
0x20000);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constant

DPRINT("OHCI_RH_DisableIrq: OhciExtension - %p\n", OhciExtension);

WRITE_REGISTER_ULONG(&OhciExtension->OperationalRegs->HcInterruptDisable.AsULONG,
0x40);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constant

DPRINT("OHCI_RH_EnableIrq: OhciExtension - %p\n", OhciExtension);

WRITE_REGISTER_ULONG(&OhciExtension->OperationalRegs->HcInterruptEnable.AsULONG,
0x40);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constant

{
InsertHeadList(HeadLink, &ED->HcdEDLink);

if (HeadED->Type & 0x20) // ControlTransfer or BulkTransfer
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constant

DPRINT_OHCI("OHCI_QueryEndpointRequirements: IsoTransfer\n");
*((PULONG)EndpointRequirements + 1) = 0x10000;
*EndpointRequirements = sizeof(OHCI_HCD_ED) +
0x40 * sizeof(OHCI_HCD_TD);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

DPRINT_OHCI("OHCI_QueryEndpointRequirements: ControlTransfer\n");
*((PULONG)EndpointRequirements + 1) = 0x10000;
*EndpointRequirements = sizeof(OHCI_HCD_ED) +
0x26 * sizeof(OHCI_HCD_TD);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

NTAPI
OHCI_SubmitTransfer(IN PVOID ohciExtension,
IN PVOID ohciEndpoint,
IN PVOID transferParameters,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this the first time around: should this always be PUSBPORT_TRANSFER_PARAMETERS?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

IN PVOID ohciEndpoint,
IN PVOID transferParameters,
IN PVOID ohciTransfer,
IN PVOID sgList)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and this PUSBPORT_SCATTER_GATHER_LIST?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

NTAPI
OHCI_SubmitIsoTransfer(IN PVOID ohciExtension,
IN PVOID ohciEndpoint,
IN PVOID transferParameters,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and the same here for SubmitIsoTransfer?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

OhciExtension,
Port);

ASSERT(Port >= 0);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue here got fixed by moving the StatusReg assignment inside each if block. The assert is not needed (and is a tautology since USHORT is always >= 0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, deleted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants