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; DCLCommand* fToInterpret; DCLCommand* fCurrentDCLCommand; int fPingCount; UInt32 fPacketHeader;
static void ListeningDCLPingPongProc(DCLCommand* pDCLCommand);
static void TalkingDCLPingPongProc(DCLCommand* pDCLCommand);
public:
virtual bool init(DCLCommand* toInterpret);
virtual IOReturn allocateHW(IOFWSpeed speed, UInt32 chan);
virtual IOReturn releaseHW();
virtual IOReturn notify(IOFWDCLNotificationType notificationType,
DCLCommand** dclCommandList, UInt32 numDCLCommands);
virtual void stop();
DCLCommand* getTranslatorOpcodes();
void setHWProgram(IODCLProgram *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