Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 1 | /* |
Kristofer Jonsson | d779a08 | 2023-01-04 17:09:47 +0100 | [diff] [blame] | 2 | * Copyright 2022-2023 Arm Limited and/or its affiliates |
Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 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 | |
Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 31 | #include <linux/types.h> |
| 32 | #include <linux/completion.h> |
| 33 | |
| 34 | /**************************************************************************** |
| 35 | * Types |
| 36 | ****************************************************************************/ |
| 37 | |
Kristofer Jonsson | d779a08 | 2023-01-04 17:09:47 +0100 | [diff] [blame] | 38 | struct ethosu_core_msg_cancel_inference_rsp; |
Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 39 | struct ethosu_inference; |
Kristofer Jonsson | d779a08 | 2023-01-04 17:09:47 +0100 | [diff] [blame] | 40 | struct ethosu_uapi_cancel_inference_status; |
Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 41 | |
| 42 | struct ethosu_cancel_inference { |
Kristofer Jonsson | ec47704 | 2023-01-20 13:38:13 +0100 | [diff] [blame] | 43 | struct device *dev; |
Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 44 | struct ethosu_inference *inf; |
| 45 | struct ethosu_uapi_cancel_inference_status *uapi; |
Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 46 | struct completion done; |
| 47 | struct ethosu_mailbox_msg msg; |
| 48 | int errno; |
| 49 | }; |
| 50 | |
| 51 | /**************************************************************************** |
| 52 | * Functions |
| 53 | ****************************************************************************/ |
| 54 | |
| 55 | /** |
| 56 | * ethosu_cancel_inference_request() - Send cancel inference request |
| 57 | * |
| 58 | * Return: 0 on success, error code otherwise. |
| 59 | */ |
Kristofer Jonsson | ec47704 | 2023-01-20 13:38:13 +0100 | [diff] [blame] | 60 | int ethosu_cancel_inference_request(struct device *dev, |
| 61 | struct ethosu_mailbox *mailbox, |
| 62 | struct ethosu_inference *inf, |
Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 63 | struct ethosu_uapi_cancel_inference_status *uapi); |
| 64 | |
| 65 | /** |
| 66 | * ethosu_cancel_inference_rsp() - Handle cancel inference response |
| 67 | */ |
Kristofer Jonsson | ec47704 | 2023-01-20 13:38:13 +0100 | [diff] [blame] | 68 | void ethosu_cancel_inference_rsp(struct ethosu_mailbox *mailbox, |
Kristofer Jonsson | d779a08 | 2023-01-04 17:09:47 +0100 | [diff] [blame] | 69 | int msg_id, |
| 70 | struct ethosu_core_msg_cancel_inference_rsp *rsp); |
Davide Grohmann | 7e8f508 | 2022-03-23 12:48:45 +0100 | [diff] [blame] | 71 | |
| 72 | #endif /* ETHOSU_CANCEL_INFERENCE_H */ |