[USBEHCI_NEW]

- Move error checking if controller reported an error inside the door bell ring check block
- Extend interface of IUSBRequest to include DeviceAddress, which is needed to retrieve configuration descriptor of newly set address
- Allocate CtrlSetup from nonpaged pool
- Release setup packet on cleanup
- Devices now receive an device address
- Currently asserts while retrieving configuration descriptor as this code path is not yet existant
*** Assertion failed: Urb->UrbHeader.UsbdDeviceHandle == NULL
***   Source File: d:\usb-bringup\drivers\usb\usbehci_new\hub_controller.cpp, line 1118

svn path=/branches/usb-bringup/; revision=51477
This commit is contained in:
Johannes Anderwald 2011-04-28 16:40:07 +00:00
parent ede1d48da4
commit a3f701378c
4 changed files with 49 additions and 24 deletions

View file

@ -36,7 +36,7 @@ public:
}
// IUSBRequest interface functions
virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, IN OUT ULONG TransferBufferLength, IN OUT PMDL TransferBuffer);
virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, IN UCHAR DeviceAddress, IN OUT ULONG TransferBufferLength, IN OUT PMDL TransferBuffer);
virtual NTSTATUS InitializeWithIrp(IN PDMAMEMORYMANAGER DmaManager, IN OUT PIRP Irp);
virtual VOID CompletionCallback(IN NTSTATUS NtStatusCode, IN ULONG UrbStatusCode, IN struct _QUEUE_HEAD *QueueHead);
virtual VOID CancelCallback(IN NTSTATUS NtStatusCode, IN struct _QUEUE_HEAD *QueueHead);
@ -57,7 +57,7 @@ public:
NTSTATUS BuildBulkTransferQueueHead(PQUEUE_HEAD * OutHead);
NTSTATUS CreateDescriptor(PQUEUE_TRANSFER_DESCRIPTOR *OutDescriptor);
NTSTATUS CreateQueueHead(PQUEUE_HEAD *OutQueueHead);
ULONG GetDeviceAddress();
UCHAR GetDeviceAddress();
NTSTATUS BuildSetupPacket();
NTSTATUS BuildSetupPacketFromURB();
@ -98,6 +98,11 @@ protected:
//
PKEVENT m_CompletionEvent;
//
// device address for callers who initialized it with device address
//
UCHAR m_DeviceAddress;
//
// DMA queue head
//
@ -137,6 +142,7 @@ NTSTATUS
CUSBRequest::InitializeWithSetupPacket(
IN PDMAMEMORYMANAGER DmaManager,
IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
IN UCHAR DeviceAddress,
IN OUT ULONG TransferBufferLength,
IN OUT PMDL TransferBuffer)
{
@ -153,6 +159,7 @@ CUSBRequest::InitializeWithSetupPacket(
m_SetupPacket = SetupPacket;
m_TransferBufferLength = TransferBufferLength;
m_TransferBufferMDL = TransferBuffer;
m_DeviceAddress = DeviceAddress;
//
// allocate completion event
@ -796,7 +803,7 @@ CUSBRequest::CreateQueueHead(
}
//----------------------------------------------------------------------------------------
ULONG
UCHAR
CUSBRequest::GetDeviceAddress()
{
PIO_STACK_LOCATION IoStack;
@ -809,9 +816,9 @@ CUSBRequest::GetDeviceAddress()
if (!m_Irp)
{
//
// no irp is provided
// assume it is for device address 0
return 0;
// used provided address
//
return m_DeviceAddress;
}
//
@ -1158,6 +1165,14 @@ CUSBRequest::FreeQueueHead(
m_DmaManager->Release(m_TransferDescriptors[2], sizeof(QUEUE_TRANSFER_DESCRIPTOR));
m_TransferDescriptors[2] = 0;
}
if (m_DescriptorPacket)
{
//
// release packet descriptor
//
m_DmaManager->Release(m_DescriptorPacket, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET));
}
}
//-----------------------------------------------------------------------------------------