[USBEHCI_NEW]

- Check if the current request type is supported (currently only control is supported, bulk will be implemented soon)
- Fix bug in IUSBRequest::CreateQueueHead
- Code runs now until first device descriptor get request (async / periodic queue not yet enabled)
- mjmartin usbehci status not yet reached
- Let the fun now begin ;)

svn path=/branches/usb-bringup/; revision=51474
This commit is contained in:
Johannes Anderwald 2011-04-28 13:13:13 +00:00
parent ede324a063
commit 8df637b778
3 changed files with 75 additions and 4 deletions

View file

@ -550,7 +550,6 @@ CUSBDevice::CommitSetupPacket(
return Status;
}
//
// now add the request
//

View file

@ -157,20 +157,82 @@ CUSBQueue::AddUSBRequest(
IUSBRequest * Request)
{
PQUEUE_HEAD QueueHead;
NTSTATUS Status;
ULONG Type;
//
// sanity check
//
ASSERT(Request != NULL);
Request->GetQueueHead(&QueueHead);
//
// get request type
//
Type = Request->GetTransferType();
//
// Add it to the pending list
// check if supported
//
LinkQueueHead(PendingListQueueHead, QueueHead);
switch(Type)
{
case USB_ENDPOINT_TYPE_ISOCHRONOUS:
case USB_ENDPOINT_TYPE_INTERRUPT:
/* NOT IMPLEMENTED IN QUEUE */
Status = STATUS_NOT_SUPPORTED;
break;
case USB_ENDPOINT_TYPE_BULK:
case USB_ENDPOINT_TYPE_CONTROL:
Status = STATUS_SUCCESS;
break;
default:
/* BUG */
PC_ASSERT(FALSE);
}
//
// check for success
//
if (!NT_SUCCESS(Status))
{
//
// request not supported, please try later
//
return Status;
}
if (Type == USB_ENDPOINT_TYPE_BULK || Type == USB_ENDPOINT_TYPE_CONTROL)
{
//
// get queue head
//
Status = Request->GetQueueHead(&QueueHead);
//
// check for success
//
if (!NT_SUCCESS(Status))
{
//
// failed to get queue head
//
return Status;
}
DPRINT1("Request %p QueueHead %p inserted into AsyncQueue\n", Request, QueueHead);
//
// Add it to the pending list
//
LinkQueueHead(PendingListQueueHead, QueueHead);
}
//
// add extra reference which is released when the request is completed
//
Request->AddRef();
return STATUS_SUCCESS;
}

View file

@ -538,6 +538,11 @@ CUSBRequest::BuildControlTransferQueueHead(
return STATUS_INSUFFICIENT_RESOURCES;
}
//
// sanity check
//
PC_ASSERT(QueueHead);
//
// create setup packet
//
@ -773,6 +778,11 @@ CUSBRequest::CreateQueueHead(
//
QueueHead->PhysicalAddr = QueueHeadPhysicalAddress.LowPart;
//
// output queue head
//
*OutQueueHead = QueueHead;
//
// done
//