source: svn/trunk/newcon3bcm2_21bu/magnum/syslib/hdmlib/bhdmlib_hdcp.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 10.5 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2002-2008, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bhdmlib_hdcp.h $
11 * $brcm_Revision: Hydra_Software_Devel/11 $
12 * $brcm_Date: 4/2/08 4:30p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/syslib/hdmlib/bhdmlib_hdcp.h $
19 *
20 * Hydra_Software_Devel/11   4/2/08 4:30p vle
21 * PR 40101: Fix compiler errors when not building with HDCP.
22 *
23 * Hydra_Software_Devel/10   4/2/08 2:31p vle
24 * PR 40101: Time HDCP Keyloader function to accurately calculate
25 * appropriate wait time before reading R0'
26 *
27 * Hydra_Software_Devel/9   7/16/07 6:19p vle
28 * PR 32662: Add BHDMlib_HDCP_Close(...) prototype
29 *
30 * Hydra_Software_Devel/8   8/11/06 3:49p rgreen
31 * PR22187: Fix HDCP Key Loader to use standalone HSM PI
32 *
33 * Hydra_Software_Devel/7   8/11/06 1:15p rgreen
34 * PR22187: Fix HDCP Key Loader to use standalone HSM PI
35 *
36 * Hydra_Software_Devel/6   8/18/04 4:40p rgreen
37 * PR 12116:   Add HDCP Key Loading Support
38 * Use new BHDM_EncryptedHdcpStructure for HDCP Key loading
39 *
40 * Hydra_Software_Devel/5   5/13/04 4:32p rgreen
41 * PR 10273: HDMI / HDCP Revocation/renewability support requirement
42 *
43 * Hydra_Software_Devel/4   4/5/04 1:17p rgreen
44 * PR8896: HDMI API Development/Test
45 * PR10273: HDCP Revocation/renewability support
46 * Add support to AuthenticateReceiver function for checking Revoked KSVs
47 *
48 * Hydra_Software_Devel/3   2/13/04 7:57p rgreen
49 * PR8896: HDMI API Development/Test
50 * Add code to support Repeater Authentication;
51 * Use SIMULATE_REPEATER to generate Tx verifications values contained in
52 * the HDCP 1.1 Spec
53 * Modify BHDM_HDCP_AuthenticateRepeater call
54 *
55 * Hydra_Software_Devel/2   1/27/04 1:04p rgreen
56 * PR8896: HDMI API Development/Test
57 * Move AuthenticateRepeater function to BHDMlib; needs access to XPT
58 * handle for authentication with HDCP Repeater
59 *
60 * Hydra_Software_Devel/1   1/20/04 7:38p rgreen
61 * PR8896: HDMI API Development/Test
62 * Create HDMI HDCP Syslib to utilize XPT Key Serializer
63 *
64 ***************************************************************************/
65
66#ifndef BHDMLIB_HDCP_H__
67#define BHDMLIB_HDCP_H__
68
69#include "bhdm.h"
70#include "bhdm_hdcp.h"
71#include "btmr.h"
72#include "bhdmlib_hdcp_keyloader.h"
73
74
75
76#if BHSM_AEGIS_SUPPORT
77#define BHDMLIB_KeyHandle BHSM_Handle
78#define hHANDLE hHsm
79#define hHDCP_BHDMLIB_KeyHandle hHDCP->hHsm
80#else
81#define BHDMLIB_KeyHandle BXPT_Handle
82#define hHANDLE hXPT
83#define hHDCP_BHDMLIB_KeyHandle hHDCP->hXPT
84#endif
85
86#ifdef __cplusplus
87extern "C" {
88#endif
89
90/******************************************************************************
91Summary:
92HDMI Context Handle
93*******************************************************************************/
94typedef struct BHDMlib_HDCP_P_Handle *BHDMlib_HDCP_Handle ;
95
96
97
98/******************************************************************************
99Summary:
100Open an HDMI HDCP handle to support HDP functions between the Transmitter and
101the Receiver.
102
103Description:
104This function initializes the handle/devices needed to support HDCP operations
105between HDCP capable Transmitters and the Receivers
106
107
108Input:
109        hHDMI - The HDMI device handle that the application created earlier
110        during the system initialization sequence.
111
112        hXPT - pointer to the XPT device handle that the application created earlier
113        during the system initialization sequence.
114
115Output:
116        pHdcpHandle - pointer to a newly created HDMI/HDCP device handle.
117
118Returns:
119        BERR_SUCCESS                  - HDMI HDCP device handle successfully created
120        BERR_INVALID_PARAMETER        - Invalid function parameter.
121        BERR_OUT_OF_SYSTEM_MEMORY     - Not enough memory to create HDCP handle
122
123See Also:
124        o BHDM_Handle
125        o BXPT_Handle
126
127*******************************************************************************/
128BERR_Code BHDMlib_HDCP_Open(
129        BHDMlib_HDCP_Handle *pHdcpHandle, /* [out] HDMI HDCP handle */
130        BHDM_Handle hHDMI,                /* [in] HDMI device handle */
131        BHDMLIB_KeyHandle hHANDLE
132) ;             
133
134
135/******************************************************************************
136Summary:
137Close an HDMI HDCP handle
138
139Description:
140This function uninitializes the handle/devices support HDCP operations
141between HDCP capable Transmitters and the Receivers
142
143
144Input:
145        hHDCP - The HDCP device handle that the application created earlier
146        during the system initialization sequence.
147
148Returns:
149        BERR_SUCCESS                  - HDMI HDCP device handle successfully created
150        BERR_INVALID_PARAMETER        - Invalid function parameter.
151        BERR_OUT_OF_SYSTEM_MEMORY     - Not enough memory to create HDCP handle
152
153See Also:
154        o BHDM_Handle
155
156*******************************************************************************/
157BERR_Code BHDMlib_HDCP_Close(
158        BHDMlib_HDCP_Handle hHDCP         /* [in] HDCP lib handle */
159);
160
161/******************************************************************************
162Summary:
163Authenticate the HDCP link between the Transmitter and the Receiver.
164
165Description:
166This function does the HDCP Authentication with a receiver as specified in the
167HDCP specification.  The return codes will indicate the source of failure;
168if any.
169
170
171Input:
172        hHDMI - The HDMI device handle that the application created earlier
173        during the system initialization sequence.
174
175        AnSelection - HDCP An value to be generated by the HDCP core
176
177        pTxAksv  - pointer to the Transmitter Key Selection Vector (Aksv) shipped
178        with the HDCP key set from Digital-CP (www.digital-cp.com)
179       
180        pRekovedKsvList - pointer to list of revoked Ksvs retrieved from SRM message
181       
182        uiNumRevokedKsvs - number of Ksvs in the revoked list
183
184Output:
185        <none>
186
187Returns:
188        BERR_SUCCESS                  - HDCP protected link created.
189        BERR_INVALID_PARAMETER        - Invalid function parameter.
190        BHDM_HDCP_RX_NO_DEVICE        - No Rx Device is attached
191        BHDM_HDCP_RX_NO_HDCP_SUPPORT  - Attached Rx Device has no HDCP support
192        BHDM_HDCP_RX_BKSV_ERROR       - Attached Rx Device has invalid Bksv
193        BHDM_HDCP_TX_AKSV_ERROR       - Transmtter Aksv value is invalid
194        BHDM_HDCP_AUTHENTICATE_ERROR  - Link Authentication Value (R0) failed
195
196Note:
197The pRevokedKsvList should be passed in as big-endian (the same endian-ness
198contained in the original SRM message).
199The HDCP keys are loaded using the Serializer in transport porting interface.
200Use NULL and 0 for pRevokedKsvList and uiNumRevokedKsvs if no DCP LLC SRM
201messages are available.
202
203See Also:
204        o BHDM_Handle
205        o BXPT_Handle
206        o BHDM_HDCP_AnSelect
207        o BHDM_HDCP_EnableSerialKeyLoad
208
209*******************************************************************************/
210BERR_Code BHDMlib_HDCP_AuthenticateReceiver(
211   BHDMlib_HDCP_Handle hHDCP,       /* [in] HDMI HDCP handle */
212   BHDM_HDCP_AnSelect AnSelection, /* [in] HDCP An type value to use */
213   const uint8_t *pTxAksv,         /* [in] pointer HDCP Key Set Aksv Value */
214   const BHDM_EncryptedHdcpKeyStruct *pTxKeyStruct,         /* [in] pointer to HDCP Keys */
215   const uint8_t *pRevokedKsvList, /* [in] pointer to Revoked KSV List */
216   const uint16_t uiNumRevokedKsvs /* [in] number of KSVs in Revoked Ksv List */
217 ) ;
218
219
220
221/******************************************************************************
222Summary:
223Authenticate the HDCP link between the Transmitter and an HDCP Repeater.
224
225Description:
226This function does the HDCP Authentication with an HDCP Repeater as specified
227in the HDCP specification.  The return codes will indicate the source of
228failure; if any.
229
230
231Input:
232        hHDMI - The HDMI device handle that the application created earlier
233        during the system initialization sequence.
234
235        AnSelection - HDCP An value to be generated by the HDCP core
236
237        pTxAksv  - pointer to the Transmitter Key Selection Vector (Aksv) shipped
238        with the HDCP key set from Digital-CP (www.digital-cp.com)
239       
240        pRekovedKsvList - pointer to list of revoked Ksvs retrieved from SRM message
241       
242        uiNumRevokedKsvs - number of Ksvs in the revoked list
243
244Output:
245        <none>
246
247Returns:
248        BERR_SUCCESS                  - HDCP protected link created.
249        BERR_INVALID_PARAMETER        - Invalid function parameter.
250        BHDM_HDCP_RX_NO_DEVICE        - No Rx Device is attached
251        BHDM_HDCP_RX_NO_HDCP_SUPPORT  - Attached Rx Device has no HDCP support
252        BHDM_HDCP_RX_BKSV_ERROR       - Attached Rx Device has invalid Bksv
253        BHDM_HDCP_TX_AKSV_ERROR       - Transmtter Aksv value is invalid
254        BHDM_HDCP_AUTHENTICATE_ERROR  - Link Authentication Value (R0) failed
255
256See Also:
257        o BHDM_Handle
258        o BHDM_HDCP_AnSelect
259
260*******************************************************************************/
261BERR_Code BHDMlib_HDCP_AuthenticateRepeater(
262   BHDM_Handle hHDMI,              /* [in] HDMI handle */
263   uint8_t *RepeaterAuthenticated, 
264   const uint8_t *pRevokedKsvList, /* [in] pointer to Revoked KSV List */
265   const uint16_t uiNumRevokedKsvs /* [in] number of KSVs in Revoked Ksv List */
266) ;
267
268
269/******************************************************************************
270Summary:
271Set the timer handle
272
273Description:
274Save timer handle into HDMI HDCP handle to use for calculating the HDCP keys loading time.
275Base on the loading time, an appropriate waiting time will be calculated to ensure R0' is
276read 100ms after writing Aksv
277
278Input:
279        hHDCP - HDMI HDCP Handle
280        hTMR - Timer handle to be saved
281
282Returns:
283        BERR_SUCCESS                 
284       
285See Also:
286
287*******************************************************************************/
288BERR_Code BHDMlib_HDCP_SetTimerHandle(
289   BHDMlib_HDCP_Handle hHDCP,      /* [in] HDMI HDCP Handle */
290   BTMR_Handle hTMR                              /* [in] TMR handle */
291);
292
293
294
295/******************************************************************************
296Summary:
297Get the Aksv value and keys from storage
298
299Description:
300Simple debug/development function to return a Aksv value and associated HDCP
301keys.  Under production code this call would be replaced with a call which
302would read these values from non volitale memory.  The private keys should
303be encrypted in the non-volitale memory.
304
305
306Output:
307        pTxAksv    copy of the Aksv value
308        pTxKeys    copy of the BHDM_HDCP_NUM_KEYS HDCP Keys
309
310Returns:
311        BERR_SUCCESS                 
312       
313Notes:
314        The pointers must point to allocated memory to hold the data values.
315       
316See Also:
317
318*******************************************************************************/
319BERR_Code BHDMlib_HDCP_GetKeySet(uint8_t *pTxAksv, BHDM_EncryptedHdcpKeyStruct *EncryptedHdcpTxKey) ;
320
321 
322
323#ifdef __cplusplus
324}
325#endif
326
327#endif /* BHDMLIB_HDCP_H__ */
Note: See TracBrowser for help on using the repository browser.