t4_eeprom_ptov(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 t4_eeprom_ptov β€” kernel API manual, bestie edition πŸ’…

okay so welcome to t4_eeprom_ptov(9), a little function with a big job, and yes i'm gonna explain it to you like you're my bestie who deserves to know ✨


πŸŽ€ NAME πŸŽ€

t4_eeprom_ptov β€” translate a physical EEPROM address to virtual πŸ’–


✨ SYNOPSIS ✨

int t4_eeprom_ptov (unsigned int phys_addr , unsigned int fn , unsigned
int sz );

like, that's the whole signature, and no i will not be shortening it 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • phys_addr β€” the physical EEPROM address, aka the original coordinates, the birth address, the real one πŸ”₯
  • fn β€” the PCI function number. yes THE function number, don't lose it
  • sz β€” size of function-specific area πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

So bestie, what this does is translate a physical EEPROM address to virtual. That's it, that's the whole vibe check ✨

Now the mapping, and pay attention because this is the main character part:

  • The first 1K is accessed through virtual addresses starting at 31K πŸ’…
  • The rest is accessed through virtual addresses starting at 0 🌈

The mapping is as follows, and i'm giving it to you exactly as it is, no cap:

[0..1K) -> [31K..32K) [1K..1K+A) -> [31K-
A..31K) [1K+A..ES) -> [0..ES-A-1K)

where A = fn * sz, and ES = EEPROM size. πŸ‘‘

That's literally it. Small function, iconic math, periodt. πŸŽ€

ngl the notation is giving "trust me bro" but it's correct, so just vibe with the ranges πŸ’–

🧚 SEE ALSO 🧚

First up, the source file itself, because you know we always cite our sources, bestie:

  • Kernel file ./drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

and now the whole entire friend group, in order, all of them, i'm not skipping a single one πŸ™ˆ

like okay that's a LOT of friends but every single one of them matters πŸ’€βœ¨


πŸ’« sign-off πŸ’«

so this page comes to us from ./drivers/net/ethernet/chelsio... and it's dated October 2026 β€” that's the source/version and the date, bestie, do with that what you will 🌸

go forth and translate those addresses, you're gonna slay πŸ’…πŸŽ€

πŸ“¦ where this page comes from