aboutsummaryrefslogtreecommitdiff
path: root/kernel/rpmsg/ethosu_rpmsg_network_info.c
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2024-02-12 09:56:56 +0100
committerMikael Olsson <mikael.olsson@arm.com>2024-02-12 13:28:26 +0100
commit16be28550f0906e2bfff20b94dd373f59b4a2ccf (patch)
tree72ac8fa23cccacc5db2f4e08e31659eaed60ad51 /kernel/rpmsg/ethosu_rpmsg_network_info.c
parentd4ad9e55cb8e17a4a42b3a94c64e6bc48529b26e (diff)
downloadethos-u-linux-driver-stack-16be28550f0906e2bfff20b94dd373f59b4a2ccf.tar.gz
Rename macros and types to namespace their usage
Macros and types have been renamed accordingly to namespace them by their usage in the new kernel driver source tree structure. This is done in a separate commit from the restructuring to avoid Git from seeing some of the moved files as new ones because they have been both moved and modified at the same time and thus losing the connection in the history. Change-Id: Icd4d8e8c76779479b5b46a55bf1d4f78a629c281 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'kernel/rpmsg/ethosu_rpmsg_network_info.c')
-rw-r--r--kernel/rpmsg/ethosu_rpmsg_network_info.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/kernel/rpmsg/ethosu_rpmsg_network_info.c b/kernel/rpmsg/ethosu_rpmsg_network_info.c
index 0e54d87..36b6290 100644
--- a/kernel/rpmsg/ethosu_rpmsg_network_info.c
+++ b/kernel/rpmsg/ethosu_rpmsg_network_info.c
@@ -31,18 +31,19 @@
#define NETWORK_INFO_RESP_TIMEOUT_MS 3000
-static inline int ethosu_network_info_send(struct ethosu_network_info *info,
- struct ethosu_mailbox *mailbox)
+static inline int ethosu_rpmsg_network_info_send(
+ struct ethosu_rpmsg_network_info *info,
+ struct ethosu_rpmsg_mailbox *mailbox)
{
/* Send network info request to firmware */
- return ethosu_mailbox_network_info_request(mailbox,
- &info->msg,
- info->net);
+ return ethosu_rpmsg_mailbox_network_info_request(mailbox,
+ &info->msg,
+ info->net);
}
-static void ethosu_network_info_fail(struct ethosu_mailbox_msg *msg)
+static void ethosu_rpmsg_network_info_fail(struct ethosu_rpmsg_mailbox_msg *msg)
{
- struct ethosu_network_info *info =
+ struct ethosu_rpmsg_network_info *info =
container_of(msg, typeof(*info), msg);
if (completion_done(&info->done))
@@ -52,12 +53,12 @@ static void ethosu_network_info_fail(struct ethosu_mailbox_msg *msg)
complete(&info->done);
}
-int ethosu_network_info_request(struct device *dev,
- struct ethosu_mailbox *mailbox,
- struct ethosu_network *net,
- struct ethosu_uapi_network_info *uapi)
+int ethosu_rpmsg_network_info_request(struct device *dev,
+ struct ethosu_rpmsg_mailbox *mailbox,
+ struct ethosu_rpmsg_network *net,
+ struct ethosu_uapi_network_info *uapi)
{
- struct ethosu_network_info *info;
+ struct ethosu_rpmsg_network_info *info;
int ret;
int timeout;
@@ -69,16 +70,16 @@ int ethosu_network_info_request(struct device *dev,
info->net = net;
info->uapi = uapi;
init_completion(&info->done);
- info->msg.fail = ethosu_network_info_fail;
+ info->msg.fail = ethosu_rpmsg_network_info_fail;
- ret = ethosu_mailbox_register(mailbox, &info->msg);
+ ret = ethosu_rpmsg_mailbox_register(mailbox, &info->msg);
if (ret < 0)
goto kfree;
/* Get reference to network */
- ethosu_network_get(info->net);
+ ethosu_rpmsg_network_get(info->net);
- ret = ethosu_network_info_send(info, mailbox);
+ ret = ethosu_rpmsg_network_info_send(info, mailbox);
if (ret)
goto deregister;
@@ -104,8 +105,8 @@ int ethosu_network_info_request(struct device *dev,
ret = info->errno;
deregister:
- ethosu_mailbox_deregister(mailbox, &info->msg);
- ethosu_network_put(info->net);
+ ethosu_rpmsg_mailbox_deregister(mailbox, &info->msg);
+ ethosu_rpmsg_network_put(info->net);
kfree:
dev_dbg(dev,
@@ -116,21 +117,21 @@ kfree:
return ret;
}
-void ethosu_network_info_rsp(struct ethosu_mailbox *mailbox,
- int msg_id,
- struct ethosu_core_msg_network_info_rsp *rsp)
+void ethosu_rpmsg_network_info_rsp(struct ethosu_rpmsg_mailbox *mailbox,
+ int msg_id,
+ struct ethosu_rpmsg_network_info_rsp *rsp)
{
int ret;
struct device *dev = mailbox->dev;
- struct ethosu_mailbox_msg *msg;
- struct ethosu_network_info *info;
+ struct ethosu_rpmsg_mailbox_msg *msg;
+ struct ethosu_rpmsg_network_info *info;
uint32_t i;
const size_t rsp_desc_size = sizeof(rsp->desc);
BUILD_BUG_ON(rsp_desc_size != sizeof(info->uapi->desc));
- msg = ethosu_mailbox_find(mailbox, msg_id,
- ETHOSU_CORE_MSG_NETWORK_INFO_REQ);
+ msg = ethosu_rpmsg_mailbox_find(mailbox, msg_id,
+ ETHOSU_RPMSG_NETWORK_INFO_REQ);
if (IS_ERR(msg)) {
dev_warn(dev,
"Id for network info msg not found. Id=0x%x: %ld\n",
@@ -146,7 +147,7 @@ void ethosu_network_info_rsp(struct ethosu_mailbox *mailbox,
info->errno = 0;
- if (rsp->status != ETHOSU_CORE_STATUS_OK) {
+ if (rsp->status != ETHOSU_RPMSG_STATUS_OK) {
dev_err(dev, "Failed to get information about the network\n");
info->errno = -EBADF;
goto signal_complete;