kszphy_get_sqi(9)
π 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
errnoon failure β the bad timeline π
π SEE ALSO π
Kernel file ./drivers/net/phy/micrel.c and its page homies:
LAN8814_PAGE_PCS(9)LAN8814_PAGE_AFE_PMA(9)LAN8814_PAGE_PCS_DIGITAL(9)LAN8814_PAGE_EEE(9)LAN8814_PAGE_COMMON_REGS(9)LAN8814_PAGE_PORT_REGS(9)LAN8814_PAGE_POWER_REGS(9)LAN8814_PAGE_SYSTEM_CTRL(9)
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
- 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