#ifndef _IOKIT_IOFireWireLink_H
#define _IOKIT_IOFireWireLink_H
#include <IOKit/IOService.h>
#include <IOKit/IOFilterInterruptEventSource.h>
#include <IOKit/firewire/IOFireWireController.h>
enum
{
kIOFWAllPhysicalFilters = 64
};
enum
{
kIOFWNodeFlagRetryOnAckD = (1 << 0)
};
struct IOFWNodeScan;
class IOFireWireLink : public IOService
{
OSDeclareAbstractStructors(IOFireWireLink)
class FWOHCIIsocInterruptEventSource : public IOFilterInterruptEventSource
{
public:
static FWOHCIIsocInterruptEventSource *
filterInterruptEventSource(OSObject *owner,
IOInterruptEventSource::Action action,
Filter filter,
IOService *provider,
int intIndex = 0);
inline void openGate() {IOEventSource::openGate();};
inline void closeGate() {IOEventSource::closeGate();};
};
protected:
IOFireWireController *fControl;
IOFWWorkLoop * fWorkLoop;
struct ExpansionData { };
ExpansionData *reserved;
void processBusReset()
{ fControl->processBusReset(); };
void processSelfIDs(UInt32 *IDs, int numIDs, UInt32 *ownIDs, int numOwnIDs)
{ fControl->processSelfIDs(IDs, numIDs, ownIDs, numOwnIDs); };
void processRcvPacket(UInt32 *data, int numQuads)
{ fControl->processRcvPacket(data, numQuads); };
virtual IOFireWireController * createController();
virtual IOFWWorkLoop* createWorkLoop();
public:
virtual IOFireWireDevice *createDeviceNub(CSRNodeUniqueID guid, const IOFWNodeScan *deviceInfo);
virtual IOReturn setLinkPowerState ( unsigned long powerStateOrdinal) = 0;
virtual IOReturn setContender(bool state) = 0;
virtual IOReturn setRootHoldOff(bool state) = 0;
virtual IOReturn setCycleMaster(bool state) = 0;
virtual IODCLProgram *createDCLProgram(bool talking, DCLCommandStruct *opcodes,
IOFireWireController::DCLTaskInfo *info, UInt32 startEvent, UInt32 startState, UInt32 startMask) = 0;
virtual IOReturn sendPHYPacket(UInt32 quad) = 0;
virtual void handleInterrupts(int count) = 0;
virtual IOReturn resetBus() = 0;
virtual IOReturn asyncRead(UInt16 nodeID, UInt16 addrHi, UInt32 addrLo,
int speed, int label, int size, IOFWAsyncCommand *cmd) = 0;
virtual IOReturn asyncReadQuadResponse(UInt16 nodeID, int speed,
int label, int rcode, UInt32 data) = 0;
virtual IOReturn asyncReadResponse(UInt16 nodeID, int speed,
int label, int rcode, IOMemoryDescriptor *buf,
IOByteCount offset, int len) = 0;
virtual IOReturn asyncWrite(UInt16 nodeID, UInt16 addrHi, UInt32 addrLo,
int speed, int label, IOMemoryDescriptor *buf, IOByteCount offset,
int size, IOFWAsyncCommand *cmd) = 0;
virtual IOReturn asyncWrite(UInt16 nodeID, UInt16 addrHi, UInt32 addrLo,
int speed, int label, void *data, int size, IOFWAsyncCommand *cmd) = 0;
virtual IOReturn asyncWriteResponse(UInt16 nodeID, int speed,
int label, int rcode, UInt16 addrHi) = 0;
virtual IOReturn asyncLock(UInt16 nodeID, UInt16 addrHi, UInt32 addrLo,
int speed, int label, int type, void *data, int size, IOFWAsyncCommand *cmd) = 0;
virtual IOReturn asyncLockResponse(UInt16 nodeID, int speed,
int label, int rcode, int type, void *data, int len) = 0;
virtual IOReturn handleAsyncTimeout(IOFWAsyncCommand *cmd) = 0;
virtual IOReturn updateROM(const OSData *rom) = 0;
virtual IOReturn getCycleTime(UInt32 &cycleTime) = 0;
virtual IOReturn getBusCycleTime(UInt32 &busTime, UInt32 &cycleTime) = 0;
virtual IOReturn setBusTime(UInt32 busTime) = 0;
virtual CSRNodeUniqueID getGUID() = 0;
virtual UInt32 getBusCharacteristics() = 0;
virtual UInt32 getMaxSendLog() = 0;
virtual UInt16 getNodeID() = 0;
virtual IOFireWireController * getController() const;
virtual IOWorkLoop * getWorkLoop() const;
virtual IOFWWorkLoop * getFireWireWorkLoop() const;
virtual void setNodeIDPhysicalFilter( UInt16 nodeID, bool state ) =0;
virtual void setNodeFlags( UInt16 nodeID, UInt32 flags )=0;
virtual void closeIsochGate() ;
virtual void openIsochGate() ;
private:
OSMetaClassDeclareReservedUnused(IOFireWireLink, 0);
OSMetaClassDeclareReservedUnused(IOFireWireLink, 1);
OSMetaClassDeclareReservedUnused(IOFireWireLink, 2);
OSMetaClassDeclareReservedUnused(IOFireWireLink, 3);
OSMetaClassDeclareReservedUnused(IOFireWireLink, 4);
OSMetaClassDeclareReservedUnused(IOFireWireLink, 5);
OSMetaClassDeclareReservedUnused(IOFireWireLink, 6);
OSMetaClassDeclareReservedUnused(IOFireWireLink, 7);
OSMetaClassDeclareReservedUnused(IOFireWireLink, 8);
protected:
FWOHCIIsocInterruptEventSource* fIsocInterruptEventSource;
IOWorkLoop * fIsocWorkloop;
};
#endif