qseecom_kernel.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef __QSEECOM_KERNEL_H_
  6. #define __QSEECOM_KERNEL_H_
  7. #include <linux/types.h>
  8. #define QSEECOM_ALIGN_SIZE 0x40
  9. #define QSEECOM_ALIGN_MASK (QSEECOM_ALIGN_SIZE - 1)
  10. #define QSEECOM_ALIGN(x) \
  11. ((x + QSEECOM_ALIGN_MASK) & (~QSEECOM_ALIGN_MASK))
  12. /*
  13. * struct qseecom_handle -
  14. * Handle to the qseecom device for kernel clients
  15. * @dev - qseecom_dev_handle
  16. * @sbuf - shared buffer pointer
  17. * @sbbuf_len - shared buffer size
  18. */
  19. struct qseecom_handle {
  20. void *dev; /* in/out */
  21. unsigned char *sbuf; /* in/out */
  22. uint32_t sbuf_len; /* in/out */
  23. };
  24. int qseecom_start_app(struct qseecom_handle **handle,
  25. char *app_name,
  26. uint32_t size);
  27. int qseecom_shutdown_app(struct qseecom_handle **handle);
  28. int qseecom_send_command(struct qseecom_handle *handle,
  29. void *send_buf, uint32_t sbuf_len,
  30. void *resp_buf, uint32_t rbuf_len);
  31. #if IS_ENABLED(CONFIG_QSEECOM_PROXY)
  32. struct qseecom_drv_ops {
  33. int (*qseecom_send_command)(struct qseecom_handle *handle, void *send_buf,
  34. uint32_t sbuf_len, void *resp_buf, uint32_t rbuf_len);
  35. int (*qseecom_start_app)(struct qseecom_handle **handle,
  36. char *app_name, uint32_t size);
  37. int (*qseecom_shutdown_app)(struct qseecom_handle **handle);
  38. };
  39. int provide_qseecom_kernel_fun_ops(const struct qseecom_drv_ops *ops);
  40. #endif
  41. #endif /* __QSEECOM_KERNEL_H_ */