STRUCT SPI_TEST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 template spi_message used for the default settings. it's giving starter-pack energy ✨
  • transfers β€” an array of spi_transfers that are part of the resulting spi_message. the whole squad of transfers, basically πŸ’…
  • transfer_count β€” number of transfers. count 'em, bestie πŸ”’
  • run_test β€” run a specific spi_test. this lets you override the default implementation of spi_test_run_transfer either 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 the spi_message for real. this lets you override spi_test_execute_msg to apply final modifications on the spi_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 of spi_transfer.tx_buf for 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 of spi_transfer.rx_buf; see iterate_tx_align for details. same vibe, rx edition πŸ¦‹
  • iterate_transfer_mask β€” the bitmask of transfers to which the iterations apply. if 0, then it applies to all transfer. mask on, mask off πŸ’€
  • fill_option β€” define the way how tx_buf is filled. the FILL_* #defines up in the synopsis are right there hanging out, bestie πŸŽ€
  • fill_pattern β€” fill pattern to apply to the tx_buf (used in some of the fill_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