@@ -1677,10 +1677,10 @@ void MlxlinkCommander::prepareDDMSection(bool valid, bool isModuleExtSupported)
16771677 float voltageHighTH = getFieldValue (" voltage_high_th" ) / 10.0 ;
16781678 float voltageLowTH = getFieldValue (" voltage_low_th" ) / 10.0 ;
16791679
1680- rxPowerHighTH = getPower (getFieldValue (" rx_power_high_th" ));
1681- rxPowerLowTH = getPower (getFieldValue (" rx_power_low_th" ));
1682- txPowerHighTH = getPower (getFieldValue (" tx_power_high_th" ));
1683- txPowerLowTH = getPower (getFieldValue (" tx_power_low_th" ));
1680+ rxPowerHighTH = getPower (getFieldValue (" rx_power_high_th" ), isModuleExtSupported );
1681+ rxPowerLowTH = getPower (getFieldValue (" rx_power_low_th" ), isModuleExtSupported );
1682+ txPowerHighTH = getPower (getFieldValue (" tx_power_high_th" ), isModuleExtSupported );
1683+ txPowerLowTH = getPower (getFieldValue (" tx_power_low_th" ), isModuleExtSupported );
16841684 if (isModuleExtSupported)
16851685 {
16861686 rxPowerHighTH = convertFloatPrec (rxPowerHighTH);
@@ -1706,8 +1706,8 @@ void MlxlinkCommander::prepareDDMSection(bool valid, bool isModuleExtSupported)
17061706 for (u_int32_t lane = 0 ; lane < _numOfLanes; lane++)
17071707 {
17081708 string laneStr = to_string (_moduleLanesMapping[lane]);
1709- rxPowerLane.push_back (getPower (getFieldValue (" rx_power_lane" + laneStr)));
1710- txPowerLane.push_back (getPower (getFieldValue (" tx_power_lane" + laneStr)));
1709+ rxPowerLane.push_back (getPower (getFieldValue (" rx_power_lane" + laneStr), isModuleExtSupported ));
1710+ txPowerLane.push_back (getPower (getFieldValue (" tx_power_lane" + laneStr), isModuleExtSupported ));
17111711 biasCurrentLane.push_back (getFieldValue (" tx_bias_lane" + laneStr) * txMultiplier / 500.0 );
17121712 }
17131713
@@ -1727,37 +1727,27 @@ void MlxlinkCommander::prepareDDMSection(bool valid, bool isModuleExtSupported)
17271727 setPrintVal (_moduleInfoCmd, " Tx Power Current [dBm]" , txPowerStr, ANSI_COLOR_RESET, true , valid);
17281728}
17291729
1730- string MlxlinkCommander::getValuesOfActiveLanes (const string& row, bool isSnr )
1730+ string MlxlinkCommander::getValuesOfActiveLanes (const string& row, bool moduleLanes )
17311731{
17321732 string newValue = row;
17331733
17341734 auto valuesPerLane = MlxlinkRecord::split (newValue, " ," );
1735-
1735+ vector<string> validValues;
17361736 if (valuesPerLane.size () > 1 )
17371737 {
1738- if (isSnr )
1738+ for ( u_int32_t i = 0 ; i < _numOfLanes; i++ )
17391739 {
1740- // Remove all "0" (invalid lanes) values
1741- valuesPerLane.erase (std::remove_if (valuesPerLane.begin (), valuesPerLane.end (),
1742- [](const string& value) { return value == " 0" ; }),
1743- valuesPerLane.end ());
1744-
1745- // If all lanes are invalid, set all lanes to 0
1746- if (valuesPerLane.empty ())
1740+ if (moduleLanes)
17471741 {
1748- for (u_int32_t i = 0 ; i < _numOfLanes; i++)
1749- {
1750- valuesPerLane.push_back (to_string (0 ));
1751- }
1742+ validValues.push_back (valuesPerLane[_moduleLanesMapping[i]]);
1743+ }
1744+ else
1745+ {
1746+ validValues.push_back (valuesPerLane[i]);
17521747 }
1753- }
1754- else
1755- {
1756- // Remove all lanes that are not in the valuesPerLane vector
1757- valuesPerLane.erase (valuesPerLane.begin () + _numOfLanes, valuesPerLane.end ());
17581748 }
17591749
1760- newValue = getStringFromVector (valuesPerLane );
1750+ newValue = getStringFromVector (validValues );
17611751 }
17621752
17631753 return newValue;
@@ -1852,7 +1842,7 @@ void MlxlinkCommander::prepareBerModuleInfo(bool valid, const vector<AmberField>
18521842 }
18531843 if (it->perLane )
18541844 {
1855- fieldValue = getValuesOfActiveLanes (fieldValue);
1845+ fieldValue = getValuesOfActiveLanes (fieldValue, true );
18561846 }
18571847
18581848 if ((it->uiName == " Cable Rx Emphasis" ) && _cmisCable)
@@ -1868,12 +1858,12 @@ bool MlxlinkCommander::checkIfModuleExtSupported()
18681858{
18691859 bool isModuleExtSupported = false ;
18701860
1871- sendPrmReg (ACCESS_REG_PDDR, GET, " page_select=%d , module_info_ext=1" , PDDR_MODULE_INFO_PAGE);
1872- float rxPowerHighTH_fst = getFieldValue (" rx_power_high_th" );
1873-
18741861 sendPrmReg (ACCESS_REG_PDDR, GET, " page_select=%d , module_info_ext=0" , PDDR_MODULE_INFO_PAGE);
18751862 float rxPowerHighTH_sec = getFieldValue (" rx_power_high_th" );
18761863
1864+ sendPrmReg (ACCESS_REG_PDDR, GET, " page_select=%d , module_info_ext=1" , PDDR_MODULE_INFO_PAGE);
1865+ float rxPowerHighTH_fst = getFieldValue (" rx_power_high_th" );
1866+
18771867 if (rxPowerHighTH_sec != rxPowerHighTH_fst)
18781868 {
18791869 isModuleExtSupported = true ;
0 commit comments