STRUCT DMA_TEST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ struct dma_test(9) β€” the Kernel API Manual glow-up πŸ¦‹

okay bestie, so this is a page from the Kernel API Manual (that's the manual name, we're not copying the whole header line, you're welcome ✨) and today's main character is struct dma_test β€” literally the private data of the DMA test device driver. no cap, it's just a lil struct holding all the state, but she's iconic πŸ’…


✨ NAME ✨

struct dma_test β€” the DMA test device driver's private data, periodt.


πŸŽ€ SYNOPSIS πŸŽ€

struct dma_test {
    const struct tb_service *svc;
    struct tb_xdomain *xd;
    struct tb_ring *rx_ring;
    int rx_hopid;
    struct tb_ring *tx_ring;
    int tx_hopid;
    unsigned int packets_to_send;
    unsigned int packets_to_receive;
    unsigned int packets_sent;
    unsigned int packets_received;
    unsigned int link_speed;
    enum tb_link_width link_width;
    unsigned int crc_errors;
    unsigned int buffer_overflow_errors;
    enum dma_test_result result;
    enum dma_test_test_error error_code;
    struct completion complete;
    struct mutex lock;
 };

ngl that's the whole vibe right there 🫢 copy it exactly, don't freestyle it.


πŸ’– Members πŸ’–

okay so let's meet every single field, one by one, no skipping, we don't do that here πŸ“

  • svc β€” the XDomain service the driver is bound to. her whole situation πŸ’«
  • xd β€” the XDomain that the service belongs to. the bigger picture, iykyk.
  • rx_ring β€” the software ring holding RX frames. receiving queen πŸ‘‘
  • rx_hopid β€” the HopID used for receiving frames.
  • tx_ring β€” the software ring holding TX frames. sending queen, matching set 🌸
  • tx_hopid β€” the HopID used for sending frames.
  • packets_to_send β€” number of packets to send. the goal, the dream ✨
  • packets_to_receive β€” number of packets to receive.
  • packets_sent β€” the actual number of packets sent. reality check 😭
  • packets_received β€” the actual number of packets received.
  • link_speed β€” expected link speed in (Gb/s), and 0 means "use whatever is negotiated". lowkey the chill option πŸ¦‹
  • link_width β€” expected link width in (Gb/s), and 0 means "use whatever is negotiated". same energy πŸ’œ
  • crc_errors β€” number of CRC errors during the test run. the oopsie counter πŸ’€
  • buffer_overflow_errors β€” number of buffer overflow errors during the test run. the bigger oopsie counter πŸ™ˆ
  • result β€” result of the last run. the vibe check results, fr fr.
  • error_code β€” error code of the last run.
  • complete β€” used to wait for the Rx to complete. very "wait for me bestie" of her ⭐
  • lock β€” lock serializing access to this structure. she's the bouncer at the door, one at a time please πŸ’…

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/thunderbolt/dma_test.c β€” go read the source, it ate πŸ”₯

yes, every single member got her moment. nobody left behind, that's the rule 🫢

and that's the whole page bestie!! πŸ§šπŸ’– this one came from ./drivers/thunderbolt and it's dated October 2026 β€” so mark your calendar, screenshot it, send it to the group chat, it's giving archival slay πŸ’…βœ¨

πŸ“¦ where this page comes from