blob: 1d6cc0349b0bd46bd9980a37beefa21502995b9b [file] [log] [blame]
Davide Grohmann7e8f5082022-03-23 12:48:45 +01001/*
Mikael Olssond4ad9e52024-02-07 11:22:26 +01002 * SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
3 * SPDX-License-Identifier: GPL-2.0-only
Davide Grohmann7e8f5082022-03-23 12:48:45 +01004 *
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
8 * of such GNU licence.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, you can access it online at
17 * http://www.gnu.org/licenses/gpl-2.0.html.
Davide Grohmann7e8f5082022-03-23 12:48:45 +010018 */
19
20#ifndef ETHOSU_CANCEL_INFERENCE_H
21#define ETHOSU_CANCEL_INFERENCE_H
22
23/****************************************************************************
24 * Includes
25 ****************************************************************************/
26
Mikael Olssond4ad9e52024-02-07 11:22:26 +010027#include <rpmsg/ethosu_rpmsg_mailbox.h>
28#include <uapi/ethosu.h>
Davide Grohmann7e8f5082022-03-23 12:48:45 +010029
Davide Grohmann7e8f5082022-03-23 12:48:45 +010030#include <linux/types.h>
31#include <linux/completion.h>
32
33/****************************************************************************
34 * Types
35 ****************************************************************************/
36
Kristofer Jonssond779a082023-01-04 17:09:47 +010037struct ethosu_core_msg_cancel_inference_rsp;
Davide Grohmann7e8f5082022-03-23 12:48:45 +010038struct ethosu_inference;
Kristofer Jonssond779a082023-01-04 17:09:47 +010039struct ethosu_uapi_cancel_inference_status;
Davide Grohmann7e8f5082022-03-23 12:48:45 +010040
41struct ethosu_cancel_inference {
Kristofer Jonssonec477042023-01-20 13:38:13 +010042 struct device *dev;
Davide Grohmann7e8f5082022-03-23 12:48:45 +010043 struct ethosu_inference *inf;
44 struct ethosu_uapi_cancel_inference_status *uapi;
Davide Grohmann7e8f5082022-03-23 12:48:45 +010045 struct completion done;
46 struct ethosu_mailbox_msg msg;
47 int errno;
48};
49
50/****************************************************************************
51 * Functions
52 ****************************************************************************/
53
54/**
55 * ethosu_cancel_inference_request() - Send cancel inference request
56 *
57 * Return: 0 on success, error code otherwise.
58 */
Kristofer Jonssonec477042023-01-20 13:38:13 +010059int ethosu_cancel_inference_request(struct device *dev,
60 struct ethosu_mailbox *mailbox,
61 struct ethosu_inference *inf,
Davide Grohmann7e8f5082022-03-23 12:48:45 +010062 struct ethosu_uapi_cancel_inference_status *uapi);
63
64/**
65 * ethosu_cancel_inference_rsp() - Handle cancel inference response
66 */
Kristofer Jonssonec477042023-01-20 13:38:13 +010067void ethosu_cancel_inference_rsp(struct ethosu_mailbox *mailbox,
Kristofer Jonssond779a082023-01-04 17:09:47 +010068 int msg_id,
69 struct ethosu_core_msg_cancel_inference_rsp *rsp);
Davide Grohmann7e8f5082022-03-23 12:48:45 +010070
71#endif /* ETHOSU_CANCEL_INFERENCE_H */