summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2013-10-26 12:22:04 +0200
committerTom Gundersen <teg@jklm.no>2013-10-26 14:34:41 +0200
commit89f17d4f807f2fbd9918b513296e25ee2be108c3 (patch)
tree4c7cc1d13a6d45548a2363b2dc39d4d09cf4f4d0
parent8e18485284a8718d4a9111b7c1ed91cb2f9634b0 (diff)
udev-builtin: path_id - add support for bcma bus
This matches the bcma support in the network device naming. Eventually wa want to make sure ID_PATH is equivalent to ID_NET_NAME_PATH, so we never need to match on the latter.
-rw-r--r--src/udev/udev-builtin-path_id.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
index 0659967c68..763f3c3113 100644
--- a/src/udev/udev-builtin-path_id.c
+++ b/src/udev/udev-builtin-path_id.c
@@ -452,6 +452,19 @@ static struct udev_device *handle_usb(struct udev_device *parent, char **path)
return parent;
}
+static struct udev_device *handle_bcma(struct udev_device *parent, char **path)
+{
+ const char *sysname;
+ unsigned int core;
+
+ sysname = udev_device_get_sysname(parent);
+ if (sscanf(sysname, "bcma%*u:%u", &core) != 1)
+ return NULL;
+
+ path_prepend(path, "bcma-%u", core);
+ return parent;
+}
+
static struct udev_device *handle_ccw(struct udev_device *parent, struct udev_device *dev, char **path)
{
struct udev_device *scsi_dev;
@@ -509,6 +522,9 @@ static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
} else if (streq(subsys, "usb")) {
parent = handle_usb(parent, &path);
some_transport = true;
+ } else if (streq(subsys, "bcma")) {
+ parent = handle_bcma(parent, &path);
+ some_transport = true;
} else if (streq(subsys, "serio")) {
path_prepend(&path, "serio-%s", udev_device_get_sysnum(parent));
parent = skip_subsystem(parent, "serio");