Show
Ignore:
Timestamp:
11/28/07 12:02:08 (15 years ago)
Author:
ppalmers
Message:

- Adapt the ffado external API (upgrade to v3)

NEEDS NEW JACK BACKEND

- simplify FFADODevice constructor even more
- implement first framework support for supporting multiple adapters.

currently all firewire adapters are scanned for supported devices unless specified otherwise
however attaching devices to separate adapters is not supported. using multiple adapters at
that are connected together might work.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r734 r739  
    5252}; 
    5353 
    54 DiceAvDevice::DiceAvDevice( Ieee1394Service& ieee1394Service, 
    55                             std::auto_ptr<ConfigRom>( configRom )) 
    56     : FFADODevice( ieee1394Service, configRom ) 
     54DiceAvDevice::DiceAvDevice( std::auto_ptr<ConfigRom>( configRom )) 
     55    : FFADODevice( configRom ) 
    5756    , m_model( NULL ) 
    5857    , m_global_reg_offset (0xFFFFFFFFLU) 
     
    108107 
    109108FFADODevice * 
    110 DiceAvDevice::createDevice( Ieee1394Service& ieee1394Service, 
    111                             std::auto_ptr<ConfigRom>( configRom )) 
     109DiceAvDevice::createDevice( std::auto_ptr<ConfigRom>( configRom )) 
    112110{ 
    113     return new DiceAvDevice(ieee1394Service, configRom ); 
     111    return new DiceAvDevice( configRom ); 
    114112} 
    115113 
     
    117115DiceAvDevice::discover() 
    118116{ 
    119     unsigned int vendorId = m_pConfigRom->getNodeVendorId(); 
    120     unsigned int modelId = m_pConfigRom->getModelId(); 
     117    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
     118    unsigned int modelId = getConfigRom().getModelId(); 
    121119 
    122120    for ( unsigned int i = 0; 
     
    490488        Streaming::AmdtpReceiveStreamProcessor *p; 
    491489        p=new Streaming::AmdtpReceiveStreamProcessor( 
    492                              m_p1394Service->getPort(), 
     490                             get1394Service().getPort(), 
    493491                             nb_channels); 
    494492 
     
    576574        Streaming::AmdtpTransmitStreamProcessor *p; 
    577575        p=new Streaming::AmdtpTransmitStreamProcessor( 
    578                              m_p1394Service->getPort(), 
     576                             get1394Service().getPort(), 
    579577                             nb_channels); 
    580578 
     
    690688    // get a notifier to handle device notifications 
    691689    nodeaddr_t notify_address; 
    692     notify_address = m_p1394Service->findFreeARMBlock( 
     690    notify_address = get1394Service().findFreeARMBlock( 
    693691                        DICE_NOTIFIER_BASE_ADDRESS, 
    694692                        DICE_NOTIFIER_BLOCK_LENGTH, 
     
    707705    } 
    708706 
    709     if (!m_p1394Service->registerARMHandler(m_notifier)) { 
     707    if (!get1394Service().registerARMHandler(m_notifier)) { 
    710708        debugError("Could not register notifier\n"); 
    711709        delete m_notifier; 
     
    726724    } 
    727725 
    728     fb_nodeaddr_t swap_value = ((0xFFC0) | m_p1394Service->getLocalNodeId()); 
     726    fb_nodeaddr_t swap_value = ((0xFFC0) | get1394Service().getLocalNodeId()); 
    729727    swap_value = swap_value << 48; 
    730728    swap_value |= m_notifier->getStart(); 
    731729 
    732     if (!m_p1394Service->lockCompareSwap64(  getNodeId() | 0xFFC0, addr, DICE_OWNER_NO_OWNER, 
     730    if (!get1394Service().lockCompareSwap64(  getNodeId() | 0xFFC0, addr, DICE_OWNER_NO_OWNER, 
    733731                                       swap_value, &result )) { 
    734732        debugWarning("Could not register ourselves as device owner\n"); 
     
    765763    } 
    766764 
    767     fb_nodeaddr_t compare_value = ((0xFFC0) | m_p1394Service->getLocalNodeId()); 
     765    fb_nodeaddr_t compare_value = ((0xFFC0) | get1394Service().getLocalNodeId()); 
    768766    compare_value <<= 48; 
    769767    compare_value |= m_notifier->getStart(); 
    770768 
    771     if (!m_p1394Service->lockCompareSwap64(  getNodeId() | 0xFFC0, addr, compare_value, 
     769    if (!get1394Service().lockCompareSwap64(  getNodeId() | 0xFFC0, addr, compare_value, 
    772770                                       DICE_OWNER_NO_OWNER, &result )) { 
    773771        debugWarning("Could not unregister ourselves as device owner\n"); 
     
    775773    } 
    776774 
    777     m_p1394Service->unregisterARMHandler(m_notifier); 
     775    get1394Service().unregisterARMHandler(m_notifier); 
    778776    delete m_notifier; 
    779777    m_notifier=NULL; 
     
    984982    unsigned int bandwidth=8+packet_size; 
    985983 
    986     int ch=m_p1394Service->allocateIsoChannelGeneric(bandwidth); 
     984    int ch=get1394Service().allocateIsoChannelGeneric(bandwidth); 
    987985 
    988986    debugOutput(DEBUG_LEVEL_VERBOSE, "allocated channel %d, bandwidth %d\n", 
     
    994992bool DiceAvDevice::deallocateIsoChannel(int channel) { 
    995993    debugOutput(DEBUG_LEVEL_VERBOSE, "freeing channel %d\n",channel); 
    996     return m_p1394Service->freeIsoChannel(channel); 
     994    return get1394Service().freeIsoChannel(channel); 
    997995} 
    998996 
     
    12271225    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    12281226 
    1229     if(!m_p1394Service->read_quadlet( nodeId, addr, result ) ) { 
     1227    if(!get1394Service().read_quadlet( nodeId, addr, result ) ) { 
    12301228        debugError("Could not read from node 0x%04X addr 0x%012X\n", nodeId, addr); 
    12311229        return false; 
     
    12521250    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    12531251 
    1254     if(!m_p1394Service->write_quadlet( nodeId, addr, htonl(data) ) ) { 
     1252    if(!get1394Service().write_quadlet( nodeId, addr, htonl(data) ) ) { 
    12551253        debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); 
    12561254        return false; 
     
    12721270    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    12731271 
    1274     if(!m_p1394Service->read( nodeId, addr, length/4, data ) ) { 
     1272    if(!get1394Service().read( nodeId, addr, length/4, data ) ) { 
    12751273        debugError("Could not read from node 0x%04X addr 0x%012llX\n", nodeId, addr); 
    12761274        return false; 
     
    13031301    } 
    13041302 
    1305     if(!m_p1394Service->write( nodeId, addr, length/4, data_out ) ) { 
     1303    if(!get1394Service().write( nodeId, addr, length/4, data_out ) ) { 
    13061304        debugError("Could not write to node 0x%04X addr 0x%012llX\n", nodeId, addr); 
    13071305        return false; 
  • trunk/libffado/src/dice/dice_avdevice.h

    r734 r739  
    5757    class DiceNotifier; 
    5858public: 
    59     DiceAvDevice( Ieee1394Service& ieee1394Service, 
    60                   std::auto_ptr<ConfigRom>( configRom )); 
     59    DiceAvDevice( std::auto_ptr<ConfigRom>( configRom )); 
    6160    ~DiceAvDevice(); 
    6261 
    6362    static bool probe( ConfigRom& configRom ); 
    64     static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
    65                                         std::auto_ptr<ConfigRom>( configRom )); 
     63    static FFADODevice * createDevice( std::auto_ptr<ConfigRom>( configRom )); 
    6664    virtual bool discover(); 
    6765