Changeset 405

Show
Ignore:
Timestamp:
02/19/07 00:02:47 (17 years ago)
Author:
pieterpalmers
Message:

- fix some small bugs in ieee1394service and configrom
- modify bounce device's discovery routine

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/streaming-rework/src/bounce/bounce_avdevice.cpp

    r404 r405  
    4444namespace Bounce { 
    4545 
     46// to define the supported devices 
     47static VendorModelEntry supportedDeviceList[] = 
     48{ 
     49    {0x0B0001, 0x0B0001, 0x0B0001, "FreeBoB", "Bounce"}, 
     50}; 
     51 
    4652IMPL_DEBUG_MODULE( BounceDevice, BounceDevice, DEBUG_LEVEL_VERBOSE ); 
    4753 
     
    5662    , m_verboseLevel( verboseLevel ) 
    5763    , m_samplerate (44100) 
     64    , m_model( NULL ) 
    5865    , m_id(0) 
    5966    , m_receiveProcessor ( 0 ) 
     
    7986} 
    8087 
    81 struct VendorModelEntry { 
    82     unsigned int vendor_id; 
    83     unsigned int model_id; 
    84 }; 
    85  
    86 static VendorModelEntry supportedDeviceList[] = 
    87 { 
    88 //     {0x0000, 0x000000}, 
    89 }; 
    90  
    9188bool 
    9289BounceDevice::probe( ConfigRom& configRom ) 
    9390{ 
    94     unsigned int vendorId = configRom.getNodeVendorId(); 
     91//     unsigned int vendorId = configRom.getNodeVendorId(); 
    9592    unsigned int modelId = configRom.getModelId(); 
     93    unsigned int unitSpecifierId = configRom.getUnitSpecifierId(); 
    9694 
    9795    for ( unsigned int i = 0; 
     
    9997          ++i ) 
    10098    { 
    101         if ( ( supportedDeviceList[i].vendor_id == vendorId ) 
    102              && ( supportedDeviceList[i].model_id == modelId ) 
     99        if (  
     100//             ( supportedDeviceList[i].vendor_id == vendorId ) 
     101             ( supportedDeviceList[i].model_id == modelId ) 
     102             && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId )  
    103103           ) 
    104104        { 
     
    117117//      quadlet_t *resp; 
    118118 
     119//     unsigned int vendorId = m_configRom->getNodeVendorId(); 
     120    unsigned int modelId = m_configRom->getModelId(); 
     121    unsigned int unitSpecifierId = m_configRom->getUnitSpecifierId(); 
     122 
     123    for ( unsigned int i = 0; 
     124          i < ( sizeof( supportedDeviceList )/sizeof( VendorModelEntry ) ); 
     125          ++i ) 
     126    { 
     127        if ( //( supportedDeviceList[i].vendor_id == vendorId ) 
     128             ( supportedDeviceList[i].model_id == modelId )  
     129             && ( supportedDeviceList[i].unit_specifier_id == unitSpecifierId )  
     130           ) 
     131        { 
     132            m_model = &(supportedDeviceList[i]); 
     133        } 
     134    } 
     135 
     136    if (m_model != NULL) { 
     137        debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
     138                m_model->vendor_name, m_model->model_name); 
     139        return true; 
     140    } 
     141     
    119142    debugOutput( DEBUG_LEVEL_VERBOSE, "Discovering...\n" ); 
    120143 
     
    171194    debugOutput(DEBUG_LEVEL_NORMAL, "Vendor            :  %s\n", m_configRom->getVendorName().c_str()); 
    172195    debugOutput(DEBUG_LEVEL_NORMAL, "Model             :  %s\n", m_configRom->getModelName().c_str()); 
     196    debugOutput(DEBUG_LEVEL_NORMAL, "Vendor Name       :  %s\n", m_model->vendor_name); 
     197    debugOutput(DEBUG_LEVEL_NORMAL, "Model Name        :  %s\n", m_model->model_name); 
    173198    debugOutput(DEBUG_LEVEL_NORMAL, "Node              :  %d\n", m_nodeId); 
    174199    debugOutput(DEBUG_LEVEL_NORMAL, "GUID              :  0x%016llX\n", m_configRom->getGuid()); 
  • branches/streaming-rework/src/bounce/bounce_avdevice.h

    r404 r405  
    4242namespace Bounce { 
    4343 
     44// struct to define the supported devices 
     45struct VendorModelEntry { 
     46    unsigned int vendor_id; 
     47    unsigned int model_id; 
     48    unsigned int unit_specifier_id; 
     49    char *vendor_name; 
     50    char *model_name; 
     51}; 
     52 
    4453class BounceDevice : public IAvDevice { 
    4554public: 
     
    8291 
    8392    unsigned int m_samplerate; 
     93    struct VendorModelEntry* m_model; 
    8494    unsigned int m_id; 
    8595 
  • branches/streaming-rework/src/configrom.cpp

    r368 r405  
    128128                                 &csr_info ); 
    129129    if (!m_csr || csr1212_parse_csr( m_csr ) != CSR1212_SUCCESS) { 
    130         debugError( "Could not parse config rom of node %d on port %d", m_nodeId, m_1394Service->getPort() ); 
     130        debugError( "Could not parse config rom of node %d on port %d\n", m_nodeId, m_1394Service->getPort() ); 
    131131        if (m_csr) { 
    132132            csr1212_destroy_csr(m_csr); 
     
    215215{ 
    216216    struct config_csr_info* csr_info = (struct config_csr_info*) private_data; 
    217  
     217     
    218218    if ( !csr_info->service->read( csr_info->nodeId, 
    219219                                   addr, 
    220                                    length/4, 
     220                                   (size_t)length/4, 
    221221                                   ( quadlet_t* )buffer) ) 
    222222    { 
     
    486486    printf( "\tNode Vendor ID:\t\t0x%06x\n",  getNodeVendorId() ); 
    487487    printf( "\tModel Id:\t\t0x%08x\n",        getModelId() ); 
     488    printf( "\tUnit Specifier ID:\t0x%06x\n",  getUnitSpecifierId() ); 
     489    printf( "\tUnit version:\t\t0x%08x\n",        getUnitVersion() ); 
    488490    printf( "\tISO resource manager:\t%d\n",  isIsoResourseManager() ); 
    489491    printf( "\tCycle master capable:\t%d\n",  isSupportsIsoOperations() ); 
    490492    printf( "\tBus manager capable:\t%d\n",   isBusManagerCapable() ); 
    491     printf( "\tCycle clock accurancy:\t%d\n", getCycleClockAccurancy() ); 
     493    printf( "\tCycle clock accuracy:\t%d\n", getCycleClockAccurancy() ); 
    492494    printf( "\tMax rec:\t\t%d (max asy payload: %d bytes)\n", 
    493495            getMaxRec(), getAsyMaxPayload() ); 
  • branches/streaming-rework/src/devicemanager.cpp

    r404 r405  
    372372        } 
    373373 
    374         free(result); 
    375374    } 
    376375 
  • branches/streaming-rework/src/libfreebobavc/ieee1394service.cpp

    r377 r405  
    3333 
    3434Ieee1394Service::Ieee1394Service() 
    35     : m_handle( 0 ) 
     35    : m_handle( 0 ), m_resetHandle( 0 ) 
    3636    , m_port( -1 ) 
    3737    , m_threadRunning( false ) 
     
    109109        #ifdef DEBUG 
    110110        debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 
    111             "read: node 0x%X, addr = 0x%016X, length = %d\n", 
     111            "read: node 0x%X, addr = 0x%016llX, length = %u\n", 
    112112            nodeId, addr, length); 
    113113        printBuffer( length, buffer ); 
     
    117117    } else { 
    118118        #ifdef DEBUG 
    119         debugError("raw1394_read failed: node 0x%X, addr = 0x%016X, length = %d\n", 
     119        debugError("raw1394_read failed: node 0x%X, addr = 0x%016llX, length = %u\n", 
    120120              nodeId, addr, length); 
    121121        #endif