drivers/misc/mei/hdcp/mei_hdcp.c
Source file repositories/reference/linux-study-clean/drivers/misc/mei/hdcp/mei_hdcp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/mei/hdcp/mei_hdcp.c- Extension
.c- Size
- 26421 bytes
- Lines
- 890
- Domain
- Driver Families
- Bucket
- drivers/misc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/pci.hlinux/slab.hlinux/mei.hlinux/mei_cl_bus.hlinux/component.hdrm/drm_connector.hdrm/intel/i915_component.hdrm/intel/i915_hdcp_interface.hmei_hdcp.h
Detected Declarations
function implementerfunction mei_hdcp_verify_receiver_cert_prepare_kmfunction mei_hdcp_verify_hprimefunction mei_hdcp_store_pairing_infofunction mei_hdcp_initiate_locality_checkfunction mei_hdcp_verify_lprimefunction mei_hdcp_get_session_keyfunction mei_hdcp_repeater_check_flow_prepare_ackfunction mei_hdcp_verify_mprimefunction mei_hdcp_enable_authenticationfunction mei_hdcp_close_sessionfunction mei_component_master_bindfunction mei_component_master_unbindfunction mei_hdcp_component_matchfunction mei_hdcp_probefunction mei_hdcp_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright © 2019 Intel Corporation
*
* mei_hdcp.c: HDCP client driver for mei bus
*
* Author:
* Ramalingam C <ramalingam.c@intel.com>
*/
/**
* DOC: MEI_HDCP Client Driver
*
* The mei_hdcp driver acts as a translation layer between HDCP 2.2
* protocol implementer (I915) and ME FW by translating HDCP2.2
* negotiation messages to ME FW command payloads and vice versa.
*/
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/mei.h>
#include <linux/mei_cl_bus.h>
#include <linux/component.h>
#include <drm/drm_connector.h>
#include <drm/intel/i915_component.h>
#include <drm/intel/i915_hdcp_interface.h>
#include "mei_hdcp.h"
/**
* mei_hdcp_initiate_session() - Initiate a Wired HDCP2.2 Tx Session in ME FW
* @dev: device corresponding to the mei_cl_device
* @data: Intel HW specific hdcp data
* @ake_data: AKE_Init msg output.
*
* Return: 0 on Success, <0 on Failure.
*/
static int
mei_hdcp_initiate_session(struct device *dev, struct hdcp_port_data *data,
struct hdcp2_ake_init *ake_data)
{
struct wired_cmd_initiate_hdcp2_session_in session_init_in = { { 0 } };
struct wired_cmd_initiate_hdcp2_session_out
session_init_out = { { 0 } };
struct mei_cl_device *cldev;
ssize_t byte;
if (!dev || !data || !ake_data)
return -EINVAL;
cldev = to_mei_cl_device(dev);
session_init_in.header.api_version = HDCP_API_VERSION;
session_init_in.header.command_id = WIRED_INITIATE_HDCP2_SESSION;
session_init_in.header.status = FW_HDCP_STATUS_SUCCESS;
session_init_in.header.buffer_len =
WIRED_CMD_BUF_LEN_INITIATE_HDCP2_SESSION_IN;
session_init_in.port.integrated_port_type = data->port_type;
session_init_in.port.physical_port = (u8)data->hdcp_ddi;
session_init_in.port.attached_transcoder = (u8)data->hdcp_transcoder;
session_init_in.protocol = data->protocol;
byte = mei_cldev_send(cldev, (u8 *)&session_init_in,
sizeof(session_init_in));
if (byte < 0) {
dev_dbg(dev, "mei_cldev_send failed. %zd\n", byte);
return byte;
}
byte = mei_cldev_recv(cldev, (u8 *)&session_init_out,
sizeof(session_init_out));
if (byte < 0) {
dev_dbg(dev, "mei_cldev_recv failed. %zd\n", byte);
return byte;
}
if (session_init_out.header.status != FW_HDCP_STATUS_SUCCESS) {
dev_dbg(dev, "ME cmd 0x%08X Failed. Status: 0x%X\n",
WIRED_INITIATE_HDCP2_SESSION,
session_init_out.header.status);
return -EIO;
}
ake_data->msg_id = HDCP_2_2_AKE_INIT;
ake_data->tx_caps = session_init_out.tx_caps;
memcpy(ake_data->r_tx, session_init_out.r_tx, HDCP_2_2_RTX_LEN);
return 0;
Annotation
- Immediate include surface: `linux/module.h`, `linux/pci.h`, `linux/slab.h`, `linux/mei.h`, `linux/mei_cl_bus.h`, `linux/component.h`, `drm/drm_connector.h`, `drm/intel/i915_component.h`.
- Detected declarations: `function implementer`, `function mei_hdcp_verify_receiver_cert_prepare_km`, `function mei_hdcp_verify_hprime`, `function mei_hdcp_store_pairing_info`, `function mei_hdcp_initiate_locality_check`, `function mei_hdcp_verify_lprime`, `function mei_hdcp_get_session_key`, `function mei_hdcp_repeater_check_flow_prepare_ack`, `function mei_hdcp_verify_mprime`, `function mei_hdcp_enable_authentication`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.