STRUCT MESSAGE(9)
π NAME π
okay bestie, welcome to the Kernel API Manual page for struct message(9) β¨ β and yes, this is literally struct message β a complete spi message. Not a fragment, not a side quest: the whole message. slay. π
β¨ SYNOPSIS β¨
struct message {
__le16 type;
u8 zero;
u8 counter;
__le16 rsp_buf_len;
__le16 length;
union {
struct keyboard_protocol keyboard;
struct touchpad_protocol touchpad;
struct touchpad_info_protocol tp_info;
struct command_protocol_tp_info tp_info_command;
struct command_protocol_mt_init init_mt_command;
struct command_protocol_capsl capsl_command;
struct command_protocol_bl bl_command;
u8 data[];
};
};
π Members π
okay so here's the member-by-member tea, no cap β:
typeβ the message type. that's the whole vibe.zeroβ always0. vibe check: passed, fr fr.counterβ incremented on each message, and it rolls over after255; there is a separate counter for each message type. πrsp_buf_lenβ response buffer length (the exact nature of this field is quite speculative π). On a request/write this is often the same aslength, though in some cases it has been seen to be much larger (e.g.0x400); on a response/read this is the same as on the request; for reads that are not responses it is0.lengthβ length of the remainder of the data in the whole message structure (after re-assembly in case of being split over multiplespi-packets), minus the trailing crc. The total size of the message struct is thereforelength + 10.{unnamed_union}β anonymous. iykyk π«Άkeyboardβ Keyboard message.touchpadβ Touchpad message.tp_infoβ Touchpad info (response).tp_info_commandβ Touchpad info (CRC).init_mt_commandβ Initialise Multitouch.capsl_commandβ Toggle caps-lock LED.bl_commandβ Keyboard brightness.dataβ Buffer data.
π¦ Description π¦
okay so each message begins with a fixed header, followed by a message-type specific payload, and ends with a 16-bit crc. it's giving very structured, honestly. because of the varying lengths of the payload, the crc is defined at the end of each payload struct, rather than in this struct. periodt. π
π SEE ALSO π
obsessed with these refs, honestly:
- Kernel file:
./drivers/input/keyboard/applespi.c struct keyboard_protocol(9)struct tp_finger(9)struct touchpad_protocol(9)struct command_protocol_tp_info(9)struct touchpad_info_protocol(9)struct command_protocol_mt_init(9)struct command_protocol_capsl(9)struct command_protocol_bl(9)struct spi_packet(9)
Catch you later, bestie π«Ά β this page comes from ./drivers/input/keyboard, dated October 2026, and it's filed under struct message(9). π
π¦ 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