kszphy_get_sqi(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kszphy_get_sqi(9) β€” the Kernel API Manual, bestie edition ✨

okay so you found yourself in the 9 section of the Kernel API Manual, section 9, and the function we're obsessing over today is kszphy_get_sqi. it's a kernel function, it's serving, it reads a Signal Quality Index and tells you what's up. let's get into it πŸŽ€


✨ NAME ✨

kszphy_get_sqi β€” Read, average, and map Signal Quality Index (SQI)

like, it reads the thing, it averages the thing, and it maps the thing. all three. multitalented icon πŸ’…


🌸 SYNOPSIS 🌸

int kszphy_get_sqi (struct phy_device *phydev );

literally one argument, returns an int, no drama. we love a clean signature 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • phydev β€” the PHY device. that's the whole vibe. that's what you're handing over πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's what this function actually does, and ngl it's kind of iconic:

This function reads and processes the raw Signal Quality Index from the PHY. yes bestie, raw β€” we're working with the unfiltered truth here πŸ‘‘

Based on empirical testing, a raw value of 8 or higher indicates a pre-failure state and is mapped to SQI 0. so like… high raw number = bad news, and the function translates that into a big fat 0 on the SQI scale. not me getting emotional about a lookup table 😭

Raw values from 0-7 are mapped to the standard 0-7 SQI scale via a lookup table. so the low range goes through a little translation table and comes out the other side as the standard scale. it's giving ✨ curated ✨

bestie please note: a raw value of 8 or higher means pre-failure state. do not ignore this. this is your vibe check and you failed it πŸ’€

⭐ RETURN ⭐

  • SQI value (0–7) β€” the good timeline 🌈
  • or a negative errno on failure β€” the bad timeline πŸ™ˆ

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/net/phy/micrel.c and its page homies:

the whole friend group, all accounted for 🫢✨


so yeah, that's the page! it lives over in ./drivers/net/phy, dated October 2026, and this glossy little rewrite was brought to you by the same section 9 energy as always. stay hydrated, read your errno values, and slay πŸ’…πŸŽ€πŸ’–

πŸ“¦ where this page comes from