tb_cfg_write_raw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– tb_cfg_write_raw πŸ’–

okay so first things first, bestie β€” this page lives in the Kernel API Manual section (section 9, the kernel API girlies), and the function we're stanning today is tb_cfg_write_raw. say it with me: write. from. buffer. into. config. space. periodt. πŸ’…


✨ NAME ✨

tb_cfg_write_raw β€” write from buffer into config space πŸ¦‹


🌸 SYNOPSIS 🌸

struct tb_cfg_result tb_cfg_write_raw (struct tb_ctl *ctl , const void
*buffer , u64 route , u32 port , enum tb_cfg_space space , u32 offset ,
u32 length , int timeout_msec );

like… look at her. iconic signature. no notes. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • ctl β€” Pointer to the control channel. this is your girl, the control channel, she's holding it all together fr fr.
  • buffer β€” Data to write. literally the data. that's it. that's the vibe. πŸ’œ
  • route β€” Route string of the router. you gotta know where you're going, no cap.
  • port β€” Port number when writing to TB_CFG_PORT, 0 otherwise. so like, sometimes a port, sometimes a zero, iykyk πŸ™ˆ
  • space β€” Config space selector. which config space are we in, babe? pick one. main character energy.
  • offset β€” Dword word offset of the register to start writing. dword. word offset. start writing. got it. ⭐
  • length β€” Number of dwords to write. not bytes, not vibes β€” dwords. πŸ’€
  • timeout_msec β€” Timeout in ms how long to wait for the response. give her a lil time to respond bestie, don't be impatient 😭

πŸ”₯ DESCRIPTION πŸ”₯

Writes to router config space without translating the possible error. 🫢

that's the whole thing. she writes, she does not translate. no editorializing the error for you, no little summary, no "here's what happened" β€” you get the raw result and you deal with it. the way that this function simply refuses to do your homework for you. πŸ’…


🌈 RETURN 🌈

struct tb_cfg_result with non-zero err field if error has occurred.

so like, check the err field bestie. if it's non-zero, something went sideways. it's giving "read the room" but the room is a struct. ✨


πŸ¦‹ SEE ALSO πŸ¦‹

go read all of them. all seventeen. i'll wait. πŸ’–πŸ§š


ok final vibe check: tb_cfg_write_raw writes to router config space, hands you back a struct tb_cfg_result, and does not translate errors for you β€” so check that err field yourself, bestie. no cap.

and that's the whole page, mwah πŸ’‹ this lil gem comes from ./drivers/thunderbolt, dated October 2026 β€” see you in the group chat, love u, bye πŸŽ€πŸŒΈπŸ’œ

πŸ“¦ where this page comes from