summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei
diff options
context:
space:
mode:
authorRamalingam C <ramalingam.c@intel.com>2019-02-21 13:12:07 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2019-02-25 11:02:49 -0500
commit5e23491175eed8f9546491b5512ff62c1ea62dd3 (patch)
tree1e12320660d6b7beaed7132262d6c50b596052da /drivers/misc/mei
parent0a1af1b5c18d71b3e2eef7f46386c655170d6001 (diff)
misc/mei/hdcp: Enabling the HDCP authentication
Request to ME to configure a port as authenticated. On Success, ME FW will mark the port as authenticated and provides HDCP cipher with the encryption keys. Enabling the Authentication can be requested once all stages of HDCP2.2 authentication is completed by interacting with ME FW. Only after this stage, driver can enable the HDCP encryption for the port, through HW registers. v2: Rebased. v3: cldev is passed as first parameter [Tomas] Redundant comments and cast are removed [Tomas] v4: %zd for ssize_t [Alexander] %s/return -1/return -EIO [Alexander] Style and typos fixed [Uma] v5: Rebased. v6: Collected the Rb-ed by. Rebased. v7: Adjust to the new mei interface. Fix for Kdoc. v8: K-Doc addition. [Tomas] v9: renamed func as mei_hdcp_* [Tomas] Inline function is defined for DDI index [Tomas] v10: K-Doc fix. [Tomas] v11: Rebased. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1550772730-23280-14-git-send-email-ramalingam.c@intel.com
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r--drivers/misc/mei/hdcp/mei_hdcp.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
index 4bcb1ddeac1c..1e8c6f1ee4a5 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.c
+++ b/drivers/misc/mei/hdcp/mei_hdcp.c
@@ -605,6 +605,59 @@ static int mei_hdcp_verify_mprime(struct device *dev,
605 return 0; 605 return 0;
606} 606}
607 607
608/**
609 * mei_hdcp_enable_authentication() - Mark a port as authenticated
610 * through ME FW
611 * @dev: device corresponding to the mei_cl_device
612 * @data: Intel HW specific hdcp data
613 *
614 * Return: 0 on Success, <0 on Failure
615 */
616static int mei_hdcp_enable_authentication(struct device *dev,
617 struct hdcp_port_data *data)
618{
619 struct wired_cmd_enable_auth_in enable_auth_in = { { 0 } };
620 struct wired_cmd_enable_auth_out enable_auth_out = { { 0 } };
621 struct mei_cl_device *cldev;
622 ssize_t byte;
623
624 if (!dev || !data)
625 return -EINVAL;
626
627 cldev = to_mei_cl_device(dev);
628
629 enable_auth_in.header.api_version = HDCP_API_VERSION;
630 enable_auth_in.header.command_id = WIRED_ENABLE_AUTH;
631 enable_auth_in.header.status = ME_HDCP_STATUS_SUCCESS;
632 enable_auth_in.header.buffer_len = WIRED_CMD_BUF_LEN_ENABLE_AUTH_IN;
633
634 enable_auth_in.port.integrated_port_type = data->port_type;
635 enable_auth_in.port.physical_port = mei_get_ddi_index(data->port);
636 enable_auth_in.stream_type = data->streams[0].stream_type;
637
638 byte = mei_cldev_send(cldev, (u8 *)&enable_auth_in,
639 sizeof(enable_auth_in));
640 if (byte < 0) {
641 dev_dbg(dev, "mei_cldev_send failed. %zd\n", byte);
642 return byte;
643 }
644
645 byte = mei_cldev_recv(cldev, (u8 *)&enable_auth_out,
646 sizeof(enable_auth_out));
647 if (byte < 0) {
648 dev_dbg(dev, "mei_cldev_recv failed. %zd\n", byte);
649 return byte;
650 }
651
652 if (enable_auth_out.header.status != ME_HDCP_STATUS_SUCCESS) {
653 dev_dbg(dev, "ME cmd 0x%08X failed. status: 0x%X\n",
654 WIRED_ENABLE_AUTH, enable_auth_out.header.status);
655 return -EIO;
656 }
657
658 return 0;
659}
660
608static const __attribute__((unused)) 661static const __attribute__((unused))
609struct i915_hdcp_component_ops mei_hdcp_ops = { 662struct i915_hdcp_component_ops mei_hdcp_ops = {
610 .owner = THIS_MODULE, 663 .owner = THIS_MODULE,
@@ -619,7 +672,7 @@ struct i915_hdcp_component_ops mei_hdcp_ops = {
619 .repeater_check_flow_prepare_ack = 672 .repeater_check_flow_prepare_ack =
620 mei_hdcp_repeater_check_flow_prepare_ack, 673 mei_hdcp_repeater_check_flow_prepare_ack,
621 .verify_mprime = mei_hdcp_verify_mprime, 674 .verify_mprime = mei_hdcp_verify_mprime,
622 .enable_hdcp_authentication = NULL, 675 .enable_hdcp_authentication = mei_hdcp_enable_authentication,
623 .close_hdcp_session = NULL, 676 .close_hdcp_session = NULL,
624}; 677};
625 678