include/linux/surface_aggregator/serial_hub.h
Source file repositories/reference/linux-study-clean/include/linux/surface_aggregator/serial_hub.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/surface_aggregator/serial_hub.h- Extension
.h- Size
- 22612 bytes
- Lines
- 692
- 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/crc-itu-t.hlinux/kref.hlinux/ktime.hlinux/list.hlinux/types.h
Detected Declarations
struct ssh_framestruct ssh_commandstruct ssam_spanstruct ssh_ptlstruct ssh_packetstruct ssh_packet_opsstruct ssh_packetstruct ssh_rtlstruct ssh_requeststruct ssh_request_opsstruct ssh_requestenum ssh_frame_typeenum ssh_payload_typeenum ssam_ssh_tidenum ssam_ssh_tcenum ssh_packet_base_priorityenum ssh_packet_flagsenum ssh_request_flagsfunction SSH_MESSAGE_LENGTHfunction ssh_rqid_next_validfunction ssh_rqid_to_eventfunction ssh_rqid_is_eventfunction ssh_tc_to_rqidfunction ssh_tid_to_indexfunction ssh_tid_is_validfunction SSH_PACKET_PRIORITYfunction ssh_packet_priority_get_basefunction ssh_packet_set_datafunction to_ssh_requestfunction ssh_request_getfunction ssh_request_putfunction ssh_request_set_data
Annotated Snippet
struct ssh_frame {
u8 type;
__le16 len;
u8 seq;
} __packed;
static_assert(sizeof(struct ssh_frame) == 4);
/*
* SSH_FRAME_MAX_PAYLOAD_SIZE - Maximum SSH frame payload length in bytes.
*
* This is the physical maximum length of the protocol. Implementations may
* set a more constrained limit.
*/
#define SSH_FRAME_MAX_PAYLOAD_SIZE U16_MAX
/**
* enum ssh_payload_type - Type indicator for the SSH payload.
* @SSH_PLD_TYPE_CMD: The payload is a command structure with optional command
* payload.
*/
enum ssh_payload_type {
SSH_PLD_TYPE_CMD = 0x80,
};
/**
* struct ssh_command - Payload of a command-type frame.
* @type: The type of the payload. See &enum ssh_payload_type. Should be
* SSH_PLD_TYPE_CMD for this struct.
* @tc: Command target category.
* @tid: Target ID. Indicates the target of the message.
* @sid: Source ID. Indicates the source of the message.
* @iid: Instance ID.
* @rqid: Request ID. Used to match requests with responses and differentiate
* between responses and events.
* @cid: Command ID.
*/
struct ssh_command {
u8 type;
u8 tc;
u8 tid;
u8 sid;
u8 iid;
__le16 rqid;
u8 cid;
} __packed;
static_assert(sizeof(struct ssh_command) == 8);
/*
* SSH_COMMAND_MAX_PAYLOAD_SIZE - Maximum SSH command payload length in bytes.
*
* This is the physical maximum length of the protocol. Implementations may
* set a more constrained limit.
*/
#define SSH_COMMAND_MAX_PAYLOAD_SIZE \
(SSH_FRAME_MAX_PAYLOAD_SIZE - sizeof(struct ssh_command))
/*
* SSH_MSG_LEN_BASE - Base-length of a SSH message.
*
* This is the minimum number of bytes required to form a message. The actual
* message length is SSH_MSG_LEN_BASE plus the length of the frame payload.
*/
#define SSH_MSG_LEN_BASE (sizeof(struct ssh_frame) + 3ull * sizeof(u16))
/*
* SSH_MSG_LEN_CTRL - Length of a SSH control message.
*
* This is the length of a SSH control message, which is equal to a SSH
* message without any payload.
*/
#define SSH_MSG_LEN_CTRL SSH_MSG_LEN_BASE
/**
* SSH_MESSAGE_LENGTH() - Compute length of SSH message.
* @payload_size: Length of the payload inside the SSH frame.
*
* Return: Returns the length of a SSH message with payload of specified size.
*/
#define SSH_MESSAGE_LENGTH(payload_size) (SSH_MSG_LEN_BASE + (payload_size))
/**
* SSH_COMMAND_MESSAGE_LENGTH() - Compute length of SSH command message.
* @payload_size: Length of the command payload.
*
* Return: Returns the length of a SSH command message with command payload of
* specified size.
*/
#define SSH_COMMAND_MESSAGE_LENGTH(payload_size) \
Annotation
- Immediate include surface: `linux/crc-itu-t.h`, `linux/kref.h`, `linux/ktime.h`, `linux/list.h`, `linux/types.h`.
- Detected declarations: `struct ssh_frame`, `struct ssh_command`, `struct ssam_span`, `struct ssh_ptl`, `struct ssh_packet`, `struct ssh_packet_ops`, `struct ssh_packet`, `struct ssh_rtl`, `struct ssh_request`, `struct ssh_request_ops`.
- 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.