Changeset 656

Show
Ignore:
Timestamp:
10/17/07 18:58:50 (15 years ago)
Author:
f.ernoult
Message:

MotU: Fix bugs in the ports definition mechanism

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/motu/motu_avdevice.cpp

    r655 r656  
    101101    {"Analog7", MOTUFW_DIR_INOUT, MOTUFW_PA_RATE_ANY|MOTUFW_PA_OPTICAL_ANY, 34}, 
    102102    {"Analog8", MOTUFW_DIR_INOUT, MOTUFW_PA_RATE_ANY|MOTUFW_PA_OPTICAL_ANY, 37}, 
    103     {"AES/EBU-L", MOTUFW_DIR_INOUT, MOTUFW_PA_RATE_1x2x|MOTUFW_PA_OPTICAL_ANY, 40}, 
    104     {"AES/EBU-R", MOTUFW_DIR_INOUT, MOTUFW_PA_RATE_1x2x|MOTUFW_PA_OPTICAL_ANY, 43}, 
     103    {"AES/EBU1", MOTUFW_DIR_INOUT, MOTUFW_PA_RATE_1x2x|MOTUFW_PA_OPTICAL_ANY, 40}, 
     104    {"AES/EBU2", MOTUFW_DIR_INOUT, MOTUFW_PA_RATE_1x2x|MOTUFW_PA_OPTICAL_ANY, 43}, 
    105105    {"SPDIF1", MOTUFW_DIR_INOUT, MOTUFW_PA_RATE_1x2x|MOTUFW_PA_OPTICAL_OFF|MOTUFW_PA_OPTICAL_ADAT, 46}, 
    106106    {"SPDIF2", MOTUFW_DIR_INOUT, MOTUFW_PA_RATE_1x2x|MOTUFW_PA_OPTICAL_OFF|MOTUFW_PA_OPTICAL_ADAT, 49}, 
     
    778778        flags |= MOTUFW_PA_RATE_1x; 
    779779 
    780     for (i=0; i < ( DevicesPorts[m_motu_model].PortsListLength /sizeof( PortEntry ) ); i++) { 
    781         if (( DevicesPorts[m_motu_model].PortsList[i].port_dir & dir ) && 
    782            ( DevicesPorts[m_motu_model].PortsList[i].port_flags & MOTUFW_PA_RATE_MASK & flags ) && 
    783            ( DevicesPorts[m_motu_model].PortsList[i].port_flags & MOTUFW_PA_OPTICAL_MASK & flags )) { 
     780    for (i=0; i < ( DevicesPorts[m_motu_model-1].PortsListLength /sizeof( PortEntry ) ); i++) { 
     781        if (( DevicesPorts[m_motu_model-1].PortsList[i].port_dir & dir ) && 
     782           ( DevicesPorts[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_RATE_MASK & flags ) && 
     783           ( DevicesPorts[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_OPTICAL_MASK & flags )) { 
    784784            size += 3; 
    785785        } 
     
    858858    } 
    859859 
    860     for (i=0; i < ( DevicesPorts[m_motu_model].PortsListLength /sizeof( PortEntry ) ); i++) { 
    861         if (( DevicesPorts[m_motu_model].PortsList[i].port_dir & dir ) && 
    862            ( DevicesPorts[m_motu_model].PortsList[i].port_flags & MOTUFW_PA_RATE_MASK & flags ) && 
    863            ( DevicesPorts[m_motu_model].PortsList[i].port_flags & MOTUFW_PA_OPTICAL_MASK & flags )) { 
     860    for (i=0; i < ( DevicesPorts[m_motu_model-1].PortsListLength /sizeof( PortEntry ) ); i++) { 
     861        if (( DevicesPorts[m_motu_model-1].PortsList[i].port_dir & dir ) && 
     862           ( DevicesPorts[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_RATE_MASK & flags ) && 
     863           ( DevicesPorts[m_motu_model-1].PortsList[i].port_flags & MOTUFW_PA_OPTICAL_MASK & flags )) { 
    864864            asprintf(&buff,"%s_%s_%s" , id.c_str(), mode_str, 
    865               DevicesPorts[m_motu_model].PortsList[i].port_name); 
    866             if (!addPort(s_processor, buff, direction, DevicesPorts[m_motu_model].PortsList[i].port_offset, 0)) 
     865              DevicesPorts[m_motu_model-1].PortsList[i].port_name); 
     866            if (!addPort(s_processor, buff, direction, DevicesPorts[m_motu_model-1].PortsList[i].port_offset, 0)) 
    867867                return false; 
    868868        }