Changeset 2092

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

DICE-EAP Corrects the number of router entries for clearing in EAP::RouterConfig::write

By Philippe Carriere:

EAP::RouterConfig::write assumes the router has 128 entries, something
which is not part of the Dice EAP specifications. This number is
replaced by the maximal number of entries as read in the rom; introduce
the function getMaxNbRouterEntries() as a public function of EAP. Then
use it in EAP::RouterConfig::write.

Files:

Legend:

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

    r2075 r2092  
    16171617    } 
    16181618 
    1619     uint32_t zeros[129]; 
    1620     for (int i=0; i<129; ++i) zeros[i] = 0; 
    1621     if(!m_eap.writeRegBlock(base, offset, zeros, 129*4)) { 
     1619    unsigned int nb_routes_max = m_eap.getMaxNbRouterEntries(); 
     1620    uint32_t zeros[nb_routes_max+1]; 
     1621 
     1622    for (unsigned int i=0; i<nb_routes_max+1; ++i) zeros[i] = 0; 
     1623    if(!m_eap.writeRegBlock(base, offset, zeros, (nb_routes_max+1)*4)) { 
    16221624        debugError("Failed to write zeros to router config block\n"); 
    16231625        return false; 
  • trunk/libffado/src/dice/dice_eap.h

    r2057 r2092  
    549549                        enum eRouteDestination destid, unsigned int offset=0); 
    550550 
     551    uint16_t getMaxNbRouterEntries() {return m_router_nb_entries;}; 
     552 
    551553private: 
    552554    /// Return the router configuration for the current rate