#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
{
kIOFWSetDSLimit = 0
};
enum
{
kIOFWNodeFlagRetryOnAckD = (1 << 0)
};
struct IOFWNodeScan;
class IOFWDCLPool ;
class IODCLProgram ;
class IOFireWireLink : public IOService
{
OSDeclareAbstractStructors(IOFireWireLink)
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, IOFWSpeed speed )
{ fControl->processRcvPacket(data, numQuads, speed ); };
void processCycle64Int()
{ fControl->processCycle64Int(); };
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( IOInterruptEventSource *, 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,
IOFWReadFlags flags) = 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, IODMACommand * in_dma_command ) = 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 ; }
inline IOWorkLoop * getWorkloop() { return (IOWorkLoop*)fWorkLoop; }
virtual IOFWBufferFillIsochPort * createBufferFillIsochPort () ;
virtual IOReturn clipMaxRec2K( bool clipMaxRec ) = 0;
virtual IOFWSpeed getPhySpeed() = 0 ;
virtual void disablePHYPortOnSleep( UInt32 mask );
virtual UInt32 * getPingTimes ();
virtual IOReturn handleAsyncCompletion( IOFWCommand *cmd, IOReturn status );
virtual void handleSystemShutDown( UInt32 messageType );
virtual void configureAsyncRobustness( bool enabled );
virtual bool isPhysicalAccessEnabledForNodeID( UInt16 nodeID );
virtual void notifyInvalidSelfIDs ();
virtual IOReturn asyncPHYPacket( UInt32 data, UInt32 data2, IOFWAsyncPHYCommand * cmd );
virtual bool enterLoggingMode( void );
virtual IOReturn getCycleTimeAndUpTime( UInt32 &cycleTime, UInt64 &uptime );
virtual UInt32 setLinkMode( UInt32 arg1, UInt32 arg2 );
void requestBusReset()
{ fControl->resetBus(); };
virtual void enableAllInterrupts( void ) = 0;
virtual IOPMPowerState * getPowerStateTable( unsigned long * numberOfStates ) = 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:
IOWorkLoop * fIsocWorkloop;
};
#endif