From 6db21a05554530b98a3b99e5f9f315bc3748a8d1 Mon Sep 17 00:00:00 2001 From: Evan Lojewski Date: Sun, 13 Dec 2020 13:49:20 -0700 Subject: network: Update EEE exit time based on speed per the tg3 driver. (#192) --- libs/Network/ports.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libs/Network') diff --git a/libs/Network/ports.c b/libs/Network/ports.c index 877d3ec..cf144bc 100644 --- a/libs/Network/ports.c +++ b/libs/Network/ports.c @@ -1120,6 +1120,19 @@ bool Network_updatePortState(NetworkPort_t *port) txMacLengths.bits.IPGCRSLength = 0x2; } port->device->TransmitMacLengths = txMacLengths; + + // Update EEE Control + RegDEVICEEeeControl_t eeectrl; + eeectrl.r32 = 0; + if (emacMode.bits.PortMode == DEVICE_EMAC_MODE_PORT_MODE_1000) + { + eeectrl.bits.ExitTime = DEVICE_EEE_CONTROL_EXIT_TIME_16_5_US; + } + else + { + eeectrl.bits.ExitTime = DEVICE_EEE_CONTROL_EXIT_TIME_36_US; + } + port->device->EeeControl.r32 = eeectrl.r32; } updated = true; -- cgit v1.2.1