Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/mdio_bus

FieldValue
SubsystemMDIO bus core, drivers/net/phy/mdio_bus.c; the cached v5.10 copy (mdio_bus_510.c) defines struct class mdio_bus_class named “mdio_bus” with the statistics attribute group; current master builds mdio_bus.o under the fetched Makefile
Config gatev5.10: CONFIG_MDIO_DEVICE (fetched mdio_bus_510_Makefile: obj-$(CONFIG_MDIO_DEVICE) += mdio-bus.o; phy-Kconfig-510 line 19 select MDIO_DEVICE); current master: CONFIG_PHYLIB (fetched Makefile: obj-$(CONFIG_PHYLIB) += mdio_bus.o)
ABI documentationDocumentation/ABI/testing/sysfs-bus-mdio (statistics; KernelVersion 5.6) and Documentation/ABI/testing/sysfs-class-net-phydev (per-PHY-device attributes, documented with /sys/class/mdio_bus/<bus>/<device>/ What: paths)
Since5.6 for the bus statistics group; per-PHY attributes 3.8-6.17 (see table)
Live (5.10.134 host)none observed (class absent from the cached 46-class enumeration; no MDIO bus on the container host)
Ledger IDSYSC-mdio_bus

What it represents

One device per MDIO bus (mii_bus), named after the bus id. The class is the lookup view over MDIO bus devices; the same devices also appear under /sys/bus/mdio_bus/devices, and their PHY/MDIO children are matched on mdio_bus_type. The v5.10 source registers the class with a per-bus statistics/ attribute group, counters accumulated by the bus transfer helpers – so the numbers reflect real hardware bus traffic.

Relationship to the device model

Bus devices carry mdio_bus_groups (the statistics/ group per mdio_bus_510.c); MDIO devices and PHY devices attached to a bus carry their own four-file statistics group (mdio_bus_dev_groups) and the phydev attributes below. of_mdio_find_bus() in the same file looks buses up through this class by name and OF node, which is why the class exists: cross-driver bus discovery.

Attributes

AttributeR/WUnit/formatConditional?Source
.../statistics/transfersROtotal transfers for the busalwaysABI testing sysfs-bus-mdio (5.6); mdio_bus_510.c
.../statistics/{errors,writes,reads}ROtransfer errors / write transactions / read transactions for the busalwaysABI testing sysfs-bus-mdio
.../statistics/{transfers,errors,writes,reads}_<addr>ROsame four counters per bus address (addresses 0-31, generated groups)alwaysABI testing sysfs-bus-mdio; mdio_bus_510.c
<bus>/<device>/phy_idRO32-bit PHY identifier from enumeration, hexadecimalPHY devices, 3.8ABI testing sysfs-class-net-phydev
<bus>/<device>/phy_interfaceROinterface mode string (mii, gmii, sgmii, rgmii-*, 1000base-x, …)PHY devices, 3.15ABI testing sysfs-class-net-phydev
<bus>/<device>/phy_has_fixupsROboolean: any fixup workaround ranPHY devices, 3.15ABI testing sysfs-class-net-phydev
<bus>/<device>/attached_devROsymlink to the attached network devicePHY devices, 4.13ABI testing sysfs-class-net-phydev
<bus>/<device>/phy_standaloneROboolean: PHYLINK standalone mode; created only when truePHYLINK-only PHYs, 5.3ABI testing sysfs-class-net-phydev
<bus>/<device>/phy_dev_flagsRO32-bit hex mask of consumer-passed config bits (debug aid, unstable placement)PHY devices, 5.13ABI testing sysfs-class-net-phydev
<bus>/<device>/c45_phy_ids/mmd<n>_device_idROper-MMD 32-bit C45 identifiers, hexadecimalC45 PHYs, 6.17ABI testing sysfs-class-net-phydev

Safety and writes

Everything documented is a read-only counter or identifier; no write path exists in either ABI file or the cached source. Useful for spotting a wedged bus address: compare statistics/errors_<addr> against transfers_<addr>.

References