[USBEHCI]

- Rewrite the transfer descriptor handling
- Take into account the direction of the pid
- Revert previously added hacks 
- Support now more than one transfer descriptor for control transfers
- Include the bulk transfers in one queue head which should speed up operation
- Store data toggle in usb endpoint structure
- Mass storage devices now passes the control status phase on real hw and enters bulk operation stage

svn path=/branches/usb-bringup-trunk/; revision=55489
This commit is contained in:
Johannes Anderwald 2012-02-07 21:48:05 +00:00
parent 4009376a99
commit 133cb2712c
7 changed files with 463 additions and 450 deletions

View file

@ -1339,6 +1339,7 @@ EhciDefferedRoutine(
// controller reported error
//
DPRINT1("CStatus %x\n", CStatus);
ASSERT(FALSE);
}
//

View file

@ -148,7 +148,7 @@ typedef struct _QUEUE_TRANSFER_DESCRIPTOR
//Software
ULONG PhysicalAddr;
LIST_ENTRY LinkedDescriptors;
LIST_ENTRY DescriptorEntry;
ULONG TotalBytesToTransfer;
} QUEUE_TRANSFER_DESCRIPTOR, *PQUEUE_TRANSFER_DESCRIPTOR;
@ -216,6 +216,7 @@ typedef struct _QUEUE_HEAD
//Software
ULONG PhysicalAddr;
LIST_ENTRY LinkedQueueHeads;
LIST_ENTRY TransferDescriptorListHead;
PVOID Request;
} QUEUE_HEAD, *PQUEUE_HEAD;
@ -292,3 +293,4 @@ typedef struct
ULONG PortChange;
}EHCI_PORT_STATUS;

View file

@ -379,6 +379,7 @@ typedef IDMAMemoryManager *PDMAMEMORYMANAGER;
//
struct _QUEUE_HEAD;
struct _USB_ENDPOINT;
DECLARE_INTERFACE_(IUSBRequest, IUnknown)
{
@ -395,7 +396,7 @@ DECLARE_INTERFACE_(IUSBRequest, IUnknown)
virtual NTSTATUS InitializeWithSetupPacket(IN PDMAMEMORYMANAGER DmaManager,
IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
IN UCHAR DeviceAddress,
IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor,
IN OPTIONAL struct _USB_ENDPOINT *EndpointDescriptor,
IN OUT ULONG TransferBufferLength,
IN OUT PMDL TransferBuffer) = 0;

View file

@ -11,24 +11,6 @@
#define INITGUID
#include "usbehci.h"
typedef struct _USB_ENDPOINT
{
USB_ENDPOINT_DESCRIPTOR EndPointDescriptor;
} USB_ENDPOINT, *PUSB_ENDPOINT;
typedef struct _USB_INTERFACE
{
USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
USB_ENDPOINT *EndPoints;
} USB_INTERFACE, *PUSB_INTERFACE;
typedef struct _USB_CONFIGURATION
{
USB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
USB_INTERFACE *Interfaces;
} USB_CONFIGURATION, *PUSB_CONFIGURATION;
class CUSBDevice : public IUSBDevice
{
public:
@ -73,7 +55,7 @@ public:
// local function
virtual NTSTATUS CommitIrp(PIRP Irp);
virtual NTSTATUS CommitSetupPacket(PUSB_DEFAULT_PIPE_SETUP_PACKET Packet, IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor, IN ULONG BufferLength, IN OUT PMDL Mdl);
virtual NTSTATUS CommitSetupPacket(PUSB_DEFAULT_PIPE_SETUP_PACKET Packet, IN OPTIONAL PUSB_ENDPOINT EndpointDescriptor, IN ULONG BufferLength, IN OUT PMDL Mdl);
virtual NTSTATUS CreateConfigurationDescriptor(ULONG ConfigurationIndex);
virtual NTSTATUS CreateDeviceDescriptor();
virtual VOID DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor);
@ -537,7 +519,7 @@ CUSBDevice::SubmitIrp(
NTSTATUS
CUSBDevice::CommitSetupPacket(
IN PUSB_DEFAULT_PIPE_SETUP_PACKET Packet,
IN OPTIONAL PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor,
IN OPTIONAL PUSB_ENDPOINT EndpointDescriptor,
IN ULONG BufferLength,
IN OUT PMDL Mdl)
{

View file

@ -499,11 +499,6 @@ CUSBQueue::UnlinkQueueHead(
// remove software link
//
RemoveEntryList(&QueueHead->LinkedQueueHeads);
//
// FIXME: clear failure
//
QueueHead->Token.Bits.Halted = FALSE;
}
//

File diff suppressed because it is too large Load diff

View file

@ -39,6 +39,28 @@
#define C_PORT_OVER_CURRENT 19
#define C_PORT_RESET 20
typedef struct _USB_ENDPOINT
{
USB_ENDPOINT_DESCRIPTOR EndPointDescriptor;
UCHAR HubAddress;
UCHAR HubPort;
UCHAR DataToggle;
} USB_ENDPOINT, *PUSB_ENDPOINT;
typedef struct _USB_INTERFACE
{
USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
USB_ENDPOINT *EndPoints;
} USB_INTERFACE, *PUSB_INTERFACE;
typedef struct _USB_CONFIGURATION
{
USB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
USB_INTERFACE *Interfaces;
} USB_CONFIGURATION, *PUSB_CONFIGURATION;
typedef struct
{
BOOLEAN IsFDO; // is device a FDO or PDO