STRUCT TB_NHI_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct tb_nhi_ops(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual entry for struct tb_nhi_ops β€” and yes, that (9) means it's a kernel-internals girlie, section 9, we're deep in the guts of the thing. this is the NHI-specific optional operations struct, and honestly? it's giving "plugin board of function pointers" and i'm obsessed. ✨


🌸 NAME 🌸

struct tb_nhi_ops β€” NHI specific optional operations πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole struct, bestie, copied exactly so you can vibe-check every single member pointer:

struct tb_nhi_ops {
    int (*init)(struct tb_nhi *nhi);
    int (*suspend_noirq)(struct tb_nhi *nhi, bool wakeup);
    int (*resume_noirq)(struct tb_nhi *nhi);
    int (*runtime_suspend)(struct tb_nhi *nhi);
    int (*runtime_resume)(struct tb_nhi *nhi);
    void (*shutdown)(struct tb_nhi *nhi);
    void (*pre_nvm_auth)(struct tb_nhi *nhi);
    void (*post_nvm_auth)(struct tb_nhi *nhi);
    int (*request_ring_irq)(struct tb_ring *ring, bool no_suspend);
    void (*release_ring_irq)(struct tb_ring *ring);
    bool (*is_present)(struct tb_nhi *nhi);
    int (*init_interrupts)(struct tb_nhi *nhi);
};

twelve function pointers. twelve. she's thorough and we respect it 🫢


πŸ¦‹ Members πŸ¦‹

okay let's go through them one by one, no skipping, no cap:

  • init β€” NHI specific initialization. the little "hey wake up, get ready" moment for the NHI. πŸŒ…
  • suspend_noirq β€” NHI specific suspend_noirq hook. takes the nhi and a wakeup bool, because context matters, obviously.
  • resume_noirq β€” NHI specific resume_noirq hook. the comeback era. πŸ’«
  • runtime_suspend β€” NHI specific runtime_suspend hook. nap time, but make it runtime.
  • runtime_resume β€” NHI specific runtime_resume hook. nap's over, back to main character energy. πŸ‘‘
  • shutdown β€” NHI specific shutdown. returns void β€” she just leaves, no notes. πŸ’€
  • pre_nvm_auth β€” hook to run before Thunderbolt 3 NVM authentication. the pre-game. ✨
  • post_nvm_auth β€” hook to run after Thunderbolt 3 NVM authentication. the after-party. πŸŽ‰
  • request_ring_irq β€” NHI specific interrupt retrieval hook. grabs an irq for a struct tb_ring *ring, and there's a bool no_suspend in there too, so mind that. πŸ”₯
  • release_ring_irq β€” NHI specific interrupt release hook. gives the irq back for that struct tb_ring *ring, very "borrowed your hoodie, returning it washed" of her. 🧚
  • is_present β€” Whether the device is currently present on the parent bus. returns bool, so it's a simple yes/no, iykyk. πŸ¦‹
  • init_interrupts β€” NHI specific interrupt initialization hook. last one and she ate. πŸ’…

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/thunderbolt/nhi.h β€” go read it, bestie, that's where the real lore lives πŸ“–

fr fr, this is a struct of optional hooks β€” every member here is a function pointer the NHI can supply, so don't go assuming any of them are mandatory. the manpage doesn't say they're all populated and neither will i πŸ™ˆ

and that's the page! brought to you by the fine folks in ./drivers/thunderbolt, dated October 2026 β€” mwah, love u, go read nhi.h πŸ’œπŸŽ€

πŸ“¦ where this page comes from