git: 13011cbf7d80 - main - smsc: Remove phy address check in smsc_miibus_writereg
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 23 Oct 2026 21:59:27 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=13011cbf7d80cd1554d87296225ceccb3f7524b4
commit 13011cbf7d80cd1554d87296225ceccb3f7524b4
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2026-10-15 13:31:41 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-10-23 21:58:51 +0000
smsc: Remove phy address check in smsc_miibus_writereg
The driver only allowed writes to the expected phy (i.e., sc->sc_phyno),
and reads were never filtered. sc_phyno is already passed to
mii_attach() as phyloc, so nothing tries to issue MDIO writes to other
addresses and the check is not required.
Remove the check in advance of supporting external PHYs at arbitrary
addresses.
Tested on Microchip's EVB-LAN9500A-LC LAN9500A evaluation board.
Sponsored by: The FreeBSD Foundation
Sponsored by: Microchip (Hardware)
Differential Revision: https://reviews.freebsd.org/D60743
---
sys/dev/usb/net/if_smsc.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c
index c3c21fd22472..5803a5bd1bcf 100644
--- a/sys/dev/usb/net/if_smsc.c
+++ b/sys/dev/usb/net/if_smsc.c
@@ -494,9 +494,6 @@ smsc_miibus_writereg(device_t dev, int phy, int reg, int val)
int locked;
uint32_t addr;
- if (sc->sc_phyno != phy)
- return (0);
-
locked = mtx_owned(&sc->sc_mtx);
if (!locked)
SMSC_LOCK(sc);