1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
|
/*
* Copyright 2019 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef MODULES_HDCP_HDCP_PSP_H_
#define MODULES_HDCP_HDCP_PSP_H_
/*
* NOTE: These parameters are a one-to-one copy of the
* parameters required by PSP
*/
enum bgd_security_hdcp_encryption_level {
HDCP_ENCRYPTION_LEVEL__INVALID = 0,
HDCP_ENCRYPTION_LEVEL__OFF,
HDCP_ENCRYPTION_LEVEL__ON
};
enum bgd_security_hdcp2_content_type {
HDCP2_CONTENT_TYPE__INVALID = 0,
HDCP2_CONTENT_TYPE__TYPE0,
HDCP2_CONTENT_TYPE__TYPE1
};
enum ta_dtm_command {
TA_DTM_COMMAND__UNUSED_1 = 1,
TA_DTM_COMMAND__TOPOLOGY_UPDATE_V2,
#if defined(CONFIG_DRM_AMD_DC_DCN3_1)
TA_DTM_COMMAND__TOPOLOGY_ASSR_ENABLE,
TA_DTM_COMMAND__TOPOLOGY_UPDATE_V3
#else
TA_DTM_COMMAND__TOPOLOGY_ASSR_ENABLE
#endif
};
/* DTM related enumerations */
/**********************************************************/
enum ta_dtm_status {
TA_DTM_STATUS__SUCCESS = 0x00,
TA_DTM_STATUS__GENERIC_FAILURE = 0x01,
TA_DTM_STATUS__INVALID_PARAMETER = 0x02,
TA_DTM_STATUS__NULL_POINTER = 0x3
};
/* input/output structures for DTM commands */
/**********************************************************/
/**
* Input structures
*/
enum ta_dtm_hdcp_version_max_supported {
TA_DTM_HDCP_VERSION_MAX_SUPPORTED__NONE = 0,
TA_DTM_HDCP_VERSION_MAX_SUPPORTED__1_x = 10,
TA_DTM_HDCP_VERSION_MAX_SUPPORTED__2_0 = 20,
TA_DTM_HDCP_VERSION_MAX_SUPPORTED__2_1 = 21,
TA_DTM_HDCP_VERSION_MAX_SUPPORTED__2_2 = 22,
TA_DTM_HDCP_VERSION_MAX_SUPPORTED__2_3 = 23
};
struct ta_dtm_topology_update_input_v2 {
/* display handle is unique across the driver and is used to identify a display */
/* for all security interfaces which reference displays such as HDCP */
uint32_t display_handle;
uint32_t is_active;
uint32_t is_miracast;
uint32_t controller;
uint32_t ddc_line;
uint32_t dig_be;
uint32_t dig_fe;
uint32_t dp_mst_vcid;
uint32_t is_assr;
uint32_t max_hdcp_supported_version;
};
#if defined(CONFIG_DRM_AMD_DC_DCN3_1)
/* For security reason/HW may change value, these encoder type enum values are not HW register values */
/* Security code will check real HW register values and these SW enum values */
enum ta_dtm_encoder_type {
TA_DTM_ENCODER_TYPE__INVALID = 0,
TA_DTM_ENCODER_TYPE__DIG = 0x10
};
struct ta_dtm_topology_update_input_v3 {
/* display handle is unique across the driver and is used to identify a display */
/* for all security interfaces which reference displays such as HDCP */
/* link_hdcp_cap means link is HDCP-capable for audio HDCP capable property(informational), not for other logic(e.g. Crossbar) */
uint32_t display_handle;
uint32_t is_active;
uint32_t is_miracast;
uint32_t controller;
uint32_t ddc_line;
uint32_t link_enc;
uint32_t stream_enc;
uint32_t dp_mst_vcid;
uint32_t is_assr;
uint32_t max_hdcp_supported_version;
enum ta_dtm_encoder_type encoder_type;
uint32_t phy_id;
uint32_t link_hdcp_cap;
};
#endif
struct ta_dtm_topology_assr_enable {
uint32_t display_topology_dig_be_index;
};
/**
* Output structures
*/
/* No output structures yet */
union ta_dtm_cmd_input {
struct ta_dtm_topology_update_input_v2 topology_update_v2;
struct ta_dtm_topology_assr_enable topology_assr_enable;
#if defined(CONFIG_DRM_AMD_DC_DCN3_1)
struct ta_dtm_topology_update_input_v3 topology_update_v3;
#endif
};
union ta_dtm_cmd_output {
uint32_t reserved;
};
struct ta_dtm_shared_memory {
uint32_t cmd_id;
uint32_t resp_id;
enum ta_dtm_status dtm_status;
uint32_t reserved;
union ta_dtm_cmd_input dtm_in_message;
union ta_dtm_cmd_output dtm_out_message;
};
int psp_cmd_submit_buf(struct psp_context *psp, struct amdgpu_firmware_info *ucode, struct psp_gfx_cmd_resp *cmd,
uint64_t fence_mc_addr);
enum { PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE = 5120 };
enum ta_hdcp_command {
TA_HDCP_COMMAND__INITIALIZE,
TA_HDCP_COMMAND__HDCP1_CREATE_SESSION,
TA_HDCP_COMMAND__HDCP1_DESTROY_SESSION,
TA_HDCP_COMMAND__HDCP1_FIRST_PART_AUTHENTICATION,
TA_HDCP_COMMAND__HDCP1_SECOND_PART_AUTHENTICATION,
TA_HDCP_COMMAND__HDCP1_ENABLE_ENCRYPTION,
TA_HDCP_COMMAND__HDCP1_ENABLE_DP_STREAM_ENCRYPTION,
TA_HDCP_COMMAND__HDCP1_GET_ENCRYPTION_STATUS,
TA_HDCP_COMMAND__UNUSED_1,
TA_HDCP_COMMAND__HDCP2_DESTROY_SESSION,
TA_HDCP_COMMAND__UNUSED_2,
TA_HDCP_COMMAND__HDCP2_SET_ENCRYPTION,
TA_HDCP_COMMAND__HDCP2_GET_ENCRYPTION_STATUS,
TA_HDCP_COMMAND__UNUSED_3,
TA_HDCP_COMMAND__HDCP2_CREATE_SESSION_V2,
TA_HDCP_COMMAND__HDCP2_PREPARE_PROCESS_AUTHENTICATION_MSG_V2,
TA_HDCP_COMMAND__HDCP2_ENABLE_DP_STREAM_ENCRYPTION,
TA_HDCP_COMMAND__HDCP_DESTROY_ALL_SESSIONS,
TA_HDCP_COMMAND__HDCP_SET_SRM,
TA_HDCP_COMMAND__HDCP_GET_SRM
};
enum ta_hdcp2_msg_id {
TA_HDCP_HDCP2_MSG_ID__NULL_MESSAGE = 1,
TA_HDCP_HDCP2_MSG_ID__AKE_INIT = 2,
TA_HDCP_HDCP2_MSG_ID__AKE_SEND_CERT = 3,
TA_HDCP_HDCP2_MSG_ID__AKE_NO_STORED_KM = 4,
TA_HDCP_HDCP2_MSG_ID__AKE_STORED_KM = 5,
TA_HDCP_HDCP2_MSG_ID__AKE_SEND_RRX = 6,
TA_HDCP_HDCP2_MSG_ID__AKE_SEND_H_PRIME = 7,
TA_HDCP_HDCP2_MSG_ID__AKE_SEND_PAIRING_INFO = 8,
TA_HDCP_HDCP2_MSG_ID__LC_INIT = 9,
TA_HDCP_HDCP2_MSG_ID__LC_SEND_L_PRIME = 10,
TA_HDCP_HDCP2_MSG_ID__SKE_SEND_EKS = 11,
TA_HDCP_HDCP2_MSG_ID__REPEATERAUTH_SEND_RECEIVERID_LIST = 12,
TA_HDCP_HDCP2_MSG_ID__RTT_READY = 13,
TA_HDCP_HDCP2_MSG_ID__RTT_CHALLENGE = 14,
TA_HDCP_HDCP2_MSG_ID__REPEATERAUTH_SEND_ACK = 15,
TA_HDCP_HDCP2_MSG_ID__REPEATERAUTH_STREAM_MANAGE = 16,
TA_HDCP_HDCP2_MSG_ID__REPEATERAUTH_STREAM_READY = 17,
TA_HDCP_HDCP2_MSG_ID__RECEIVER_AUTH_STATUS = 18,
TA_HDCP_HDCP2_MSG_ID__AKE_TRANSMITTER_INFO = 19,
TA_HDCP_HDCP2_MSG_ID__AKE_RECEIVER_INFO = 20,
TA_HDCP_HDCP2_MSG_ID__SIGNAL_CONTENT_STREAM_TYPE_DP = 129
};
enum ta_hdcp2_hdcp2_msg_id_max_size {
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__NULL_MESSAGE = 0,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_INIT = 12,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_SEND_CERT = 534,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_NO_STORED_KM = 129,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_STORED_KM = 33,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_SEND_RRX = 9,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_SEND_H_PRIME = 33,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_SEND_PAIRING_INFO = 17,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__LC_INIT = 9,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__LC_SEND_L_PRIME = 33,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__SKE_SEND_EKS = 25,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__REPEATERAUTH_SEND_RECEIVERID_LIST = 181,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__RTT_READY = 1,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__RTT_CHALLENGE = 17,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__REPEATERAUTH_SEND_RACK = 17,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__REPEATERAUTH_STREAM_MANAGE = 13,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__REPEATERAUTH_STREAM_READY = 33,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__RECEIVER_AUTH_STATUS = 4,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_TRANSMITTER_INFO = 6,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_RECEIVER_INFO = 6,
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__SIGNAL_CONTENT_STREAM_TYPE_DP = 1
};
/* HDCP related enumerations */
/**********************************************************/
#define TA_HDCP__INVALID_SESSION 0xFFFF
#define TA_HDCP__HDCP1_AN_SIZE 8
#define TA_HDCP__HDCP1_KSV_SIZE 5
#define TA_HDCP__HDCP1_KSV_LIST_MAX_ENTRIES 127
#define TA_HDCP__HDCP1_V_PRIME_SIZE 20
#define TA_HDCP__HDCP2_TX_BUF_MAX_SIZE \
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_NO_STORED_KM + TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_STORED_KM + 6
// 64 bits boundaries
#define TA_HDCP__HDCP2_RX_BUF_MAX_SIZE \
TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_SEND_CERT + TA_HDCP_HDCP2_MSG_ID_MAX_SIZE__AKE_RECEIVER_INFO + 4
enum ta_hdcp_status {
TA_HDCP_STATUS__SUCCESS = 0x00,
TA_HDCP_STATUS__GENERIC_FAILURE = 0x01,
TA_HDCP_STATUS__NULL_POINTER = 0x02,
TA_HDCP_STATUS__FAILED_ALLOCATING_SESSION = 0x03,
TA_HDCP_STATUS__FAILED_SETUP_TX = 0x04,
TA_HDCP_STATUS__INVALID_PARAMETER = 0x05,
TA_HDCP_STATUS__VHX_ERROR = 0x06,
TA_HDCP_STATUS__SESSION_NOT_CLOSED_PROPERLY = 0x07,
TA_HDCP_STATUS__SRM_FAILURE = 0x08,
TA_HDCP_STATUS__MST_AUTHENTICATED_ALREADY_STARTED = 0x09,
TA_HDCP_STATUS__AKE_SEND_CERT_FAILURE = 0x0A,
TA_HDCP_STATUS__AKE_NO_STORED_KM_FAILURE = 0x0B,
TA_HDCP_STATUS__AKE_SEND_HPRIME_FAILURE = 0x0C,
TA_HDCP_STATUS__LC_SEND_LPRIME_FAILURE = 0x0D,
TA_HDCP_STATUS__SKE_SEND_EKS_FAILURE = 0x0E,
TA_HDCP_STATUS__REPAUTH_SEND_RXIDLIST_FAILURE = 0x0F,
TA_HDCP_STATUS__REPAUTH_STREAM_READY_FAILURE = 0x10,
TA_HDCP_STATUS__ASD_GENERIC_FAILURE = 0x11,
TA_HDCP_STATUS__UNWRAP_SECRET_FAILURE = 0x12,
TA_HDCP_STATUS__ENABLE_ENCR_FAILURE = 0x13,
TA_HDCP_STATUS__DISABLE_ENCR_FAILURE = 0x14,
TA_HDCP_STATUS__NOT_ENOUGH_MEMORY_FAILURE = 0x15,
TA_HDCP_STATUS__UNKNOWN_MESSAGE = 0x16,
TA_HDCP_STATUS__TOO_MANY_STREAM = 0x17
};
enum ta_hdcp_authentication_status {
TA_HDCP_AUTHENTICATION_STATUS__NOT_STARTED = 0x00,
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_FIRST_PART_FAILED = 0x01,
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_FIRST_PART_COMPLETE = 0x02,
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_SECOND_PART_FAILED = 0x03,
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_AUTHENTICATED = 0x04,
TA_HDCP_AUTHENTICATION_STATUS__HDCP22_AUTHENTICATION_PENDING = 0x06,
TA_HDCP_AUTHENTICATION_STATUS__HDCP22_AUTHENTICATION_FAILED = 0x07,
TA_HDCP_AUTHENTICATION_STATUS__HDCP22_AUTHENTICATED = 0x08,
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_KSV_VALIDATION_FAILED = 0x09,
TA_HDCP_AUTHENTICATION_STATUS__HDCP1_KSV_REVOKED = 0x0A
};
enum ta_hdcp2_msg_authentication_status {
TA_HDCP2_MSG_AUTHENTICATION_STATUS__SUCCESS = 0,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__KM_NOT_AVAILABLE,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__UNUSED,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__INVALID = 100, // everything above does not fail the request
TA_HDCP2_MSG_AUTHENTICATION_STATUS__NOT_ENOUGH_MEMORY,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__NOT_EXPECTED_MSG,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__SIGNATURE_CERTIFICAT_ERROR,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__INCORRECT_HDCP_VERSION,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__UNKNOWN_MESSAGE,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__INVALID_HMAC,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__INVALID_TOPOLOGY,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__INVALID_SEQ_NUM,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__INVALID_SIZE,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__INVALID_LENGTH,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__REAUTH_REQUEST,
TA_HDCP2_MSG_AUTHENTICATION_STATUS__RECEIVERID_REVOKED
};
enum ta_hdcp_content_type {
TA_HDCP2_CONTENT_TYPE__TYPE0 = 1,
TA_HDCP2_CONTENT_TYPE__TYPE1,
};
enum ta_hdcp_content_type_negotiation_type {
TA_HDCP2_CONTENT_TYPE_NEGOTIATION_TYPE__FORCE_TYPE0 = 1,
TA_HDCP2_CONTENT_TYPE_NEGOTIATION_TYPE__FORCE_TYPE1,
TA_HDCP2_CONTENT_TYPE_NEGOTIATION_TYPE__MAX_SUPPORTED
};
enum ta_hdcp2_version {
TA_HDCP2_VERSION_UNKNOWN = 0,
TA_HDCP2_VERSION_2_0 = 20,
TA_HDCP2_VERSION_2_1 = 21,
#if defined(CONFIG_DRM_AMD_DC_DCN3_1)
TA_HDCP2_VERSION_2_3 = 23,
#endif
TA_HDCP2_VERSION_2_2 = 22
};
/* input/output structures for HDCP commands */
/**********************************************************/
struct ta_hdcp_cmd_hdcp1_create_session_input {
uint8_t display_handle;
};
struct ta_hdcp_cmd_hdcp1_create_session_output {
uint32_t session_handle;
uint8_t an_primary[TA_HDCP__HDCP1_AN_SIZE];
uint8_t aksv_primary[TA_HDCP__HDCP1_KSV_SIZE];
uint8_t ainfo_primary;
uint8_t an_secondary[TA_HDCP__HDCP1_AN_SIZE];
uint8_t aksv_secondary[TA_HDCP__HDCP1_KSV_SIZE];
uint8_t ainfo_secondary;
};
struct ta_hdcp_cmd_hdcp1_destroy_session_input {
uint32_t session_handle;
};
struct ta_hdcp_cmd_hdcp1_first_part_authentication_input {
uint32_t session_handle;
uint8_t bksv_primary[TA_HDCP__HDCP1_KSV_SIZE];
uint8_t bksv_secondary[TA_HDCP__HDCP1_KSV_SIZE];
uint8_t bcaps;
uint16_t r0_prime_primary;
uint16_t r0_prime_secondary;
};
struct ta_hdcp_cmd_hdcp1_first_part_authentication_output {
enum ta_hdcp_authentication_status authentication_status;
};
struct ta_hdcp_cmd_hdcp1_second_part_authentication_input {
uint32_t session_handle;
uint16_t bstatus_binfo;
uint8_t ksv_list[TA_HDCP__HDCP1_KSV_LIST_MAX_ENTRIES][TA_HDCP__HDCP1_KSV_SIZE];
uint32_t ksv_list_size;
uint8_t pj_prime;
uint8_t v_prime[TA_HDCP__HDCP1_V_PRIME_SIZE];
};
struct ta_hdcp_cmd_hdcp1_second_part_authentication_output {
enum ta_hdcp_authentication_status authentication_status;
};
struct ta_hdcp_cmd_hdcp1_enable_encryption_input {
uint32_t session_handle;
};
struct ta_hdcp_cmd_hdcp1_enable_dp_stream_encryption_input {
uint32_t session_handle;
uint32_t display_handle;
};
struct ta_hdcp_cmd_hdcp1_get_encryption_status_input {
uint32_t session_handle;
};
struct ta_hdcp_cmd_hdcp1_get_encryption_status_output {
uint32_t protection_level;
};
struct ta_hdcp_cmd_hdcp2_create_session_input_v2 {
uint32_t display_handle;
enum ta_hdcp_content_type_negotiation_type negotiate_content_type;
};
struct ta_hdcp_cmd_hdcp2_create_session_output_v2 {
uint32_t session_handle;
};
struct ta_hdcp_cmd_hdcp2_destroy_session_input {
uint32_t session_handle;
};
struct ta_hdcp_cmd_hdcp2_authentication_message_v2 {
enum ta_hdcp2_msg_id msg_id;
uint32_t msg_size;
};
struct ta_hdcp_cmd_hdcp2_process_authentication_message_input_v2 {
struct ta_hdcp_cmd_hdcp2_authentication_message_v2 msg1_desc;
struct ta_hdcp_cmd_hdcp2_authentication_message_v2 msg2_desc;
struct ta_hdcp_cmd_hdcp2_authentication_message_v2 msg3_desc;
uint8_t receiver_message[TA_HDCP__HDCP2_RX_BUF_MAX_SIZE];
};
struct ta_hdcp_cmd_hdcp2_process_authentication_message_output_v2 {
uint32_t hdcp_version;
uint32_t is_km_stored;
uint32_t is_locality_precompute_support;
uint32_t is_repeater;
enum ta_hdcp2_msg_authentication_status msg1_status;
enum ta_hdcp2_msg_authentication_status msg2_status;
enum ta_hdcp2_msg_authentication_status msg3_status;
};
struct ta_hdcp_cmd_hdcp2_prepare_authentication_message_input_v2 {
enum ta_hdcp2_msg_id msg1_id;
enum ta_hdcp2_msg_id msg2_id;
};
struct ta_hdcp_cmd_hdcp2_prepare_authentication_message_output_v2 {
enum ta_hdcp2_msg_authentication_status msg1_status;
enum ta_hdcp2_msg_authentication_status msg2_status;
struct ta_hdcp_cmd_hdcp2_authentication_message_v2 msg1_desc;
struct ta_hdcp_cmd_hdcp2_authentication_message_v2 msg2_desc;
uint8_t transmitter_message[TA_HDCP__HDCP2_TX_BUF_MAX_SIZE];
};
struct ta_hdcp_cmd_hdcp2_process_prepare_authentication_message_input_v2 {
uint32_t session_handle;
struct ta_hdcp_cmd_hdcp2_process_authentication_message_input_v2 process;
struct ta_hdcp_cmd_hdcp2_prepare_authentication_message_input_v2 prepare;
};
struct ta_hdcp_cmd_hdcp2_process_prepare_authentication_message_output_v2 {
uint32_t authentication_status;
struct ta_hdcp_cmd_hdcp2_process_authentication_message_output_v2 process;
struct ta_hdcp_cmd_hdcp2_prepare_authentication_message_output_v2 prepare;
};
struct ta_hdcp_cmd_hdcp2_set_encryption_input {
uint32_t session_handle;
};
struct ta_hdcp_cmd_hdcp2_get_encryption_status_input {
uint32_t session_handle;
};
struct ta_hdcp_cmd_hdcp2_get_encryption_status_output {
enum ta_hdcp_content_type hdcp2_type;
uint32_t protection_level;
};
struct ta_hdcp_cmd_hdcp2_enable_dp_stream_encryption_input {
uint32_t session_handle;
uint32_t display_handle;
};
struct ta_hdcp_cmd_set_srm_input {
uint32_t srm_buf_size;
uint8_t srm_buf[PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE];
};
struct ta_hdcp_cmd_set_srm_output {
uint8_t valid_signature;
uint32_t srm_version;
};
struct ta_hdcp_cmd_get_srm_output {
uint32_t srm_version;
uint32_t srm_buf_size;
uint8_t srm_buf[PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE];
};
/**********************************************************/
/* Common input structure for HDCP callbacks */
union ta_hdcp_cmd_input {
struct ta_hdcp_cmd_hdcp1_create_session_input hdcp1_create_session;
struct ta_hdcp_cmd_hdcp1_destroy_session_input hdcp1_destroy_session;
struct ta_hdcp_cmd_hdcp1_first_part_authentication_input hdcp1_first_part_authentication;
struct ta_hdcp_cmd_hdcp1_second_part_authentication_input hdcp1_second_part_authentication;
struct ta_hdcp_cmd_hdcp1_enable_encryption_input hdcp1_enable_encryption;
struct ta_hdcp_cmd_hdcp1_enable_dp_stream_encryption_input hdcp1_enable_dp_stream_encryption;
struct ta_hdcp_cmd_hdcp1_get_encryption_status_input hdcp1_get_encryption_status;
struct ta_hdcp_cmd_hdcp2_destroy_session_input hdcp2_destroy_session;
struct ta_hdcp_cmd_hdcp2_set_encryption_input hdcp2_set_encryption;
struct ta_hdcp_cmd_hdcp2_get_encryption_status_input hdcp2_get_encryption_status;
struct ta_hdcp_cmd_hdcp2_create_session_input_v2 hdcp2_create_session_v2;
struct ta_hdcp_cmd_hdcp2_process_prepare_authentication_message_input_v2
hdcp2_prepare_process_authentication_message_v2;
struct ta_hdcp_cmd_hdcp2_enable_dp_stream_encryption_input hdcp2_enable_dp_stream_encryption;
struct ta_hdcp_cmd_set_srm_input hdcp_set_srm;
};
/* Common output structure for HDCP callbacks */
union ta_hdcp_cmd_output {
struct ta_hdcp_cmd_hdcp1_create_session_output hdcp1_create_session;
struct ta_hdcp_cmd_hdcp1_first_part_authentication_output hdcp1_first_part_authentication;
struct ta_hdcp_cmd_hdcp1_second_part_authentication_output hdcp1_second_part_authentication;
struct ta_hdcp_cmd_hdcp1_get_encryption_status_output hdcp1_get_encryption_status;
struct ta_hdcp_cmd_hdcp2_get_encryption_status_output hdcp2_get_encryption_status;
struct ta_hdcp_cmd_hdcp2_create_session_output_v2 hdcp2_create_session_v2;
struct ta_hdcp_cmd_hdcp2_process_prepare_authentication_message_output_v2
hdcp2_prepare_process_authentication_message_v2;
struct ta_hdcp_cmd_set_srm_output hdcp_set_srm;
struct ta_hdcp_cmd_get_srm_output hdcp_get_srm;
};
/**********************************************************/
struct ta_hdcp_shared_memory {
uint32_t cmd_id;
enum ta_hdcp_status hdcp_status;
uint32_t reserved;
union ta_hdcp_cmd_input in_msg;
union ta_hdcp_cmd_output out_msg;
};
enum psp_status {
PSP_STATUS__SUCCESS = 0,
PSP_STATUS__ERROR_INVALID_PARAMS,
PSP_STATUS__ERROR_GENERIC,
PSP_STATUS__ERROR_OUT_OF_MEMORY,
PSP_STATUS__ERROR_UNSUPPORTED_FEATURE
};
#endif /* MODULES_HDCP_HDCP_PSP_H_ */
|