blob: a809d35cd5a02172312c27ada6efb09c53cdf957 [file] [log] [blame]
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +01001/*
Kristofer Jonssond779a082023-01-04 17:09:47 +01002 * Copyright 2022-2023 Arm Limited and/or its affiliates
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +01003 *
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_NETWORK_INFO_H
22#define ETHOSU_NETWORK_INFO_H
23
24/****************************************************************************
25 * Includes
26 ****************************************************************************/
27
Kristofer Jonsson442fefb2022-03-17 17:15:52 +010028#include "ethosu_mailbox.h"
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010029
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +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_network_info_rsp;
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010038struct ethosu_device;
39struct ethosu_network;
40struct ethosu_uapi_network_info;
41
42struct ethosu_network_info {
43 struct ethosu_device *edev;
44 struct ethosu_network *net;
45 struct ethosu_uapi_network_info *uapi;
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010046 struct completion done;
47 int errno;
Kristofer Jonsson442fefb2022-03-17 17:15:52 +010048 struct ethosu_mailbox_msg msg;
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010049};
50
51/****************************************************************************
52 * Functions
53 ****************************************************************************/
54
55/**
Davide Grohmann32660f92022-04-27 16:49:07 +020056 * ethosu_network_info_request() - Send a network info request
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010057 *
58 * This function must be called in the context of a user space process.
59 *
Davide Grohmann32660f92022-04-27 16:49:07 +020060 * Return: 0 on success, .
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010061 */
Davide Grohmann32660f92022-04-27 16:49:07 +020062int ethosu_network_info_request(struct ethosu_network *net,
63 struct ethosu_uapi_network_info *uapi);
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010064
65/**
66 * ethosu_network_info_rsp() - Handle network info response.
67 */
68void ethosu_network_info_rsp(struct ethosu_device *edev,
Kristofer Jonssond779a082023-01-04 17:09:47 +010069 int msg_id,
70 struct ethosu_core_msg_network_info_rsp *rsp);
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010071
72#endif /* ETHOSU_NETWORK_INFO_H */