STRUCT GB_SPI_TRANSFER(9)
π struct gb_spi_transfer(9) π
okay so bestie, welcome to the Kernel API Manual β yes, the actual kernel manpages, and yes, we're gonna get through this together. this page is all about struct gb_spi_transfer, and ngl the name is giving exactly what it is: a read/write buffer pair. that's it. that's the whole vibe. π¦
β¨ NAME β¨
struct gb_spi_transfer β a read/write buffer pair π
π SYNOPSIS π
here's the whole struct, laid out, not a single line changed, i would never do that to you:
struct gb_spi_transfer {
__le32 speed_hz;
__le32 len;
__le16 delay_usecs;
__u8 cs_change;
__u8 bits_per_word;
__u8 xfer_flags;
#define GB_SPI_XFER_READ 0x01;
#define GB_SPI_XFER_WRITE 0x02;
#define GB_SPI_XFER_INPROGRESS 0x04;
};
those three #defines are literally the flags squad β GB_SPI_XFER_READ, GB_SPI_XFER_WRITE, and GB_SPI_XFER_INPROGRESS β each with their exact values 0x01, 0x02, and 0x04. slay. π₯
π§ Members π§
okay so now we go member by member, and honestly each one is kind of a main character in its own way:
speed_hzβ this lets you pick a speed that isn't the device default for this one transfer. and if it's0? then the default (fromspi_device) is what you get. no cap, that's the rule. βlenβ the size of the rx and tx buffers, and it's measured in bytes. both buffers, one number. iconic. πdelay_usecsβ microseconds to delay after this transfer before (optionally) changing the chipselect status, and then starting the next transfer or completing thisspi_message. it's giving "hold up, let me breathe for a sec". πcs_changeβ affects chipselect after this transfer completes. short line, big job. πbits_per_wordβ lets you select abits_per_wordthat isn't the device default for this transfer. and if it's0, the default (fromspi_device) is used. same deal asspeed_hz, just... bits. π
π SEE ALSO π
- Kernel file
./include/linux/greybus/greybus_protocols.hβ go read it, iykyk π
π«Ά friendly reminder:speed_hzandbits_per_wordboth fall back to thespi_devicedefault when they're0, so don't come for me when your transfer runs at device-default settings. that's literally the documented behaviour, bestie.
and that's the page!! πΈ source: ./include/linux/greybus, dated October 2026 β so you know this info is fresh, periodt. go forth and transfer your buffers, you absolute icon πβ¨
π¦ 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