In macro QSEECOM_ALIGN, change (x + QSEECOM_ALIGN_SIZE) to (x + QSEECOM_ALIGN_MASK); otherwise, when x is already aligned, QSEECOM_ALIGN(x) will get (x + QSEECOM_ALIGN_SIZE), but it should be x. Also, remove the dulplicate QSEECOM_ALIGN definition in hdcp.c and mpq_sdmx.c, since they already include "qseecom_kernel.h" Change-Id: I9dbcadb618372fce71c2ff7ab62ca691afe7c7fa Signed-off-by: Zhen Kong <zkong@codeaurora.org>
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
/* Copyright (c) 2012-2013, 2016-2017 The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
* only version 2 as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef __QSEECOM_KERNEL_H_
|
|
#define __QSEECOM_KERNEL_H_
|
|
|
|
#include <linux/types.h>
|
|
#include <soc/qcom/scm.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
|
|
* @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);
|
|
int qseecom_set_bandwidth(struct qseecom_handle *handle, bool high);
|
|
int qseecom_process_listener_from_smcinvoke(struct scm_desc *desc);
|
|
|
|
#endif /* __QSEECOM_KERNEL_H_ */
|