Home | History | Annotate | Download | only in mii
History log of /src/sys/dev/mii/makphyvar.h
RevisionDateAuthorComments
 1.4  06-Jan-2022  msaitoh QEMU e1000's PHY code doesn't reflect the PSSR_LINK bit. Do workaround.

IEEE 802.3 clause 22's PHY device has a link status bit in the BMCR
register, but it's required to read twice to get the correct value.
Almost all PHY devices have the vendor specific register which has
the link status bit that it's not required to read twice. makphy(4)
use the bit in the PSSR register to reduce the access cost.

QEMU's e1000 provides the PHY specific status register at 0x11 but the
link indication bit (PSSR_LINK.) is always 1 because
e1000x_update_regs_on_link_{down,up}() modify MII_SR_LINK_STATUS
(BMSR_LINK in NetBSD) but don't modify PSSR_LINK. It causes
"virsh domif-setlink xxx yyy down" doesn't work.
To avoid this problem, read the BMSR and check the BMSR_LINK bit. Add
MAKPHY_QUIRK_PSSR_LINK bit for this quirk. Set it if MII_EXTSR doesn't
exist because it's one of the case of QEMU.

Found and tested by ozaki-r.
 1.3  28-Dec-2021  msaitoh Reduce the access of the ESSR register.

- makphyattach() have a code to detect the Fiber/Copper auto selection
feature. Save the info to sc_flags to reduce the access
to the ESSR register. One of the reason is that the register is not
implemented on QEMU. Another reason is that it's not required to
access the register if the device is in the copper only mode.
 1.2  25-Mar-2019  msaitoh branches: 1.2.4; 1.2.6; 1.2.8;
Add my name.
 1.1  25-Mar-2019  msaitoh - 88E1000(S) has no page select register, so don't access it.
Note that qemu doesn't implement the register and the access fails.
For I210, we can use the register.
- Don't set PSCR_CRS_ON_TX bit on I210.
 1.2.8.2  01-Aug-2019  martin Add missing file from last pullup (ticket #1316, revisions 1.1-1.2)
 1.2.8.1  25-Mar-2019  martin file makphyvar.h was added on branch netbsd-8 on 2019-08-01 15:48:15 +0000
 1.2.6.1  29-Jan-2022  martin Pull up the following revisions (all via patch), requested by msaitoh
in ticket #1410:

sys/dev/mii/makphy.c 1.67,1.69-1.72
sys/dev/mii/makphyvar.h 1.3-1.4

- Add I347-AT4 support.
- Add three workarounds for QEMU e1000:
- QEMU sets BMSR_EXTSTAT but the access to register 15 fails.
Set EXTSR_1000TFDX and EXTSR_1000THDX if the access failed in the
attach function. It's just a cosmetic change.
- Marvell 88E1[01]11 have the Fiber/Copper auto selection feature,
but QEMU doesn't implement it. If the register access failed,
the media is regarded as copper only. It's just a cosmetic change.
- QEMU provides the PHY specific status register at 0x11 but the
link indication bit (PSSR_LINK) is always 1. It causes
"virsh domif-setlink xxx yyy down" doesn't work. To avoid this
problem, read the BMSR and check the BMSR_LINK bit. Add
MAKPHY_QUIRK_PSSR_LINK bit for this quirk. Set it if MII_EXTSR
doesn't exist because it's one of the case of QEMU.
- Reduce the number of access to the ESSR register. One of the reason
is that the register is not implemented on QEMU. Another reason is
that it's not required to access the register if the device is in
the copper only mode.
 1.2.4.2  10-Jun-2019  christos Sync with HEAD
 1.2.4.1  25-Mar-2019  christos file makphyvar.h was added on branch phil-wifi on 2019-06-10 22:07:14 +0000

RSS XML Feed