STRUCT SPI_PACKET(9)
π struct spi_packet(9) β the kernel API manual, but make it cute π¦
Okay so bestie, let me tell you about struct spi_packet β it's a complete spi packet and it is always 256 bytes. No cap. It carries the (parts of the) message in the data, but lowkey note that this does not necessarily contain a complete message, because in some cases (e.g. many fingers pressed πππ) the message is split over multiple packets β see the @offset, @remaining, and @length fields, iykyk. In general the data parts in spi_packet's are concatenated until @remaining is 0, and the result is an message. Periodt. β¨
πΈ SYNOPSIS πΈ
struct spi_packet {
u8 flags;
u8 device;
__le16 offset;
__le16 remaining;
__le16 length;
u8 data[246];
__le16 crc16;
};
π Members π
flagsβ0x40= write (to device),0x20= read (from device); note that the response to a write still has0x40. It's giving "read receipt energy" ngl πdeviceβ1= keyboard,2= touchpad. Two icons, two vibes πΉπ±οΈoffsetβ specifies the offset of this packet's data in the complete message; i.e.> 0indicates this is a continuation packet (in the second packet for a message split over multiple packets this would then be the same as thelengthin the first packet). So it's like the "part 2" timestamp of your fave show, fr fr πΊremainingβ number of message bytes remaining in subsequents packets (in the first packet of a message split over two packets this would then be the same as thelengthin the second packet). Basically the "how much more tea is there to spill" counter π«lengthβ length of the valid data in the data in this packet. The main character's screen time in this episode πdataβ all or part of a message. The actual content, the lore, the moment πcrc16β crc over this whole structure minus thiscrc16field. This covers just this packet, even on multi-packet messages (in contrast to the crc in the message). So it's the packet's own personal vibe check, not the whole thread's π
π₯ SEE ALSO π₯
- Kernel file
./drivers/input/keyboard/applespi.cstructkeyboard_protocol(9), structtp_finger(9), structtouchpad_protocol(9), structcommand_protocol_tp_info(9), structtouchpad_info_protocol(9), structcommand_protocol_mt_init(9), structcommand_protocol_capsl(9), structcommand_protocol_bl(9), structmessage(9)
And that's the tea, bestie π The source lives in ./drivers/input/keyboard, dated October 2026 β stay iconic, stay hydrated, and may your packets always have remaining = 0 πβ¨
π¦ 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