IOFWDCLTranslator.h [plain text]
#ifndef _IOKIT_IOFWDCLTRANSLATOR_H
#define _IOKIT_IOFWDCLTRANSLATOR_H
#include <libkern/c++/OSObject.h>
#include <IOKit/firewire/IOFWDCLProgram.h>
class IODCLTranslator : public IODCLProgram
{
OSDeclareAbstractStructors(IODCLTranslator)
protected:
enum
{
kNumPingPongs = 2,
kNumPacketsPerPingPong = 500,
kMaxIsochPacketSize = 1000,
kPingPongBufferSize =
kNumPingPongs * kNumPacketsPerPingPong * kMaxIsochPacketSize
};
DCLLabel fStartLabel;
DCLTransferPacket fTransfers[kNumPingPongs*kNumPacketsPerPingPong];
DCLCallProc fCalls[kNumPingPongs];
DCLJump fJumpToStart;
UInt8 fBuffer[kPingPongBufferSize];
IODCLProgram * fHWProgram; DCLCommandPtr fToInterpret; DCLCommandPtr fCurrentDCLCommand; int fPingCount;
UInt32 fPacketHeader;
static void ListeningDCLPingPongProc(DCLCommandPtr pDCLCommand);
static void TalkingDCLPingPongProc(DCLCommandPtr pDCLCommand);
public:
virtual bool init(DCLCommandPtr toInterpret);
virtual IOReturn allocateHW(IOFWSpeed speed, UInt32 chan);
virtual IOReturn releaseHW();
virtual IOReturn notify(UInt32 notificationType,
DCLCommandPtr *dclCommandList, UInt32 numDCLCommands);
virtual void stop();
DCLCommandPtr getTranslatorOpcodes() {return (DCLCommandPtr)&fStartLabel;}
void setHWProgram(IODCLProgram *program) {fHWProgram = program;};
};
class IODCLTranslateTalk : public IODCLTranslator
{
OSDeclareDefaultStructors(IODCLTranslateTalk)
protected:
public:
virtual IOReturn compile(IOFWSpeed speed, UInt32 chan);
virtual IOReturn start();
};
class IODCLTranslateListen : public IODCLTranslator
{
OSDeclareDefaultStructors(IODCLTranslateListen)
protected:
public:
virtual IOReturn compile(IOFWSpeed speed, UInt32 chan);
virtual IOReturn start();
};
#endif