aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tee/optee/optee_msg.h26
-rw-r--r--drivers/tee/optee/optee_smc.h26
-rw-r--r--drivers/tee/tee_core.c9
-rw-r--r--include/linux/tee_drv.h12
4 files changed, 25 insertions, 48 deletions
diff --git a/drivers/tee/optee/optee_msg.h b/drivers/tee/optee/optee_msg.h
index 30504901be80..795bc19ae17a 100644
--- a/drivers/tee/optee/optee_msg.h
+++ b/drivers/tee/optee/optee_msg.h
@@ -1,28 +1,6 @@
1/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
1/* 2/*
2 * Copyright (c) 2015-2016, Linaro Limited 3 * Copyright (c) 2015-2019, Linaro Limited
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
26 */ 4 */
27#ifndef _OPTEE_MSG_H 5#ifndef _OPTEE_MSG_H
28#define _OPTEE_MSG_H 6#define _OPTEE_MSG_H
diff --git a/drivers/tee/optee/optee_smc.h b/drivers/tee/optee/optee_smc.h
index bbf0cf028c16..c72122d9c997 100644
--- a/drivers/tee/optee/optee_smc.h
+++ b/drivers/tee/optee/optee_smc.h
@@ -1,28 +1,6 @@
1/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
1/* 2/*
2 * Copyright (c) 2015-2016, Linaro Limited 3 * Copyright (c) 2015-2019, Linaro Limited
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
26 */ 4 */
27#ifndef OPTEE_SMC_H 5#ifndef OPTEE_SMC_H
28#define OPTEE_SMC_H 6#define OPTEE_SMC_H
diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
index 06fbfc044ea3..17c64fccbb10 100644
--- a/drivers/tee/tee_core.c
+++ b/drivers/tee/tee_core.c
@@ -1041,6 +1041,15 @@ int tee_client_invoke_func(struct tee_context *ctx,
1041} 1041}
1042EXPORT_SYMBOL_GPL(tee_client_invoke_func); 1042EXPORT_SYMBOL_GPL(tee_client_invoke_func);
1043 1043
1044int tee_client_cancel_req(struct tee_context *ctx,
1045 struct tee_ioctl_cancel_arg *arg)
1046{
1047 if (!ctx->teedev->desc->ops->cancel_req)
1048 return -EINVAL;
1049 return ctx->teedev->desc->ops->cancel_req(ctx, arg->cancel_id,
1050 arg->session);
1051}
1052
1044static int tee_client_device_match(struct device *dev, 1053static int tee_client_device_match(struct device *dev,
1045 struct device_driver *drv) 1054 struct device_driver *drv)
1046{ 1055{
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
index 56d7f1b4516d..4a49f80e7f71 100644
--- a/include/linux/tee_drv.h
+++ b/include/linux/tee_drv.h
@@ -535,6 +535,18 @@ int tee_client_invoke_func(struct tee_context *ctx,
535 struct tee_ioctl_invoke_arg *arg, 535 struct tee_ioctl_invoke_arg *arg,
536 struct tee_param *param); 536 struct tee_param *param);
537 537
538/**
539 * tee_client_cancel_req() - Request cancellation of the previous open-session
540 * or invoke-command operations in a Trusted Application
541 * @ctx: TEE Context
542 * @arg: Cancellation arguments, see description of
543 * struct tee_ioctl_cancel_arg
544 *
545 * Returns < 0 on error else 0 if the cancellation was successfully requested.
546 */
547int tee_client_cancel_req(struct tee_context *ctx,
548 struct tee_ioctl_cancel_arg *arg);
549
538static inline bool tee_param_is_memref(struct tee_param *param) 550static inline bool tee_param_is_memref(struct tee_param *param)
539{ 551{
540 switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) { 552 switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {