IOFireWireDevice.cpp [plain text]
#import "FWDebugging.h"
#define DEBUGGING_LEVEL 0 // 1 = low; 2 = high; 3 = extreme
#ifndef DEBUGLOG
#define DEBUGLOG kprintf
#endif
#import <IOKit/assert.h>
#import <IOKit/IOMessage.h>
#import <IOKit/IODeviceTreeSupport.h>
#import <IOKit/firewire/IOFireWireLink.h>
#import <IOKit/firewire/IOFireWireDevice.h>
#import <IOKit/firewire/IOFireWireUnit.h>
#import <IOKit/firewire/IOFireWireController.h>
#import <IOKit/firewire/IOConfigDirectory.h>
#import "IORemoteConfigDirectory.h"
#import "IOFireWireROMCache.h"
OSDefineMetaClassAndStructors(IOFireWireDevice, IOFireWireNub)
OSMetaClassDefineReservedUnused(IOFireWireDevice, 0);
OSMetaClassDefineReservedUnused(IOFireWireDevice, 1);
struct RomScan
{
IOFireWireDevice * fDevice;
UInt32 fROMGeneration;
};
class IOFireWireUnitInfo : public OSObject
{
OSDeclareDefaultStructors(IOFireWireUnitInfo);
private:
OSDictionary * fPropTable;
IOConfigDirectory * fDirectory;
protected:
virtual void free();
public:
static IOFireWireUnitInfo * create( void );
void setPropTable( OSDictionary * propTable );
OSDictionary * getPropTable( void );
void setDirectory( IOConfigDirectory * directory );
IOConfigDirectory * getDirectory( void );
};
OSDefineMetaClassAndStructors(IOFireWireUnitInfo, OSObject);
IOFireWireUnitInfo * IOFireWireUnitInfo::create( void )
{
IOFireWireUnitInfo * me;
me = new IOFireWireUnitInfo;
return me;
}
void IOFireWireUnitInfo::free()
{
if( fPropTable != NULL )
{
fPropTable->release();
fPropTable = NULL;
}
if( fDirectory != NULL )
{
fDirectory->release();
fDirectory = NULL;
}
OSObject::free();
}
void IOFireWireUnitInfo::setPropTable( OSDictionary * propTable )
{
OSDictionary * oldPropTable = fPropTable;
propTable->retain();
fPropTable = propTable;
if( oldPropTable )
oldPropTable->release();
}
OSDictionary * IOFireWireUnitInfo::getPropTable( void )
{
return fPropTable;
}
void IOFireWireUnitInfo::setDirectory( IOConfigDirectory * directory )
{
IOConfigDirectory * oldDirectory = fDirectory;
directory->retain();
fDirectory = directory;
if( oldDirectory )
oldDirectory->release();
}
IOConfigDirectory * IOFireWireUnitInfo::getDirectory( void )
{
return fDirectory;
}
#pragma mark -
bool IOFireWireDevice::init(OSDictionary *propTable, const IOFWNodeScan *info)
{
if(!IOFireWireNub::init(propTable))
return false;
if(info->fROMSize > 8) {
UInt32 maxPackLog =
((info->fBuf[2] & kFWBIBMaxRec) >> kFWBIBMaxRecPhase) + 1;
if(maxPackLog == 1) {
IOLog("Illegal maxrec, using 512 bytes\n");
maxPackLog = 9;
}
if(info->fBuf[2] & kFWBIBGeneration) {
if(((info->fBuf[2] & kFWBIBMaxROM) >> kFWBIBMaxROMPhase) == 2)
fMaxReadROMPackLog = 10; else
fMaxReadROMPackLog = 2; }
else
fMaxReadROMPackLog = maxPackLog;
fMaxReadPackLog = maxPackLog;
fMaxWritePackLog = maxPackLog;
}
else {
fMaxReadROMPackLog = 2;
fMaxReadPackLog = 2;
fMaxWritePackLog = 2;
}
fROMLock = IORecursiveLockAlloc();
return fROMLock != NULL;
}
void IOFireWireDevice::readROMDirGlue(void *refcon, IOReturn status,
IOFireWireNub *nub, IOFWCommand *fwCmd)
{
}
void IOFireWireDevice::terminateDevice(void *refcon)
{
IOFireWireDevice *me = (IOFireWireDevice *)refcon;
me->fControl->closeGate();
me->lockForArbitration();
if( me->fNodeID == kFWBadNodeID && !me->isInactive() && !me->isOpen() )
{
if( me->fDeviceROM )
{
me->fDeviceROM->setROMState( IOFireWireROMCache::kROMStateInvalid );
}
me->unlockForArbitration();
me->terminate();
}
else
{
me->unlockForArbitration();
}
me->fControl->openGate();
}
void IOFireWireDevice::free()
{
FWKLOG(( "IOFireWireDevice@0x%08lx::free()\n", (UInt32)this ));
if( fDeviceROM )
{
fDeviceROM->setROMState( IOFireWireROMCache::kROMStateInvalid );
fDeviceROM->release();
fDeviceROM = NULL;
}
if(fROMLock)
{
IORecursiveLockFree(fROMLock);
}
IOFireWireNub::free();
}
bool IOFireWireDevice::attach(IOService *provider)
{
char location[17];
assert(OSDynamicCast(IOFireWireController, provider));
if( !IOFireWireNub::attach(provider))
return (false);
fControl = (IOFireWireController *)provider;
sprintf(location, "%lx%08lx", (UInt32)(fUniqueID >> 32), (UInt32)(fUniqueID & 0xffffffff));
setLocation(location);
IOService *parent = provider;
while(parent) {
if(parent->inPlane(gIODTPlane))
break;
parent = parent->getProvider();
}
if(parent) {
attachToParent(parent, gIODTPlane);
setName("node", gIODTPlane);
}
return(true);
}
bool IOFireWireDevice::finalize( IOOptionBits options )
{
if(fDirectory) {
fDirectory->release();
fDirectory = NULL;
}
detachAll(gIODTPlane);
return IOFireWireNub::finalize(options);
}
void IOFireWireDevice::setRegistrationState( RegistrationState state )
{
fRegistrationState = state;
}
void IOFireWireDevice::setNodeROM(UInt32 gen, UInt16 localID, const IOFWNodeScan *info)
{
OSObject *prop;
IOFireWireROMCache * rom;
fLocalNodeID = localID;
fGeneration = gen;
if( info )
{
fNodeID = info->fAddr.nodeID;
}
else
{
fNodeID = kFWBadNodeID;
}
FWKLOG(( "IOFireWireDevice@0x%08lx::setNodeROM entered with nodeID = 0x%04x\n", (UInt32)this, fNodeID ));
prop = OSNumber::withNumber( fNodeID, 16 );
setProperty( gFireWireNodeID, prop );
prop->release();
if( fNodeID != kFWBadNodeID )
{
configureNode(); }
if( !info )
{
fDeviceROM->setROMState( IOFireWireROMCache::kROMStateSuspended );
messageClients( kIOMessageServiceIsSuspended );
return; }
prop = OSData::withBytes( info->fSelfIDs, info->fNumSelfIDs*sizeof(UInt32) );
setProperty( gFireWireSelfIDs, prop );
prop->release();
UInt32 newROMSize = info->fROMSize;
bool rom_changed = true;
if( fDeviceROM != NULL )
{
rom_changed = fDeviceROM->hasROMChanged( info->fBuf, newROMSize );
}
if( !rom_changed )
{
fDeviceROM->setROMState( IOFireWireROMCache::kROMStateResumed, fGeneration );
messageClients( kIOMessageServiceIsResumed );
#if IOFIREWIREDEBUG > 0
IOLog("IOFireWireDevice, ROM unchanged 0x%p\n", this);
#endif
FWKLOG(( "IOFireWireDevice@0x%08lx::setNodeROM exited - ROM unchanged\n", (UInt32)this ));
return; }
fROMGeneration++;
if( fRegistrationState == kDeviceNotRegistered )
{
setRegistrationState( kDeviceNeedsRegisterService );
adjustBusy( 1 );
}
if( newROMSize > 12 )
{
UInt32 vendorID = info->fBuf[3] >> 8;
prop = OSNumber::withNumber( vendorID, 32 );
setProperty( gFireWireVendor_ID, prop );
prop->release();
}
rom = IOFireWireROMCache::withOwnerAndBytes( this, info->fBuf, newROMSize, fGeneration );
setProperty( gFireWireROM, rom );
if( fDeviceROM )
{
fDeviceROM->setROMState( IOFireWireROMCache::kROMStateInvalid );
fDeviceROM->release();
}
fDeviceROM = rom;
if( newROMSize == 20 )
{
RomScan *romScan = (RomScan *)IOMalloc( sizeof(RomScan) );
if( romScan )
{
romScan->fROMGeneration = fROMGeneration;
romScan->fDevice = this;
IOCreateThread( readROMThreadFunc, romScan );
}
}
else
{
if( fRegistrationState == kDeviceNeedsRegisterService )
{
setRegistrationState( kDeviceNotRegistered );
adjustBusy( -1 );
}
}
FWKLOG(( "IOFireWireDevice@0x%08lx::setNodeROM exited\n", (UInt32)this ));
}
void IOFireWireDevice::readROMThreadFunc( void *refcon )
{
RomScan * romScan = (RomScan *)refcon;
IOFireWireDevice * device = romScan->fDevice;
IORecursiveLockLock(device->fROMLock);
device->processROM( romScan );
IORecursiveLockUnlock(device->fROMLock);
IOFree(romScan, sizeof(RomScan));
}
void IOFireWireDevice::processROM( RomScan *romScan )
{
IOReturn status = kIOReturnSuccess;
IOConfigDirectory * directory = NULL;
IOFireWireROMCache * rom = NULL;
OSSet * unitSet = NULL;
OSDictionary * rootPropTable = NULL;
fControl->closeGate();
rom = fDeviceROM;
rom->retain();
UInt32 generation = fROMGeneration;
fControl->openGate();
FWKLOG(( "IOFireWireDevice@0x%08lx::processROM generation %ld entered\n", (UInt32)this, generation ));
if( romScan->fROMGeneration != generation )
{
FWKLOG(( "IOFireWireDevice@0x%08lx::processROM generation %ld != romScan->fROMGeneration\n", (UInt32)this, generation ));
status = kIOReturnError;
}
if( status == kIOReturnSuccess )
{
directory = IORemoteConfigDirectory::withOwnerOffset( rom, 5, kConfigRootDirectoryKey );
if( directory == NULL )
{
#if IOFIREWIREDEBUG > 0
IOLog("whoops, no root directory!!\n");
#endif
status = kIOReturnNoMemory;
}
}
if( status == kIOReturnSuccess )
{
rootPropTable = OSDictionary::withCapacity(7);
if( rootPropTable == NULL )
status = kIOReturnNoMemory;
}
if( status == kIOReturnSuccess )
{
status = readRootDirectory( directory, rootPropTable );
}
if( status == kIOReturnSuccess )
{
unitSet = OSSet::withCapacity(2);
if( unitSet == NULL )
status = kIOReturnNoMemory;
}
if( status == kIOReturnSuccess )
{
status = readUnitDirectories( directory, unitSet );
}
if( status == kIOReturnSuccess )
{
preprocessDirectories( rootPropTable, unitSet );
}
if( status == kIOReturnSuccess )
{
fControl->closeGate();
RegistrationState registrationState = fRegistrationState;
status = setConfigDirectory( directory );
FWKLOGASSERT( status == kIOReturnSuccess );
status = processRootDirectory( rootPropTable );
FWKLOGASSERT( status == kIOReturnSuccess );
status = processUnitDirectories( unitSet );
FWKLOGASSERT( status == kIOReturnSuccess );
if( registrationState == kDeviceNeedsRegisterService )
{
adjustBusy( -1 );
}
messageClients( kIOMessageServiceIsResumed );
fControl->openGate();
}
else if( status != kIOFireWireConfigROMInvalid )
{
fControl->closeGate();
if( fRegistrationState == kDeviceNeedsRegisterService )
{
setRegistrationState( kDeviceNotRegistered );
adjustBusy( -1 );
}
fControl->openGate();
}
if( unitSet != NULL )
{
unitSet->release();
}
if( rootPropTable != NULL )
{
rootPropTable->release();
}
if( directory != NULL )
{
directory->release();
}
if( rom != NULL )
{
rom->release();
}
FWKLOG(( "IOFireWireDevice@0x%08lx::processROM generation %ld exited\n", (UInt32)this, generation ));
}
void IOFireWireDevice::preprocessDirectories( OSDictionary * rootPropTable, OSSet * unitSet )
{
OSObject * modelNameProperty = rootPropTable->getObject( gFireWireProduct_Name );
OSObject * vendorNameProperty = rootPropTable->getObject( gFireWireVendor_Name );
OSIterator * iterator = OSCollectionIterator::withCollection( unitSet );
iterator->reset();
IOFireWireUnitInfo * info = NULL;
while( (info = (IOFireWireUnitInfo *) iterator->getNextObject()) )
{
OSDictionary * propTable = info->getPropTable();
OSObject * unitModelNameProperty = propTable->getObject( gFireWireProduct_Name );
if( unitModelNameProperty == NULL && modelNameProperty != NULL )
{
propTable->setObject( gFireWireProduct_Name, modelNameProperty );
}
if( vendorNameProperty )
{
propTable->setObject( gFireWireVendor_Name, vendorNameProperty );
}
}
iterator->release();
}
IOReturn IOFireWireDevice::readRootDirectory( IOConfigDirectory * directory, OSDictionary * propTable )
{
IOReturn status = kIOReturnSuccess;
OSString * modelName = NULL;
OSString * vendorName = NULL;
FWKLOG(( "IOFireWireDevice@0x%08lx::readRootDirectory entered\n", (UInt32)this ));
if( status == kIOReturnSuccess )
{
IOReturn result = kIOReturnSuccess;
UInt32 vendorID = 0;
result = directory->getKeyValue( kConfigModuleVendorIdKey, vendorID, &vendorName );
if( result == kIOFireWireConfigROMInvalid )
status = result;
if(result == kIOReturnSuccess) {
OSNumber *num = OSNumber::withNumber(vendorID, 32);
if(num) {
propTable->setObject( gFireWireVendor_ID, num);
num->release();
}
}
}
if( status == kIOReturnSuccess )
{
IOReturn result = kIOReturnSuccess;
UInt32 modelID = 0;
result = directory->getKeyValue( kConfigModelIdKey, modelID, &modelName );
if( result == kIOFireWireConfigROMInvalid )
status = result;
}
if( status == kIOReturnSuccess )
{
IOReturn result = kIOReturnSuccess;
OSString * t = NULL;
IOConfigDirectory * unit = NULL;
result = directory->getKeyValue( kConfigModuleVendorIdKey, unit, &t );
if( result == kIOFireWireConfigROMInvalid )
status = result;
if( result == kIOReturnSuccess && t != NULL )
{
if( vendorName )
vendorName->release();
vendorName = t;
t = NULL;
}
if( result == kIOReturnSuccess )
{
UInt32 modelID = 0;
result = unit->getKeyValue( kConfigModelIdKey, modelID, &t );
if( result == kIOFireWireConfigROMInvalid )
status = result;
if( result == kIOReturnSuccess && t != NULL )
{
if( modelName )
modelName->release();
modelName = t;
t = NULL;
}
unit->release();
}
}
if( modelName != NULL )
{
if( status == kIOReturnSuccess )
propTable->setObject( gFireWireProduct_Name, modelName );
modelName->release();
}
if( vendorName != NULL )
{
if( status == kIOReturnSuccess )
propTable->setObject( gFireWireVendor_Name, vendorName );
vendorName->release();
}
FWKLOG(( "IOFireWireDevice@0x%08lx::readRootDirectory returned status = 0x%08lx\n", (UInt32)this, (UInt32)status ));
return status;
}
IOReturn IOFireWireDevice::processRootDirectory( OSDictionary * propTable )
{
IOReturn status = kIOReturnSuccess;
OSSymbol * key = NULL;
OSObject * property = NULL;
OSCollectionIterator * iterator = OSCollectionIterator::withCollection( propTable );
while( NULL != (key = OSDynamicCast(OSSymbol, iterator->getNextObject())) )
{
property = propTable->getObject( key );
setProperty( key, property );
}
iterator->release();
if( fRegistrationState == kDeviceNeedsRegisterService )
{
setRegistrationState( kDeviceRegistered );
registerService();
}
return status;
}
IOReturn IOFireWireDevice::readUnitDirectories( IOConfigDirectory * directory, OSSet * unitInfo )
{
IOReturn status = kIOReturnSuccess;
OSIterator * unitDirs = NULL;
OSString * modelName = NULL;
FWKLOG(( "IOFireWireDevice@0x%08lx::readUnitDirectory entered\n", (UInt32)this ));
if( status == kIOReturnSuccess )
{
IOReturn result = kIOReturnSuccess;
result = directory->getKeySubdirectories( kConfigUnitDirectoryKey, unitDirs );
if( result == kIOFireWireConfigROMInvalid )
status = result;
if( result == kIOReturnSuccess )
{
IOConfigDirectory * unit = NULL;
while( unit = OSDynamicCast( IOConfigDirectory, unitDirs->getNextObject() ) )
{
UInt32 unitSpecID = 0;
UInt32 unitSoftwareVersion = 0;
UInt32 modelID = 0;
OSString * t = NULL;
result = unit->getKeyValue(kConfigUnitSpecIdKey, unitSpecID);
if( result == kIOReturnSuccess )
result = unit->getKeyValue(kConfigUnitSwVersionKey, unitSoftwareVersion);
if( result == kIOReturnSuccess )
result = unit->getKeyValue(kConfigModelIdKey, modelID, &t);
if( result == kIOFireWireConfigROMInvalid )
status = result;
if( result == kIOReturnSuccess && t != NULL )
{
if( modelName )
modelName->release();
modelName = t;
t = NULL;
}
if( status == kIOReturnSuccess )
{
OSDictionary * propTable = 0;
do
{
OSObject * prop;
propTable = OSDictionary::withCapacity(7);
if( !propTable )
continue;
prop = OSString::withCString("FireWire Unit");
propTable->setObject(gIOMatchCategoryKey, prop);
prop->release();
if( modelName )
propTable->setObject(gFireWireProduct_Name, modelName);
prop = OSNumber::withNumber(unitSpecID, 32);
propTable->setObject(gFireWireUnit_Spec_ID, prop);
prop->release();
prop = OSNumber::withNumber(unitSoftwareVersion, 32);
propTable->setObject(gFireWireUnit_SW_Version, prop);
prop->release();
prop = getProperty(gFireWireVendor_ID);
if( prop )
propTable->setObject(gFireWireVendor_ID, prop);
prop = getProperty(gFireWire_GUID);
if( prop )
propTable->setObject(gFireWire_GUID, prop);
IOFireWireUnitInfo * info = IOFireWireUnitInfo::create();
info->setDirectory( unit );
info->setPropTable( propTable );
unitInfo->setObject( info );
info->release();
} while( false );
if( propTable != NULL )
propTable->release();
}
if( modelName != NULL )
{
modelName->release();
modelName = NULL;
}
}
unitDirs->release();
}
}
FWKLOG(( "IOFireWireDevice@0x%08lx::readUnitDirectory returned status = 0x%08lx\n", (UInt32)this, (UInt32)status ));
return status;
}
IOReturn IOFireWireDevice::processUnitDirectories( OSSet * unitSet )
{
IOReturn status = kIOReturnSuccess;
OSIterator * iterator = OSCollectionIterator::withCollection( unitSet );
iterator->reset();
IOFireWireUnitInfo * info = NULL;
while( (info = (IOFireWireUnitInfo *) iterator->getNextObject()) )
{
IOFireWireUnit * newDevice = 0;
OSDictionary * propTable = info->getPropTable();
IOConfigDirectory * unit = info->getDirectory();
do
{
OSIterator * childIterator;
IOFireWireUnit * found = NULL;
childIterator = getClientIterator();
if( childIterator )
{
OSObject *child;
while( (child = childIterator->getNextObject()) )
{
found = OSDynamicCast(IOFireWireUnit, child);
if( found && found->matchPropertyTable(propTable) )
{
break;
}
else
{
found = NULL;
}
}
childIterator->release();
if(found)
{
found->setConfigDirectory( unit );
break;
}
}
newDevice = new IOFireWireUnit;
if (!newDevice || !newDevice->init(propTable, unit))
break;
newDevice->setMaxPackLog(true, false, fMaxWritePackLog);
newDevice->setMaxPackLog(false, false, fMaxReadPackLog);
newDevice->setMaxPackLog(false, true, fMaxReadROMPackLog);
if (!newDevice->attach(this))
break;
newDevice->registerService();
}
while( false );
if( newDevice != NULL )
{
newDevice->release();
newDevice = NULL;
}
}
if( iterator != NULL )
{
iterator->release();
}
return status;
}
IOReturn IOFireWireDevice::cacheROM(OSData *rom, UInt32 offset, const UInt32 *&romBase)
{
return kIOReturnError;
}
const UInt32 * IOFireWireDevice::getROMBase()
{
return (const UInt32 *)fDeviceROM->getBytesNoCopy();
}
IOReturn IOFireWireDevice::message( UInt32 mess, IOService * provider,
void * argument )
{
if( kIOFWMessageServiceIsRequestingClose == mess )
{
messageClients( mess );
return kIOReturnSuccess;
}
return IOService::message(mess, provider, argument );
}
bool IOFireWireDevice::handleOpen( IOService * forClient, IOOptionBits options, void * arg )
{
bool ok = true;
IOFireWireUnit * unitClient = OSDynamicCast( IOFireWireUnit, forClient );
if( unitClient != NULL )
{
if( fOpenFromDevice )
return false;
if( fOpenFromUnitCount == 0 )
{
ok = IOService::handleOpen( this, options, arg );
if( ok )
fOpenFromUnitCount++;
}
else
{
fOpenFromUnitCount++;
}
}
else
{
if( fOpenFromUnitCount != 0 )
return false;
if( !fOpenFromDevice ) {
ok = IOService::handleOpen( forClient, options, arg );
if( ok )
{
fOpenFromDevice = true;
}
}
else
{
ok = false; }
}
return ok;
}
void IOFireWireDevice::handleClose( IOService * forClient, IOOptionBits options )
{
IOFireWireUnit * unitClient = OSDynamicCast( IOFireWireUnit, forClient );
if( unitClient != NULL )
{
if( fOpenFromUnitCount != 0 )
{
fOpenFromUnitCount--;
if( fOpenFromUnitCount == 0 ) {
IOService::handleClose( this, options );
if( fNodeID == kFWBadNodeID && !isInactive() ) {
IOCreateThread(terminateDevice, this);
}
}
}
}
else
{
if( fOpenFromDevice )
{
fOpenFromDevice = false;
IOService::handleClose( forClient, options );
if( fNodeID == kFWBadNodeID && !isInactive() )
IOCreateThread(terminateDevice, this);
}
}
}
bool IOFireWireDevice::handleIsOpen( const IOService * forClient ) const
{
if( forClient == NULL )
{
return (fOpenFromUnitCount != 0 || fOpenFromDevice);
}
if( fOpenFromUnitCount != 0 )
{
IOFireWireUnit * unitClient = OSDynamicCast( IOFireWireUnit, forClient );
return (unitClient != NULL);
}
if( fOpenFromDevice )
{
return IOService::handleIsOpen( forClient );
}
return false;
}
bool IOFireWireDevice::matchPropertyTable(OSDictionary * table)
{
if (!IOFireWireNub::matchPropertyTable(table)) return false;
return compareProperty(table, gFireWireVendor_ID) &&
compareProperty(table, gFireWire_GUID);
}
#pragma mark -
void IOFireWireDevice::setNodeFlags( UInt32 flags )
{
fControl->closeGate();
fNodeFlags |= flags;
configureNode();
fControl->openGate();
}
void IOFireWireDevice::clearNodeFlags( UInt32 flags )
{
fControl->closeGate();
fNodeFlags &= ~flags;
configureNode();
fControl->openGate();
}
UInt32 IOFireWireDevice::getNodeFlags( void )
{
return fNodeFlags;
}
IOReturn IOFireWireDevice::configureNode( void )
{
if( fNodeID != kFWBadNodeID )
{
configurePhysicalFilter();
if( fNodeFlags & kIOFWEnableRetryOnAckD )
{
IOFireWireLink * fwim = fControl->getLink();
fwim->setNodeFlags( fNodeID & 0x3f, kIOFWNodeFlagRetryOnAckD );
}
}
return kIOReturnSuccess;
}
void IOFireWireDevice::configurePhysicalFilter( void )
{
if( fNodeID != kFWBadNodeID )
{
if( fNodeFlags & kIOFWDisableAllPhysicalAccess )
{
fControl->setPhysicalAccessMode( kIOFWPhysicalAccessDisabledForGeneration );
}
if( (fNodeFlags & kIOFWDisablePhysicalAccess) )
{
fControl->setNodeIDPhysicalFilter( fNodeID & 0x3f, false );
}
else
{
fControl->setNodeIDPhysicalFilter( fNodeID & 0x3f, true );
}
}
}
#pragma mark -
IOFWPhysicalAddressSpace * IOFireWireDevice::createPhysicalAddressSpace(IOMemoryDescriptor *mem)
{
IOFWPhysicalAddressSpace * space = fControl->createPhysicalAddressSpace(mem);
if( space != NULL )
{
space->addTrustedNode( this );
}
return space;
}
IOFWPseudoAddressSpace * IOFireWireDevice::createPseudoAddressSpace(FWAddress *addr, UInt32 len,
FWReadCallback reader, FWWriteCallback writer, void *refcon)
{
IOFWPseudoAddressSpace * space = fControl->createPseudoAddressSpace(addr, len, reader, writer, refcon);
if( space != NULL )
{
space->addTrustedNode( this );
}
return space;
}