Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3bafdda33550
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b1ce3deef134
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 13, 2019

  1. Copy the full SHA
    e74f6f9 View commit details
  2. LeCroyOscilloscope: correctly update channel enable status in cache w…

    …hen calling EnableChannel() / DisableChannel()
    azonenberg committed Dec 13, 2019
    Copy the full SHA
    b1ce3de View commit details
Showing with 107 additions and 0 deletions.
  1. +2 −0 scopehal/LeCroyOscilloscope.cpp
  2. +105 −0 scopeprotocols/MDIODecoder.cpp
2 changes: 2 additions & 0 deletions scopehal/LeCroyOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -359,12 +359,14 @@ void LeCroyOscilloscope::EnableChannel(size_t i)
//LogDebug("enable channel %d\n", i);
lock_guard<recursive_mutex> lock(m_mutex);
//LogDebug("got mutex\n");
m_channelsEnabled[i] = true;
SendCommand(m_channels[i]->GetHwname() + ":TRACE ON");
}

void LeCroyOscilloscope::DisableChannel(size_t i)
{
lock_guard<recursive_mutex> lock(m_mutex);
m_channelsEnabled[i] = false;
SendCommand(m_channels[i]->GetHwname() + ":TRACE OFF");
}

105 changes: 105 additions & 0 deletions scopeprotocols/MDIODecoder.cpp
Original file line number Diff line number Diff line change
@@ -298,6 +298,7 @@ void MDIODecoder::Refresh()
pack->m_headers["Value"] = tmp;

//Add extra information to the decode if it's a known register
//TODO: share this between clause 22 and 45 decoders
string info;
switch(addr)
{
@@ -359,6 +360,109 @@ void MDIODecoder::Refresh()
info += ", Link down";

break;

//PHY ID
case 0x2:
info = "PHY ID 1";
break;
case 0x3:
info = "PHY ID 2";
break;

//Autonegotiation
case 0x4:
info = "ANEG Advertisement";
break;
case 0x5:
info = "ANEG Partner Ability";
break;
case 0x6:
info = "ANEG Expansion";
break;
case 0x7:
info = "ANEG Next Page";
break;
case 0x8:
info = "ANEG Partner Next Page";
break;

//1000base-T
case 0x9:
info = "1000base-T Control: ";
if( (value >> 13) != 0)
{
char tmp[128];
snprintf(tmp, sizeof(tmp), "Test mode %d, ", value >> 13);
info += tmp;
}

if(value & 0x1000)
{
if(value & 0x0800)
info += "Force master";
else
info += "Force slave";
}
else
{
if(value & 0x0400)
info += "Prefer master";
else
info += "Prefer slave";
}
break;

case 0xa:
info = "1000base-T Status: ";

if(value & 0x4000)
info += "Master, ";
else
info += "Slave, ";

//TODO: other fields

{
char tmp[32];
snprintf(tmp, sizeof(tmp), "Err count: %d", value & 0xff);
info += tmp;
}

break;

//MMD stuff
case 0xd:
info = "MMD Access: ";

switch(value >> 14)
{
case 0:
info += "Register";
break;

case 1:
info += "Data";
break;

case 2:
info += "Data R/W increment";
break;

case 3:
info += "Data W increment";
break;
}
break;

case 0xe:
info = "MMD Addr/Data";
break;

case 0xf:
info = "Extended Status";
break;

//TODO: support for PHY vendor specific registers if we know the PHY ID (or are told)
}
pack->m_headers["Info"] = info;

@@ -379,6 +483,7 @@ void MDIODecoder::Refresh()
dmdio[i].m_offset,
(dmdio[i+1].m_offset - dmdio[i].m_offset) + dmdio[i+1].m_duration,
MDIOSymbol(MDIOSymbol::TYPE_ERROR, 0)));
continue;
}
}