STRUCT CEC_MSG(9)
π struct cec_msg β CEC message structure β¨
okay so bestie, we're in the Kernel API Manual today and the main character is struct cec_msg π
this is the CEC message structure itself, no cap. CEC = the thing your TV remote talks over HDMI, and this struct is literally the whole text message. let's get into it π«Ά
πΈ NAME πΈ
struct cec_msg β CEC message structure, fr fr. that's the whole vibe.
β¨ SYNOPSIS β¨
struct cec_msg {
__u64 tx_ts;
__u64 rx_ts;
__u32 len;
__u32 timeout;
__u32 sequence;
__u32 flags;
__u8 msg[CEC_MAX_MSG_SIZE];
__u8 reply;
__u8 rx_status;
__u8 tx_status;
__u8 tx_arb_lost_cnt;
__u8 tx_nack_cnt;
__u8 tx_low_drive_cnt;
__u8 tx_error_cnt;
};
like, copy that exactly, don't be cute with it π
π Members π
okay field-by-field, group chat style, but every single fact stays:
tx_tsβ timestamp in nanoseconds usingCLOCK_MONOTONIC. the driver sets this when the message transmission has finished πrx_tsβ timestamp in nanoseconds usingCLOCK_MONOTONIC. driver sets this when the message was received π₯lenβ length in bytes of the message. that's it, that's the whole field β¨timeoutβ the timeout (in ms) used to timeoutCEC_RECEIVE. set it to0if you literally want to wait forever π this timeout can also be used withCEC_TRANSMITas the timeout for waiting for a reply. but heads up: if it's0, then it uses a 1 second timeout instead of waiting forever, which is not whatCEC_RECEIVEdoes. the way these two behave differentlyβ¦ πsequenceβ the framework assigns a sequence number to messages that are sent. use it to track replies to messages you sent earlier πflagsβ set to0. that's the assignment. slay πmsgβ the message payload πreplyβ okay this one's the big one, sit down. this field is ignored withCEC_RECEIVEand is only used byCEC_TRANSMIT. if non-zero, then wait for a reply with this opcode. set it toCEC_MSG_FEATURE_ABORTif you want to wait for a possible ABORT reply. if there was an error when sending the msg or FeatureAbort was returned, thenreplyis set to0. ifreplyis non-zero upon return, thenlen/msgare set to the received message. ifreplyis zero upon return andstatushas theCEC_TX_STATUS_FEATURE_ABORTbit set, thenlen/msgare set to the received feature abort message. ifreplyis zero upon return andstatushas theCEC_TX_STATUS_MAX_RETRIESbit set, then no reply was seen at all π ifreplyis non-zero forCEC_TRANSMITand the message is a broadcast, then-EINVALis returned. ifreplyis non-zero, thentimeoutis set to1000(the required maximum response time). phew. iconic field, frankly πrx_statusβ the message receive status bits. set by the driver π¦tx_statusβ the message transmit status bits. set by the driver π¦tx_arb_lost_cntβ the number of 'Arbitration Lost' events. set by the driver π€tx_nack_cntβ the number of 'Not Acknowledged' events. set by the driver πtx_low_drive_cntβ the number of 'Low Drive Detected' events. set by the driver πtx_error_cntβ the number of 'Error' events. set by the driver π₯
ngl bestie, notice the pattern: almost everything here is set by the driver. you're reading these, not writing them. respect the driver's main character energy π
π SEE ALSO π
kernel file ./include/uapi/linux/cec.h, plus the whole friend group:
cec_msg_initiator(9)cec_msg_destination(9)cec_msg_opcode(9)cec_msg_is_broadcast(9)cec_msg_init(9)cec_msg_set_reply_to(9)cec_msg_recv_is_tx_result(9)cec_msg_recv_is_rx_result(9)struct cec_caps(9)struct cec_log_addrs(9)struct cec_drm_connector_info(9)struct cec_connector_info(9)struct cec_event_state_change(9)struct cec_event_lost_msgs(9)struct cec_event(9)
go read them, iykyk π
and that's the page!! π this one lives at ./include/uapi/linux, dated October 2026, and it's filed under struct cec_msg(9) in the Kernel API Manual β mwah, bye bestie, go send some CEC messages π
β¨
π¦ 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