STRUCT PHY_MSE_CAPABILITY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 the PHY_MSE_CAP_AVG capability 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 either PHY_MSE_CAP_PEAK or PHY_MSE_CAP_WORST_PEAK is 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 of PHY_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 corresponding max_average_mse or max_peak_mse value. Slay, that's your normalized value. πŸ”₯

πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./include/linux/phy.h β€” and the whole extended family:


✨ 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