tb_nvm_write_data(9)
π tb_nvm_write_data(9) β from the Kernel API Manual, bestie
okay so this is tb_nvm_write_data, and it lives in the Kernel API Manual section 9 (that's the kernel-functions girly). Let me tell you everything about it, no cap. π«Ά
β¨ NAME β¨
tb_nvm_write_data β literally just "Write data to NVM". That's the whole vibe. π
πΈ SYNOPSIS πΈ
int tb_nvm_write_data (unsigned int address , const void *buf , size_t
size , unsigned int retries , write_block_fn write_block , void
*write_block_data );
like, six arguments. she's high maintenance but she's worth it. π
π ARGUMENTS π
addressβ the start address on the flash. where the magic happens, basically. πbufβ the buffer where the data is copied from. it's the source, the main character. πsizeβ size of the buffer, in bytes. don't fumble this one bestie. πretriesβ number of retries if the block write fails. yes, she tries again. persistence ate. πwrite_blockβ the function that writes block to the flash. a whole callback, iconic. β‘write_block_dataβ data passed towrite_block. it's giving "plus one". π
π¦ DESCRIPTION π¦
So this is a generic function that writes data to NVM, or to an NVM-like device. that's it, that's the whole description β she's a generalist, she's versatile, she contains multitudes. β¨ lowkey obsessed with how straightforward that is.
π RETURN π
0on success π- negative
errnootherwise π
fr fr, check that return value. negative errno is NOT a vibe and she will not warn you twice. π
π SEE ALSO π
Kernel file ./drivers/thunderbolt/nvm.c and honestly the whole friend group:
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_read_data(9)
go read all of them, iykyk. ππ
aaaand that's the page!! π sign-off time: this one's straight out of ./drivers/thunderbolt, dated October 2026 β so she's lowkey from the future, slay. mwah, go write some NVM data responsibly π§π
π¦ 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