#ifndef _IOKIT_IOFireWireLink_H
#define _IOKIT_IOFireWireLink_H
#ifndef FIREWIREPRIVATE
#warning Please do not include this file. Include IOFireWireBus.h instead.
#endif
#import <IOKit/firewire/IOFireWireFamilyCommon.h>
#import <IOKit/IOService.h>
#import <IOKit/IOFilterInterruptEventSource.h>
#import <IOKit/firewire/IOFireWireController.h>
enum
{
kIOFWAllPhysicalFilters = 64
};
enum
{
kIOFWNodeFlagRetryOnAckD = (1 << 0)
};
struct IOFWNodeScan;
class IOFWDCLPool ;
class IODCLProgram ;
class IOFireWireLink : public IOService
{
OSDeclareAbstractStructors(IOFireWireLink)
public :
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, DCLCommand *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( bool useIBR = false ) = 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,
IOFWWriteFlags flags ) = 0;
virtual IOReturn asyncWriteResponse(UInt16 nodeID, int speed,
int label, int rcode, UInt16 addrHi) = 0;
virtual IOReturn asyncLock( UInt16 destID,
UInt16 addrHi,
UInt32 addrLo,
int speed,
int label,
int type,
IOMemoryDescriptor * buf,
IOByteCount offset,
int length,
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 IOReturn asyncStreamTransmit (
UInt32 channel,
int speed,
UInt32 sync,
UInt32 tag,
IOMemoryDescriptor *pmd,
IOByteCount offset,
int length,
IOFWAsyncStreamCommand * cmd ) = 0;
virtual void setSecurityMode (
IOFWSecurityMode mode ) = 0;
void handleARxReqIntComplete ( void ) { fControl->handleARxReqIntComplete(); };
virtual void flushWaitingPackets ( void ) = 0;
virtual IOFWDCLPool* createDCLPool (
UInt32 capacity ) ;
inline IOWorkLoop * getIsochWorkloop () { return fIsocWorkloop ; }
virtual IOFWBufferFillIsochPort * createBufferFillIsochPort () ;
virtual IOReturn clipMaxRec2K( bool clipMaxRec ) = 0;
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