Changeset 2093

Show
Ignore:
Timestamp:
03/29/12 13:28:46 (11 years ago)
Author:
adi
Message:

DICE-EAP add (possibly) printing the full router content with test-dice-eap

By Philippe Carriere.

Additional debug information.

Files:

Legend:

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

    r2092 r2093  
    717717        } 
    718718    } 
     719} 
     720 
     721void 
     722EAP::showFullRouter() 
     723{ 
     724    printMessage("--- Full router content ---\n"); 
     725    fb_quadlet_t* tmp = (fb_quadlet_t *) calloc(m_router_nb_entries, sizeof(fb_quadlet_t)); 
     726 
     727    printMessage(" %d entries to read\n", m_router_nb_entries); 
     728 
     729    // Current config 
     730    printMessage("  Current Configuration:\n"); 
     731    // First bloc is the effective number of routes 
     732    uint32_t nb_routes; 
     733    if(!readRegBlock(eRT_CurrentCfg, 0, &nb_routes, 4)) { 
     734        printMessage("Failed to read number of entries\n"); 
     735        return; 
     736    } 
     737    printMessage("   %d routes\n", nb_routes); 
     738 
     739    // read the route info 
     740    uint32_t tmp_entries[m_router_nb_entries]; 
     741    if(!readRegBlock(eRT_CurrentCfg, 4, tmp_entries, m_router_nb_entries*4)) { 
     742        printMessage("Failed to read router config block information\n"); 
     743        return; 
     744    } 
     745 
     746    // decode and print 
     747    for(unsigned int i=0; i < m_router_nb_entries; i++) { 
     748        printMessage("    %d: 0x%02x <- 0x%02x;\n", i, tmp_entries[i]&0xff, (tmp_entries[i]>>8)&0xff); 
     749    } 
     750    // New config 
     751    printMessage("  New Configuration:\n"); 
     752    // First bloc is the effective number of routes 
     753    if(!readRegBlock(eRT_NewRouting, 0, &nb_routes, 4)) { 
     754        printMessage("Failed to read number of entries\n"); 
     755        return; 
     756    } 
     757    printMessage("   %d routes\n", nb_routes); 
     758 
     759    // read the route info 
     760    if(!readRegBlock(eRT_NewRouting, 4, tmp_entries, m_router_nb_entries*4)) { 
     761        printMessage("Failed to read router config block information\n"); 
     762        return; 
     763    } 
     764 
     765    // decode and print 
     766    for(unsigned int i=0; i < m_router_nb_entries; i++) { 
     767        printMessage("    %d: 0x%02x <- 0x%02x;\n", i, tmp_entries[i]&0xff, (tmp_entries[i]>>8)&0xff); 
     768    } 
     769 
     770    return; 
    719771} 
    720772 
     
    15281580    // print the peak space as it also contains the routing configuration 
    15291581    printMessage("Router sources:\n"); 
     1582    printMessage(" %ld sources:\n", m_sources.size()); 
    15301583    for ( std::map<std::string, int>::iterator it=m_sources.begin(); it!=m_sources.end(); ++it ) { 
    15311584        printMessage(" 0x%02x : %s\n", (*it).second, (*it).first.c_str()); 
    15321585    } 
    15331586    printMessage("Router destinations:\n"); 
     1587    printMessage(" %ld destinations:\n", m_destinations.size()); 
    15341588    for ( std::map<std::string, int>::iterator it=m_destinations.begin(); it!=m_destinations.end(); ++it ) { 
    15351589        printMessage(" 0x%02x : %s\n", (*it).second, (*it).first.c_str()); 
     
    16891743EAP::RouterConfig::show() 
    16901744{ 
     1745    printMessage("%ld routes\n", m_routes2.size()); 
    16911746    for ( RouteVectorV2::iterator it=m_routes2.begin(); it!=m_routes2.end(); ++it ) { 
    16921747        printMessage("0x%02x -> 0x%02x\n", it->second, it->first); 
  • trunk/libffado/src/dice/dice_eap.h

    r2092 r2093  
    476476    void showApplication(); 
    477477 
     478    /// Show the full router content 
     479    void showFullRouter(); 
     480 
    478481    /// Restore from flash 
    479482    bool loadFlashConfig(); 
  • trunk/libffado/tests/test-dice-eap.cpp

    r2088 r2093  
    251251    EAP &eap = *(avDevice->getEAP()); 
    252252 
    253     if (arguments.application) 
     253    if (arguments.application) { 
    254254        eap.showApplication(); 
     255        eap.showFullRouter(); 
     256    } 
    255257    else 
    256258        eap.show();