Lines Matching full:hdcp

26 #include "hdcp.h"
28 static inline enum mod_hdcp_status validate_bksv(struct mod_hdcp *hdcp) in validate_bksv() argument
33 memcpy(&n, hdcp->auth.msg.hdcp1.bksv, sizeof(uint64_t)); in validate_bksv()
43 static inline enum mod_hdcp_status check_ksv_ready(struct mod_hdcp *hdcp) in check_ksv_ready() argument
45 if (is_dp_hdcp(hdcp)) in check_ksv_ready()
46 return (hdcp->auth.msg.hdcp1.bstatus & DP_BSTATUS_READY) ? in check_ksv_ready()
49 return (hdcp->auth.msg.hdcp1.bcaps & DRM_HDCP_DDC_BCAPS_KSV_FIFO_READY) ? in check_ksv_ready()
54 static inline enum mod_hdcp_status check_hdcp_capable_dp(struct mod_hdcp *hdcp) in check_hdcp_capable_dp() argument
56 return (hdcp->auth.msg.hdcp1.bcaps & DP_BCAPS_HDCP_CAPABLE) ? in check_hdcp_capable_dp()
61 static inline enum mod_hdcp_status check_r0p_available_dp(struct mod_hdcp *hdcp) in check_r0p_available_dp() argument
64 if (is_dp_hdcp(hdcp)) { in check_r0p_available_dp()
65 status = (hdcp->auth.msg.hdcp1.bstatus & in check_r0p_available_dp()
76 struct mod_hdcp *hdcp) in check_link_integrity_dp() argument
78 return (hdcp->auth.msg.hdcp1.bstatus & in check_link_integrity_dp()
85 struct mod_hdcp *hdcp) in check_no_reauthentication_request_dp() argument
87 return (hdcp->auth.msg.hdcp1.bstatus & DP_BSTATUS_REAUTH_REQ) ? in check_no_reauthentication_request_dp()
92 static inline enum mod_hdcp_status check_no_max_cascade(struct mod_hdcp *hdcp) in check_no_max_cascade() argument
96 if (is_dp_hdcp(hdcp)) in check_no_max_cascade()
97 status = DRM_HDCP_MAX_CASCADE_EXCEEDED(hdcp->auth.msg.hdcp1.binfo_dp >> 8) in check_no_max_cascade()
101 status = DRM_HDCP_MAX_CASCADE_EXCEEDED(hdcp->auth.msg.hdcp1.bstatus >> 8) in check_no_max_cascade()
107 static inline enum mod_hdcp_status check_no_max_devs(struct mod_hdcp *hdcp) in check_no_max_devs() argument
111 if (is_dp_hdcp(hdcp)) in check_no_max_devs()
112 status = DRM_HDCP_MAX_DEVICE_EXCEEDED(hdcp->auth.msg.hdcp1.binfo_dp) ? in check_no_max_devs()
116 status = DRM_HDCP_MAX_DEVICE_EXCEEDED(hdcp->auth.msg.hdcp1.bstatus) ? in check_no_max_devs()
122 static inline uint8_t get_device_count(struct mod_hdcp *hdcp) in get_device_count() argument
124 return is_dp_hdcp(hdcp) ? in get_device_count()
125 DRM_HDCP_NUM_DOWNSTREAM(hdcp->auth.msg.hdcp1.binfo_dp) : in get_device_count()
126 DRM_HDCP_NUM_DOWNSTREAM(hdcp->auth.msg.hdcp1.bstatus); in get_device_count()
129 static inline enum mod_hdcp_status check_device_count(struct mod_hdcp *hdcp) in check_device_count() argument
131 /* device count must be greater than or equal to tracked hdcp displays */ in check_device_count()
132 return (get_device_count(hdcp) < get_active_display_count(hdcp)) ? in check_device_count()
137 static enum mod_hdcp_status wait_for_active_rx(struct mod_hdcp *hdcp, in wait_for_active_rx() argument
150 hdcp, "bksv_read")) in wait_for_active_rx()
154 hdcp, "bcaps_read")) in wait_for_active_rx()
160 static enum mod_hdcp_status exchange_ksvs(struct mod_hdcp *hdcp, in exchange_ksvs() argument
173 hdcp, "create_session")) in exchange_ksvs()
177 hdcp, "an_write")) in exchange_ksvs()
181 hdcp, "aksv_write")) in exchange_ksvs()
185 hdcp, "bksv_read")) in exchange_ksvs()
189 hdcp, "bksv_validation")) in exchange_ksvs()
191 if (hdcp->auth.msg.hdcp1.ainfo) { in exchange_ksvs()
194 hdcp, "ainfo_write")) in exchange_ksvs()
202 struct mod_hdcp *hdcp, in computations_validate_rx_test_for_repeater() argument
215 hdcp, "r0p_read")) in computations_validate_rx_test_for_repeater()
219 hdcp, "rx_validation")) in computations_validate_rx_test_for_repeater()
221 if (hdcp->connection.is_repeater) { in computations_validate_rx_test_for_repeater()
222 if (!hdcp->connection.link.adjust.hdcp1.postpone_encryption) in computations_validate_rx_test_for_repeater()
226 hdcp, "encryption")) in computations_validate_rx_test_for_repeater()
231 hdcp, "encryption")) in computations_validate_rx_test_for_repeater()
233 if (is_dp_mst_hdcp(hdcp)) in computations_validate_rx_test_for_repeater()
237 hdcp, "stream_encryption_dp")) in computations_validate_rx_test_for_repeater()
244 static enum mod_hdcp_status authenticated(struct mod_hdcp *hdcp, in authenticated() argument
257 hdcp, "link_maintenance")) in authenticated()
263 static enum mod_hdcp_status wait_for_ready(struct mod_hdcp *hdcp, in wait_for_ready() argument
276 if (is_dp_hdcp(hdcp)) { in wait_for_ready()
279 hdcp, "bstatus_read")) in wait_for_ready()
283 hdcp, "link_integrity_check")) in wait_for_ready()
287 hdcp, "reauth_request_check")) in wait_for_ready()
292 hdcp, "bcaps_read")) in wait_for_ready()
297 hdcp, "ready_check")) in wait_for_ready()
303 static enum mod_hdcp_status read_ksv_list(struct mod_hdcp *hdcp, in read_ksv_list() argument
315 if (is_dp_hdcp(hdcp)) { in read_ksv_list()
318 hdcp, "binfo_read_dp")) in read_ksv_list()
323 hdcp, "bstatus_read")) in read_ksv_list()
328 hdcp, "max_cascade_check")) in read_ksv_list()
332 hdcp, "max_devs_check")) in read_ksv_list()
336 hdcp, "device_count_check")) in read_ksv_list()
338 device_count = get_device_count(hdcp); in read_ksv_list()
339 hdcp->auth.msg.hdcp1.ksvlist_size = device_count*5; in read_ksv_list()
342 hdcp, "ksvlist_read")) in read_ksv_list()
346 hdcp, "vp_read")) in read_ksv_list()
350 hdcp, "ksvlist_vp_validation")) in read_ksv_list()
355 hdcp, "encryption")) in read_ksv_list()
357 if (is_dp_mst_hdcp(hdcp)) in read_ksv_list()
361 hdcp, "stream_encryption_dp")) in read_ksv_list()
367 static enum mod_hdcp_status determine_rx_hdcp_capable_dp(struct mod_hdcp *hdcp, in determine_rx_hdcp_capable_dp() argument
380 hdcp, "bcaps_read")) in determine_rx_hdcp_capable_dp()
384 hdcp, "hdcp_capable_dp")) in determine_rx_hdcp_capable_dp()
390 static enum mod_hdcp_status wait_for_r0_prime_dp(struct mod_hdcp *hdcp, in wait_for_r0_prime_dp() argument
404 hdcp, "bstatus_read")) in wait_for_r0_prime_dp()
408 hdcp, "r0p_available_dp")) in wait_for_r0_prime_dp()
414 static enum mod_hdcp_status authenticated_dp(struct mod_hdcp *hdcp, in authenticated_dp() argument
427 hdcp, "bstatus_read")) in authenticated_dp()
431 hdcp, "link_integrity_check")) in authenticated_dp()
435 hdcp, "reauth_request_check")) in authenticated_dp()
443 enum mod_hdcp_status *status, struct mod_hdcp *hdcp, char *str) in mod_hdcp_execute_and_set() argument
445 *status = func(hdcp); in mod_hdcp_execute_and_set()
447 HDCP_INPUT_PASS_TRACE(hdcp, str); in mod_hdcp_execute_and_set()
450 HDCP_INPUT_FAIL_TRACE(hdcp, str); in mod_hdcp_execute_and_set()
456 enum mod_hdcp_status mod_hdcp_hdcp1_execution(struct mod_hdcp *hdcp, in mod_hdcp_hdcp1_execution() argument
462 switch (current_state(hdcp)) { in mod_hdcp_hdcp1_execution()
464 status = wait_for_active_rx(hdcp, event_ctx, input); in mod_hdcp_hdcp1_execution()
467 status = exchange_ksvs(hdcp, event_ctx, input); in mod_hdcp_hdcp1_execution()
470 status = computations_validate_rx_test_for_repeater(hdcp, in mod_hdcp_hdcp1_execution()
474 status = authenticated(hdcp, event_ctx, input); in mod_hdcp_hdcp1_execution()
477 status = wait_for_ready(hdcp, event_ctx, input); in mod_hdcp_hdcp1_execution()
480 status = read_ksv_list(hdcp, event_ctx, input); in mod_hdcp_hdcp1_execution()
490 extern enum mod_hdcp_status mod_hdcp_hdcp1_dp_execution(struct mod_hdcp *hdcp, in mod_hdcp_hdcp1_dp_execution() argument
496 switch (current_state(hdcp)) { in mod_hdcp_hdcp1_dp_execution()
498 status = determine_rx_hdcp_capable_dp(hdcp, event_ctx, input); in mod_hdcp_hdcp1_dp_execution()
501 status = exchange_ksvs(hdcp, event_ctx, input); in mod_hdcp_hdcp1_dp_execution()
504 status = wait_for_r0_prime_dp(hdcp, event_ctx, input); in mod_hdcp_hdcp1_dp_execution()
508 hdcp, event_ctx, input); in mod_hdcp_hdcp1_dp_execution()
511 status = authenticated_dp(hdcp, event_ctx, input); in mod_hdcp_hdcp1_dp_execution()
514 status = wait_for_ready(hdcp, event_ctx, input); in mod_hdcp_hdcp1_dp_execution()
517 status = read_ksv_list(hdcp, event_ctx, input); in mod_hdcp_hdcp1_dp_execution()