blob: a5965c009434beacb2b39fc95a3994f400b9b3b7 [file] [log] [blame]
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +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
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +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.
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010018 */
19
Mikael Olsson16be2852024-02-12 09:56:56 +010020#ifndef ETHOSU_RPMSG_NETWORK_INFO_H
21#define ETHOSU_RPMSG_NETWORK_INFO_H
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010022
23/****************************************************************************
24 * Includes
25 ****************************************************************************/
26
Mikael Olssond4ad9e52024-02-07 11:22:26 +010027#include <rpmsg/ethosu_rpmsg_mailbox.h>
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010028
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010029#include <linux/types.h>
30#include <linux/completion.h>
31
32/****************************************************************************
33 * Types
34 ****************************************************************************/
35
Mikael Olsson16be2852024-02-12 09:56:56 +010036struct ethosu_rpmsg_network_info_rsp;
37struct ethosu_rpmsg_network;
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010038struct ethosu_uapi_network_info;
39
Mikael Olsson16be2852024-02-12 09:56:56 +010040struct ethosu_rpmsg_network_info {
Kristofer Jonssonec477042023-01-20 13:38:13 +010041 struct device *dev;
Mikael Olsson16be2852024-02-12 09:56:56 +010042 struct ethosu_rpmsg_network *net;
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010043 struct ethosu_uapi_network_info *uapi;
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010044 struct completion done;
45 int errno;
Mikael Olsson16be2852024-02-12 09:56:56 +010046 struct ethosu_rpmsg_mailbox_msg msg;
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010047};
48
49/****************************************************************************
50 * Functions
51 ****************************************************************************/
52
53/**
Mikael Olsson16be2852024-02-12 09:56:56 +010054 * ethosu_rpmsg_network_info_request() - Send a network info request
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010055 *
56 * This function must be called in the context of a user space process.
57 *
Davide Grohmann32660f92022-04-27 16:49:07 +020058 * Return: 0 on success, .
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010059 */
Mikael Olsson16be2852024-02-12 09:56:56 +010060int 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 Jonsson3c6a2602022-03-10 11:17:29 +010064
65/**
Mikael Olsson16be2852024-02-12 09:56:56 +010066 * ethosu_rpmsg_network_info_rsp() - Handle network info response.
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010067 */
Mikael Olsson16be2852024-02-12 09:56:56 +010068void ethosu_rpmsg_network_info_rsp(struct ethosu_rpmsg_mailbox *mailbox,
69 int msg_id,
70 struct ethosu_rpmsg_network_info_rsp *rsp);
Kristofer Jonsson3c6a2602022-03-10 11:17:29 +010071
Mikael Olsson16be2852024-02-12 09:56:56 +010072#endif /* ETHOSU_RPMSG_NETWORK_INFO_H */