Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 1 | /* |
Mikael Olsson | d4ad9e5 | 2024-02-07 11:22:26 +0100 | [diff] [blame] | 2 | * SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its affiliates <open-source-office@arm.com> |
| 3 | * SPDX-License-Identifier: GPL-2.0-only |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 4 | * |
| 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. |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 18 | */ |
| 19 | |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 20 | #ifndef ETHOSU_RPMSG_NETWORK_INFO_H |
| 21 | #define ETHOSU_RPMSG_NETWORK_INFO_H |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 22 | |
| 23 | /**************************************************************************** |
| 24 | * Includes |
| 25 | ****************************************************************************/ |
| 26 | |
Mikael Olsson | d4ad9e5 | 2024-02-07 11:22:26 +0100 | [diff] [blame] | 27 | #include <rpmsg/ethosu_rpmsg_mailbox.h> |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 28 | |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 29 | #include <linux/types.h> |
| 30 | #include <linux/completion.h> |
| 31 | |
| 32 | /**************************************************************************** |
| 33 | * Types |
| 34 | ****************************************************************************/ |
| 35 | |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 36 | struct ethosu_rpmsg_network_info_rsp; |
| 37 | struct ethosu_rpmsg_network; |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 38 | struct ethosu_uapi_network_info; |
| 39 | |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 40 | struct ethosu_rpmsg_network_info { |
Kristofer Jonsson | ec47704 | 2023-01-20 13:38:13 +0100 | [diff] [blame] | 41 | struct device *dev; |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 42 | struct ethosu_rpmsg_network *net; |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 43 | struct ethosu_uapi_network_info *uapi; |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 44 | struct completion done; |
| 45 | int errno; |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 46 | struct ethosu_rpmsg_mailbox_msg msg; |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | /**************************************************************************** |
| 50 | * Functions |
| 51 | ****************************************************************************/ |
| 52 | |
| 53 | /** |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 54 | * ethosu_rpmsg_network_info_request() - Send a network info request |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 55 | * |
| 56 | * This function must be called in the context of a user space process. |
| 57 | * |
Davide Grohmann | 32660f9 | 2022-04-27 16:49:07 +0200 | [diff] [blame] | 58 | * Return: 0 on success, . |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 59 | */ |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 60 | int ethosu_rpmsg_network_info_request(struct device *dev, |
| 61 | struct ethosu_rpmsg_mailbox *mailbox, |
| 62 | struct ethosu_rpmsg_network *net, |
| 63 | struct ethosu_uapi_network_info *uapi); |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 64 | |
| 65 | /** |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 66 | * ethosu_rpmsg_network_info_rsp() - Handle network info response. |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 67 | */ |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 68 | void ethosu_rpmsg_network_info_rsp(struct ethosu_rpmsg_mailbox *mailbox, |
| 69 | int msg_id, |
| 70 | struct ethosu_rpmsg_network_info_rsp *rsp); |
Kristofer Jonsson | 3c6a260 | 2022-03-10 11:17:29 +0100 | [diff] [blame] | 71 | |
Mikael Olsson | 16be285 | 2024-02-12 09:56:56 +0100 | [diff] [blame] | 72 | #endif /* ETHOSU_RPMSG_NETWORK_INFO_H */ |