hdcp2p2.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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 HDCP2P2_PROVISION_KEY 0
  10. #define HDCP2P2_VERIFY_KEY 1
  11. #define HDCP2P2_TX_INIT 2
  12. #define HDCP2P2_TX_DEINIT 3
  13. #define HDCP2P2_RCVD_MSG 4
  14. #define HDCP2P2_SEND_TIMEOUT 5
  15. #define HDCP2P2_SET_HW_KEY 6
  16. #define HDCP2P2_QUERY_STREAM_TYPE 7
  17. #define HDCP2P2_INIT 8
  18. #define HDCP2P2_DEINIT 9
  19. #define HDCP2P2_VERSION 10
  20. #define HDCP2P2_SESSION_INIT 11
  21. #define HDCP2P2_SESSION_DEINIT 12
  22. #define HDCP2P2_START_AUTH 13
  23. #define HDCP2P2_SESSION_OPEN_STREAM 14
  24. #define HDCP2P2_SESSION_CLOSE_STREAM 15
  25. #define HDCP2P2_FORCE_ENCRYPTION 16
  26. #define HDCP2P2_DELETE_PAIRING_INFO 17
  27. static inline int32_t hdcp2p2_release(struct Object self)
  28. {
  29. return Object_invoke(self, Object_OP_release, 0, 0);
  30. }
  31. static inline int32_t hdcp2p2_retain(struct Object self)
  32. {
  33. return Object_invoke(self, Object_OP_retain, 0, 0);
  34. }
  35. static inline int32_t hdcp2p2_provision_key(struct Object self, const void *key_ptr,
  36. size_t key_len,
  37. const void *dps_ptr,
  38. size_t dps_len)
  39. {
  40. union ObjectArg a[2] = {{{0, 0}}};
  41. a[0].bi = (struct ObjectBufIn) {key_ptr, key_len * 1};
  42. a[1].bi = (struct ObjectBufIn) {dps_ptr, dps_len * 1};
  43. return Object_invoke(self, HDCP2P2_PROVISION_KEY, a,
  44. ObjectCounts_pack(2, 0, 0, 0));
  45. }
  46. static inline int32_t hdcp2p2_verify_key(struct Object self)
  47. {
  48. return Object_invoke(self, HDCP2P2_VERIFY_KEY, 0, 0);
  49. }
  50. static inline int32_t hdcp2p2_tx_init(struct Object self, uint32_t sessionid_val,
  51. uint32_t *ctxhandle_ptr)
  52. {
  53. union ObjectArg a[2] = {{{0, 0}}};
  54. a[0].b = (struct ObjectBuf) {&sessionid_val, sizeof(uint32_t)};
  55. a[1].b = (struct ObjectBuf) {ctxhandle_ptr, sizeof(uint32_t)};
  56. return Object_invoke(self, HDCP2P2_TX_INIT, a,
  57. ObjectCounts_pack(1, 1, 0, 0));
  58. }
  59. static inline int32_t hdcp2p2_tx_deinit(struct Object self, uint32_t ctxhandle_val)
  60. {
  61. union ObjectArg a[1] = {{{0, 0}}};
  62. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  63. return Object_invoke(self, HDCP2P2_TX_DEINIT, a,
  64. ObjectCounts_pack(1, 0, 0, 0));
  65. }
  66. static inline int32_t hdcp2p2_rcvd_msg(
  67. struct Object self, const void *reqMsg_ptr, size_t reqMsg_len,
  68. uint32_t ctxhandle_val, void *resMsg_ptr, size_t resMsg_len,
  69. size_t *resMsg_lenout, uint32_t *timeout_ptr, uint32_t *flag_ptr, uint32_t *state_ptr)
  70. {
  71. union ObjectArg a[4] = {{{0, 0}}};
  72. int32_t result = 0;
  73. struct {
  74. uint32_t m_timeout;
  75. uint32_t m_flag;
  76. uint32_t m_state;
  77. } o = {0, 0, 0};
  78. a[2].b = (struct ObjectBuf) {&o, 12};
  79. a[0].bi = (struct ObjectBufIn) {reqMsg_ptr, reqMsg_len * 1};
  80. a[1].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  81. a[3].b = (struct ObjectBuf) {resMsg_ptr, resMsg_len * 1};
  82. result = Object_invoke(self, HDCP2P2_RCVD_MSG, a,
  83. ObjectCounts_pack(2, 2, 0, 0));
  84. *resMsg_lenout = a[3].b.size / 1;
  85. *timeout_ptr = o.m_timeout;
  86. *flag_ptr = o.m_flag;
  87. *state_ptr = o.m_state;
  88. return result;
  89. }
  90. static inline int32_t hdcp2p2_send_timeout(struct Object self, uint32_t ctxhandle_val,
  91. void *resMsg_ptr, size_t resMsg_len,
  92. size_t *resMsg_lenout,
  93. uint32_t *timeout_ptr)
  94. {
  95. union ObjectArg a[3] = {{{0, 0}}};
  96. int32_t result = 0;
  97. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  98. a[1].b = (struct ObjectBuf) {resMsg_ptr, resMsg_len * 1};
  99. a[2].b = (struct ObjectBuf) {timeout_ptr, sizeof(uint32_t)};
  100. result = Object_invoke(self, HDCP2P2_SEND_TIMEOUT, a,
  101. ObjectCounts_pack(1, 2, 0, 0));
  102. *resMsg_lenout = a[1].b.size / 1;
  103. return result;
  104. }
  105. static inline int32_t hdcp2p2_set_hw_key(struct Object self, uint32_t ctxhandle_val)
  106. {
  107. union ObjectArg a[1] = {{{0, 0}}};
  108. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  109. return Object_invoke(self, HDCP2P2_SET_HW_KEY, a,
  110. ObjectCounts_pack(1, 0, 0, 0));
  111. }
  112. static inline int32_t hdcp2p2_query_stream_type(
  113. struct Object self, uint32_t ctxhandle_val, void *resMsg_ptr, size_t resMsg_len,
  114. size_t *resMsg_lenout, uint32_t *timeout_ptr)
  115. {
  116. union ObjectArg a[3] = {{{0, 0}}};
  117. int32_t result = 0;
  118. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  119. a[1].b = (struct ObjectBuf) {resMsg_ptr, resMsg_len * 1};
  120. a[2].b = (struct ObjectBuf) {timeout_ptr, sizeof(uint32_t)};
  121. result = Object_invoke(self, HDCP2P2_QUERY_STREAM_TYPE, a,
  122. ObjectCounts_pack(1, 2, 0, 0));
  123. *resMsg_lenout = a[1].b.size / 1;
  124. return result;
  125. }
  126. static inline int32_t hdcp2p2_init(struct Object self, uint32_t clientVersion_val,
  127. uint32_t *appversion_ptr)
  128. {
  129. union ObjectArg a[2] = {{{0, 0}}};
  130. a[0].b = (struct ObjectBuf) {&clientVersion_val, sizeof(uint32_t)};
  131. a[1].b = (struct ObjectBuf) {appversion_ptr, sizeof(uint32_t)};
  132. return Object_invoke(self, HDCP2P2_INIT, a,
  133. ObjectCounts_pack(1, 1, 0, 0));
  134. }
  135. static inline int32_t hdcp2p2_deinit(struct Object self)
  136. {
  137. return Object_invoke(self, HDCP2P2_DEINIT, 0, 0);
  138. }
  139. static inline int32_t hdcp2p2_version(struct Object self, uint32_t *appversion_ptr)
  140. {
  141. union ObjectArg a[1] = {{{0, 0}}};
  142. a[0].b = (struct ObjectBuf) {appversion_ptr, sizeof(uint32_t)};
  143. return Object_invoke(self, HDCP2P2_VERSION, a,
  144. ObjectCounts_pack(0, 1, 0, 0));
  145. }
  146. static inline int32_t hdcp2p2_session_init(struct Object self, uint32_t deviceId_val,
  147. uint32_t *sessionId_ptr)
  148. {
  149. union ObjectArg a[2] = {{{0, 0}}};
  150. a[0].b = (struct ObjectBuf) {&deviceId_val, sizeof(uint32_t)};
  151. a[1].b = (struct ObjectBuf) {sessionId_ptr, sizeof(uint32_t)};
  152. return Object_invoke(self, HDCP2P2_SESSION_INIT, a,
  153. ObjectCounts_pack(1, 1, 0, 0));
  154. }
  155. static inline int32_t hdcp2p2_session_deinit(struct Object self,
  156. uint32_t sessionId_val)
  157. {
  158. union ObjectArg a[1] = {{{0, 0}}};
  159. a[0].b = (struct ObjectBuf) {&sessionId_val, sizeof(uint32_t)};
  160. return Object_invoke(self, HDCP2P2_SESSION_DEINIT, a,
  161. ObjectCounts_pack(1, 0, 0, 0));
  162. }
  163. static inline int32_t hdcp2p2_start_auth(struct Object self, uint32_t ctxhandle_val,
  164. void *resMsg_ptr, size_t resMsg_len,
  165. size_t *resMsg_lenout,
  166. uint32_t *timeout_ptr,
  167. uint32_t *flag_ptr,
  168. uint32_t *tzctxhandle_ptr)
  169. {
  170. union ObjectArg a[3] = {{{0, 0}}};
  171. int32_t result = 0;
  172. struct {
  173. uint32_t m_timeout;
  174. uint32_t m_flag;
  175. uint32_t m_tzctxhandle;
  176. } o = {0, 0, 0};
  177. a[1].b = (struct ObjectBuf) {&o, 12};
  178. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  179. a[2].b = (struct ObjectBuf) {resMsg_ptr, resMsg_len * 1};
  180. result = Object_invoke(self, HDCP2P2_START_AUTH, a,
  181. ObjectCounts_pack(1, 2, 0, 0));
  182. *resMsg_lenout = a[2].b.size / 1;
  183. *timeout_ptr = o.m_timeout;
  184. *flag_ptr = o.m_flag;
  185. *tzctxhandle_ptr = o.m_tzctxhandle;
  186. return result;
  187. }
  188. static inline int32_t hdcp2p2_session_open_stream(struct Object self,
  189. uint32_t sessionid_val,
  190. uint32_t vcpayloadid_val,
  191. uint32_t stream_number_val,
  192. uint32_t streamMediaType_val,
  193. uint32_t *resStreamId_ptr)
  194. {
  195. union ObjectArg a[2] = {{{0, 0}}};
  196. struct {
  197. uint32_t m_sessionid;
  198. uint32_t m_vcpayloadid;
  199. uint32_t m_stream_number;
  200. uint32_t m_streamMediaType;
  201. } i = {0, 0, 0, 0};
  202. a[0].b = (struct ObjectBuf) {&i, 16};
  203. i.m_sessionid = sessionid_val;
  204. i.m_vcpayloadid = vcpayloadid_val;
  205. i.m_stream_number = stream_number_val;
  206. i.m_streamMediaType = streamMediaType_val;
  207. a[1].b = (struct ObjectBuf) {resStreamId_ptr, sizeof(uint32_t)};
  208. return Object_invoke(self, HDCP2P2_SESSION_OPEN_STREAM, a,
  209. ObjectCounts_pack(1, 1, 0, 0));
  210. }
  211. static inline int32_t hdcp2p2_session_close_stream(struct Object self,
  212. uint32_t sessionid_val,
  213. uint32_t streamId_val)
  214. {
  215. union ObjectArg a[1] = {{{0, 0}}};
  216. struct {
  217. uint32_t m_sessionid;
  218. uint32_t m_streamId;
  219. } i = {0, 0};
  220. a[0].b = (struct ObjectBuf) {&i, 8};
  221. i.m_sessionid = sessionid_val;
  222. i.m_streamId = streamId_val;
  223. return Object_invoke(self, HDCP2P2_SESSION_CLOSE_STREAM, a,
  224. ObjectCounts_pack(1, 0, 0, 0));
  225. }
  226. static inline int32_t hdcp2p2_force_encryption(struct Object self,
  227. uint32_t ctxhandle_val,
  228. uint32_t enable_val)
  229. {
  230. union ObjectArg a[1] = {{{0, 0}}};
  231. struct {
  232. uint32_t m_ctxhandle;
  233. uint32_t m_enable;
  234. } i = {0, 0};
  235. a[0].b = (struct ObjectBuf) {&i, 8};
  236. i.m_ctxhandle = ctxhandle_val;
  237. i.m_enable = enable_val;
  238. return Object_invoke(self, HDCP2P2_FORCE_ENCRYPTION, a,
  239. ObjectCounts_pack(1, 0, 0, 0));
  240. }
  241. static inline int32_t hdcp2p2_delete_pairing_info(struct Object self)
  242. {
  243. return Object_invoke(self, HDCP2P2_DELETE_PAIRING_INFO, 0, 0);
  244. }