AppleUSBXHCI_IsocQueues.h [plain text]
#ifndef AppleUSBXHCI_AppleUSBXHCI_IsocQueues_h
#define AppleUSBXHCI_AppleUSBXHCI_IsocQueues_h
#include <libkern/c++/OSMetaClass.h>
#include <libkern/c++/OSObject.h>
#include <IOKit/usb/IOUSBCommand.h>
#include <IOKit/usb/IOUSBControllerListElement.h>
#include <IOKit/IODMACommand.h>
#include "XHCI.h"
enum
{
kMaxTransfersPerFrame = 8,
kIsocRingSizeinMS = 100,
kNumTDSlots = 128, kMaxFramesWithoutInterrupt = 8,
};
class AppleXHCIIsochEndpoint;
class AppleXHCIIsochTransferDescriptor : public IOUSBControllerIsochListElement
{
OSDeclareDefaultStructors(AppleXHCIIsochTransferDescriptor)
public:
IOUSBIsocCommand * command;
IOByteCount bufferOffset;
UInt32 trbIndex[kMaxTransfersPerFrame]; UInt32 numTRBs[kMaxTransfersPerFrame]; bool statusUpdated[kMaxTransfersPerFrame]; TRB eventTRB; bool newFrame; bool interruptThisTD;
static AppleXHCIIsochTransferDescriptor *ForEndpoint(AppleXHCIIsochEndpoint *endpoint);
virtual void SetPhysicalLink(IOPhysicalAddress next); virtual IOPhysicalAddress GetPhysicalLink(void); virtual IOPhysicalAddress GetPhysicalAddrWithType(void);
virtual IOReturn UpdateFrameList(AbsoluteTime timeStamp);
virtual IOReturn Deallocate(IOUSBControllerV2 *uim);
virtual void print(int level);
public:
int FrameForEventIndex(UInt32 eventIndex);
private:
IOReturn MungeXHCIIsochTDStatus(UInt32 status, UInt16 *transferLen, UInt32 maxPacketSize, UInt8 direction);
};
class AppleXHCIIsochEndpoint : public IOUSBControllerIsochEndpoint
{
OSDeclareDefaultStructors(AppleXHCIIsochEndpoint)
public:
virtual bool init();
virtual void free(void);
void print(int level);
AppleXHCIIsochTransferDescriptor * tdSlots[kNumTDSlots]; struct ringStruct * ring;
volatile AppleXHCIIsochTransferDescriptor * savedDoneQueueHead; volatile UInt32 producerCount; volatile UInt32 consumerCount; IOSimpleLock * wdhLock; UInt64 lastScheduledFrame; UInt8 maxBurst; UInt8 mult; UInt32 ringSizeInPages; UInt16 outSlot; UInt16 maxTRBs; UInt8 transactionsPerFrame; UInt8 msBetweenTDs; UInt8 xhciInterval; UInt8 speed; bool waitForRingToRunDry; volatile bool ringRunning; bool continuousStream; };
#endif