dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	daniel.vetter@intel.com
Subject: [RFC v1 14/20] drm/hdcp2.2: HDCP2.2 protocol msg definitions
Date: Wed, 12 Jul 2017 13:58:58 +0530	[thread overview]
Message-ID: <1499848144-8456-15-git-send-email-ramalingam.c@intel.com> (raw)
In-Reply-To: <1499848144-8456-1-git-send-email-ramalingam.c@intel.com>

Protocol message structures and constants of the
HDCP2.2 specification are defined at <drm/drm_hdcp.h>

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 include/drm/drm_hdcp.h | 204 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 204 insertions(+)

diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h
index d5adbf5..1f9a04d 100644
--- a/include/drm/drm_hdcp.h
+++ b/include/drm/drm_hdcp.h
@@ -166,6 +166,210 @@ struct drm_hdcp {
 #define DRM_HDCP_STATUS_SHIFT			20
 #define DRM_HDCP_STATUS_MASK			(0xFULL<<DRM_HDCP_STATUS_SHIFT)
 
+
+/**
+ * Protocol message definition for HDCP2.2 specification
+ */
+
+/* HDCP2.2 Msg IDs */
+#define NULL_MSG				1
+#define AKE_INIT				2
+#define AKE_SEND_CERT				3
+#define AKE_NO_STORED_KM			4
+#define AKE_STORED_KM				5
+#define AKE_SEND_HPRIME				7
+#define AKE_SEND_PARING_INFO			8
+#define LC_INIT					9
+#define LC_SEND_LPRIME				10
+#define SKE_SEND_EKS				11
+#define REP_SEND_RECVID_LIST			12
+#define REP_SEND_ACK				15
+#define REP_STREAM_MANAGE			16
+#define REP_STREAM_READY			17
+
+#define HDCP_RTX_LEN				8
+#define HDCP_RRX_LEN				8
+#define RECEIVER_ID_SIZE			5
+
+#define K_PUB_RX_MOD_N_SIZE			128
+#define K_PUB_RX_EXP_E_SIZE			3
+#define K_PUB_RX_SIZE				(K_PUB_RX_MOD_N_SIZE + \
+						 K_PUB_RX_EXP_E_SIZE)
+
+#define DCP_LLC_SIGNATURE_SIZE			384
+
+#define HDCP_E_KPUB_KM_LEN			128
+#define HDCP_E_KH_KM_M_LEN			(16 + 16)
+#define HDCP_H_PRIME_LEN			32
+#define HDCP_E_KH_KM_LEN			16
+#define HDCP_RN_LEN				8
+#define HDCP_L_PRIME_LEN			32
+#define HDCP_E_DKEY_KS_LEN			16
+#define HDCP_RIV_LEN				8
+#define HDCP_SEQ_NUM_LEN			3
+#define HDCP_LPRIME_HALF_SIZE			(HDCP_L_PRIME_LEN / 2)
+#define HDCP_RECEIVER_ID_LEN			5
+#define HDCP_MAX_DEVICE_COUNT			31
+#define HDCP_RECEIVER_IDS_MAX_LEN		(HDCP_RECEIVER_ID_LEN * \
+						 HDCP_MAX_DEVICE_COUNT)
+
+/**
+ * TODO: This has to be changed for DP MST, as multiple stream on
+ * same port is possible.
+ * For HDCP2.2 on HDMI and DP SST this value is always 1.
+ */
+#define MAX_CONTENT_STREAMS_CNT			1
+
+#define HDCP_MPRIME_LEN				32
+
+struct hdcp_cert_rx {
+	uint8_t	receiver_id[RECEIVER_ID_SIZE];
+	uint8_t	kpub_rx[K_PUB_RX_SIZE];
+	uint8_t	reserved1			:4;
+
+	/* As per HDMI & DP HDCP Spec, must be 0x0 or 0x1 */
+	uint8_t	protocol_descriptor		:4;
+
+	/* As per HDMI & DP HDCP Spec, must be 0x0000 */
+	uint8_t	reserved2;
+	uint8_t	dcp_signature[DCP_LLC_SIGNATURE_SIZE];
+} __packed;
+
+/**
+ * The RxCaps field specified in the HDCP HDMI, DP specs
+ * This field is big endian as specified in the errata.
+ */
+union rx_caps {
+	struct	{
+		uint8_t version;
+		uint8_t receiver_capability_mask_hi;
+		uint8_t repeater:1;
+
+		/* Rsvd in HDMI. Applicable in DP alone */
+		uint8_t hdcp_capable:1;
+		uint8_t receiver_capability_mask_low:6;
+	} fields;
+	uint8_t rx_caps_value[3];
+} __packed;
+
+/**
+ * RxInfo fields Contains various topology information for the
+ * repeater authentication flows
+ */
+union rx_info {
+	struct {
+		uint8_t device_count_hi:1;
+		uint8_t depth:3;
+		uint8_t rsvd:4;
+
+		/* Bit-0: downstream HDCP 1.x device exist */
+		uint8_t hdcp1_device_downstream:1;
+
+		/* Bit-1: downstream HDCP 2.0, 2.1 device exist */
+		uint8_t hdcp2_legacy_device_downstream:1;
+
+		/* Bit-2: downstream Topology limit errors */
+		uint8_t max_cascade_exceeded:1;
+		uint8_t max_devs_exceeded:1;
+		uint8_t device_count_lo:4;
+
+	} fields;
+	uint16_t rx_info_value;
+} __packed;
+
+struct wired_streamid_type {
+	uint8_t stream_id;
+	uint8_t stream_type;
+} __packed;
+
+/**
+ * The TxCaps field specified in the HDCP HDMI, DP specs
+ * This field is big endian as specified in the errata.
+ */
+struct tx_caps {
+	uint8_t			version;
+
+	/* Reserved for HDCP and DP Spec. Read as Zero */
+	uint16_t		transmitter_capability_mask;
+} __packed;
+
+/*
+ * Main structures for HDCP2.2 protocol communication
+ */
+struct wired_ake_init {
+	uint8_t			msg_id;
+	uint8_t			r_tx[HDCP_RTX_LEN];
+	struct tx_caps		tx_caps;
+} __packed;
+
+struct wired_ake_send_cert {
+	uint8_t			msg_id;
+	struct hdcp_cert_rx	cert_rx;
+	uint8_t			r_rx[HDCP_RRX_LEN];
+	union rx_caps		rx_caps;
+} __packed;
+
+struct wired_ake_no_stored_km {
+	uint8_t			msg_id;
+	uint8_t			e_kpub_km[HDCP_E_KPUB_KM_LEN];
+} __packed;
+
+struct wired_ake_stored_km {
+	uint8_t			msg_id;
+	uint8_t			e_kh_km_m[HDCP_E_KH_KM_M_LEN];
+} __packed;
+
+struct wired_ake_send_hprime {
+	uint8_t			msg_id;
+	uint8_t			h_prime[HDCP_H_PRIME_LEN];
+} __packed;
+
+struct wired_ake_send_pairing_info {
+	uint8_t			msg_id;
+	uint8_t			e_kh_km[HDCP_E_KH_KM_LEN];
+} __packed;
+
+struct wired_lc_init {
+	uint8_t			msg_id;
+	uint8_t			r_n[HDCP_RN_LEN];
+} __packed;
+
+struct wired_lc_send_lprime {
+	uint8_t			msg_id;
+	uint8_t			l_prime[HDCP_L_PRIME_LEN];
+} __packed;
+
+struct wired_ske_send_eks {
+	uint8_t			msg_id;
+	uint8_t			e_dkey_ks[HDCP_E_DKEY_KS_LEN];
+	uint8_t			riv[HDCP_RIV_LEN];
+} __packed;
+
+struct wired_rep_send_receiverid_list {
+	uint8_t			msg_id;
+	union rx_info		rx_info;
+	uint8_t			seq_num_v[HDCP_SEQ_NUM_LEN];
+	uint8_t			v_prime[HDCP_LPRIME_HALF_SIZE];
+	uint8_t			receiver_ids[HDCP_RECEIVER_IDS_MAX_LEN];
+} __packed;
+
+struct wired_rep_send_ack {
+	uint8_t			msg_id;
+	uint8_t			v[HDCP_LPRIME_HALF_SIZE];
+} __packed;
+
+struct wired_rep_stream_manage {
+	uint8_t			msg_id;
+	uint8_t			seq_num_m[HDCP_SEQ_NUM_LEN];
+	uint16_t		k;
+	struct wired_streamid_type streams[MAX_CONTENT_STREAMS_CNT];
+} __packed;
+
+struct wired_rep_stream_ready {
+	uint8_t			msg_id;
+	uint8_t			m_prime[HDCP_MPRIME_LEN];
+} __packed;
+
 /* Functions exported */
 extern int drm_hdcp_init(struct drm_connector *connector,
 					struct drm_hdcp *hdcp,
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-07-12  8:28 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12  8:28 [RFC v1 00/20] DRM Interfaces for HDCP support Ramalingam C
2017-07-12  8:28 ` [RFC v1 01/20] drm/hdcp: HDCP bitmask property for connectors Ramalingam C
2017-07-12  9:54   ` Daniel Vetter
2017-07-12 14:56     ` [Intel-gfx] " Ramalingam C
2017-07-12 19:10       ` Sean Paul
2017-07-13  6:09         ` Daniel Vetter
2017-07-13  6:54           ` Ramalingam C
2017-07-13  8:45             ` Daniel Vetter
2017-07-13 10:15               ` [Intel-gfx] " Ramalingam C
2017-07-13 10:36                 ` Daniel Vetter
2017-07-13 12:59                   ` Ramalingam C
2017-07-13 19:02                     ` [Intel-gfx] " Daniel Vetter
2017-07-14 10:40                       ` Ramalingam C
2017-07-14 11:21                         ` [RFC v2] drm/hdcp: drm enum property for HDCP State Ramalingam C
2017-07-14 13:55                           ` Sean Paul
2017-07-21 13:02                             ` Ramalingam C
2017-07-24 13:23                               ` Sean Paul
2017-07-24 13:34                                 ` Ramalingam C
2017-07-24 18:12                                 ` [RFC v3] drm/hdcp: drm enum property for CP State Ramalingam C
2017-07-25 12:34                                   ` Sean Paul
2017-07-26  9:54                                     ` Ramalingam C
2017-07-26 14:52                                       ` Sean Paul
2017-07-26 16:51                                         ` C, Ramalingam
2017-07-26 17:54                                           ` Sean Paul
2017-08-02 15:32                                             ` Ramalingam C
2017-08-02 15:53                                               ` [RFC v4] " Ramalingam C
2017-08-05 15:51                                                 ` Ramalingam C
2017-08-07  5:32                                                   ` Ramalingam C
2017-07-13  6:36         ` [Intel-gfx] [RFC v1 01/20] drm/hdcp: HDCP bitmask property for connectors Ramalingam C
2017-07-12  8:28 ` [RFC v1 02/20] drm/hdcp: HDCP SRM blob " Ramalingam C
2017-07-12  8:28 ` [RFC v1 03/20] drm/sysfs: Generate drm uevent with custom string Ramalingam C
2017-07-12  8:28 ` [RFC v1 04/20] drm/hdcp: Struct drm_hdcp for connector's hdcp state Ramalingam C
2017-07-12  8:28 ` [RFC v1 05/20] drm/hdcp: HDCP status code for DRM HDCP stack Ramalingam C
2017-07-12  8:28 ` [RFC v1 06/20] drm/hdcp: display driver callback funcs defined Ramalingam C
2017-07-12  8:28 ` [RFC v1 07/20] drm/hdcp: Initialization of DRM hdcp stack Ramalingam C
2017-07-12  8:28 ` [RFC v1 08/20] drm/hdcp: Add KBuild for DRM HDCP support Ramalingam C
2017-07-12  8:28 ` [RFC v1 09/20] drm/hdcp: Generic enable, disable and late_init Ramalingam C
2017-07-12  8:28 ` [RFC v1 10/20] drm/hdcp: Handler for connector state change Ramalingam C
2017-07-12  8:28 ` [RFC v1 11/20] drm/hdcp: Registering " Ramalingam C
2017-07-12  8:28 ` [RFC v1 12/20] drm/hdcp: Atomic set and get property for hdcp Ramalingam C
2017-07-12  8:28 ` [RFC v1 13/20] drm/hdcp: Updating DRM Property val with HDCP state Ramalingam C
2017-07-12  8:28 ` Ramalingam C [this message]
2017-07-12  8:28 ` [RFC v1 15/20] drm/hdcp2.2: Display driver service functions Ramalingam C
2017-07-12  8:29 ` [RFC v1 16/20] drm/hdcp2.2: HDCP2.2 Initialization Ramalingam C
2017-07-12  8:29 ` [RFC v1 17/20] drm/hdcp2.2: Definitions of HDMI HDCP2.2 registers Ramalingam C
2017-07-12  8:29 ` [RFC v1 18/20] drm/hdcp2.2: Late_init: Capability probing on panel Ramalingam C
2017-07-12  8:29 ` [RFC v1 19/20] drm/hdcp2.2: HDCP2.2 enable as a asynchronous work Ramalingam C
2017-07-12  8:29 ` [RFC v1 20/20] drm/hdcp2.2: HDCP2.2 disable " Ramalingam C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499848144-8456-15-git-send-email-ramalingam.c@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox