STRUCT PHY_MSE_CAPABILITY(9)
π NAME π
struct phy_mse_capability β okay bestie, this is the struct that describes the capabilities of the Mean Square Error (MSE) measurement interface. It's the "what can this thing even measure" receipt. This is a page from the Kernel API Manual, and we're gonna get through it together, fr fr. π«Ά
πΈ SYNOPSIS πΈ
struct phy_mse_capability {
u64 max_average_mse;
u64 max_peak_mse;
u64 refresh_rate_ps;
u64 num_symbols;
u32 supported_caps;
};
That's the whole squad right there. Five members, all of them pulling their weight. π
π MEMBERS π
max_average_mseβ the ceiling for an average MSE snapshot, i.e. it sets the scale for the measurement. No cap on the cap, just the max. π If thePHY_MSE_CAP_AVGcapability is supported, this value MUST be greater than 0. Units are vendor-specific, so don't come for me about units.max_peak_mseβ the same deal but for a peak MSE snapshot. If eitherPHY_MSE_CAP_PEAKorPHY_MSE_CAP_WORST_PEAKis supported, this value MUST be greater than 0. (vendor-specific units, again, iykyk).refresh_rate_psβ the typical interval, in picoseconds, between hardware updates of the MSE values. Lowkey important: this is only an estimate, and callers should not assume synchronous sampling. Please, do not assume. π (vendor-specific units).num_symbolsβ how many symbols get aggregated per hardware sample to calculate the MSE. (vendor-specific units).supported_capsβ a bitmask ofPHY_MSE_CAP_*values telling you which measurement types (e.g. average, peak) and which channels (e.g. per-pair or link-wide) are supported. This is the vibe check of the whole struct. β¨
π¦ DESCRIPTION π¦
Standardization notes, and bestie you need these:
- Presence of MSE/SQI/pMSE is defined by OPEN Alliance specs, but numeric scaling, refresh/update rate and aggregation windows are not fixed β they're vendor-/product-specific. (OA 100BASE-T1 TC1 v1.0 6.1.; OA 1000BASE-T1 TC12 v2.2 6.1.)
- Typical recommendations: 2^16 symbols and 0..511 scaling for MSE; pMSE is only defined for 100BASE-T1 (sliding window example), the others are vendor extensions. Drivers must report actual scale/limits here.
So this struct describes the MSE measurement capabilities for the current link mode. And here's the messy part: these properties are dynamic and may change when link settings get modified. π So callers should re-query this capability after any link state change to make sure they've got the most up-to-date info. Like refreshing your feed, but for link capabilities.
Callers should only request measurements for channels and types that supported_caps says are supported β it's literally in the bitmask, respect it. π
And if supported_caps is 0, the device provides no MSE diagnostics, and driver operations should typically return -EOPNOTSUPP. Not me getting rejected by a bitmask π.
Little math moment: snapshot values for average and peak MSE can be normalized to a 0..1 ratio by dividing the raw snapshot by the correspondingmax_average_mseormax_peak_msevalue. Slay, that's your normalized value. π₯
π SEE ALSO π
Kernel file ./include/linux/phy.h β and the whole extended family:
enum phy_interface_t(9),phy_modes(9),rgmii_clock(9),struct mdio_bus_stats(9),struct mii_bus(9),mdiobus_alloc(9),enum phy_state(9),struct phy_c45_device_ids(9),struct phy_oatc14_sqi_capability(9),struct phy_device(9),struct phy_tdr_config(9),enum link_inband_signalling(9),struct phy_plca_cfg(9),struct phy_plca_status(9),struct phy_led(9),struct phy_mse_snapshot(9),struct phy_driver(9),phy_id_compare(9),phy_id_compare_vendor(9),phy_id_compare_model(9),phydev_id_compare(9),phy_is_started(9),phy_driver_is_genphy(9),phy_disable_eee_mode(9),phy_can_wakeup(9),phy_may_wakeup(9),phy_read(9),__phy_read(9),phy_write(9),__phy_write(9),__phy_modify_changed(9),phy_read_mmd_poll_timeout(9),__phy_set_bits(9),__phy_clear_bits(9),phy_set_bits(9),phy_clear_bits(9),__phy_set_bits_mmd(9),__phy_clear_bits_mmd(9),phy_set_bits_mmd(9),phy_clear_bits_mmd(9),phy_interrupt_is_valid(9),phy_polling_mode(9),phy_has_hwtstamp(9),phy_has_rxtstamp(9),phy_has_tsinfo(9),phy_has_txtstamp(9),phy_is_default_hwtstamp(9),phy_on_sfp(9),phy_interface_mode_is_rgmii(9),phy_interface_mode_is_8023z(9),phy_interface_is_rgmii(9),phy_is_pseudo_fixed_link(9),phy_module_driver(9)
β¨ that's the whole page, no crumbs left β¨ Source path ./include/linux, dated October 2026 β mwah, go read your PHY headers bestie, ily, bye! πππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms