tb_nvm_read_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ tb_nvm_read_data β€” the Kernel API Manual page for reading stuff out of NVM πŸ’–

okay so bestie, welcome to tb_nvm_read_data, straight out of the Kernel API Manual, and this one is lowkey the little workhorse you call when you want bytes out of flash and into your own buffer. let's get into it 🫢


🌸 SYNOPSIS 🌸

int tb_nvm_read_data (unsigned int address , void *buf , size_t size ,
       unsigned int retries , read_block_fn read_block , void *read_block_data
       );

the way that signature is just sitting there with six args and a return type… she's giving "i do exactly one thing and i do it well" ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • address β€” the start address on the flash, like the little spot where the reading begins πŸ‘‘
  • buf β€” the buffer where the read data gets copied. that's your basket, she gets filled 🧺
  • size β€” size of the buffer, in bytes. yes bestie, actual bytes, count them correctly 😭
  • retries β€” how many retries you get if a block read fails. like, how many chances you're willing to hand out πŸ’€
  • read_block β€” the function that reads a block from the flash. you supply the muscle, she supplies the choreography πŸ”₯
  • read_block_data β€” the data passed to read_block. it rides along, no questions asked πŸ¦‹

πŸ’… DESCRIPTION πŸ’…

so this is a generic function that reads data from NVM, or from a device that's NVM-like (an NVM adjacent queen, if you will). that's it, that's the whole vibe β€” one entry point, many NVM situations ✨


⭐ RETURN ⭐

0 on success, negative errno otherwise. so like… zero is the slay, negative is the "oop" πŸ™ˆ


🌈 SEE ALSO 🌈

the kernel file ./drivers/thunderbolt/nvm.c is the spot, and the whole friend group is here:

ngl bestie, if tb_nvm_read_data is the read, you just know tb_nvm_write_data(9) is her counterpart. they're a matching set, iykyk πŸ’œ

and that's the page! big kiss from ./drivers/thunderbolt, dated October 2026 β€” mwah πŸ’‹πŸŽ€βœ¨

πŸ“¦ where this page comes from