Skip to content

Commit 45d287c

Browse files
committed
stm32/eth: Code cleanup - remove unused constant and fix issues.
This commit addresses 4 issues found during comprehensive code review: 1. Remove unused MAC_RECONFIG_DELAY_MS constant (all uses were removed when fixed delays were replaced with descriptor polling). 2. Initialize mac_speed_configured and autoneg_start_ms in eth_init() to prevent uninitialized values between eth_init() and eth_start(). 3. Fix misleading comment about DHCP restart - the link-down handler only does dhcp_stop(), not dhcp_start(). 4. Remove extra blank line in eth_phy.h. No functional changes, purely cleanup. Signed-off-by: Andrew Leech <[email protected]>
1 parent e86d748 commit 45d287c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ports/stm32/eth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ int eth_init(eth_t *self, int mac_idx, uint32_t phy_addr, int phy_type) {
203203
self->last_link_status = false;
204204
self->enabled = false;
205205
self->mac_reconfig_in_progress = false;
206+
self->mac_speed_configured = false;
207+
self->autoneg_start_ms = 0;
206208
if (phy_type == ETH_PHY_DP83825 || phy_type == ETH_PHY_DP83848) {
207209
self->phy_get_link_status = eth_phy_dp838xx_get_link_status;
208210
} else if (phy_type == ETH_PHY_LAN8720 || phy_type == ETH_PHY_LAN8742) {

ports/stm32/eth_phy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
#define PHY_SPEED_100FULL (6)
5858
#define PHY_DUPLEX (4)
5959

60-
6160
uint32_t eth_phy_read(uint32_t phy_addr, uint32_t reg);
6261
void eth_phy_write(uint32_t phy_addr, uint32_t reg, uint32_t val);
6362

0 commit comments

Comments
 (0)