#ifndef _IOKIT_IOFIREWIRENUB_H
#define _IOKIT_IOFIREWIRENUB_H
#include <IOKit/IOService.h>
#include <IOKit/firewire/IOFWCommand.h>
#include <IOKit/firewire/IOFWAddressSpace.h>
class IOFireWireController;
class IOFireWireBus;
class IOConfigDirectory;
class IOFireWireNub : public IOService
{
OSDeclareAbstractStructors(IOFireWireNub)
friend class IOFireWireController;
protected:
int fDeviceSpeed; int fCommsSpeed; UInt16 fNodeID; UInt16 fLocalNodeID; UInt32 fGeneration; CSRNodeUniqueID fUniqueID; mach_timespec_t fAsyncTimeout;
int fMaxReadPackLog;
int fMaxWritePackLog;
int fMaxReadROMPackLog;
IOFireWireController *fControl;
IOConfigDirectory *fDirectory;
UInt32 fNodeFlags;
struct ExpansionData { };
ExpansionData *reserved;
virtual void free();
virtual IOReturn newUserClient( task_t owningTask,
void * security_id,
UInt32 type,
IOUserClient ** handler );
public:
IOReturn getNodeIDGeneration(UInt32 &generation, UInt16 &nodeID, UInt16 &localID) const
{ generation = fGeneration; nodeID = fNodeID; localID = fLocalNodeID; return kIOReturnSuccess;};
IOReturn getNodeIDGeneration(UInt32 &generation, UInt16 &nodeID) const
{ generation = fGeneration; nodeID = fNodeID; return kIOReturnSuccess;};
virtual IOFWSpeed FWSpeed() const;
virtual IOFWSpeed FWSpeed(const IOFireWireNub *dst) const;
virtual int maxPackLog(bool forSend) const;
virtual int maxPackLog(bool forSend, FWAddress address) const;
virtual int maxPackLog(bool forSend, const IOFireWireNub *dst) const;
virtual void setMaxPackLog(bool forSend, bool forROM, int maxPackLog);
virtual IOFWReadCommand *createReadCommand(FWAddress devAddress, IOMemoryDescriptor *hostMem,
FWDeviceCallback completion=NULL, void *refcon=NULL,
bool failOnReset=false);
virtual IOFWReadQuadCommand *createReadQuadCommand(FWAddress devAddress, UInt32 *quads, int numQuads,
FWDeviceCallback completion=NULL, void *refcon=NULL,
bool failOnReset=false);
virtual IOFWWriteCommand *createWriteCommand(FWAddress devAddress, IOMemoryDescriptor *hostMem,
FWDeviceCallback completion=NULL, void *refcon=NULL,
bool failOnReset=false);
virtual IOFWWriteQuadCommand *createWriteQuadCommand(FWAddress devAddress, UInt32 *quads, int numQuads,
FWDeviceCallback completion=NULL, void *refcon=NULL,
bool failOnReset=false);
virtual IOFWCompareAndSwapCommand *createCompareAndSwapCommand(FWAddress devAddress,
const UInt32 *cmpVal, const UInt32 *newVal, int size,
FWDeviceCallback completion=NULL, void *refcon=NULL,
bool failOnReset=false);
virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem);
virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len,
FWReadCallback reader, FWWriteCallback writer, void *refcon);
virtual IOReturn getConfigDirectory(IOConfigDirectory *&dir);
IOFireWireBus * getBus() const
{ return (IOFireWireBus *)fControl; };
IOFireWireController * getController() const
{ return fControl; };
const CSRNodeUniqueID &getUniqueID() const
{ return fUniqueID; };
virtual bool init(OSDictionary * propTable);
virtual void setNodeFlags( UInt32 flags );
virtual UInt32 getNodeFlags( void );
private:
OSMetaClassDeclareReservedUnused(IOFireWireNub, 0);
OSMetaClassDeclareReservedUnused(IOFireWireNub, 1);
OSMetaClassDeclareReservedUnused(IOFireWireNub, 2);
OSMetaClassDeclareReservedUnused(IOFireWireNub, 3);
};
#endif