tb_switch_nvm_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

tb_switch_nvm_read β€” bestie, this is the one that reads the router NVM πŸ’… (yes, this page lives in the section 9 Kernel API Manual, iykyk)


✨ SYNOPSIS ✨

int tb_switch_nvm_read (struct tb_switch *sw , unsigned int address ,
       void *buf , size_t size );

That's the whole vibe check right there β€” four args, one int coming back at you 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • sw β€” the router whose NVM you're about to read. like, which router, bestie, be specific πŸ’–
  • address β€” the start address on the NVM. where the reading begins, no cap πŸ“
  • buf β€” the buffer where the read data gets copied. this is where the tea lands β˜•
  • size β€” size of the buffer, in bytes. please get this right or it's giving chaos 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the whole thing: it reads from the router NVM and hands you back the requested data in buf. that's it, that's the function ✨

🚨 the one thing you cannot skip: locking is up to the caller. the function does not do it for you. not me having to remind you β€” it literally says so. so lock it yourself, bestie, or it's giving undefined chaos πŸ’€

🌈 RETURN 🌈

  • 0 on success β€” slay, we ate πŸ‘‘
  • negative errno otherwise β€” so if it's negative, something went wrong, and that's your sign 😭

🧚 SEE ALSO 🧚

the kernel file is ./drivers/thunderbolt/switch.c β€” go read the source, it's iconic πŸŽ€

the ports & paths girlies:

link speed / width / lane bonding squad πŸ’…:

usb3 / pci / displayport besties:

the switch main characters πŸ‘‘:


okay that's the whole page, you're so welcome πŸ’œ this little writeup ships out of the ./drivers/thunderbolt source and it's dated October 2026 β€” so like, future vibes only, periodt 🌟 byeee, go read your NVM responsibly 🫢✨

πŸ“¦ where this page comes from