summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-path_id.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2013-10-26 12:22:04 +0200
committerAnthony G. Basile <blueness@gentoo.org>2014-01-09 20:34:55 -0500
commit1e60f44be995edf571ece7a11dac2a7333d47096 (patch)
treeded3ad2abc38a15aeecab5371eb4a5763792d941 /src/udev/udev-builtin-path_id.c
parentbf8193ca9ec1f360e020d77200ead2257db0c5e2 (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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-builtin-path_id.c')
-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 baa49478d4..7476330196 100644
--- a/src/udev/udev-builtin-path_id.c
+++ b/src/udev/udev-builtin-path_id.c
@@ -453,6 +453,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;
@@ -510,6 +523,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");