tb_nvm_read_data(9)
β¨ 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 toread_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:
struct tb_nvm_vendor_ops(9)struct tb_nvm_vendor(9)tb_nvm_alloc(9)tb_nvm_read_version(9)tb_nvm_validate(9)tb_nvm_write_headers(9)tb_nvm_add_active(9)tb_nvm_write_buf(9)tb_nvm_add_non_active(9)tb_nvm_free(9)tb_nvm_write_data(9)
ngl bestie, iftb_nvm_read_datais the read, you just knowtb_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
- 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