/*************************************************************************** * Copyright (c) 2002-2008, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: bhdmlib_hdcp.h $ * $brcm_Revision: Hydra_Software_Devel/11 $ * $brcm_Date: 4/2/08 4:30p $ * * Module Description: * * Revision History: * * $brcm_Log: /magnum/syslib/hdmlib/bhdmlib_hdcp.h $ * * Hydra_Software_Devel/11 4/2/08 4:30p vle * PR 40101: Fix compiler errors when not building with HDCP. * * Hydra_Software_Devel/10 4/2/08 2:31p vle * PR 40101: Time HDCP Keyloader function to accurately calculate * appropriate wait time before reading R0' * * Hydra_Software_Devel/9 7/16/07 6:19p vle * PR 32662: Add BHDMlib_HDCP_Close(...) prototype * * Hydra_Software_Devel/8 8/11/06 3:49p rgreen * PR22187: Fix HDCP Key Loader to use standalone HSM PI * * Hydra_Software_Devel/7 8/11/06 1:15p rgreen * PR22187: Fix HDCP Key Loader to use standalone HSM PI * * Hydra_Software_Devel/6 8/18/04 4:40p rgreen * PR 12116: Add HDCP Key Loading Support * Use new BHDM_EncryptedHdcpStructure for HDCP Key loading * * Hydra_Software_Devel/5 5/13/04 4:32p rgreen * PR 10273: HDMI / HDCP Revocation/renewability support requirement * * Hydra_Software_Devel/4 4/5/04 1:17p rgreen * PR8896: HDMI API Development/Test * PR10273: HDCP Revocation/renewability support * Add support to AuthenticateReceiver function for checking Revoked KSVs * * Hydra_Software_Devel/3 2/13/04 7:57p rgreen * PR8896: HDMI API Development/Test * Add code to support Repeater Authentication; * Use SIMULATE_REPEATER to generate Tx verifications values contained in * the HDCP 1.1 Spec * Modify BHDM_HDCP_AuthenticateRepeater call * * Hydra_Software_Devel/2 1/27/04 1:04p rgreen * PR8896: HDMI API Development/Test * Move AuthenticateRepeater function to BHDMlib; needs access to XPT * handle for authentication with HDCP Repeater * * Hydra_Software_Devel/1 1/20/04 7:38p rgreen * PR8896: HDMI API Development/Test * Create HDMI HDCP Syslib to utilize XPT Key Serializer * ***************************************************************************/ #ifndef BHDMLIB_HDCP_H__ #define BHDMLIB_HDCP_H__ #include "bhdm.h" #include "bhdm_hdcp.h" #include "btmr.h" #include "bhdmlib_hdcp_keyloader.h" #if BHSM_AEGIS_SUPPORT #define BHDMLIB_KeyHandle BHSM_Handle #define hHANDLE hHsm #define hHDCP_BHDMLIB_KeyHandle hHDCP->hHsm #else #define BHDMLIB_KeyHandle BXPT_Handle #define hHANDLE hXPT #define hHDCP_BHDMLIB_KeyHandle hHDCP->hXPT #endif #ifdef __cplusplus extern "C" { #endif /****************************************************************************** Summary: HDMI Context Handle *******************************************************************************/ typedef struct BHDMlib_HDCP_P_Handle *BHDMlib_HDCP_Handle ; /****************************************************************************** Summary: Open an HDMI HDCP handle to support HDP functions between the Transmitter and the Receiver. Description: This function initializes the handle/devices needed to support HDCP operations between HDCP capable Transmitters and the Receivers Input: hHDMI - The HDMI device handle that the application created earlier during the system initialization sequence. hXPT - pointer to the XPT device handle that the application created earlier during the system initialization sequence. Output: pHdcpHandle - pointer to a newly created HDMI/HDCP device handle. Returns: BERR_SUCCESS - HDMI HDCP device handle successfully created BERR_INVALID_PARAMETER - Invalid function parameter. BERR_OUT_OF_SYSTEM_MEMORY - Not enough memory to create HDCP handle See Also: o BHDM_Handle o BXPT_Handle *******************************************************************************/ BERR_Code BHDMlib_HDCP_Open( BHDMlib_HDCP_Handle *pHdcpHandle, /* [out] HDMI HDCP handle */ BHDM_Handle hHDMI, /* [in] HDMI device handle */ BHDMLIB_KeyHandle hHANDLE ) ; /****************************************************************************** Summary: Close an HDMI HDCP handle Description: This function uninitializes the handle/devices support HDCP operations between HDCP capable Transmitters and the Receivers Input: hHDCP - The HDCP device handle that the application created earlier during the system initialization sequence. Returns: BERR_SUCCESS - HDMI HDCP device handle successfully created BERR_INVALID_PARAMETER - Invalid function parameter. BERR_OUT_OF_SYSTEM_MEMORY - Not enough memory to create HDCP handle See Also: o BHDM_Handle *******************************************************************************/ BERR_Code BHDMlib_HDCP_Close( BHDMlib_HDCP_Handle hHDCP /* [in] HDCP lib handle */ ); /****************************************************************************** Summary: Authenticate the HDCP link between the Transmitter and the Receiver. Description: This function does the HDCP Authentication with a receiver as specified in the HDCP specification. The return codes will indicate the source of failure; if any. Input: hHDMI - The HDMI device handle that the application created earlier during the system initialization sequence. AnSelection - HDCP An value to be generated by the HDCP core pTxAksv - pointer to the Transmitter Key Selection Vector (Aksv) shipped with the HDCP key set from Digital-CP (www.digital-cp.com) pRekovedKsvList - pointer to list of revoked Ksvs retrieved from SRM message uiNumRevokedKsvs - number of Ksvs in the revoked list Output: Returns: BERR_SUCCESS - HDCP protected link created. BERR_INVALID_PARAMETER - Invalid function parameter. BHDM_HDCP_RX_NO_DEVICE - No Rx Device is attached BHDM_HDCP_RX_NO_HDCP_SUPPORT - Attached Rx Device has no HDCP support BHDM_HDCP_RX_BKSV_ERROR - Attached Rx Device has invalid Bksv BHDM_HDCP_TX_AKSV_ERROR - Transmtter Aksv value is invalid BHDM_HDCP_AUTHENTICATE_ERROR - Link Authentication Value (R0) failed Note: The pRevokedKsvList should be passed in as big-endian (the same endian-ness contained in the original SRM message). The HDCP keys are loaded using the Serializer in transport porting interface. Use NULL and 0 for pRevokedKsvList and uiNumRevokedKsvs if no DCP LLC SRM messages are available. See Also: o BHDM_Handle o BXPT_Handle o BHDM_HDCP_AnSelect o BHDM_HDCP_EnableSerialKeyLoad *******************************************************************************/ BERR_Code BHDMlib_HDCP_AuthenticateReceiver( BHDMlib_HDCP_Handle hHDCP, /* [in] HDMI HDCP handle */ BHDM_HDCP_AnSelect AnSelection, /* [in] HDCP An type value to use */ const uint8_t *pTxAksv, /* [in] pointer HDCP Key Set Aksv Value */ const BHDM_EncryptedHdcpKeyStruct *pTxKeyStruct, /* [in] pointer to HDCP Keys */ const uint8_t *pRevokedKsvList, /* [in] pointer to Revoked KSV List */ const uint16_t uiNumRevokedKsvs /* [in] number of KSVs in Revoked Ksv List */ ) ; /****************************************************************************** Summary: Authenticate the HDCP link between the Transmitter and an HDCP Repeater. Description: This function does the HDCP Authentication with an HDCP Repeater as specified in the HDCP specification. The return codes will indicate the source of failure; if any. Input: hHDMI - The HDMI device handle that the application created earlier during the system initialization sequence. AnSelection - HDCP An value to be generated by the HDCP core pTxAksv - pointer to the Transmitter Key Selection Vector (Aksv) shipped with the HDCP key set from Digital-CP (www.digital-cp.com) pRekovedKsvList - pointer to list of revoked Ksvs retrieved from SRM message uiNumRevokedKsvs - number of Ksvs in the revoked list Output: Returns: BERR_SUCCESS - HDCP protected link created. BERR_INVALID_PARAMETER - Invalid function parameter. BHDM_HDCP_RX_NO_DEVICE - No Rx Device is attached BHDM_HDCP_RX_NO_HDCP_SUPPORT - Attached Rx Device has no HDCP support BHDM_HDCP_RX_BKSV_ERROR - Attached Rx Device has invalid Bksv BHDM_HDCP_TX_AKSV_ERROR - Transmtter Aksv value is invalid BHDM_HDCP_AUTHENTICATE_ERROR - Link Authentication Value (R0) failed See Also: o BHDM_Handle o BHDM_HDCP_AnSelect *******************************************************************************/ BERR_Code BHDMlib_HDCP_AuthenticateRepeater( BHDM_Handle hHDMI, /* [in] HDMI handle */ uint8_t *RepeaterAuthenticated, const uint8_t *pRevokedKsvList, /* [in] pointer to Revoked KSV List */ const uint16_t uiNumRevokedKsvs /* [in] number of KSVs in Revoked Ksv List */ ) ; /****************************************************************************** Summary: Set the timer handle Description: Save timer handle into HDMI HDCP handle to use for calculating the HDCP keys loading time. Base on the loading time, an appropriate waiting time will be calculated to ensure R0' is read 100ms after writing Aksv Input: hHDCP - HDMI HDCP Handle hTMR - Timer handle to be saved Returns: BERR_SUCCESS See Also: *******************************************************************************/ BERR_Code BHDMlib_HDCP_SetTimerHandle( BHDMlib_HDCP_Handle hHDCP, /* [in] HDMI HDCP Handle */ BTMR_Handle hTMR /* [in] TMR handle */ ); /****************************************************************************** Summary: Get the Aksv value and keys from storage Description: Simple debug/development function to return a Aksv value and associated HDCP keys. Under production code this call would be replaced with a call which would read these values from non volitale memory. The private keys should be encrypted in the non-volitale memory. Output: pTxAksv copy of the Aksv value pTxKeys copy of the BHDM_HDCP_NUM_KEYS HDCP Keys Returns: BERR_SUCCESS Notes: The pointers must point to allocated memory to hold the data values. See Also: *******************************************************************************/ BERR_Code BHDMlib_HDCP_GetKeySet(uint8_t *pTxAksv, BHDM_EncryptedHdcpKeyStruct *EncryptedHdcpTxKey) ; #ifdef __cplusplus } #endif #endif /* BHDMLIB_HDCP_H__ */