mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
port: name the port an eee command acted on the way the user wrote it
port_eee_enable() and port_eee_disable() report the port with print_byte(), which prints the internal index in hex, so turning EEE off on port 5 answers "EEE off for 04". port_eee_status() in the same file already uses print_phys_port(), and the status listing it produces counts from one, so the two halves of the same command disagreed. Use print_phys_port() in all three messages.
This commit is contained in:
1 parent
0a65536a7f
commit
fd058ea74d
1 file changed
+3
-3
+3
-3
@@ -590,12 +590,12 @@ void port_eee_enable(__xdata uint8_t port,__xdata uint8_t speed) __banked
|
|||||||
|
|
||||||
if (machine.is_sfp[port])
|
if (machine.is_sfp[port])
|
||||||
{
|
{
|
||||||
print_string("EEE can't be enabled for SFP port "); print_byte(port); print_string("\n");
|
print_string("EEE can't be enabled for SFP port "); print_phys_port(port); print_string("\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
REG_SET(RTL837X_EEE_CTRL_BASE + (port << 8), EEE_RX_ENABLE | EEE_TX_ENABLE);
|
REG_SET(RTL837X_EEE_CTRL_BASE + (port << 8), EEE_RX_ENABLE | EEE_TX_ENABLE);
|
||||||
print_string("EEE on for "); print_byte(port); print_string(" speed ");
|
print_string("EEE on for "); print_phys_port(port); print_string(" speed ");
|
||||||
// Enable all speeds up to the specified speed
|
// Enable all speeds up to the specified speed
|
||||||
if (speed & EEE_100) {
|
if (speed & EEE_100) {
|
||||||
print_string("100m\n");
|
print_string("100m\n");
|
||||||
@@ -654,7 +654,7 @@ void port_eee_disable(uint8_t port) __banked
|
|||||||
if (machine.is_sfp[port])
|
if (machine.is_sfp[port])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
print_string("EEE off for "); print_byte(port); write_char('\n');
|
print_string("EEE off for "); print_phys_port(port); write_char('\n');
|
||||||
REG_SET(RTL837X_EEE_CTRL_BASE + (port << 8), 0);
|
REG_SET(RTL837X_EEE_CTRL_BASE + (port << 8), 0);
|
||||||
// Disable EEE advertisement for 100/1000BASE-T via EEE Advertisement Reg
|
// Disable EEE advertisement for 100/1000BASE-T via EEE Advertisement Reg
|
||||||
phy_write(port, PHY_MMD_AN, PHY_EEE_ADV, 0);
|
phy_write(port, PHY_MMD_AN, PHY_EEE_ADV, 0);
|
||||||
|
|||||||
Reference in new issue
Block a user