ntb_peer_spad_addr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ntb_peer_spad_addr(9) β€” like, the Kernel API Manual's lil' scratchpad address getter ✨

okay so bestie, this page lives in the Kernel API Manual, section 9, and it's about one tiny but iconic function. let's get into it πŸŽ€


✨ NAME ✨

ntb_peer_spad_addr β€” literally just gives you the address of the peer scratchpad register πŸ’– no cap.


🌸 SYNOPSIS 🌸

int ntb_peer_spad_addr (struct ntb_dev *ntb , int pidx , int sidx ,
       phys_addr_t *spad_addr );

like, that's the whole signature, periodt. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ntb β€” the NTB device context. your main character struct, basically πŸ‘‘
  • pidx β€” port index of the peer device. which peer we're talking about, iykyk πŸ”₯
  • sidx β€” scratchpad index. which scratchpad slot we're eyeing πŸ‘€
  • spad_addr β€” OUT β€” the address of the peer scratchpad register. it gets written into this, so it's an output param πŸ’œ

⭐ DESCRIPTION ⭐

so what it does is: return the address of the peer scratchpad register. that's it, that's the vibe ✨

and like, why would you even want that? the manpage says it may be used, for example, by drivers that offload memory copy operations to a dma engine 🧚 so if your driver's handing the copying off to a dma engine, this address is exactly the thing you'd want. slay.


🌈 RETURN 🌈

zero on success πŸ’– otherwise an error number 😭 (so, y'know, check it. always check it.)


πŸŽ€ SEE ALSO πŸŽ€

the kernel file ./include/linux/ntb.h has all the lore, and honestly the friend group here is huge, so buckle up bestie β€” every single one of these is on the list:

like, go read them all. or at least the scratchpad ones, they're siblings fr fr πŸ“


πŸ’€ friendly reminder bestie: spad_addr is an OUT param, so pass it a real pointer you actually own. don't be out here handing it garbage and then acting surprised 😭

k that's the whole page!! this one came straight out of ./include/linux and it's dated October 2026 β€” so like, future vibes only πŸ’…πŸ¦‹ mwah, go read the source and stay hydrated ✨🌸

πŸ“¦ where this page comes from