STRUCT GB_SPI_TRANSFER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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's 0? then the default (from spi_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 this spi_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 a bits_per_word that isn't the device default for this transfer. and if it's 0, the default (from spi_device) is used. same deal as speed_hz, just... bits. πŸŽ€

🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/greybus/greybus_protocols.h β€” go read it, iykyk πŸ‘‘

🫢 friendly reminder: speed_hz and bits_per_word both fall back to the spi_device default when they're 0, 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