bcm2835_spi_prepare_sg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bcm2835_spi_prepare_sg β€” a page from the Kernel API Manual ✨

okay bestie, buckle up, we're doing kernel SPI DMA today and honestly? it's giving main character energy πŸŽ€ this is the man page for bcm2835_spi_prepare_sg(9), straight out of the Kernel API Manual, and yes you're gonna understand it. periodt.


🌸 NAME 🌸

bcm2835_spi_prepare_sg β€” the girl who prepares and submits the DMA descriptor for the sglist πŸ¦‹ both jobs, one function, she's booked and busy.


✨ SYNOPSIS ✨

int bcm2835_spi_prepare_sg (struct spi_controller *ctlr , struct
       spi_transfer *tfr , struct bcm2835_spi *bs , struct bcm2835_spidev
       *target , bool is_tx );

like, five arguments, one int coming back at you. she's lowkey high-maintenance but she delivers πŸ’–


🫢 ARGUMENTS 🫢

  • ctlr β€” the SPI host controller. the whole venue, the big boss energy πŸ‘‘
  • tfr β€” the SPI transfer. literally the thing being transferred, the moment, the event 🌟
  • bs β€” the BCM2835 SPI controller. yes there's also ctlr, don't come for me, they're different, iykyk πŸ’€
  • target β€” the BCM2835 SPI target. the specific one we're talking to 🎯
  • is_tx β€” a bool that decides whether we submit the DMA descriptor for the TX sglist or the RX sglist. pick a lane bestie, it's one or the other πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

so what she actually does: she prepares and submits a DMA descriptor for the TX or RX sglist of tfr. that's the whole vibe. not me explaining it in one sentence and then just vibing ✨

returns 0 on success, or a negative error number if things went sideways 😭 (kernel code, so negative numbers = bad news, always).


πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file ./drivers/spi/spi-bcm2835.c and honestly the whole friend group:

go read them. all of them. it's called self-care πŸ’…

and that's the page!! brought to you by ./drivers/spi, dated October 2026, filed under bcm2835_spi_prepare_sg(9) β€” ily, go write some DMA descriptors responsibly πŸ«ΆπŸŽ€πŸŒΈ

πŸ“¦ where this page comes from