[USBEHCI_NEW]

- Return the physical address of the async queue head in CUSBHardwareDevice::GetAsyncListRegister
- Remove superflous entries from queue head structure, they are processed within IUSBRequest class
- Remove USBHI_GetPortHackFlags, this function has been deprecated
- Add interface functions for IUSBRequest / IUSBQueue
- Callback into IUSBQueue when a hardware interrupt arrives
- Implement callback function to check for completed queue heads / free completed queue head depending on the Async Advance interrupt bit

svn path=/branches/usb-bringup/; revision=51466
This commit is contained in:
Johannes Anderwald 2011-04-27 16:23:42 +00:00
parent 346a95197f
commit 591cffee7c
6 changed files with 386 additions and 55 deletions

View file

@ -47,6 +47,9 @@ public:
virtual BOOLEAN IsRequestInitialized();
virtual BOOLEAN ShouldReleaseRequestAfterCompletion();
virtual VOID FreeQueueHead(struct _QUEUE_HEAD * QueueHead);
virtual VOID GetTransferBuffer(OUT PMDL * OutMDL, OUT PULONG TransferLength);
virtual BOOLEAN IsQueueHeadComplete(struct _QUEUE_HEAD * QueueHead);
// local functions
ULONG InternalGetTransferType();
@ -640,12 +643,6 @@ CUSBRequest::BuildControlTransferQueueHead(
m_TransferDescriptors[1]->Token.Bits.InterruptOnComplete = TRUE;
}
//
// Control Transfers have only one in or out buffer if one at all. Put in the QueueHead the
// same as BulkTransfers. USBQueue will use the Mdl to fill in the BufferPointers
//
QueueHead->Mdl = m_TransferBufferMDL;
//
// link setup packet into buffer - Physical Address!!!
//
@ -1149,6 +1146,64 @@ CUSBRequest::FreeQueueHead(
}
}
//-----------------------------------------------------------------------------------------
BOOLEAN
CUSBRequest::IsQueueHeadComplete(
struct _QUEUE_HEAD * QueueHead)
{
ULONG Index;
//
// first check - is the queue head currently active
//
if (QueueHead->Token.Bits.Active)
{
//
// queue head is active (currently processed)
//
return FALSE;
}
//
// FIXME: support chained queue heads
//
for(Index = 0; Index < 3; Index++)
{
//
// check transfer descriptors for completion
//
if (m_TransferDescriptors[Index])
{
//
// check for serious error
//
PC_ASSERT(m_TransferDescriptors[Index]->Token.Bits.Halted == 0);
//
// the transfer descriptor should be in the same state as the queue head
//
PC_ASSERT(m_TransferDescriptors[Index]->Token.Bits.Active == 0);
}
}
return TRUE;
}
//-----------------------------------------------------------------------------------------
VOID
CUSBRequest::GetTransferBuffer(
OUT PMDL * OutMDL,
OUT PULONG TransferLength)
{
// sanity checks
PC_ASSERT(OutMDL);
PC_ASSERT(TransferLength);
*OutMDL = m_TransferBufferMDL;
*TransferLength = m_TransferBufferLength;
}
//-----------------------------------------------------------------------------------------
NTSTATUS
InternalCreateUSBRequest(
PUSBREQUEST *OutRequest)