|
Q: Is there a way to find out the amount of isochronous bandwidth currently available on FireWire?A: Yes, but this information has dubious value (see Caveats, below). You can find the current Isochronous Resource Manager (IRM) for the FireWire bus your device is on and read the IRM's For example: Listing 1: Read avaliable FireWire isoch bandwidth IOReturn GetBandwidth( IOFireWireLibDeviceRef device, UInt32 * bandwidth ) { OSStatus error ; UInt16 irmNodeID ; UInt32 generation ; // get current bus generation error = (**device).GetBusGeneration( device, & generation ) ; if ( !error ) { // get ID of IRM error = (**device).GetIRMNodeID( device, generation, & irmNodeID ) ; } if ( !error ) { // build the FireWire address of the BANDWIDTH_AVAILABLE register FWAddress address = { irmNodeID, kCSRRegisterSpaceBaseAddressHi, kCSRBandwidthAvailable } ; UInt32 size = sizeof( *bandwidth ) ; // read the BANDWIDTH_AVAILABLE register error = (**device).Read( device, 0, address, bandwidth, &size, true, generation ) ; } return( error ); } Note: Bandwidth values read from the CaveatsIt's possible for a bus reset to occur at any time. If If In other words the only way to be sure there is enough bandwidth is to have your request to allocate bandwidth succeed. This means that your isochronous channel setup routine must be prepared to deal gracefully with an error due to insufficient bandwidth, even if the above technique indicates enough bandwidth is available. Document Revision History
Posted: 2004-07-07 |
|