hdcp2p2.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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)
  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. } o;
  77. a[2].b = (struct ObjectBuf) {&o, 8};
  78. a[0].bi = (struct ObjectBufIn) {reqMsg_ptr, reqMsg_len * 1};
  79. a[1].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  80. a[3].b = (struct ObjectBuf) {resMsg_ptr, resMsg_len * 1};
  81. result = Object_invoke(self, HDCP2P2_RCVD_MSG, a,
  82. ObjectCounts_pack(2, 2, 0, 0));
  83. *resMsg_lenout = a[3].b.size / 1;
  84. *timeout_ptr = o.m_timeout;
  85. *flag_ptr = o.m_flag;
  86. return result;
  87. }
  88. static inline int32_t hdcp2p2_send_timeout(struct Object self, uint32_t ctxhandle_val,
  89. void *resMsg_ptr, size_t resMsg_len,
  90. size_t *resMsg_lenout,
  91. uint32_t *timeout_ptr)
  92. {
  93. union ObjectArg a[3] = {{{0, 0}}};
  94. int32_t result = 0;
  95. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  96. a[1].b = (struct ObjectBuf) {resMsg_ptr, resMsg_len * 1};
  97. a[2].b = (struct ObjectBuf) {timeout_ptr, sizeof(uint32_t)};
  98. result = Object_invoke(self, HDCP2P2_SEND_TIMEOUT, a,
  99. ObjectCounts_pack(1, 2, 0, 0));
  100. *resMsg_lenout = a[1].b.size / 1;
  101. return result;
  102. }
  103. static inline int32_t hdcp2p2_set_hw_key(struct Object self, uint32_t ctxhandle_val)
  104. {
  105. union ObjectArg a[1] = {{{0, 0}}};
  106. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  107. return Object_invoke(self, HDCP2P2_SET_HW_KEY, a,
  108. ObjectCounts_pack(1, 0, 0, 0));
  109. }
  110. static inline int32_t hdcp2p2_query_stream_type(
  111. struct Object self, uint32_t ctxhandle_val, void *resMsg_ptr, size_t resMsg_len,
  112. size_t *resMsg_lenout, uint32_t *timeout_ptr)
  113. {
  114. union ObjectArg a[3] = {{{0, 0}}};
  115. int32_t result = 0;
  116. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  117. a[1].b = (struct ObjectBuf) {resMsg_ptr, resMsg_len * 1};
  118. a[2].b = (struct ObjectBuf) {timeout_ptr, sizeof(uint32_t)};
  119. result = Object_invoke(self, HDCP2P2_QUERY_STREAM_TYPE, a,
  120. ObjectCounts_pack(1, 2, 0, 0));
  121. *resMsg_lenout = a[1].b.size / 1;
  122. return result;
  123. }
  124. static inline int32_t hdcp2p2_init(struct Object self, uint32_t clientVersion_val,
  125. uint32_t *appversion_ptr)
  126. {
  127. union ObjectArg a[2] = {{{0, 0}}};
  128. a[0].b = (struct ObjectBuf) {&clientVersion_val, sizeof(uint32_t)};
  129. a[1].b = (struct ObjectBuf) {appversion_ptr, sizeof(uint32_t)};
  130. return Object_invoke(self, HDCP2P2_INIT, a,
  131. ObjectCounts_pack(1, 1, 0, 0));
  132. }
  133. static inline int32_t hdcp2p2_deinit(struct Object self)
  134. {
  135. return Object_invoke(self, HDCP2P2_DEINIT, 0, 0);
  136. }
  137. static inline int32_t hdcp2p2_version(struct Object self, uint32_t *appversion_ptr)
  138. {
  139. union ObjectArg a[1] = {{{0, 0}}};
  140. a[0].b = (struct ObjectBuf) {appversion_ptr, sizeof(uint32_t)};
  141. return Object_invoke(self, HDCP2P2_VERSION, a,
  142. ObjectCounts_pack(0, 1, 0, 0));
  143. }
  144. static inline int32_t hdcp2p2_session_init(struct Object self, uint32_t deviceId_val,
  145. uint32_t *sessionId_ptr)
  146. {
  147. union ObjectArg a[2] = {{{0, 0}}};
  148. a[0].b = (struct ObjectBuf) {&deviceId_val, sizeof(uint32_t)};
  149. a[1].b = (struct ObjectBuf) {sessionId_ptr, sizeof(uint32_t)};
  150. return Object_invoke(self, HDCP2P2_SESSION_INIT, a,
  151. ObjectCounts_pack(1, 1, 0, 0));
  152. }
  153. static inline int32_t hdcp2p2_session_deinit(struct Object self,
  154. uint32_t sessionId_val)
  155. {
  156. union ObjectArg a[1] = {{{0, 0}}};
  157. a[0].b = (struct ObjectBuf) {&sessionId_val, sizeof(uint32_t)};
  158. return Object_invoke(self, HDCP2P2_SESSION_DEINIT, a,
  159. ObjectCounts_pack(1, 0, 0, 0));
  160. }
  161. static inline int32_t hdcp2p2_start_auth(struct Object self, uint32_t ctxhandle_val,
  162. void *resMsg_ptr, size_t resMsg_len,
  163. size_t *resMsg_lenout,
  164. uint32_t *timeout_ptr,
  165. uint32_t *flag_ptr,
  166. uint32_t *tzctxhandle_ptr)
  167. {
  168. union ObjectArg a[3] = {{{0, 0}}};
  169. int32_t result = 0;
  170. struct {
  171. uint32_t m_timeout;
  172. uint32_t m_flag;
  173. uint32_t m_tzctxhandle;
  174. } o;
  175. a[1].b = (struct ObjectBuf) {&o, 12};
  176. a[0].b = (struct ObjectBuf) {&ctxhandle_val, sizeof(uint32_t)};
  177. a[2].b = (struct ObjectBuf) {resMsg_ptr, resMsg_len * 1};
  178. result = Object_invoke(self, HDCP2P2_START_AUTH, a,
  179. ObjectCounts_pack(1, 2, 0, 0));
  180. *resMsg_lenout = a[2].b.size / 1;
  181. *timeout_ptr = o.m_timeout;
  182. *flag_ptr = o.m_flag;
  183. *tzctxhandle_ptr = o.m_tzctxhandle;
  184. return result;
  185. }
  186. static inline int32_t hdcp2p2_session_open_stream(struct Object self,
  187. uint32_t sessionid_val,
  188. uint32_t vcpayloadid_val,
  189. uint32_t stream_number_val,
  190. uint32_t streamMediaType_val,
  191. uint32_t *resStreamId_ptr)
  192. {
  193. union ObjectArg a[2] = {{{0, 0}}};
  194. struct {
  195. uint32_t m_sessionid;
  196. uint32_t m_vcpayloadid;
  197. uint32_t m_stream_number;
  198. uint32_t m_streamMediaType;
  199. } i;
  200. a[0].b = (struct ObjectBuf) {&i, 16};
  201. i.m_sessionid = sessionid_val;
  202. i.m_vcpayloadid = vcpayloadid_val;
  203. i.m_stream_number = stream_number_val;
  204. i.m_streamMediaType = streamMediaType_val;
  205. a[1].b = (struct ObjectBuf) {resStreamId_ptr, sizeof(uint32_t)};
  206. return Object_invoke(self, HDCP2P2_SESSION_OPEN_STREAM, a,
  207. ObjectCounts_pack(1, 1, 0, 0));
  208. }
  209. static inline int32_t hdcp2p2_session_close_stream(struct Object self,
  210. uint32_t sessionid_val,
  211. uint32_t streamId_val)
  212. {
  213. union ObjectArg a[1] = {{{0, 0}}};
  214. struct {
  215. uint32_t m_sessionid;
  216. uint32_t m_streamId;
  217. } i;
  218. a[0].b = (struct ObjectBuf) {&i, 8};
  219. i.m_sessionid = sessionid_val;
  220. i.m_streamId = streamId_val;
  221. return Object_invoke(self, HDCP2P2_SESSION_CLOSE_STREAM, a,
  222. ObjectCounts_pack(1, 0, 0, 0));
  223. }
  224. static inline int32_t hdcp2p2_force_encryption(struct Object self,
  225. uint32_t ctxhandle_val,
  226. uint32_t enable_val)
  227. {
  228. union ObjectArg a[1] = {{{0, 0}}};
  229. struct {
  230. uint32_t m_ctxhandle;
  231. uint32_t m_enable;
  232. } i;
  233. a[0].b = (struct ObjectBuf) {&i, 8};
  234. i.m_ctxhandle = ctxhandle_val;
  235. i.m_enable = enable_val;
  236. return Object_invoke(self, HDCP2P2_FORCE_ENCRYPTION, a,
  237. ObjectCounts_pack(1, 0, 0, 0));
  238. }
  239. static inline int32_t hdcp2p2_delete_pairing_info(struct Object self)
  240. {
  241. return Object_invoke(self, HDCP2P2_DELETE_PAIRING_INFO, 0, 0);
  242. }