source: svn/newcon3bcm2_21bu/magnum/portinginterface/hdm/7552/bhdm_hdcp.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 38.1 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2010, 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: bhdm_hdcp.h $
11 * $brcm_Revision: Hydra_Software_Devel/43 $
12 * $brcm_Date: 11/24/10 3:28p $
13 *
14 * Module Description:
15 * This module implements HDCP functionality contained in the HDCP Spec
16 * Version 1.086 (www.digital-cp.com) for HDMI/DVI transmiters and
17 * receivers. 
18 *
19 * Revision History:
20 *
21 * $brcm_Log: /magnum/portinginterface/hdm/7038/bhdm_hdcp.h $
22 *
23 * Hydra_Software_Devel/43   11/24/10 3:28p calvinho
24 * SW7401-4468: Update HDCP version definition
25 *
26 * Hydra_Software_Devel/42   2/22/10 5:10p vle
27 * SW7335-669: add BHDM_HDCP_RX_BKSV_I2C_READ_ERROR and
28 * BHDM_HDCP_TX_AKSV_I2C_WRITE_ERROR errors constant.
29 *
30 * Hydra_Software_Devel/41   12/3/09 2:24p rgreen
31 * SW7405-3521: Fix link erros for HDCP_Get/Set options
32 *
33 * Hydra_Software_Devel/40   11/18/09 8:06p vle
34 * SW7342-76: Define HDCP debug function to resolve "implicit declaration"
35 * warnings.
36 *
37 * Hydra_Software_Devel/39   7/14/09 11:28a rgreen
38 * PR56776: Prevent HDCP An Timeout; Reduce debug messages
39 *
40 * Hydra_Software_Devel/38   5/5/09 5:14p vle
41 * PR 54851: Implement a dynamic mode in the PI where HDCP 1.1 feature
42 * will be disabled when a pre-define occurance of Pj Link Failures is
43 * met.
44 *
45 * Hydra_Software_Devel/37   6/26/06 12:04p rgreen
46 * PR22342: Detect three successive HDCP Pj failures prior to forcing an
47 * un-Authenticated link
48 *
49 * Hydra_Software_Devel/36   6/2/06 3:26p rgreen
50 * PR20866: Add option to disable Pj checking; default is on
51 * Add BHDM_HDCP_Get/SetOptions
52 * Modify LIC return codes to report specific Ri
53 * (BHDM_HDCP_LINK_RI_FAILURE)
54 * or Pj (BHDM_HDCP_LINK_PJ_FAILURE)
55 * link failure
56 *
57 * BHDM_HDCP_LINK_FAILURE (unused) left for legacy
58 *
59 * Hydra_Software_Devel/35   2/3/06 4:36p rgreen
60 * PR8896: Remove depracated functions
61 *
62 * Hydra_Software_Devel/34   10/21/05 6:02p rgreen
63 * PR17750: Add HDCP Abort return code
64 *
65 * Hydra_Software_Devel/33   6/27/05 6:21p rgreen
66 * PR15217: Add Auth Support for HDCP Repeaters with Device Count 0;
67 * Use bhdm_config.h configuration option.
68 * Add option for Repeater Simulation Test
69 *
70 * Hydra_Software_Devel/32   5/16/05 3:11p rgreen
71 * PR8896: Fix typo in definition
72 * BDHM_HDCP_RX_BSTATUS_DEPTH to
73 * BHDM_HDCP_RX_BSTATUS_DEPTH
74 *
75 * Hydra_Software_Devel/31   4/29/05 5:43p rgreen
76 * PR14848: Return failure when Repeater downstream devices do not
77 * authenticate
78 *
79 * Hydra_Software_Devel/30   4/21/05 7:43p rgreen
80 * PR14622: Add HDMI API to return KSV values
81 * Add functions
82 * BHDM_HDCP_GetRxKsv
83 * BHDM_HDCP_GetRepeaterKsvFifo
84 *
85 * Hydra_Software_Devel/29   2/4/05 1:04p rgreen
86 * PR9474: HDCP 1.1 Support
87 * Remove depracated   BHDM_HDCP_Version eHdcpVersion from
88 * BHDM_XmitEncrypted.  Already part of hdmi handle.
89 *
90 * Hydra_Software_Devel/28   12/9/04 2:38p rgreen
91 * PR8896: Change BHDM_HDCP_AuthenticateRepeater argument
92 * RepeaterAuthenticated from bool to uint8_t.
93 *
94 * Clean up debug messages
95 *
96 * Hydra_Software_Devel/27   10/21/04 6:26p rgreen
97 * PR8896: Remove HDCP Key functions used for debug purposes.
98 *
99 * Hydra_Software_Devel/26   10/18/04 11:59a rgreen
100 * PR9474: Add HDCP 1.1 Support
101 * HDCP 1.1 not fully implemented
102 * Modified BHDM_HDCP_GetRxStatus API call (RxStatus is uint16_t not
103 * uint8_t)
104 * Replace private HDCP_SetVersion with new API call HDCP_SetVersion
105 *
106 * Hydra_Software_Devel/25   9/23/04 8:36p rgreen
107 * PR12728: Make sure code compiles with -pedantic-errors
108 * Clean up documenation
109 *
110 * Hydra_Software_Devel/24   5/13/04 4:24p rgreen
111 * PR 10273: HDMI / HDCP Revocation/renewability support requirement
112 *
113 * Hydra_Software_Devel/23   4/28/04 10:59a rgreen
114 * PR8896: HDMI Development
115 * Removed code for BHDM_HDCP_VerifyLink; use
116 * BHDM_HDCP_RiLinkIntegrityCheck instead
117 *
118 * Hydra_Software_Devel/22   2/13/04 7:52p rgreen
119 * PR8896: HDMI API Development/Test
120 * Add code for HDCP Repeater Support
121 * Change BHDM_HDCP_ReadReapeaterKsvFIFO to
122 * BHDM_HDCP_ReadRxRepeaterKsvFIFO
123 * Add BHDM_HDCP_WriteTxKsvFIFO
124 * Add checkForRepeater function
125 *
126 * Hydra_Software_Devel/21   1/27/04 1:03p rgreen
127 * PR8896: HDMI API Development/Test
128 * Move AuthenticateRepeater function to BHDMlib; needs access to XPT
129 * handle for authentication with HDCP Repeater
130 *
131 * Hydra_Software_Devel/20   1/26/04 11:38a rgreen
132 * PR9474: Add HDCP 1.1 functionality
133 * Add BHDM_HDCP_Version enumeration for HDCP Version unused/1_0/1_1
134 *
135 * Replace BHDM_HDCP_XmitEncrypted bool argument with BHDM_HDCP_Version
136 * enumeration.
137 * Caller can decide which version of HDCP to used based on Rx Capability
138 *
139 * Add BHDM_HDCP_RiLinkIntegrityCheck to replace BHDM_HDCP_VerifyLink...
140 * VerifyLink will be eventually removed
141 *
142 * Add BHDM_HDCP_PjLinkIntegrityCheck stub for HDCP 1.1 functionality
143 *
144 * Add toggle to AUTH_REQUEST bit for GenerateAn
145 *
146 * Enable Always Rekey on VSync functionality (HDCP 1.1) to the
147 * XmitEncryprpted function
148 *
149 * Hydra_Software_Devel/19   1/20/04 6:32p rgreen
150 * PR8896: HDMI API Development/Test
151 * Add flag to BHDM_XmitEncrypted to enable HDCP 1.1 Features
152 *
153 * Hydra_Software_Devel/18   12/15/03 5:08p rgreen
154 * PR8896:
155 * Fix typo BHDM_HDPC... to BHDM_HDCP on error macro
156 *
157 * Hydra_Software_Devel/17   11/24/03 3:03p rgreen
158 * Add declarations for private functions switched to public functions
159 *   BHDM_HDCP_ReadRxBksv,
160 *   BHDM_HDCP_GenerateAn, and
161 *   BHDM_HDCP_AuthenticateLink
162 * Add new functions BHDM_HDCP_WriteTxAksvToRx and
163 * BHDM_HDCP_EnableSerialKeyLoad
164 *
165 * Hydra_Software_Devel/16   11/5/03 4:48p rgreen
166 * Add BHDM_HDCP_IsLinkAuthenticated declaration;  function
167 * can be used to check authentication status of the link
168 *
169 * Hydra_Software_Devel/15   10/22/03 5:18p rgreen
170 * Remove BHDM_HDCP_SetAvMute declaration;
171 * Function is in bhdm.c as BHDM_SetAvMute
172 *
173 * Hydra_Software_Devel/14   10/21/03 6:28p rgreen
174 * Add #defines for HDCP Rx I2C Registers
175 * Remove Make75XX arguments from HDCP Authenticate functions
176 * Re-arrange AnSelect enumeration to match register configuration
177 * Fix declaration and return values for BHDM_HDCP_ReadRepeaterKsvFIFO
178 *
179 * Hydra_Software_Devel/13   10/6/03 8:32p rgreen
180 * Incorporate HDMI API Review Comments
181 *
182 * Hydra_Software_Devel/12   9/30/03 5:06p lseverin
183 * fixed a few documentation (DocJet) wanrings
184 *
185 * Hydra_Software_Devel/11   9/24/03 8:37p rgreen
186 * Changes to reflect internal HDMI review comments.
187 *
188 * Hydra_Software_Devel/10   7/25/03 4:42p rgreen
189 * Add/Modify Function names
190 *
191 * Hydra_Software_Devel/9   7/24/03 2:49p rgreen
192 * Modifications for HDCP 1.1
193 *
194 * Hydra_Software_Devel/8   4/15/03 6:01p rgreen
195 * Documentation Upates
196 *
197 * Hydra_Software_Devel/7   4/14/03 2:53p rgreen
198 * Documentation Updates
199 *
200 * Hydra_Software_Devel/6   3/27/03 4:54p rgreen
201 * Documentation Updates
202 *
203 * Hydra_Software_Devel/5   3/25/03 5:49p rgreen
204 * Documentation Fix
205 *
206 * Hydra_Software_Devel/3   3/20/03 6:01p rgreen
207 * Use StandardNamingConventions on enumeration types
208 *
209 * Hydra_Software_Devel/2   3/14/03 11:23a rgreen
210 * add mofule overview
211 *
212 * Hydra_Software_Devel/1   3/7/03 1:23p rgreen
213 * Beta Release of HDMI API
214 *
215 ***************************************************************************/
216#ifndef BHDM_HDCP_H__
217#define BHDM_HDCP_H__
218
219/*=************************* Module Overview ********************************
220  The HDCP (High-bandwidth Data Content Protection) functions provide support
221  for implementing the HDCP Spec Version 1.086 as of 12/31/2002.
222
223  HDCP requires the use of purchased production type keys or the use of test
224  keys contained in the specification.  Both the transmitting and receiving
225  devices must have keys.
226
227  The specification can be found at www.digital-cp.com
228***************************************************************************/
229
230#ifdef __cplusplus
231extern "C" {
232#endif
233
234#include "bhdm.h"
235
236#define BHDM_HDCP_RX_NO_HDCP_SUPPORT  BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 1)
237#define BHDM_HDCP_RX_BKSV_ERROR           BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 2)
238#define BHDM_HDCP_RX_BKSV_REVOKED     BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 3)
239#define BHDM_HDCP_TX_AKSV_ERROR       BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 4)
240#define BHDM_HDCP_RECEIVER_AUTH_ERROR BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 5)
241#define BHDM_HDCP_REPEATER_AUTH_ERROR BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 6)
242
243#define BHDM_HDCP_LINK_FAILURE            BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 7)
244
245#define BHDM_HDCP_RX_DEVICES_EXCEEDED BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 8)
246#define BHDM_HDCP_REPEATER_DEPTH_EXCEEDED \
247                                          BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 9)
248
249#define BERR_HDCP_NOT_ENOUGH_MEM           BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 10)
250#define BHDM_HDCP_NO_AUTHENTICATED_LINK    BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 11)
251#define BHDM_HDCP_REPEATER_FIFO_NOT_READY  BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 12)
252
253#define BHDM_HDCP_REPEATER_DEVCOUNT_0      BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 13)
254#define BHDM_HDCP_AUTH_ABORTED     BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 14)
255
256#define BHDM_HDCP_LINK_RI_FAILURE                 BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 15)
257#define BHDM_HDCP_LINK_PJ_FAILURE                 BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 16)
258
259#define BHDM_HDCP_PLL_PWRDN     BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 17)
260#define BHDM_HDCP_FIFO_UNDERFLOW        BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 18)
261#define BHDM_HDCP_FIFO_OVERFLOW         BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 19)
262#define BHDM_HDCP_MULTIPLE_AN_REQUEST   BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 20)
263
264#define BHDM_HDCP_RX_BKSV_I2C_READ_ERROR BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 21)
265#define BHDM_HDCP_TX_AKSV_I2C_WRITE_ERROR BERR_MAKE_CODE(BERR_HDM_ID, BHDM_HDCP_ERRS+ 22)
266
267
268/* keep older definition in case in use */
269#define BHDM_HDCP_AUTHENTICATE_ERROR  BHDM_HDCP_RECEIVER_AUTH_ERROR
270
271/******************************************************************************
272Summary:
273HDCP Definitions
274*******************************************************************************/
275
276#define BHDM_HDCP_RX_I2C_ADDR       0x3A   /* 7 Bit Addr */
277
278#define BHDM_HDCP_NUM_KEYS  40
279#define BHDM_HDCP_KSV_LENGTH 5
280#define BHDM_HDCP_AN_LENGTH 8
281
282#define BHDM_HDCP_MAX_PJ_MISMATCH 3
283#define BHDM_HDCP_MAX_I2C_RETRY 3
284
285#define BHDM_HDCP_MAX_PJ_LINK_FAILURES_BEFORE_DISABLE_HDCP_1_1 5
286
287/******************************************************************************
288Summary:
289I2C Rx HDCP Registers
290*******************************************************************************/
291
292
293/* Rx Bksv value (Read Only) */
294#define BHDM_HDCP_RX_BKSV0                      0x00
295#define BHDM_HDCP_RX_BKSV1                      0x01
296#define BHDM_HDCP_RX_BKSV2                      0x02
297#define BHDM_HDCP_RX_BKSV3                      0x03
298#define BHDM_HDCP_RX_BKSV4                      0x04
299
300/* Rx Link verification value (Read Only) */
301#define BHDM_HDCP_RX_RI0                    0x08
302#define BHDM_HDCP_RX_RI1                    0x09
303
304/*  Rx Enhanced Link Verification Response (Read Only) */
305#define BHDM_HDCP_RX_PJ             0x0A
306
307
308/* Tx Aksv value (Write Only) */
309#define BHDM_HDCP_RX_AKSV0                      0x10
310#define BHDM_HDCP_RX_AKSV1                      0x11
311#define BHDM_HDCP_RX_AKSV2                      0x12
312#define BHDM_HDCP_RX_AKSV3                      0x13
313#define BHDM_HDCP_RX_AKSV4                      0x14
314
315/*  Rx HDCP Enable HDCP 1.1 features (Write Only) */
316#define BHDM_HDCP_RX_AINFO             0x15
317#define BHDM_HDCP_RX_ENABLE_1_1_FEATURES 0x02
318
319/* Session Random Number (An) value generated by the Tx (Write Only) */
320#define BHDM_HDCP_RX_AN0                        0x18
321#define BHDM_HDCP_RX_AN1                        0x19
322#define BHDM_HDCP_RX_AN2                        0x1a
323#define BHDM_HDCP_RX_AN3                        0x1b
324#define BHDM_HDCP_RX_AN4                        0x1c
325#define BHDM_HDCP_RX_AN5                        0x1d
326#define BHDM_HDCP_RX_AN6                        0x1e
327#define BHDM_HDCP_RX_AN7                        0x1f
328
329/* HDCP Repeater SHA-1 Hash value V' */
330#define BHDM_HDCP_REPEATER_SHA1_V_H0 0x20
331#define BHDM_HDCP_REPEATER_SHA1_V_H1 0x24
332#define BHDM_HDCP_REPEATER_SHA1_V_H2 0x28
333#define BHDM_HDCP_REPEATER_SHA1_V_H3 0x2c
334#define BHDM_HDCP_REPEATER_SHA1_V_H4 0x30
335
336/* Rx Capabilities Register (Read Only) */
337#define BHDM_HDCP_RX_BCAPS          0x40
338
339/* Rx Status Registers (Read Only) */
340#define BHDM_HDCP_RX_BSTATUS        0x41 /* 2 Bytes */
341#define BHDM_HDCP_RX_BSTATUS_DEPTH        0x0700
342#define BHDM_HDCP_RX_BSTATUS_DEVICE_COUNT 0x007F
343
344#define BHDM_HDCP_REPEATER_KSV_FIFO 0x43 /* 2 Bytes */
345
346/* HDCP Repeater Registers */
347#define BHDM_HDCP_REPEATER_MAX_DEVICE_COUNT 127
348#define BHDM_HDCP_REPEATER_MAX_DEPTH 7
349                                                                                                                                                 
350
351
352/******************************************************************************
353Summary:
354Enumerated Type containing the type of HDCP An value to be generated
355
356Description:
357The DVI/HDMI transmitter is capable of generating a psuedo-random number (An)
358which is used as a initial seed for the HDCP calculations.  This Enumerated
359Type specifies the type of An value which can be generated.
360
361   BHDM_HDCP_AnSelect_eRandomAn   - generate random An value
362   BHDM_HDCP_AnSelect_eTestA1B1An - generate fixed A1/B1 HDCP Spec An value
363   BHDM_HDCP_AnSelect_eTestA1B2An - generate fixed A1/B2 HDCP Spec An value
364   BHDM_HDCP_AnSelect_eTestA2B1An - generate fixed A2/B1 HDCP Spec An value
365   BHDM_HDCP_AnSelect_eTestA2B2An - generate fixed A2/B2 HDCP Spec An value
366
367
368*******************************************************************************/
369typedef enum BHDM_HDCP_AnSelect
370{
371   BHDM_HDCP_AnSelect_eTestA1B1An, /* generate fixed A1/B1 HDCP Spec An value */
372   BHDM_HDCP_AnSelect_eTestA1B2An, /* generate fixed A1/B2 HDCP Spec An value */
373   BHDM_HDCP_AnSelect_eTestA2B1An, /* generate fixed A2/B1 HDCP Spec An value */
374   BHDM_HDCP_AnSelect_eTestA2B2An, /* generate fixed A2/B2 HDCP Spec An value */
375   BHDM_HDCP_AnSelect_eRandomAn   /* generate random An value */
376} BHDM_HDCP_AnSelect ;
377
378
379/******************************************************************************
380Summary:
381Enumerated Type specifying the capabilites of the attached receiver
382
383Description:
384The enumeration types listed can be compared with the value of the returned
385BCaps register from the Receiver.
386
387See Also:
388        BHDM_HDCP_GetRxCaps
389
390*******************************************************************************/
391typedef enum BHDM_HDCP_RxCaps
392{
393   BHDM_HDCP_RxCaps_eHdmiCapable        = 0x80,  /* Rx is HDMI Capable      */
394   BHDM_HDCP_RxCaps_eHdcpRepeater       = 0x40,  /* Rx is Repeater          */
395   BHDM_HDCP_RxCaps_eKsvFifoReady       = 0x20,  /* Rx Ksv FIFO is ready    */
396   BHDM_HDCP_RxCaps_eI2c400KhzSupport   = 0x10,  /* Rx I2C supports 400KHz  */
397   BHDM_HDCP_RxCaps_eHDCP_1_1_Features  = 0x02,  /* Rx has HDCP1.1 Features
398                                                                                                     EESS
399                                                                                                         Advance Cipher
400                                                                                                         Enhanced Link Verification
401                                                                                                   */
402   BHDM_HDCP_RxCaps_eFastReauth         = 0x01   /* Rx can receive un-encrypted
403                                                                                                  video during Re-authemtication
404                                                                                                  */
405} BHDM_HDCP_RxCaps  ;
406
407
408/******************************************************************************
409Summary:
410Enumerated Type specifying the current status iof the attached receiver.
411
412Description:
413The enumeration types listed can be compared with the value of the returned
414BStatus register from the Receiver
415
416See Also:
417        BHDM_HDCP_GetRxStatus
418
419*******************************************************************************/
420typedef enum BHDM_HDCP_RxStatus
421{
422   BHDM_HDCP_RxStatus_eHdmiMode             = 0x1000, /* Rx in HDMI mode        */
423   BHDM_HDCP_RxStatus_eMaxRepeatersExceeded = 0x0800, /* Rx has too many repeaters */
424   BHDM_HDCP_RxStatus_eMaxDevicesExceeded   = 0x0080  /* Rx has too many devices */
425} BHDM_HDCP_RxStatus ;
426
427
428/******************************************************************************
429Summary:
430Enumerated Type specifying which version of HDCP to use
431
432Description:
433The enumeration types listed can be used to configure the core to use features
434of HDCP 1.1 or HDCP 1.1 with optional features. BHDM_HDCP_Version_e1_0 is deprecated.
435
436*******************************************************************************/
437typedef enum BHDM_HDCP_Version
438{
439   BHDM_HDCP_Version_eUnused,
440   BHDM_HDCP_Version_e1_0,
441   BHDM_HDCP_Version_e1_1 = BHDM_HDCP_Version_e1_0,
442   BHDM_HDCP_Version_e1_1_Optional_Features
443} BHDM_HDCP_Version ;
444
445
446typedef struct _BHDM_HDCP_OPTIONS_
447{
448    bool PjChecking ;       /* Set to true to enable HDCP 1.1 feature when applicable */
449    uint8_t numPjFailures;  /* Number of Pj Link failures.
450                                                    If greater than BHDM_HDCP_MAX_PJ_LINK_FAILURES_BEFORE_DISABLE_HDCP_1_1,
451                                                          HDCP 1.1 feature will not be enabled */
452           
453} BHDM_HDCP_OPTIONS ;
454
455/******************************************************************************
456Summary:
457Read the HDCP BKsv value from the Receiver
458
459Description:
460This function
4611) reads the Bksv value from the receiver,
4622) verifies it is a valid Ksv (20 zeros & 20 ones)
4633) writes the Bksv value to the HDMI transmitter
464
465
466Input:
467        hHDMI - The HDMI device handle that the application created earlier
468        during the system initialization sequence.
469       
470        pRevokedKsvList - List of Revoked KSVs obtained from DCP LLC SRM message
471       
472        uiNumRevokedKsvs - Number of Ksvs contained in the pRevokedKsvList
473
474Output:
475        <none>
476
477Returns:
478        BERR_SUCCESS                  - Bksv value read and successfully written
479        BERR_INVALID_PARAMETER        - Invalid function parameter.
480        BHDM_HDCP_RX_BKSV_ERROR       - Attached Rx Device has invalid Bksv
481       
482Note:
483The pRevokedKsvList should be passed in as big-endian (the same endian-ness
484contained in the original SRM message).
485
486Use NULL and 0 for pRevokedKsvList and uiNumRevokedKsvs if no DCP LLC SRM
487messages are available.
488
489See Also:
490        o BHDM_Handle
491
492*******************************************************************************/
493BERR_Code BHDM_HDCP_ReadRxBksv(
494   BHDM_Handle hHDMI,              /* [in] HDMI handle */
495   const uint8_t *pRevokedKsvList, /* [in] pointer to Revoked KSV List */
496   const uint16_t uiNumRevokedKsvs /* [in] number of KSVs in Revoked Ksv List */
497) ;
498
499
500/******************************************************************************
501Summary:
502Generate the HDCP An value for HDCP calculations
503
504Description:
505This function generates the random HDCP An value.  This function also supports
506generation of the fixed An values contained in the HDCP Specification
507
508
509Input:
510        hHDMI - The HDMI device handle that the application created earlier
511        during the system initialization sequence.
512
513        AnSelection - HDCP An value to be generated by the HDCP core
514
515Output:
516        <none>
517
518Returns:
519        BERR_SUCCESS                  - Generated and wrote HDCP An value
520        BERR_INVALID_PARAMETER        - Invalid function parameter.
521
522See Also:
523        o BHDM_Handle
524        o BHDM_HDCP_AnSelect
525
526*******************************************************************************/
527BERR_Code BHDM_HDCP_GenerateAn(
528        BHDM_Handle hHDMI,              /* [in] HDMI handle */
529        BHDM_HDCP_AnSelect AnSelection  /* [in] HDCP An type value to use */
530) ;
531                   
532
533
534/******************************************************************************
535Summary:
536Configure the HDMI Core to receive the HDCP Keys from the XPT Key serializer.
537
538Input:
539        hHDMI - The HDMI device handle that the application created earlier
540        during the system initialization sequence.
541
542Output:
543        <none>
544
545Returns:
546        BERR_SUCCESS                  - HDCP protected link created.
547        BERR_INVALID_PARAMETER        - Invalid function parameter.
548
549See Also:
550        o BHDM_Handle
551*******************************************************************************/
552BERR_Code BHDM_HDCP_EnableSerialKeyLoad(
553        BHDM_Handle hHDMI              /* [in] HDMI handle */
554) ;
555
556
557/******************************************************************************
558Summary: Write the HDCP Aksv value to the receiver
559
560Description:
561This function
5621) verifies the Aksv is a valid Ksv (20 zeros & 20 ones)
5631) writes the Aksv value to the receiver,
564
565
566Input:
567        hHDMI - The HDMI device handle that the application created earlier
568        during the system initialization sequence.
569
570        pTxAksv  - pointer to the Transmitter Key Selection Vector (Aksv) shipped
571        with the HDCP key set from Digital-CP (www.digital-cp.com)
572
573Output:
574        <none>
575
576Returns:
577        BERR_SUCCESS                  - HDCP protected link created.
578        BERR_INVALID_PARAMETER        - Invalid function parameter.
579        BHDM_HDCP_TX_AKSV_ERROR       - Transmtter Aksv value is invalid
580
581See Also:
582        o BHDM_Handle
583
584*******************************************************************************/
585BERR_Code BHDM_HDCP_WriteTxAksvToRx(
586   BHDM_Handle hHDMI,           /* [in] HDMI handle */
587   const uint8_t *pTxAksv       /* [in] pointer HDCP Key Set Aksv Value */
588)  ;
589
590
591/******************************************************************************
592BERR_Code BHDM_HDCP_AuthenticateLink
593Summary: Authenticate the HDCP Link; verify TxR0 and RxR0 values are equal
594
595*******************************************************************************/
596BERR_Code BHDM_HDCP_AuthenticateLink
597(
598        BHDM_Handle hHDMI              /* [in] HDMI handle */
599) ;
600
601
602
603/******************************************************************************
604Summary:
605Clear the Authenticated link between the Transmitter and the Receiver.
606
607Description:
608This function sets the transmitted in an un-authenticated state
609
610Input:
611        hHDMI - The HDMI device handle that the application created earlier
612        during the system initialization sequence.
613
614Output:
615        <none>
616
617Returns:
618        BERR_SUCCESS                  - HDCP protected link created.
619        BERR_INVALID_PARAMETER        - Invalid function parameter.
620
621See Also:
622        o BHDM_Handle
623
624*******************************************************************************/
625BERR_Code BHDM_HDCP_ClearAuthentication(
626   BHDM_Handle hHDMI              /* [in] HDMI handle */
627) ;
628
629
630/******************************************************************************
631Summary:
632Start transmitting video encrypted with HDCP.
633
634Input:
635        hHDMI - The HDMI device handle that the application created earlier
636        during the system initialization sequence.
637
638Output:
639        <none>
640
641Returns:
642        BERR_SUCCESS - transmission of HDCP protected video has begun
643        BERR_INVALID_PARAMETER - Invalid function parameter.
644
645See Also:
646        o BHDM_Handle
647
648*******************************************************************************/
649BERR_Code BHDM_HDCP_XmitEncrypted(
650   BHDM_Handle hHDMI             /* [in] HDMI handle */
651) ;
652
653
654/******************************************************************************
655Summary:
656Start transmitting video without HDCP.
657
658Input:
659        hHDMI - The HDMI device handle that the application created earlier
660        during the system initialization sequence.
661
662Output:
663        <none>
664
665Returns:
666        BERR_SUCCESS - transmission of video is now done without HDCP encryption
667        BERR_INVALID_PARAMETER - Invalid function parameter.
668
669See Also:
670        o BHDM_Handle
671
672*******************************************************************************/
673BERR_Code BHDM_HDCP_XmitClear(
674   BHDM_Handle hHDMI              /* [in] HDMI handle */
675) ;
676
677/******************************************************************************
678Summary:
679Use the HDCP Ri value to verify a protected HDCP link is still valid.
680
681Description:
682This function should be called approximately every two seconds (~128 frames)
683to verify the HDCP link is still valid.  The validation is done by reading
684the Ri values from the Rx and the Tx.  The Ri values are calculated using the
685HDCP Key Set.  The Ri values should be equal and should also change
686approximately every two seconds.
687
688Input:
689        hHDMI - The HDMI device handle that the application created earlier
690        during the system initialization sequence.
691
692Output:
693        <none>
694
695Returns:
696        BERR_SUCCESS            - HDCP Link is still valid
697        BERR_INVALID_PARAMETER  - Invalid function parameter.
698        BHDM_HDCP_LINK_FAILURE  - HDCP Link has failed
699
700See Also:
701        o BHDM_Handle
702
703*******************************************************************************/
704BERR_Code BHDM_HDCP_RiLinkIntegrityCheck(
705   BHDM_Handle hHDMI              /* [in] HDMI handle */
706) ;
707
708/******************************************************************************
709Summary:
710Use the HDCP Pj value to verify the protected HDCP link is still valid.
711
712Description:
713This function should be called approximately every TBD (16 frames)
714to verify the HDCP link is still valid.  The validation is done by reading
715the Pj values from the Rx and the Tx.  The Pj values are calculated using the
716HDCP Key Set.  The Pj values should be equal and should also change
717every 16 frames.
718
719Input:
720        hHDMI - The HDMI device handle that the application created earlier
721        during the system initialization sequence.
722
723Output:
724        <none>
725
726Returns:
727        BERR_SUCCESS            - HDCP Link is still valid
728        BERR_INVALID_PARAMETER  - Invalid function parameter.
729        BHDM_HDCP_LINK_FAILURE  - HDCP Link has failed
730
731See Also:
732        o BHDM_Handle
733
734*******************************************************************************/
735BERR_Code BHDM_HDCP_PjLinkIntegrityCheck(
736   BHDM_Handle hHDMI              /* [in] HDMI handle */
737) ;
738
739
740
741/******************************************************************************
742Summary:
743Retrieve the Rx Capabilities.
744
745Input:
746        hHDMI - The HDMI device handle that the application created earlier
747        during the system initialization sequence.
748
749Output:
750        pRxCapsReg - contents of Rx capabilities;
751        Use logical AND with RxCapsRegister and BHDM_HDCP_RxCaps feature
752        enumeration type to check for specific capability:
753
754Example:
755        feature - Rx Capabilities
756
757        BHDM_HDCP_RxCaps_eHdmiCapable           - Rx is HDMI Capable         
758        BHDM_HDCP_RxCaps_eHdcpRepeater          - Rx is a Repeater             
759        BHDM_HDCP_RxCaps_eKsvFifoReady          - Rx Ksv FIFO is ready       
760        BHDM_HDCP_RxCaps_eI2c400KhzSupport      - Rx I2C supports 400KHz Xfer
761        BHDM_HDCP_RxCaps_eHDCP_1_1_Features - Rx supports HDCP 1.1 Features
762                                               EESS, Advance Cipher, and
763                                               Enhanced Link Verification
764    BHDM_HDCP_RxCaps_eFastReauth        - Rx supports fast Re-authemtication
765
766        BHDM_HDCP_GetRxCaps(hHDMI, &RxCaps) ;
767        if (RxCaps & BHDM_HDCP_RxCaps_eHdmiCapable)
768                HDMI Capable
769        else
770                DVI Only
771
772
773Returns:
774        BERR_SUCCESS
775        BERR_INVALID_PARAMETER - Invalid function parameter.
776
777See Also:
778        o BHDM_Handle
779        o BHDM_HDCP_RxCaps
780
781*******************************************************************************/
782BERR_Code BHDM_HDCP_GetRxCaps(
783   BHDM_Handle hHDMI,         /* [in] HDMI handle */
784   uint8_t *pRxCapsReg     /* [out] HDCP Rx Capability */
785) ;
786
787
788/******************************************************************************
789Summary:
790Check the status of the attached receiver.
791
792Input:
793        hHDMI - The HDMI device handle that the application created earlier
794        during the system initialization sequence.
795
796Output:
797        pRxStatusReg - contents of Rx Status Register
798
799        Use logical AND with RxStatusReg and BHDM_HDCP_RxStatus
800        enumeration type to check for specific capability:
801
802        BHDM_HDCP_RxStatus_eHdmiMode                     -  Rx in HDMI mode       
803        BHDM_HDCP_RxStatus_eMaxRepeatersExceeded -  Rx has too many repeaters
804        BHDM_HDCP_RxStatus_eMaxDevicesExceeded   -  Rx has too many devices
805
806Returns:
807        BERR_SUCCESS
808
809See Also:
810        o BHDM_Handle
811        o BHDM_HDCP_RxStatus
812
813*******************************************************************************/
814BERR_Code BHDM_HDCP_GetRxStatus(
815   BHDM_Handle hHDMI,                /* [in] HDMI handle */
816   uint16_t *pRxStatusReg          /* [out] HDCP Rx Status */
817) ;
818
819
820/******************************************************************************
821Summary:
822Get the depth (number of levels) of HDCP Repeaters
823
824Input:
825        hHDMI - The HDMI device handle that the application created earlier
826        during the system initialization sequence.
827
828Output:
829        pRepeaterDepth - pointer to integer containing the number of levels (depth)
830        of receive devices.
831
832Returns:
833        BERR_SUCCESS - Repeater Depth successfully retrieved
834        BERR_INVALID_PARAMETER - Invalid function parameter.
835
836See Also:
837        o BHDM_Handle
838        o BHDM_HDCP_GetRepeaterDeviceCount
839
840*******************************************************************************/
841BERR_Code BHDM_HDCP_GetRepeaterDepth(
842   BHDM_Handle hHDMI,      /* [in] HDMI handle */
843   uint8_t *pRepeaterDepth  /* [out] pointer to hold Levels of HDCP Repeaters */
844) ;
845
846
847/******************************************************************************
848Summary:
849Get the number of devices attached to the HDCP Repeater.
850
851Input:
852        hHDMI - The HDMI device handle that the application created earlier
853        during the system initialization sequence.
854
855Output:
856        pNumDevices - Number of devices attached to the HDCP Receiver
857
858Returns:
859        BERR_SUCCESS - Number of Repeaters successfully retrieved
860        BERR_INVALID_PARAMETER - Invalid function parameter.
861
862See Also:
863        o BHDM_Handle
864        o BHDM_HDCP_GetRepeaterDepth
865
866*******************************************************************************/
867BERR_Code BHDM_HDCP_GetRepeaterDeviceCount(
868   BHDM_Handle hHDMI,   /* [in] HDMI handle */
869   uint8_t *pNumDevices /* [out] pointer to # of devices attached to the HDCP
870                           Repeater */
871) ;
872
873
874/******************************************************************************
875Summary:
876Read the KSV list from the attached repeater.
877
878Input:
879        hHDMI - The HDMI device handle that the application created earlier
880        during the system initialization sequence.
881        uiDeviceCount - Number of KSVs to be read from the Ksv FIFO
882        pRevokedKsvList - List of Revoked KSVs obtained from DCP LLC SRM message
883        uiNumRevokedKsvs - Number of Ksvs contained in the pRevokedKsvList
884
885
886Output:
887        pKsvList - pointer to memory location to load the KSV list read from the
888        HDCP repeater KSV fifo.
889
890Returns:
891        BERR_SUCCESS
892        BERR_INVALID_PARAMETER    - Invalid function parameter.
893        BERR_HDCP_NOT_ENOUGH_MEM  - Not enough memory to hold results
894
895Note:
896        The pKsvList must point to a buffer (allocated and freed by the calling
897        function) that is DEVICE_COUNT * 5 bytes long.  The DEVICE_COUNT can be
898        retrieved using the BHDM_HDCP_GetRepeaterDeviceCount function. 
899
900
901See Also:
902        o BHDM_Handle
903        o BHDM_HDCP_GetRepeaterDeviceCount
904
905*******************************************************************************/
906BERR_Code BHDM_HDCP_ReadRxRepeaterKsvFIFO(
907   BHDM_Handle hHDMI,     /* [in] HDMI handle */
908   uint8_t *pKsvList,     /* [out] pointer to memory to hold KSV List */
909   uint16_t uiDeviceCount, /* [in ] number of devices size of memory in bytes to hold KSV List */
910   const uint8_t *pRevokedKsvList, /* [in] pointer to Revoked KSV List */
911   const uint16_t uiNumRevokedKsvs /* [in] number of KSVs in Revoked Ksv List */
912) ;
913
914
915
916/******************************************************************************
917Summary:
918Write the KSV listread  from the attached repeater to the transmitter core
919
920Input:
921        hHDMI - The HDMI device handle that the application created earlier
922        during the system initialization sequence.
923        pKsvList - pointer to memory location holding the KSV list from the
924        HDCP repeater KSV fifo.
925        uiDeviceCount - number of Ksvs from the downstream Rx Devices 
926       
927Output:
928        <none>
929
930Returns:
931        BERR_SUCCESS
932        BERR_INVALID_PARAMETER    - Invalid function parameter.
933        BERR_HDCP_NOT_ENOUGH_MEM  - Not enough memory to hold results
934
935Note:
936        The pKsvList must point to a buffer (allocated and freed by the calling
937        function) that is DEVICE_COUNT * 5 bytes long.  The DEVICE_COUNT can be
938        retrieved using the BHDM_HDCP_GetRepeaterDeviceCount function. 
939
940
941See Also:
942        o BHDM_Handle
943        o BHDM_HDCP_GetRepeaterDeviceCount
944
945*******************************************************************************/
946BERR_Code BHDM_HDCP_WriteTxKsvFIFO(
947        BHDM_Handle hHDMI,     /* [in] HDMI handle */
948        uint8_t *pKsvList,     /* [in] pointer to memory to holding KSV List */
949        uint16_t uiDeviceCount /* [in] number of Ksvs from the downstream Rx
950                                  Devices */
951) ;
952
953
954
955/******************************************************************************
956Summary:
957Check if the current link is authenticated.
958
959Input:
960        hHDMI - The HDMI device handle that the application created earlier
961        during the system initialization sequence.
962
963
964Output:
965        <none>
966
967Returns:
968        BERR_SUCCESS
969        BERR_INVALID_PARAMETER    - Invalid function parameter.
970        BHDM_HDCP_NO_AUTHENTICATED_LINK  - Link is not Authenticated
971
972Note:
973        The pKsvList must point to a buffer (allocated and freed by the calling
974        function) that is DEVICE_COUNT * 5 bytes long.  The DEVICE_COUNT can be
975        retrieved using the BHDM_HDCP_GetRepeaterDeviceCount function. 
976
977
978See Also:
979        o BHDM_Handle
980
981*******************************************************************************/
982BERR_Code BHDM_HDCP_IsLinkAuthenticated(
983   BHDM_Handle hHDMI      /* [in] HDMI handle */
984) ;
985
986
987/******************************************************************************
988Summary:
989Check if the current Receiver is a repeater
990
991Input:
992        hHDMI - The HDMI device handle that the application created earlier
993        during the system initialization sequence.
994
995
996Output:
997        uiRepeater - flag indicating the attached receiver is a repeater
998
999Returns:
1000        BERR_SUCCESS
1001        BERR_INVALID_PARAMETER    - Invalid function parameter.
1002
1003See Also:
1004        o BHDM_Handle
1005
1006*******************************************************************************/
1007BERR_Code BHDM_HDCP_CheckForRepeater(
1008   BHDM_Handle hHDMI,           /* [in] HDMI handle */
1009   uint8_t *uiRepeater          /* [out] HDCP Rx Status */
1010) ;
1011
1012
1013/******************************************************************************
1014Summary:
1015Create an authenticated link with the attached repeater.
1016
1017Input:
1018        hHDMI - The HDMI device handle that the application created earlier
1019        during the system initialization sequence.
1020
1021Output:
1022        bRepeaterAuthenticated - flag indicating the success/failure of the repeater
1023        authentication
1024
1025Returns:
1026        BERR_SUCCESS
1027        BERR_INVALID_PARAMETER    - Invalid function parameter.
1028
1029See Also:
1030        o BHDM_Handle
1031
1032*******************************************************************************/
1033BERR_Code BHDM_HDCP_RepeaterAuthenticateLink(
1034        BHDM_Handle hHDMI, 
1035        uint8_t *RepeaterAuthenticated
1036) ;
1037
1038/******************************************************************************
1039Summary:
1040Initialize Authentication with the attached repeater
1041
1042Input:
1043        hHDMI - The HDMI device handle that the application created earlier
1044        during the system initialization sequence.
1045
1046
1047Output:
1048        <none>
1049
1050Returns:
1051        BERR_SUCCESS
1052        BERR_INVALID_PARAMETER    - Invalid function parameter.
1053
1054See Also:
1055        o BHDM_Handle
1056
1057*******************************************************************************/
1058BERR_Code BHDM_HDCP_InitializeRepeaterAuthentication(
1059   BHDM_Handle hHDMI           /* [in] HDMI handle */
1060) ;
1061
1062
1063/******************************************************************************
1064Summary:
1065Get a copy of the attached Rx device's KSV
1066
1067Input:
1068        hHDMI - The HDMI device handle that the application created earlier
1069        during the system initialization sequence.
1070
1071Output:
1072        AttachedDeviceKsv - Ksv of the Attached DVI/HDMI Rx
1073
1074Returns:
1075        BERR_SUCCESS
1076        BHDM_RX_NO_DEVICE    - No attached device(s).
1077
1078See Also:
1079        o BHDM_Handle
1080
1081*******************************************************************************/
1082BERR_Code BHDM_HDCP_GetRxKsv(BHDM_Handle hHDMI, 
1083        uint8_t *AttachedDeviceKsv
1084) ;
1085
1086
1087/******************************************************************************
1088Summary:
1089Get a copy of the KSV(s) attached to the HDMI Transmitter
1090
1091Input:
1092        hHDMI - The HDMI device handle that the application created earlier
1093        during the system initialization sequence.
1094
1095Output:
1096        DownstreamKsvsBuffer - pointer to buffer to hold KSV information
1097        DownstreamKsvsBufferSize - size in bytes of the DownstreamKsvsBuffer
1098
1099Returns:
1100        BERR_SUCCESS
1101        BERR_INVALID_PARAMETER - Invalid buffer or buffer size
1102        BHDM_RX_NO_DEVICE    - No attached device(s).
1103
1104See Also:
1105        o BHDM_Handle
1106
1107*******************************************************************************/
1108BERR_Code BHDM_HDCP_GetRepeaterKsvFifo(BHDM_Handle hHDMI, 
1109        uint8_t *DownstreamKsvsBuffer, uint16_t DownstreamKsvsBufferSize
1110) ;
1111
1112
1113/******************************************************************************
1114Summary:
1115Force the V Calculation for attached repeaters with device count zero
1116
1117Input:
1118        hHDMI - The HDMI device handle that the application created earlier
1119        during the system initialization sequence.
1120
1121Output:
1122
1123Returns:
1124
1125See Also:
1126        o BHDM_Handle
1127
1128*******************************************************************************/
1129BERR_Code BHDM_HDCP_ForceVCalculation(BHDM_Handle hHDMI) ;
1130
1131
1132/******************************************************************************
1133Summary:
1134Get the options used for HDCP Authentication
1135
1136Input:
1137        hHDMI - The HDMI device handle that the application created earlier
1138        during the system initialization sequence.
1139        HdcpOptions - pointer to structure containing HDCP Options
1140
1141Output:
1142
1143Returns:
1144
1145See Also:
1146        o BHDM_Handle
1147        o BHDM_HDCP_OPTIONS
1148
1149*******************************************************************************/
1150BERR_Code BHDM_HDCP_GetOptions(
1151        BHDM_Handle hHDMI, BHDM_HDCP_OPTIONS *HdcpOptions) ;
1152
1153
1154/******************************************************************************
1155Summary:
1156Set the options used for HDCP Authentication
1157
1158Input:
1159        hHDMI - The HDMI device handle that the application created earlier
1160        during the system initialization sequence.
1161        HdcpOptions - pointer to structure containing HDCP Options to set
1162
1163Output:
1164
1165Returns:
1166
1167See Also:
1168        o BHDM_Handle
1169        o BHDM_HDCP_OPTIONS
1170
1171*******************************************************************************/
1172BERR_Code BHDM_HDCP_SetOptions(
1173        BHDM_Handle hHDMI, BHDM_HDCP_OPTIONS *HdcpOptions) ;
1174
1175
1176
1177/******************************************************************************
1178Summary:
1179Force all video pixel a particular value, 0 or 1. This function is meant to be used for
1180debugging purposes only.
1181
1182Input:
1183        hHDMI - The HDMI device handle that the application created earlier
1184        during the system initialization sequence.
1185        value  - value to force video pixels, should be 0 or 1
1186
1187Output:
1188
1189Returns:
1190
1191See Also:
1192        o BHDM_Handle
1193        o BHDM_HDCP_P_DEBUG_PjCleanVideo
1194
1195*******************************************************************************/
1196BERR_Code BHDM_HDCP_P_DEBUG_PjForceVideo(BHDM_Handle hHDMI, uint8_t value);
1197
1198
1199/******************************************************************************
1200Summary:
1201Clean video pixel which was forced by BHDM_HDCP_P_DEBUG_PjCleanVideo.
1202This function is meant to be used for debugging purposes only.
1203
1204Input:
1205        hHDMI - The HDMI device handle that the application created earlier
1206        during the system initialization sequence.
1207
1208Output:
1209
1210Returns:
1211
1212See Also:
1213        o BHDM_Handle
1214        o BHDM_HDCP_P_DEBUG_PjForceVideo
1215
1216*******************************************************************************/
1217BERR_Code BHDM_HDCP_P_DEBUG_PjCleanVideo(BHDM_Handle hHDMI, uint8_t value);
1218
1219#ifdef __cplusplus
1220}
1221#endif
1222
1223
1224
1225#endif /* BHDM_HDCP_H__ */
1226
Note: See TracBrowser for help on using the repository browser.