]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: phy: micrel: add MSE interface support for KSZ9477 family
authorOleksij Rempel <o.rempel@pengutronix.de>
Mon, 27 Oct 2025 12:28:00 +0000 (13:28 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 4 Nov 2025 02:32:27 +0000 (18:32 -0800)
commit335a9660e141349d7751b3b880d7531ea401a8db
treef242dd6513c696b8cae23a376c89aca9e504c5e9
parente6e93fb01302e9b7a15d17f3b8a00eff8a601654
net: phy: micrel: add MSE interface support for KSZ9477 family

Implement the get_mse_capability() and get_mse_snapshot() PHY driver ops
for KSZ9477-series integrated PHYs to demonstrate the new PHY MSE
UAPI.

These PHYs do not expose a documented direct MSE register, but the
Signal Quality Indicator (SQI) registers are derived from the
internal MSE computation. This hook maps SQI readings into the MSE
interface so that tooling can retrieve the raw value together with
metadata for correct interpretation in userspace.

Behaviour:
  - For 1000BASE-T, report per-channel (A–D) values and support a
    WORST channel selector.
  - For 100BASE-TX, only LINK-wide measurements are available.
  - Report average MSE only, with a max scale based on
    KSZ9477_MMD_SQI_MASK and a fixed refresh rate of 2 µs.

This mapping differs from the OPEN Alliance SQI definition, which
assigns thresholds such as pre-fail indices; the MSE interface
instead provides the raw measurement, leaving interpretation to
userspace.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20251027122801.982364-4-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/micrel.c