mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
platform/surface: aggregator: Improve documentation and handling of message target and source IDs
The `tid_in` and `tid_out` fields of the serial hub protocol command struct (struct ssh_command) are actually source and target IDs, indicating the peer from which the message originated and the peer for which it is intended. Change the naming of those fields accordingly and improve the protocol documentation. Additionally, introduce an enum containing all currently known peers, i.e. targets and sources. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20221202223327.690880-3-luzmaximilian@gmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
committed by
Hans de Goede
parent
070b3098dd
commit
3f88b459a7
@@ -912,10 +912,10 @@ enum ssam_event_mask {
|
||||
})
|
||||
|
||||
#define SSAM_EVENT_REGISTRY_SAM \
|
||||
SSAM_EVENT_REGISTRY(SSAM_SSH_TC_SAM, 0x01, 0x0b, 0x0c)
|
||||
SSAM_EVENT_REGISTRY(SSAM_SSH_TC_SAM, SSAM_SSH_TID_SAM, 0x0b, 0x0c)
|
||||
|
||||
#define SSAM_EVENT_REGISTRY_KIP \
|
||||
SSAM_EVENT_REGISTRY(SSAM_SSH_TC_KIP, 0x02, 0x27, 0x28)
|
||||
SSAM_EVENT_REGISTRY(SSAM_SSH_TC_KIP, SSAM_SSH_TID_KIP, 0x27, 0x28)
|
||||
|
||||
#define SSAM_EVENT_REGISTRY_REG(tid)\
|
||||
SSAM_EVENT_REGISTRY(SSAM_SSH_TC_REG, tid, 0x01, 0x02)
|
||||
|
@@ -83,23 +83,21 @@ enum ssh_payload_type {
|
||||
|
||||
/**
|
||||
* 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_out: Output target ID. Should be zero if this an incoming (EC to host)
|
||||
* message.
|
||||
* @tid_in: Input target ID. Should be zero if this is an outgoing (host to
|
||||
* EC) message.
|
||||
* @iid: Instance ID.
|
||||
* @rqid: Request ID. Used to match requests with responses and differentiate
|
||||
* between responses and events.
|
||||
* @cid: Command ID.
|
||||
* @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_out;
|
||||
u8 tid_in;
|
||||
u8 tid;
|
||||
u8 sid;
|
||||
u8 iid;
|
||||
__le16 rqid;
|
||||
u8 cid;
|
||||
@@ -280,6 +278,22 @@ struct ssam_span {
|
||||
size_t len;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssam_ssh_tid - Target/source IDs for Serial Hub messages.
|
||||
* @SSAM_SSH_TID_HOST: We as the kernel Serial Hub driver.
|
||||
* @SSAM_SSH_TID_SAM: The Surface Aggregator EC.
|
||||
* @SSAM_SSH_TID_KIP: Keyboard and perihperal controller.
|
||||
* @SSAM_SSH_TID_DEBUG: Debug connector.
|
||||
* @SSAM_SSH_TID_SURFLINK: SurfLink connector.
|
||||
*/
|
||||
enum ssam_ssh_tid {
|
||||
SSAM_SSH_TID_HOST = 0x00,
|
||||
SSAM_SSH_TID_SAM = 0x01,
|
||||
SSAM_SSH_TID_KIP = 0x02,
|
||||
SSAM_SSH_TID_DEBUG = 0x03,
|
||||
SSAM_SSH_TID_SURFLINK = 0x04,
|
||||
};
|
||||
|
||||
/*
|
||||
* Known SSH/EC target categories.
|
||||
*
|
||||
|
Reference in New Issue
Block a user