IOFWUserIsochChannel.cpp [plain text]
#import <IOKit/firewire/IOFireWireController.h>
#import <IOKit/firewire/IOFWCommand.h>
#import <IOKit/firewire/IOFWLocalIsochPort.h>
#import <IOKit/firewire/IOFWDCLProgram.h>
#import "IOFireWireUserClient.h"
#import "IOFWUserIsochChannel.h"
OSDefineMetaClassAndStructors(IOFWUserIsochChannel, IOFWIsochChannel)
bool IOFWUserIsochChannel::init(
IOFireWireController * control,
bool doIRM,
UInt32 packetSize,
IOFWSpeed prefSpeed )
{
return super::init( control, doIRM, packetSize, prefSpeed, &IOFWUserIsochChannel::isochChannel_ForceStopHandler, this ) ;
}
IOReturn
IOFWUserIsochChannel::allocateChannel()
{
return kIOReturnUnsupported ;
}
IOReturn
IOFWUserIsochChannel::releaseChannel()
{
return kIOReturnUnsupported ;
}
IOReturn
IOFWUserIsochChannel::start()
{
return kIOReturnUnsupported ;
}
IOReturn
IOFWUserIsochChannel::stop()
{
return kIOReturnUnsupported ;
}
IOReturn
IOFWUserIsochChannel::allocateListenerPorts()
{
IOFWIsochPort* listen;
IOReturn result = kIOReturnSuccess ;
OSIterator* listenIterator = OSCollectionIterator::withCollection(fListeners) ;
if(listenIterator) {
listenIterator->reset();
while( (listen = (IOFWIsochPort *) listenIterator->getNextObject()) && (result == kIOReturnSuccess)) {
result = listen->allocatePort(fSpeed, fChannel);
}
listenIterator->release();
}
return result ;
}
IOReturn
IOFWUserIsochChannel::allocateTalkerPort()
{
IOReturn result = kIOReturnSuccess ;
if(fTalker)
result = fTalker->allocatePort(fSpeed, fChannel);
return result ;
}
void
IOFWUserIsochChannel::s_exporterCleanup ( IOFWUserIsochChannel * channel )
{
DebugLog( "+IOFWUserIsochChannel::s_exporterCleanup channel=%p\n", channel) ;
channel->fControl->removeAllocatedChannel( channel ) ;
channel->stop() ;
channel->releaseChannel() ;
}
IOReturn
IOFWUserIsochChannel::isochChannel_ForceStopHandler( void * self, IOFWIsochChannel*, UInt32 stopCondition )
{
IOFWUserIsochChannel * me = (IOFWUserIsochChannel*)self;
#if INFO
natural_t userProc = me->fStopRefCon ? ((natural_t*)me->fStopRefCon)[ kIOAsyncCalloutFuncIndex ] : 0 ;
natural_t userRef = me->fStopRefCon ? ((natural_t*)me->fStopRefCon)[ kIOAsyncCalloutRefconIndex ] : 0 ;
InfoLog("+ IOFireWireUserClient::s_IsochChannel_ForceStopHandler() -- fStopRefCon=%p, userProc=%p, userRef=0x%x\n", me->fStopRefCon, userProc, userRef ) ;
#endif
if ( !me->getUserAsyncRef() )
{
return kIOReturnSuccess ;
}
return IOFireWireUserClient::sendAsyncResult64( (io_user_reference_t *)me->getUserAsyncRef(), stopCondition, NULL, 0 ) ;
}