linux/include/drm/intel/i915_hdcp_interface.h

/* SPDX-License-Identifier: (GPL-2.0+) */
/*
 * Copyright © 2017-2019 Intel Corporation
 *
 * Authors:
 * Ramalingam C <[email protected]>
 */

#ifndef _I915_HDCP_INTERFACE_H_
#define _I915_HDCP_INTERFACE_H_

#include <linux/mutex.h>
#include <linux/device.h>
#include <drm/display/drm_hdcp.h>

/**
 * enum hdcp_port_type - HDCP port implementation type defined by ME/GSC FW
 * @HDCP_PORT_TYPE_INVALID: Invalid hdcp port type
 * @HDCP_PORT_TYPE_INTEGRATED: In-Host HDCP2.x port
 * @HDCP_PORT_TYPE_LSPCON: HDCP2.2 discrete wired Tx port with LSPCON
 *			   (HDMI 2.0) solution
 * @HDCP_PORT_TYPE_CPDP: HDCP2.2 discrete wired Tx port using the CPDP (DP 1.3)
 *			 solution
 */
enum hdcp_port_type {};

/**
 * enum hdcp_wired_protocol - HDCP adaptation used on the port
 * @HDCP_PROTOCOL_INVALID: Invalid HDCP adaptation protocol
 * @HDCP_PROTOCOL_HDMI: HDMI adaptation of HDCP used on the port
 * @HDCP_PROTOCOL_DP: DP adaptation of HDCP used on the port
 */
enum hdcp_wired_protocol {};

enum hdcp_ddi {};

/**
 * enum hdcp_transcoder - ME/GSC Firmware defined index for transcoders
 * @HDCP_INVALID_TRANSCODER: Index for Invalid transcoder
 * @HDCP_TRANSCODER_EDP: Index for EDP Transcoder
 * @HDCP_TRANSCODER_DSI0: Index for DSI0 Transcoder
 * @HDCP_TRANSCODER_DSI1: Index for DSI1 Transcoder
 * @HDCP_TRANSCODER_A: Index for Transcoder A
 * @HDCP_TRANSCODER_B: Index for Transcoder B
 * @HDCP_TRANSCODER_C: Index for Transcoder C
 * @HDCP_TRANSCODER_D: Index for Transcoder D
 */
enum hdcp_transcoder {};

/**
 * struct hdcp_port_data - intel specific HDCP port data
 * @hdcp_ddi: ddi index as per ME/GSC FW
 * @hdcp_transcoder: transcoder index as per ME/GSC FW
 * @port_type: HDCP port type as per ME/GSC FW classification
 * @protocol: HDCP adaptation as per ME/GSC FW
 * @k: No of streams transmitted on a port. Only on DP MST this is != 1
 * @seq_num_m: Count of RepeaterAuth_Stream_Manage msg propagated.
 *	       Initialized to 0 on AKE_INIT. Incremented after every successful
 *	       transmission of RepeaterAuth_Stream_Manage message. When it rolls
 *	       over re-Auth has to be triggered.
 * @streams: struct hdcp2_streamid_type[k]. Defines the type and id for the
 *	     streams
 */
struct hdcp_port_data {};

/**
 * struct i915_hdcp_ops- ops for HDCP2.2 services.
 * @owner: Module providing the ops
 * @initiate_hdcp2_session: Initiate a Wired HDCP2.2 Tx Session.
 *			    And Prepare AKE_Init.
 * @verify_receiver_cert_prepare_km: Verify the Receiver Certificate
 *				     AKE_Send_Cert and prepare
 *				     AKE_Stored_Km/AKE_No_Stored_Km
 * @verify_hprime: Verify AKE_Send_H_prime
 * @store_pairing_info: Store pairing info received
 * @initiate_locality_check: Prepare LC_Init
 * @verify_lprime: Verify lprime
 * @get_session_key: Prepare SKE_Send_Eks
 * @repeater_check_flow_prepare_ack: Validate the Downstream topology
 *				     and prepare rep_ack
 * @verify_mprime: Verify mprime
 * @enable_hdcp_authentication:  Mark a port as authenticated.
 * @close_hdcp_session: Close the Wired HDCP Tx session per port.
 *			This also disables the authenticated state of the port.
 */
struct i915_hdcp_ops {};

/**
 * struct i915_hdcp_arbiter - Used for communication between i915
 * and hdcp drivers for the HDCP2.2 services
 */
struct i915_hdcp_arbiter {};

/* fw_hdcp_status: Enumeration of all HDCP Status Codes */
enum fw_hdcp_status {};

#define HDCP_API_VERSION

#define HDCP_M_LEN
#define HDCP_KH_LEN

/* Payload Buffer size(Excluding Header) for CMDs and corresponding response */
/* Wired_Tx_AKE  */
#define WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN
#define WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_OUT

#define WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_IN
#define WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_MIN_OUT
#define WIRED_CMD_BUF_LEN_VERIFY_RECEIVER_CERT_MAX_OUT

#define WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_IN
#define WIRED_CMD_BUF_LEN_AKE_SEND_HPRIME_OUT

#define WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_IN
#define WIRED_CMD_BUF_LEN_SEND_PAIRING_INFO_OUT

#define WIRED_CMD_BUF_LEN_CLOSE_SESSION_IN
#define WIRED_CMD_BUF_LEN_CLOSE_SESSION_OUT

/* Wired_Tx_LC */
#define WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_IN
#define WIRED_CMD_BUF_LEN_INIT_LOCALITY_CHECK_OUT

#define WIRED_CMD_BUF_LEN_VALIDATE_LOCALITY_IN
#define WIRED_CMD_BUF_LEN_VALIDATE_LOCALITY_OUT

/* Wired_Tx_SKE */
#define WIRED_CMD_BUF_LEN_GET_SESSION_KEY_IN
#define WIRED_CMD_BUF_LEN_GET_SESSION_KEY_OUT

/* Wired_Tx_SKE */
#define WIRED_CMD_BUF_LEN_ENABLE_AUTH_IN
#define WIRED_CMD_BUF_LEN_ENABLE_AUTH_OUT

/* Wired_Tx_Repeater */
#define WIRED_CMD_BUF_LEN_VERIFY_REPEATER_IN
#define WIRED_CMD_BUF_LEN_VERIFY_REPEATER_OUT

#define WIRED_CMD_BUF_LEN_REPEATER_AUTH_STREAM_REQ_MIN_IN

#define WIRED_CMD_BUF_LEN_REPEATER_AUTH_STREAM_REQ_OUT

/* hdcp_command_id: Enumeration of all WIRED HDCP Command IDs */
enum hdcp_command_id {};

encrypted_buff;

/* HDCP HECI message header. All header values are little endian. */
struct hdcp_cmd_header {} __packed;

/* Empty command request or response. No data follows the header. */
struct hdcp_cmd_no_data {} __packed;

/* Uniquely identifies the hdcp port being addressed for a given command. */
struct hdcp_port_id {} __packed;

/*
 * Data structures for integrated wired HDCP2 Tx in
 * support of the AKE protocol
 */
/* HECI struct for integrated wired HDCP Tx session initiation. */
struct wired_cmd_initiate_hdcp2_session_in {} __packed;

struct wired_cmd_initiate_hdcp2_session_out {} __packed;

/* HECI struct for ending an integrated wired HDCP Tx session. */
struct wired_cmd_close_session_in {} __packed;

struct wired_cmd_close_session_out {} __packed;

/* HECI struct for integrated wired HDCP Tx Rx Cert verification. */
struct wired_cmd_verify_receiver_cert_in {} __packed;

struct wired_cmd_verify_receiver_cert_out {} __packed;

/* HECI struct for verification of Rx's Hprime in a HDCP Tx session */
struct wired_cmd_ake_send_hprime_in {} __packed;

struct wired_cmd_ake_send_hprime_out {} __packed;

/*
 * HECI struct for sending in AKE pairing data generated by the Rx in an
 * integrated wired HDCP Tx session.
 */
struct wired_cmd_ake_send_pairing_info_in {} __packed;

struct wired_cmd_ake_send_pairing_info_out {} __packed;

/* Data structures for integrated wired HDCP2 Tx in support of the LC protocol*/
/*
 * HECI struct for initiating locality check with an
 * integrated wired HDCP Tx session.
 */
struct wired_cmd_init_locality_check_in {} __packed;

struct wired_cmd_init_locality_check_out {} __packed;

/*
 * HECI struct for validating an Rx's LPrime value in an
 * integrated wired HDCP Tx session.
 */
struct wired_cmd_validate_locality_in {} __packed;

struct wired_cmd_validate_locality_out {} __packed;

/*
 * Data structures for integrated wired HDCP2 Tx in support of the
 * SKE protocol
 */
/* HECI struct for creating session key */
struct wired_cmd_get_session_key_in {} __packed;

struct wired_cmd_get_session_key_out {} __packed;

/* HECI struct for the Tx enable authentication command */
struct wired_cmd_enable_auth_in {} __packed;

struct wired_cmd_enable_auth_out {} __packed;

/*
 * Data structures for integrated wired HDCP2 Tx in support of
 * the repeater protocols
 */
/*
 * HECI struct for verifying the downstream repeater's HDCP topology in an
 * integrated wired HDCP Tx session.
 */
struct wired_cmd_verify_repeater_in {} __packed;

struct wired_cmd_verify_repeater_out {} __packed;

/*
 * HECI struct in support of stream management in an
 * integrated wired HDCP Tx session.
 */
struct wired_cmd_repeater_auth_stream_req_in {} __packed;

struct wired_cmd_repeater_auth_stream_req_out {} __packed;

#endif /* _I915_HDCP_INTERFACE_H_ */