hdcp1.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #pragma once
  6. // AUTOGENERATED FILE: DO NOT EDIT
  7. #include <linux/types.h>
  8. #include "smcinvoke_object.h"
  9. #define HDCP1_PROVISION 0
  10. #define HDCP1_VERIFY 1
  11. #define HDCP1_SET_ENCRYPTION 2
  12. #define HDCP1_SET_ENCRYPTION_V2 3
  13. #define HDCP1_SET_KEY 4
  14. #define HDCP1_SET_KEY_V2 5
  15. #define HDCP1_SET_MODE 6
  16. static inline int32_t hdcp1_release(struct Object self)
  17. {
  18. return Object_invoke(self, Object_OP_release, 0, 0);
  19. }
  20. static inline int32_t hdcp1_retain(struct Object self)
  21. {
  22. return Object_invoke(self, Object_OP_retain, 0, 0);
  23. }
  24. static inline int32_t hdcp1_provision(struct Object self, uint32_t keyFormat_val,
  25. const void *key_ptr, size_t key_len,
  26. const void *dps_ptr, size_t dps_len)
  27. {
  28. union ObjectArg a[3] = {{{0, 0}}};
  29. a[0].b = (struct ObjectBuf) {&keyFormat_val, sizeof(uint32_t)};
  30. a[1].bi = (struct ObjectBufIn) {key_ptr, key_len * 1};
  31. a[2].bi = (struct ObjectBufIn) {dps_ptr, dps_len * 1};
  32. return Object_invoke(self, HDCP1_PROVISION, a,
  33. ObjectCounts_pack(3, 0, 0, 0));
  34. }
  35. static inline int32_t hdcp1_verify(struct Object self, uint32_t deviceType_val)
  36. {
  37. union ObjectArg a[1] = {{{0, 0}}};
  38. a[0].b = (struct ObjectBuf) {&deviceType_val, sizeof(uint32_t)};
  39. return Object_invoke(self, HDCP1_VERIFY, a,
  40. ObjectCounts_pack(1, 0, 0, 0));
  41. }
  42. static inline int32_t hdcp1_set_encryption(struct Object self, uint32_t enable_val)
  43. {
  44. union ObjectArg a[1] = {{{0, 0}}};
  45. a[0].b = (struct ObjectBuf) {&enable_val, sizeof(uint32_t)};
  46. return Object_invoke(self, HDCP1_SET_ENCRYPTION, a,
  47. ObjectCounts_pack(1, 0, 0, 0));
  48. }
  49. static inline int32_t hdcp1_set_encryption_v2(struct Object self, uint32_t enable_val,
  50. uint32_t deviceType_val)
  51. {
  52. union ObjectArg a[1] = {{{0, 0}}};
  53. struct {
  54. uint32_t m_enable;
  55. uint32_t m_deviceType;
  56. } i;
  57. a[0].b = (struct ObjectBuf) {&i, 8};
  58. i.m_enable = enable_val;
  59. i.m_deviceType = deviceType_val;
  60. return Object_invoke(self, HDCP1_SET_ENCRYPTION_V2, a,
  61. ObjectCounts_pack(1, 0, 0, 0));
  62. }
  63. static inline int32_t hdcp1_set_key(struct Object self, void *ksv_ptr, size_t ksv_len,
  64. size_t *ksv_lenout)
  65. {
  66. union ObjectArg a[1] = {{{0, 0}}};
  67. int32_t result = 0;
  68. a[0].b = (struct ObjectBuf) {ksv_ptr, ksv_len * 1};
  69. result = Object_invoke(self, HDCP1_SET_KEY, a,
  70. ObjectCounts_pack(0, 1, 0, 0));
  71. *ksv_lenout = a[0].b.size / 1;
  72. return result;
  73. }
  74. static inline int32_t hdcp1_set_key_v2(struct Object self, void *ksv_ptr,
  75. size_t ksv_len, size_t *ksv_lenout,
  76. uint32_t deviceType_val)
  77. {
  78. union ObjectArg a[2] = {{{0, 0}}};
  79. int32_t result = 0;
  80. a[1].b = (struct ObjectBuf) {ksv_ptr, ksv_len * 1};
  81. a[0].b = (struct ObjectBuf) {&deviceType_val, sizeof(uint32_t)};
  82. result = Object_invoke(self, HDCP1_SET_KEY_V2, a,
  83. ObjectCounts_pack(1, 1, 0, 0));
  84. *ksv_lenout = a[1].b.size / 1;
  85. return result;
  86. }
  87. static inline int32_t hdcp1_set_mode(struct Object self, int32_t mode_val)
  88. {
  89. union ObjectArg a[1] = {{{0, 0}}};
  90. a[0].b = (struct ObjectBuf) {&mode_val, sizeof(int32_t)};
  91. return Object_invoke(self, HDCP1_SET_MODE, a,
  92. ObjectCounts_pack(1, 0, 0, 0));
  93. }