STRUCT TB_CFG_REQUEST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct tb_cfg_request(9) β€” Kernel API Manual

okay so bestie, welcome to the Kernel API Manual ✨ and today's main character is struct tb_cfg_request, which is literally just a Control channel request πŸŽ€ like that's the whole NAME vibe, it's giving "i am a request, i live on a control channel, i'm booked and busy" πŸ’œ


✨ SYNOPSIS ✨

here's the whole struct in all its glory, no edits, no notes, she's perfect 🌸

struct tb_cfg_request {
    struct kref kref;
    struct tb_ctl *ctl;
    const void *request;
    size_t request_size;
    enum tb_cfg_pkg_type request_type;
    void *response;
    size_t response_size;
    enum tb_cfg_pkg_type response_type;
    size_t npackets;
    bool (*match)(const struct tb_cfg_request *req, const struct ctl_pkg *pkg);
    bool (*copy)(struct tb_cfg_request *req, const struct ctl_pkg *pkg);
    void (*callback)(void *callback_data);
    void *callback_data;
    unsigned long flags;
    struct work_struct work;
    struct tb_cfg_result result;
    struct list_head list;
};

🫢 Members

like a group chat roll call but for struct fields, everybody say hi πŸ‘‘

  • kref β€” Reference count πŸ’« (she's counting her refs, respect it)
  • ctl β€” Pointer to the control channel structure. ngl this one's only set when the request is queued πŸ“¬
  • request β€” Request is stored here πŸ“₯
  • request_size β€” Size of the request packet (in bytes), yes in bytes, keep up bestie πŸ”₯
  • request_type β€” Type of the request packet 🏷️
  • response β€” Response is stored here πŸ“€
  • response_size β€” Maximum size of one response packet, maximum, not a suggestion πŸ’€
  • response_type β€” Expected type of the response packet πŸ‘€
  • npackets β€” Number of packets expected to be returned with this request 🎁
  • match β€” Function used to match the incoming packet πŸ•΅οΈβ€β™€οΈ
  • copy β€” Function used to copy the incoming packet to response πŸ“‹
  • callback β€” Callback called when the request is finished successfully βœ… (emphasis on successfully, she's picky)
  • callback_data β€” Data to be passed to callback πŸŽ’
  • flags β€” Flags for the request 🚩
  • work β€” Work item used to complete the request πŸ› οΈ
  • result β€” Result after the request has been completed 🏁
  • list β€” Requests are queued using this field 🧡 (the queue is a group chat and this is the invite link)

🌈 Description

so basically this is an arbitrary request over the Thunderbolt control channel πŸ¦‹ that's the whole gig. she's flexible, she's a generalist, she's arbitrary ✨

but like β€” for a standard control channel message, you should really use tb_cfg_read/write and friends if possible 🫢 that's the polite thing to do, okay? no cap. don't make this struct do a job the friend group already handles πŸ’…

fr fr bestie: this is the arbitrary path. the standard-message path has tb_cfg_read/write and friends waiting for you, so use those when you can πŸ™ˆ

πŸ‘€ SEE ALSO

  • Kernel file ./drivers/thunderbolt/ctl.h πŸ“‚ go read it, she's iconic

pink and that's the whole page!! πŸ’– courtesy of ./drivers/thunderbolt, dated October 2026, living in the Kernel API Manual as struct tb_cfg_request(9) β€” mwah, slay, periodt βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from