blob: 94d9fe1920fe099ef8d76042302a892ad0e54b70 [file] [log] [blame]
Davide Grohmann7e8f5082022-03-23 12:48:45 +01001/*
2 * Copyright (c) 2022 ARM Limited.
3 *
4 * This program is free software and is provided to you under the terms of the
5 * GNU General Public License version 2 as published by the Free Software
6 * Foundation, and any use by you of this program is subject to the terms
7 * of such GNU licence.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, you can access it online at
16 * http://www.gnu.org/licenses/gpl-2.0.html.
17 *
18 * SPDX-License-Identifier: GPL-2.0-only
19 */
20
21#ifndef ETHOSU_CANCEL_INFERENCE_H
22#define ETHOSU_CANCEL_INFERENCE_H
23
24/****************************************************************************
25 * Includes
26 ****************************************************************************/
27
28#include "ethosu_mailbox.h"
29#include "uapi/ethosu.h"
30
31#include <linux/kref.h>
32#include <linux/types.h>
33#include <linux/completion.h>
34
35/****************************************************************************
36 * Types
37 ****************************************************************************/
38
39struct ethosu_core_cancel_inference_rsp;
40struct ethosu_device;
41struct ethosu_uapi_cancel_inference_status;
42struct ethosu_inference;
43
44struct ethosu_cancel_inference {
45 struct ethosu_device *edev;
46 struct ethosu_inference *inf;
47 struct ethosu_uapi_cancel_inference_status *uapi;
48 struct kref kref;
49 struct completion done;
50 struct ethosu_mailbox_msg msg;
51 int errno;
52};
53
54/****************************************************************************
55 * Functions
56 ****************************************************************************/
57
58/**
59 * ethosu_cancel_inference_request() - Send cancel inference request
60 *
61 * Return: 0 on success, error code otherwise.
62 */
63int ethosu_cancel_inference_request(struct ethosu_inference *inf,
64 struct ethosu_uapi_cancel_inference_status *uapi);
65
66/**
67 * ethosu_cancel_inference_rsp() - Handle cancel inference response
68 */
69void ethosu_cancel_inference_rsp(struct ethosu_device *edev,
70 struct ethosu_core_cancel_inference_rsp *rsp);
71
72#endif /* ETHOSU_CANCEL_INFERENCE_H */