Lines Matching +full:hdcp +full:- +full:bus
1 // SPDX-License-Identifier: GPL-2.0
5 * mei_hdcp.c: HDCP client driver for mei bus
14 * The mei_hdcp driver acts as a translation layer between HDCP 2.2
32 * mei_hdcp_initiate_session() - Initiate a Wired HDCP2.2 Tx Session in ME FW
34 * @data: Intel HW specific hdcp data
50 return -EINVAL; in mei_hdcp_initiate_session()
60 session_init_in.port.integrated_port_type = data->port_type; in mei_hdcp_initiate_session()
61 session_init_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_initiate_session()
62 session_init_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_initiate_session()
63 session_init_in.protocol = data->protocol; in mei_hdcp_initiate_session()
83 return -EIO; in mei_hdcp_initiate_session()
86 ake_data->msg_id = HDCP_2_2_AKE_INIT; in mei_hdcp_initiate_session()
87 ake_data->tx_caps = session_init_out.tx_caps; in mei_hdcp_initiate_session()
88 memcpy(ake_data->r_tx, session_init_out.r_tx, HDCP_2_2_RTX_LEN); in mei_hdcp_initiate_session()
94 * mei_hdcp_verify_receiver_cert_prepare_km() - Verify the Receiver Certificate
97 * @data: Intel HW specific hdcp data
120 return -EINVAL; in mei_hdcp_verify_receiver_cert_prepare_km()
130 verify_rxcert_in.port.integrated_port_type = data->port_type; in mei_hdcp_verify_receiver_cert_prepare_km()
131 verify_rxcert_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_verify_receiver_cert_prepare_km()
132 verify_rxcert_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_verify_receiver_cert_prepare_km()
134 verify_rxcert_in.cert_rx = rx_cert->cert_rx; in mei_hdcp_verify_receiver_cert_prepare_km()
135 memcpy(verify_rxcert_in.r_rx, &rx_cert->r_rx, HDCP_2_2_RRX_LEN); in mei_hdcp_verify_receiver_cert_prepare_km()
136 memcpy(verify_rxcert_in.rx_caps, rx_cert->rx_caps, HDCP_2_2_RXCAPS_LEN); in mei_hdcp_verify_receiver_cert_prepare_km()
156 return -EIO; in mei_hdcp_verify_receiver_cert_prepare_km()
161 ek_pub_km->msg_id = HDCP_2_2_AKE_STORED_KM; in mei_hdcp_verify_receiver_cert_prepare_km()
164 ek_pub_km->msg_id = HDCP_2_2_AKE_NO_STORED_KM; in mei_hdcp_verify_receiver_cert_prepare_km()
168 memcpy(ek_pub_km->e_kpub_km, &verify_rxcert_out.ekm_buff, in mei_hdcp_verify_receiver_cert_prepare_km()
175 * mei_hdcp_verify_hprime() - Verify AKE_Send_H_prime at ME FW.
177 * @data: Intel HW specific hdcp data
192 return -EINVAL; in mei_hdcp_verify_hprime()
201 send_hprime_in.port.integrated_port_type = data->port_type; in mei_hdcp_verify_hprime()
202 send_hprime_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_verify_hprime()
203 send_hprime_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_verify_hprime()
205 memcpy(send_hprime_in.h_prime, rx_hprime->h_prime, in mei_hdcp_verify_hprime()
225 return -EIO; in mei_hdcp_verify_hprime()
232 * mei_hdcp_store_pairing_info() - Store pairing info received at ME FW
234 * @data: Intel HW specific hdcp data
249 return -EINVAL; in mei_hdcp_store_pairing_info()
259 pairing_info_in.port.integrated_port_type = data->port_type; in mei_hdcp_store_pairing_info()
260 pairing_info_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_store_pairing_info()
261 pairing_info_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_store_pairing_info()
263 memcpy(pairing_info_in.e_kh_km, pairing_info->e_kh_km, in mei_hdcp_store_pairing_info()
284 return -EIO; in mei_hdcp_store_pairing_info()
291 * mei_hdcp_initiate_locality_check() - Prepare LC_Init
293 * @data: Intel HW specific hdcp data
309 return -EINVAL; in mei_hdcp_initiate_locality_check()
318 lc_init_in.port.integrated_port_type = data->port_type; in mei_hdcp_initiate_locality_check()
319 lc_init_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_initiate_locality_check()
320 lc_init_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_initiate_locality_check()
337 return -EIO; in mei_hdcp_initiate_locality_check()
340 lc_init_data->msg_id = HDCP_2_2_LC_INIT; in mei_hdcp_initiate_locality_check()
341 memcpy(lc_init_data->r_n, lc_init_out.r_n, HDCP_2_2_RN_LEN); in mei_hdcp_initiate_locality_check()
347 * mei_hdcp_verify_lprime() - Verify lprime.
349 * @data: Intel HW specific hdcp data
364 return -EINVAL; in mei_hdcp_verify_lprime()
374 verify_lprime_in.port.integrated_port_type = data->port_type; in mei_hdcp_verify_lprime()
375 verify_lprime_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_verify_lprime()
376 verify_lprime_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_verify_lprime()
378 memcpy(verify_lprime_in.l_prime, rx_lprime->l_prime, in mei_hdcp_verify_lprime()
399 return -EIO; in mei_hdcp_verify_lprime()
406 * mei_hdcp_get_session_key() - Prepare SKE_Send_Eks.
408 * @data: Intel HW specific hdcp data
423 return -EINVAL; in mei_hdcp_get_session_key()
432 get_skey_in.port.integrated_port_type = data->port_type; in mei_hdcp_get_session_key()
433 get_skey_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_get_session_key()
434 get_skey_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_get_session_key()
452 return -EIO; in mei_hdcp_get_session_key()
455 ske_data->msg_id = HDCP_2_2_SKE_SEND_EKS; in mei_hdcp_get_session_key()
456 memcpy(ske_data->e_dkey_ks, get_skey_out.e_dkey_ks, in mei_hdcp_get_session_key()
458 memcpy(ske_data->riv, get_skey_out.r_iv, HDCP_2_2_RIV_LEN); in mei_hdcp_get_session_key()
464 * mei_hdcp_repeater_check_flow_prepare_ack() - Validate the Downstream topology
467 * @data: Intel HW specific hdcp data
487 return -EINVAL; in mei_hdcp_repeater_check_flow_prepare_ack()
497 verify_repeater_in.port.integrated_port_type = data->port_type; in mei_hdcp_repeater_check_flow_prepare_ack()
498 verify_repeater_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_repeater_check_flow_prepare_ack()
499 verify_repeater_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_repeater_check_flow_prepare_ack()
501 memcpy(verify_repeater_in.rx_info, rep_topology->rx_info, in mei_hdcp_repeater_check_flow_prepare_ack()
503 memcpy(verify_repeater_in.seq_num_v, rep_topology->seq_num_v, in mei_hdcp_repeater_check_flow_prepare_ack()
505 memcpy(verify_repeater_in.v_prime, rep_topology->v_prime, in mei_hdcp_repeater_check_flow_prepare_ack()
507 memcpy(verify_repeater_in.receiver_ids, rep_topology->receiver_ids, in mei_hdcp_repeater_check_flow_prepare_ack()
528 return -EIO; in mei_hdcp_repeater_check_flow_prepare_ack()
531 memcpy(rep_send_ack->v, verify_repeater_out.v, in mei_hdcp_repeater_check_flow_prepare_ack()
533 rep_send_ack->msg_id = HDCP_2_2_REP_SEND_ACK; in mei_hdcp_repeater_check_flow_prepare_ack()
539 * mei_hdcp_verify_mprime() - Verify mprime.
541 * @data: Intel HW specific hdcp data
558 return -EINVAL; in mei_hdcp_verify_mprime()
562 cmd_size = struct_size(verify_mprime_in, streams, data->k); in mei_hdcp_verify_mprime()
564 return -EINVAL; in mei_hdcp_verify_mprime()
568 return -ENOMEM; in mei_hdcp_verify_mprime()
570 verify_mprime_in->header.api_version = HDCP_API_VERSION; in mei_hdcp_verify_mprime()
571 verify_mprime_in->header.command_id = WIRED_REPEATER_AUTH_STREAM_REQ; in mei_hdcp_verify_mprime()
572 verify_mprime_in->header.status = FW_HDCP_STATUS_SUCCESS; in mei_hdcp_verify_mprime()
573 verify_mprime_in->header.buffer_len = cmd_size - sizeof(verify_mprime_in->header); in mei_hdcp_verify_mprime()
575 verify_mprime_in->port.integrated_port_type = data->port_type; in mei_hdcp_verify_mprime()
576 verify_mprime_in->port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_verify_mprime()
577 verify_mprime_in->port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_verify_mprime()
579 memcpy(verify_mprime_in->m_prime, stream_ready->m_prime, HDCP_2_2_MPRIME_LEN); in mei_hdcp_verify_mprime()
580 drm_hdcp_cpu_to_be24(verify_mprime_in->seq_num_m, data->seq_num_m); in mei_hdcp_verify_mprime()
582 memcpy(verify_mprime_in->streams, data->streams, in mei_hdcp_verify_mprime()
583 array_size(data->k, sizeof(*data->streams))); in mei_hdcp_verify_mprime()
585 verify_mprime_in->k = cpu_to_be16(data->k); in mei_hdcp_verify_mprime()
605 return -EIO; in mei_hdcp_verify_mprime()
612 * mei_hdcp_enable_authentication() - Mark a port as authenticated
615 * @data: Intel HW specific hdcp data
628 return -EINVAL; in mei_hdcp_enable_authentication()
637 enable_auth_in.port.integrated_port_type = data->port_type; in mei_hdcp_enable_authentication()
638 enable_auth_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_enable_authentication()
639 enable_auth_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_enable_authentication()
640 enable_auth_in.stream_type = data->streams[0].stream_type; in mei_hdcp_enable_authentication()
659 return -EIO; in mei_hdcp_enable_authentication()
666 * mei_hdcp_close_session() - Close the Wired HDCP Tx session of ME FW per port.
669 * @data: Intel HW specific hdcp data
682 return -EINVAL; in mei_hdcp_close_session()
692 session_close_in.port.integrated_port_type = data->port_type; in mei_hdcp_close_session()
693 session_close_in.port.physical_port = (u8)data->hdcp_ddi; in mei_hdcp_close_session()
694 session_close_in.port.attached_transcoder = (u8)data->hdcp_transcoder; in mei_hdcp_close_session()
713 return -EIO; in mei_hdcp_close_session()
743 comp_arbiter->ops = &mei_hdcp_ops; in mei_component_master_bind()
744 comp_arbiter->hdcp_dev = dev; in mei_component_master_bind()
767 * mei_hdcp_component_match - compare function for matching mei hdcp.
769 * The function checks if the driver is i915, the subcomponent is HDCP
770 * and the grand parent of hdcp and the parent of i915 are the same
775 * @data: compare data (mei hdcp device)
778 * * 1 - if components match
779 * * 0 - otherwise
792 if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) || in mei_hdcp_component_match()
793 pdev->vendor != PCI_VENDOR_ID_INTEL) in mei_hdcp_component_match()
799 base = base->parent; in mei_hdcp_component_match()
803 base = base->parent; in mei_hdcp_component_match()
804 dev = dev->parent; in mei_hdcp_component_match()
818 dev_err(&cldev->dev, "mei_cldev_enable Failed. %d\n", ret); in mei_hdcp_probe()
824 ret = -ENOMEM; in mei_hdcp_probe()
829 component_match_add_typed(&cldev->dev, &master_match, in mei_hdcp_probe()
830 mei_hdcp_component_match, &cldev->dev); in mei_hdcp_probe()
832 ret = -ENOMEM; in mei_hdcp_probe()
837 ret = component_master_add_with_match(&cldev->dev, in mei_hdcp_probe()
841 dev_err(&cldev->dev, "Master comp add failed %d\n", ret); in mei_hdcp_probe()
860 component_master_del(&cldev->dev, &mei_component_master_ops); in mei_hdcp_remove()
866 dev_warn(&cldev->dev, "mei_cldev_disable() failed\n"); in mei_hdcp_remove()
889 MODULE_DESCRIPTION("MEI HDCP");