include/uapi/linux/cec.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/cec.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/cec.h- Extension
.h- Size
- 43269 bytes
- Lines
- 1237
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/string.h
Detected Declarations
struct cec_msgstruct cec_capsstruct cec_log_addrsstruct cec_drm_connector_infostruct cec_connector_infostruct cec_event_state_changestruct cec_event_lost_msgsstruct cec_eventfunction cec_msg_initiatorfunction cec_msg_destinationfunction cec_msg_opcodefunction cec_msg_is_broadcastfunction cec_msg_initfunction cec_msg_set_reply_tofunction cec_msg_recv_is_tx_resultfunction cec_msg_recv_is_rx_resultfunction cec_msg_status_is_okfunction cec_has_tvfunction cec_has_recordfunction cec_has_tunerfunction cec_has_playbackfunction cec_has_audiosystemfunction cec_has_backupfunction cec_has_specificfunction cec_is_unregisteredfunction cec_is_unconfiguredfunction devicefunction cec_is_processorfunction cec_is_switchfunction cec_is_cdc_only
Annotated Snippet
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;
};
/**
* cec_msg_initiator - return the initiator's logical address.
* @msg: the message structure
*/
static inline __u8 cec_msg_initiator(const struct cec_msg *msg)
{
return msg->msg[0] >> 4;
}
/**
* cec_msg_destination - return the destination's logical address.
* @msg: the message structure
*/
static inline __u8 cec_msg_destination(const struct cec_msg *msg)
{
return msg->msg[0] & 0xf;
}
/**
* cec_msg_opcode - return the opcode of the message, -1 for poll
* @msg: the message structure
*/
static inline int cec_msg_opcode(const struct cec_msg *msg)
{
return msg->len > 1 ? msg->msg[1] : -1;
}
/**
* cec_msg_is_broadcast - return true if this is a broadcast message.
* @msg: the message structure
*/
static inline int cec_msg_is_broadcast(const struct cec_msg *msg)
{
return (msg->msg[0] & 0xf) == 0xf;
}
/**
* cec_msg_init - initialize the message structure.
* @msg: the message structure
* @initiator: the logical address of the initiator
* @destination:the logical address of the destination (0xf for broadcast)
*
* The whole structure is zeroed, the len field is set to 1 (i.e. a poll
* message) and the initiator and destination are filled in.
*/
static inline void cec_msg_init(struct cec_msg *msg,
__u8 initiator, __u8 destination)
{
memset(msg, 0, sizeof(*msg));
msg->msg[0] = (initiator << 4) | destination;
msg->len = 1;
}
/**
* cec_msg_set_reply_to - fill in destination/initiator in a reply message.
* @msg: the message structure for the reply
* @orig: the original message structure
*
* Set the msg destination to the orig initiator and the msg initiator to the
* orig destination. Note that msg and orig may be the same pointer, in which
* case the change is done in place.
*
* It also zeroes the reply, timeout and flags fields.
*/
static inline void cec_msg_set_reply_to(struct cec_msg *msg,
struct cec_msg *orig)
{
/* The destination becomes the initiator and vice versa */
msg->msg[0] = (cec_msg_destination(orig) << 4) |
cec_msg_initiator(orig);
msg->reply = 0;
msg->timeout = 0;
msg->flags = 0;
Annotation
- Immediate include surface: `linux/types.h`, `linux/string.h`.
- Detected declarations: `struct cec_msg`, `struct cec_caps`, `struct cec_log_addrs`, `struct cec_drm_connector_info`, `struct cec_connector_info`, `struct cec_event_state_change`, `struct cec_event_lost_msgs`, `struct cec_event`, `function cec_msg_initiator`, `function cec_msg_destination`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.