public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: "Winkler, Tomas" <tomas.winkler@intel.com>,
	"seanpaul@chromium.org" <seanpaul@chromium.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	"daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH 01/43] drm: hdcp2.2 authentication msg definitions
Date: Thu, 22 Feb 2018 10:59:10 +0530	[thread overview]
Message-ID: <706b80a8-28e3-b58b-2590-7faf8aadf4cf@intel.com> (raw)
In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B9422098C@hasmsx108.ger.corp.intel.com>



On Wednesday 14 February 2018 08:45 PM, Winkler, Tomas wrote:
>> This patch defines the hdcp2.2 protocol messages for the
>> HDCP2.2 authentication.
>>
>> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
>> ---
>>   include/drm/drm_hdcp.h | 226
>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 226 insertions(+)
>>
>> diff --git a/include/drm/drm_hdcp.h b/include/drm/drm_hdcp.h index
>> 562fa7df2637..9661c700cebb 100644
>> --- a/include/drm/drm_hdcp.h
>> +++ b/include/drm/drm_hdcp.h
>> @@ -38,4 +38,230 @@
>>   #define DRM_HDCP_DDC_BSTATUS			0x41
>>   #define DRM_HDCP_DDC_KSV_FIFO			0x43
>>
>> +#define DRM_HDCP_1_4_SRM_ID			0x8
>> +#define DRM_HDCP_1_4_VRL_LENGTH_SIZE		3
>> +#define DRM_HDCP_1_4_DCP_SIG_SIZE		40
>> +
>> +struct cp_srm_header {
>> +	struct {
>> +		uint8_t reserved_hi:4;
>> +		uint8_t srm_id:4;
>> +		uint8_t reserved_lo;
>> +	} spec_indicator;
> Do you really want to work with bit fields?  I mean in all the all structures.
I will rework on replacing all bitfields.
>> +	uint16_t srm_version;
> Shouldn't be it __le16?
And all multi-byte variables needs to be revisited for endianness.
>> +	uint8_t srm_gen_no;
>> +} __packed;
>> +
>> +/**
>> + * Protocol message definition for HDCP2.2 specification  */
>> +
>> +#define HDCP_STREAM_TYPE0			0x00
>> +#define HDCP_STREAM_TYPE1			0x01
>> +
>> +/* HDCP2.2 Msg IDs */
>> +#define NULL_MSG				1
>
> We need some HDCP2_ prefix this is in kernel global space and
> some of the constants have very generic name that can collide.
Sure I will add the prefix, to avoid possible conflicts. Thanks.
--Ram
>
>> +#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 ERRATA_DP_STREAM_TYPE			50
>> +
>> +#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 hdcp2_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 hdcp2_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 hdcp2_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;
> Should be probably __le16 and better to use bitmask then bit fields.
>
>> +} __packed;
>> +
>> +struct hdcp2_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 hdcp2_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
>> +hdcp2_ake_init {
>> +	uint8_t			msg_id;
>> +	uint8_t			r_tx[HDCP_RTX_LEN];
>> +	struct hdcp2_tx_caps	tx_caps;
>> +} __packed;
>> +
>> +struct hdcp2_ake_send_cert {
>> +	uint8_t			msg_id;
>> +	struct hdcp2_cert_rx	cert_rx;
>> +	uint8_t			r_rx[HDCP_RRX_LEN];
>> +	union hdcp2_rx_caps	rx_caps;
>> +} __packed;
>> +
>> +struct hdcp2_ake_no_stored_km {
>> +	uint8_t			msg_id;
>> +	uint8_t			e_kpub_km[HDCP_E_KPUB_KM_LEN];
>> +} __packed;
>> +
>> +struct hdcp2_ake_stored_km {
>> +	uint8_t			msg_id;
>> +	uint8_t			e_kh_km_m[HDCP_E_KH_KM_M_LEN];
>> +} __packed;
>> +
>> +struct hdcp2_ake_send_hprime {
>> +	uint8_t			msg_id;
>> +	uint8_t			h_prime[HDCP_H_PRIME_LEN];
>> +} __packed;
>> +
>> +struct hdcp2_ake_send_pairing_info {
>> +	uint8_t			msg_id;
>> +	uint8_t			e_kh_km[HDCP_E_KH_KM_LEN];
>> +} __packed;
>> +
>> +struct hdcp2_lc_init {
>> +	uint8_t			msg_id;
>> +	uint8_t			r_n[HDCP_RN_LEN];
>> +} __packed;
>> +
>> +struct hdcp2_lc_send_lprime {
>> +	uint8_t			msg_id;
>> +	uint8_t			l_prime[HDCP_L_PRIME_LEN];
>> +} __packed;
>> +
>> +struct hdcp2_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 hdcp2_rep_send_receiverid_list {
>> +	uint8_t			msg_id;
>> +	union hdcp2_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 hdcp2_rep_send_ack {
>> +	uint8_t			msg_id;
>> +	uint8_t			v[HDCP_LPRIME_HALF_SIZE];
>> +} __packed;
>> +
>> +struct hdcp2_rep_stream_manage {
>> +	uint8_t			msg_id;
>> +	uint8_t			seq_num_m[HDCP_SEQ_NUM_LEN];
>> +	uint16_t		k;
>> +	struct hdcp2_streamid_type
>> streams[MAX_CONTENT_STREAMS_CNT]; }
>> +__packed;
>> +
>> +struct hdcp2_rep_stream_ready {
>> +	uint8_t			msg_id;
>> +	uint8_t			m_prime[HDCP_MPRIME_LEN];
>> +} __packed;
>> +
>> +struct hdcp2_dp_errata_stream_type {
>> +	uint8_t		msg_id;
>> +	uint8_t		stream_type;
>> +} __packed;
>> +
>>   #endif
>> --
>> 2.7.4

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

  parent reply	other threads:[~2018-02-22  5:35 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 14:13 [PATCH 00/43] drm/i915: Implement HDCP2.2 Ramalingam C
2018-02-14 14:13 ` [PATCH 01/43] drm: hdcp2.2 authentication msg definitions Ramalingam C
2018-02-14 15:15   ` Winkler, Tomas
2018-02-14 19:40     ` Jani Nikula
2018-02-22  5:24       ` Ramalingam C
2018-02-22  5:29     ` Ramalingam C [this message]
2018-02-14 14:13 ` [PATCH 02/43] drm: HDMI and DP specific HDCP2.2 defines Ramalingam C
2018-02-14 14:13 ` [PATCH 03/43] mei: bus: whitelist hdcp client Ramalingam C
2018-02-14 14:13 ` [PATCH 04/43] mei: me: add gemini lake devices ids Ramalingam C
2018-02-14 14:45   ` Winkler, Tomas
2018-02-22  5:22     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 05/43] misc/mei/hdcp: Client driver for HDCP application Ramalingam C
2018-02-14 14:54   ` Winkler, Tomas
2018-02-14 14:57     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 06/43] misc/mei/hdcp: Add KBuild for mei hdcp driver Ramalingam C
2018-02-14 14:54   ` Winkler, Tomas
2018-02-14 14:58     ` Ramalingam C
2018-02-28 15:43     ` Ramalingam C
2018-02-28 16:11       ` Winkler, Tomas
2018-02-14 14:13 ` [PATCH 07/43] misc/mei/hdcp: Verify mei client device status Ramalingam C
2018-02-14 14:13 ` [PATCH 08/43] misc/mei/hdcp: Get & Put for mei cl_device Ramalingam C
2018-02-14 14:13 ` [PATCH 09/43] misc/mei/hdcp: Define ME FW interface for HDCP2.2 Ramalingam C
2018-02-14 14:13 ` [PATCH 10/43] linux/mei: Header for mei_hdcp driver interface Ramalingam C
2018-02-14 14:13 ` [PATCH 11/43] misc/mei/hdcp: Initiate Wired HDCP2.2 Tx Session Ramalingam C
2018-02-14 14:13 ` [PATCH 12/43] misc/mei/hdcp: Verify Receiver Cert and prepare km Ramalingam C
2018-02-14 14:13 ` [PATCH 13/43] misc/mei/hdcp: Verify H_prime Ramalingam C
2018-02-14 14:13 ` [PATCH 14/43] misc/mei/hdcp: Store the HDCP Pairing info Ramalingam C
2018-02-14 14:13 ` [PATCH 15/43] misc/mei/hdcp: Initiate Locality check Ramalingam C
2018-02-14 14:13 ` [PATCH 16/43] misc/mei/hdcp: Verify L_prime Ramalingam C
2018-02-14 14:13 ` [PATCH 17/43] misc/mei/hdcp: Prepare Session Key Ramalingam C
2018-02-14 14:13 ` [PATCH 18/43] misc/mei/hdcp: Repeater topology verifcation and ack Ramalingam C
2018-02-14 14:13 ` [PATCH 19/43] misc/mei/hdcp: Verify M_prime Ramalingam C
2018-02-14 14:13 ` [PATCH 20/43] misc/mei/hdcp: Enabling the HDCP authentication Ramalingam C
2018-02-14 14:13 ` [PATCH 21/43] misc/mei/hdcp: Closing wired HDCP2.2 Tx Session Ramalingam C
2018-02-14 14:13 ` [PATCH 22/43] drm/i915: Async execution of hdcp authentication Ramalingam C
2018-02-22 14:39   ` Sean Paul
2018-02-26  6:32     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 23/43] drm/i915: wrapping all hdcp var into intel_hdcp Ramalingam C
2018-02-22 14:47   ` Sean Paul
2018-02-26  6:05     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 24/43] drm/i915: wait for cp_irq Ramalingam C
2018-02-22 15:46   ` Sean Paul
2018-02-26  5:49     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 25/43] drm/i915: Define HDCP2.2 related variables Ramalingam C
2018-02-14 14:36   ` Chris Wilson
2018-02-14 14:56     ` Ramalingam C
2018-02-22 14:59   ` Sean Paul
2018-02-26  5:46     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 26/43] drm/i915: Define Intel HDCP2.2 registers Ramalingam C
2018-02-22 15:43   ` Sean Paul
2018-02-26  5:33     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 27/43] drm/i915: Wrappers for mei HDCP2.2 services Ramalingam C
2018-02-14 14:13 ` [PATCH 28/43] drm/i915: Implement HDCP2.2 receiver authentication Ramalingam C
2018-02-14 14:13 ` [PATCH 29/43] drm/i915: Implement HDCP2.2 repeater authentication Ramalingam C
2018-02-14 14:13 ` [PATCH 30/43] drm/i915: Enable and Disable HDCP2.2 port encryption Ramalingam C
2018-02-14 14:38   ` Chris Wilson
2018-02-14 14:52     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 31/43] drm/i915: Implement HDCP2.2 En/Dis-able Ramalingam C
2018-02-14 14:13 ` [PATCH 32/43] drm/i915: Implement HDCP2.2 link integrity check Ramalingam C
2018-02-14 14:13 ` [PATCH 33/43] drm/i915: Handle HDCP2.2 downstream topology change Ramalingam C
2018-02-14 14:13 ` [PATCH 34/43] drm/i915: Pullout the bksv read and validation Ramalingam C
2018-02-14 14:13 ` [PATCH 35/43] drm/i915: Enable HDCP version that is best capable Ramalingam C
2018-02-14 14:42   ` Chris Wilson
2018-02-14 14:51     ` Ramalingam C
2018-02-14 15:00       ` Chris Wilson
2018-02-14 15:00         ` Ramalingam C
2018-02-14 14:13 ` [PATCH 36/43] drm/i915: Enable HDCP1.4 incase of HDCP2.2 failure Ramalingam C
2018-02-14 14:13 ` [PATCH 37/43] drm/i915: Initialize HDCP2.2 and its MEI interface Ramalingam C
2018-02-14 14:45   ` Chris Wilson
2018-02-14 14:45     ` Ramalingam C
2018-02-14 14:13 ` [PATCH 38/43] drm/i915: Implement gmbus burst read Ramalingam C
2018-02-14 14:13 ` [PATCH 39/43] drm/i915: Implement the HDCP2.2 support for DP Ramalingam C
2018-02-14 14:13 ` [PATCH 40/43] drm/i915: Implement the HDCP2.2 support for HDMI Ramalingam C
2018-02-14 14:13 ` [PATCH 41/43] drm/i915: Add HDCP2.2 support for DP connectors Ramalingam C
2018-02-14 14:13 ` [PATCH 42/43] drm/i915: Add HDCP2.2 support for HDMI connectors Ramalingam C
2018-02-14 14:13 ` [PATCH 43/43] drm/i915: Invoke check link on CP_IRQ of DP Ramalingam C
2018-02-14 15:07 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Implement HDCP2.2 Patchwork
2018-02-14 15:13 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-02-14 15:20 ` ✗ Fi.CI.BAT: failure " Patchwork

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=706b80a8-28e3-b58b-2590-7faf8aadf4cf@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=seanpaul@chromium.org \
    --cc=tomas.winkler@intel.com \
    /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