android_kernel_msm-6.1_noth.../include/linux/qseecom_kernel.h
Anmolpreet Kaur 91fd24bcdd drivers: misc: Add qseecom proxy module
qseecom proxy module serves kernel clients
by providing required ops to smcinvoke and
qseecom drivers  via call back functions
with a minimal framework.

Change-Id: I1974329e4699f72cd1e41fb723acd72959e21ba2
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
Signed-off-by: Smita Ghosh <quic_smitag@quicinc.com>
2022-12-15 07:13:31 +05:30

50 lines
1.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef __QSEECOM_KERNEL_H_
#define __QSEECOM_KERNEL_H_
#include <linux/types.h>
#define QSEECOM_ALIGN_SIZE 0x40
#define QSEECOM_ALIGN_MASK (QSEECOM_ALIGN_SIZE - 1)
#define QSEECOM_ALIGN(x) \
((x + QSEECOM_ALIGN_MASK) & (~QSEECOM_ALIGN_MASK))
/*
* struct qseecom_handle -
* Handle to the qseecom device for kernel clients
* @dev - qseecom_dev_handle
* @sbuf - shared buffer pointer
* @sbbuf_len - shared buffer size
*/
struct qseecom_handle {
void *dev; /* in/out */
unsigned char *sbuf; /* in/out */
uint32_t sbuf_len; /* in/out */
};
int qseecom_start_app(struct qseecom_handle **handle,
char *app_name,
uint32_t size);
int qseecom_shutdown_app(struct qseecom_handle **handle);
int qseecom_send_command(struct qseecom_handle *handle,
void *send_buf, uint32_t sbuf_len,
void *resp_buf, uint32_t rbuf_len);
#if IS_ENABLED(CONFIG_QSEECOM_PROXY)
struct qseecom_drv_ops {
int (*qseecom_send_command)(struct qseecom_handle *handle, void *send_buf,
uint32_t sbuf_len, void *resp_buf, uint32_t rbuf_len);
int (*qseecom_start_app)(struct qseecom_handle **handle,
char *app_name, uint32_t size);
int (*qseecom_shutdown_app)(struct qseecom_handle **handle);
};
int provide_qseecom_kernel_fun_ops(const struct qseecom_drv_ops *ops);
#endif
#endif /* __QSEECOM_KERNEL_H_ */