STRUCT SPI_TEST(9)
π NAME π
okay so bestie, this is struct spi_test(9) from the Kernel API Manual β and it literally describes a specific (set of) tests to execute. no cap, that's the whole NAME vibe. π«Ά
πΈ SYNOPSIS πΈ
here's the struct in full, copied character-for-character so you don't gotta squint at some crusty manpage:
struct spi_test {
char description[64];
struct spi_message msg;
struct spi_transfer transfers[SPI_TEST_MAX_TRANSFERS];
unsigned int transfer_count;
int (*run_test)(struct spi_device *spi, struct spi_test *test, void
*tx, void *rx);
int (*execute_msg)(struct spi_device *spi, struct spi_test *test,
void *tx, void *rx);
int expected_return;
int iterate_len[SPI_TEST_MAX_ITERATE];
int iterate_tx_align;
int iterate_rx_align;
u32 iterate_transfer_mask;
u32 fill_option;
#define FILL_MEMSET_8 0 ;
#define FILL_MEMSET_16 1 ;
#define FILL_MEMSET_24 2 ;
#define FILL_MEMSET_32 3 ;
#define FILL_COUNT_8 4 ;
#define FILL_COUNT_16 5 ;
#define FILL_COUNT_24 6 ;
#define FILL_COUNT_32 7 ;
#define FILL_TRANSFER_BYTE_8 8 ;
#define FILL_TRANSFER_BYTE_16 9 ;
#define FILL_TRANSFER_BYTE_24 10 ;
#define FILL_TRANSFER_BYTE_32 11 ;
#define FILL_TRANSFER_NUM 16 ;
u32 fill_pattern;
unsigned long long elapsed_time;
};
π Members π
descriptionβ a description of the test. short and sweet, like a little label bestie π·οΈmsgβ a templatespi_messageused for the default settings. it's giving starter-pack energy β¨transfersβ an array ofspi_transfersthat are part of the resultingspi_message. the whole squad of transfers, basically πtransfer_countβ number of transfers. count 'em, bestie π’run_testβ run a specificspi_test. this lets you override the default implementation ofspi_test_run_transfereither to add some custom filters for a specific test or to effectively run some very custom tests... yep, main-character override energy πexecute_msgβ run thespi_messagefor real. this lets you overridespi_test_execute_msgto apply final modifications on thespi_message. finishing touches, periodt πexpected_returnβ the expected return code. in some cases we want to test also for error conditions. so yes bestie, sometimes we're literally testing the fail case πiterate_lenβ list of length to iterate on. the lengths go brrr πiterate_tx_alignβ change the alignment ofspi_transfer.tx_buffor all values in the below range if set. the ranges are:[0 : spi_master.dma_alignment[if set[0 : iterate_tx_align[if unset. alignment lore, iykyk π§iterate_rx_alignβ change the alignment ofspi_transfer.rx_buf; seeiterate_tx_alignfor details. same vibe, rx edition π¦iterate_transfer_maskβ the bitmask of transfers to which the iterations apply. if0, then it applies to all transfer. mask on, mask off πfill_optionβ define the way howtx_bufis filled. theFILL_*#defines up in the synopsis are right there hanging out, bestie πfill_patternβ fill pattern to apply to thetx_buf(used in some of thefill_options). pattern girlie πelapsed_timeβ elapsed time in nanoseconds. tiny time units, big drama β±οΈ
π₯ SEE ALSO π₯
go peek at the Kernel file ./drivers/spi/spi-test.h β that's where the extra lore lives, fr fr π
okay bye bestie! this page is from ./drivers/spi, dated October 2026, and it's the struct spi_test(9) manual page β slay 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