Author: emaste Date: Mon Apr 30 02:18:19 2018 New Revision: 333096 URL: https://svnweb.freebsd.org/changeset/base/333096
Log: if_smsc: set MII BUSY bit to read/write PHY regs Per the datasheet, the BUSY bit must be set when reading or writing PHY registers. From Linux commit 80928805babf. Submitted by: Arshan Khanifar MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15217 Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Mon Apr 30 01:58:24 2018 (r333095) +++ head/sys/dev/usb/net/if_smsc.c Mon Apr 30 02:18:19 2018 (r333096) @@ -452,7 +452,7 @@ smsc_miibus_readreg(device_t dev, int phy, int reg) goto done; } - addr = (phy << 11) | (reg << 6) | SMSC_MII_READ; + addr = (phy << 11) | (reg << 6) | SMSC_MII_READ | SMSC_MII_BUSY; smsc_write_reg(sc, SMSC_MII_ADDR, addr); if (smsc_wait_for_bits(sc, SMSC_MII_ADDR, SMSC_MII_BUSY) != 0) @@ -505,7 +505,7 @@ smsc_miibus_writereg(device_t dev, int phy, int reg, i val = htole32(val); smsc_write_reg(sc, SMSC_MII_DATA, val); - addr = (phy << 11) | (reg << 6) | SMSC_MII_WRITE; + addr = (phy << 11) | (reg << 6) | SMSC_MII_WRITE | SMSC_MII_BUSY; smsc_write_reg(sc, SMSC_MII_ADDR, addr); if (smsc_wait_for_bits(sc, SMSC_MII_ADDR, SMSC_MII_BUSY) != 0) _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"