bcm2835_spi_prepare_sg(9)
π 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 alsoctlr, don't come for me, they're different, iykyk πtargetβ the BCM2835 SPI target. the specific one we're talking to π―is_txβ aboolthat 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:
struct bcm2835_spi(9)struct bcm2835_spidev(9)bcm2835_rd_fifo_count(9)bcm2835_wr_fifo_count(9)bcm2835_wait_tx_fifo_empty(9)bcm2835_rd_fifo_blind(9)bcm2835_wr_fifo_blind(9)bcm2835_spi_transfer_prologue(9)bcm2835_spi_undo_prologue(9)bcm2835_spi_dma_rx_done(9)bcm2835_spi_dma_tx_done(9)bcm2835_spi_transfer_one_dma(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms