Lines Matching +full:rpmsg +full:- +full:channel +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) STMicroelectronics 2020 - All Rights Reserved
8 #include <linux/rpmsg.h>
9 #include <linux/rpmsg/ns.h>
15 * rpmsg_ns_register_device() - register name service device based on rpdev
19 * basis for the rpmsg name service device.
23 rpdev->src = RPMSG_NS_ADDR; in rpmsg_ns_register_device()
24 rpdev->dst = RPMSG_NS_ADDR; in rpmsg_ns_register_device()
30 /* invoked when a name service announcement arrives */
37 struct device *dev = rpdev->dev.parent; in rpmsg_ns_cb()
47 return -EINVAL; in rpmsg_ns_cb()
50 /* don't trust the remote processor for null terminating the name */ in rpmsg_ns_cb()
51 msg->name[RPMSG_NAME_SIZE - 1] = '\0'; in rpmsg_ns_cb()
53 strscpy_pad(chinfo.name, msg->name, sizeof(chinfo.name)); in rpmsg_ns_cb()
55 chinfo.dst = rpmsg32_to_cpu(rpdev, msg->addr); in rpmsg_ns_cb()
57 dev_info(dev, "%sing channel %s addr 0x%x\n", in rpmsg_ns_cb()
58 rpmsg32_to_cpu(rpdev, msg->flags) & RPMSG_NS_DESTROY ? in rpmsg_ns_cb()
59 "destroy" : "creat", msg->name, chinfo.dst); in rpmsg_ns_cb()
61 if (rpmsg32_to_cpu(rpdev, msg->flags) & RPMSG_NS_DESTROY) { in rpmsg_ns_cb()
80 .name = "name_service", in rpmsg_ns_probe()
84 * Create the NS announcement service endpoint associated to the RPMsg in rpmsg_ns_probe()
85 * device. The endpoint will be automatically destroyed when the RPMsg in rpmsg_ns_probe()
90 dev_err(&rpdev->dev, "failed to create the ns ept\n"); in rpmsg_ns_probe()
91 return -ENOMEM; in rpmsg_ns_probe()
93 rpdev->ept = ns_ept; in rpmsg_ns_probe()
99 .drv.name = KBUILD_MODNAME,
109 pr_err("%s: Failed to register rpmsg driver\n", __func__); in rpmsg_ns_init()
121 MODULE_DESCRIPTION("Name service announcement rpmsg driver");
123 MODULE_ALIAS("rpmsg:" KBUILD_MODNAME);