summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 30cd9c5)
raw | patch | inline | side by side (parent: 30cd9c5)
author | Ohad Ben-Cohen <ohad@wizery.com> | |
Sun, 4 Nov 2012 10:08:21 +0000 (12:08 +0200) | ||
committer | Suman Anna <s-anna@ti.com> | |
Fri, 30 Aug 2013 23:11:05 +0000 (18:11 -0500) |
Add a new description field to the rpmsg bus infrastructure
that can be passed onto the rpmsg client drivers for additional
information. The current rpmsg bus client drivers need to have
a fixed id_table for proper matching, this new field can allow
flexibility for the client drivers (eg: like creating unique
cdevs).
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
that can be passed onto the rpmsg client drivers for additional
information. The current rpmsg bus client drivers need to have
a fixed id_table for proper matching, this new field can allow
flexibility for the client drivers (eg: like creating unique
cdevs).
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/rpmsg/virtio_rpmsg_bus.c | patch | blob | history | |
include/linux/rpmsg.h | patch | blob | history |
index 20c2bc4ea738834ba51179b86f98ec2c8ab102d2..20203e97312dea6a430cbc5a90c99fa87e4d5111 100644 (file)
/**
* struct rpmsg_channel_info - internal channel info representation
* @name: name of service
+ * @desc: description of service
* @src: local address
* @dst: destination address
*/
struct rpmsg_channel_info {
char name[RPMSG_NAME_SIZE];
+ char desc[RPMSG_NAME_SIZE];
u32 src;
u32 dst;
};
rpmsg_show_attr(name, id.name, "%s\n");
rpmsg_show_attr(src, src, "0x%x\n");
rpmsg_show_attr(dst, dst, "0x%x\n");
+rpmsg_show_attr(desc, desc, "%s\n");
rpmsg_show_attr(announce, announce ? "true" : "false", "%s\n");
/*
static struct device_attribute rpmsg_dev_attrs[] = {
__ATTR_RO(name),
+ __ATTR_RO(desc),
__ATTR_RO(modalias),
__ATTR_RO(dst),
__ATTR_RO(src),
__ATTR_NULL
};
-/* rpmsg devices and drivers are matched using the service name */
+/* rpmsg devices and drivers are matched using the service name only */
static inline int rpmsg_id_match(const struct rpmsg_channel *rpdev,
const struct rpmsg_device_id *id)
{
if (strncmp(chinfo->name, rpdev->id.name, RPMSG_NAME_SIZE))
return 0;
+ if (strncmp(chinfo->desc, rpdev->desc, RPMSG_NAME_SIZE))
+ return 0;
+
/* found a match ! */
return 1;
}
if (tmp) {
/* decrement the matched device's refcount back */
put_device(tmp);
- dev_err(dev, "channel %s:%x:%x already exist\n",
- chinfo->name, chinfo->src, chinfo->dst);
+ dev_err(dev, "channel %s:%s:%x:%x already exist\n",
+ chinfo->name, chinfo->desc,
+ chinfo->src, chinfo->dst);
return NULL;
}
rpdev->vrp = vrp;
rpdev->src = chinfo->src;
rpdev->dst = chinfo->dst;
+ strncpy(rpdev->desc, chinfo->desc, RPMSG_NAME_SIZE);
/*
* rpmsg server channels has predefined local address (for now),
msg->name, msg->addr);
strncpy(chinfo.name, msg->name, sizeof(chinfo.name));
+ strncpy(chinfo.desc, msg->desc, sizeof(chinfo.desc));
chinfo.src = RPMSG_ADDR_ANY;
chinfo.dst = msg->addr;
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h
index 8e9cfa213a9c19ac47aaeec914f6c15db4ab71ee..97aa98ccbfda5efdd775b8cbfc345a36a8382235 100644 (file)
--- a/include/linux/rpmsg.h
+++ b/include/linux/rpmsg.h
/**
* struct rpmsg_ns_msg - dynamic name service announcement message
- * @name: name of remote service that is published
+ * @name: name of remote service that is being published
+ * @desc: description of remote service
* @addr: address of remote service that is published
* @flags: indicates whether service is created or destroyed
*
*/
struct rpmsg_ns_msg {
char name[RPMSG_NAME_SIZE];
+ char desc[RPMSG_NAME_SIZE];
u32 addr;
u32 flags;
} __packed;
* @vrp: the remote processor this channel belongs to
* @dev: the device struct
* @id: device id (used to match between rpmsg drivers and devices)
+ * @desc: description of remote service
* @src: local address
* @dst: destination address
* @ept: the rpmsg endpoint of this channel
struct virtproc_info *vrp;
struct device dev;
struct rpmsg_device_id id;
+ char desc[RPMSG_NAME_SIZE];
u32 src;
u32 dst;
struct rpmsg_endpoint *ept;