chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
15f3923
)
udev: update net_id comments
author
Kay Sievers
<kay@vrfy.org>
Thu, 27 Mar 2014 14:30:09 +0000
(15:30 +0100)
committer
Kay Sievers
<kay@vrfy.org>
Thu, 27 Mar 2014 14:30:34 +0000
(15:30 +0100)
src/udev/udev-builtin-net_id.c
patch
|
blob
|
history
diff --git
a/src/udev/udev-builtin-net_id.c
b/src/udev/udev-builtin-net_id.c
index 4f2b2c1f73b35ee1c8603f16627cf65ee876c263..9ac07de7bd6953474f91011e20ad0dccc798b3e1 100644
(file)
--- a/
src/udev/udev-builtin-net_id.c
+++ b/
src/udev/udev-builtin-net_id.c
@@
-33,8
+33,11
@@
* ww -- wwan
*
* Type of names:
* ww -- wwan
*
* Type of names:
+ * b<number> -- BCMA bus core number
+ * ccw<name> -- CCW bus group name
* o<index> -- on-board device index number
* s<slot>[f<function>][d<dev_id>] -- hotplug slot index number
* o<index> -- on-board device index number
* s<slot>[f<function>][d<dev_id>] -- hotplug slot index number
+ * v<number> -- virtio number
* x<MAC> -- MAC address
* [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>]
* -- PCI geographical location
* x<MAC> -- MAC address
* [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>]
* -- PCI geographical location
@@
-119,12
+122,9
@@
struct netnames {
const char *pci_onboard_label;
char usb_ports[IFNAMSIZ];
const char *pci_onboard_label;
char usb_ports[IFNAMSIZ];
-
char bcma_core[IFNAMSIZ];
char bcma_core[IFNAMSIZ];
-
- char virtio_core[IFNAMSIZ];
-
- char ccw_core[IFNAMSIZ];
+ char virtio[IFNAMSIZ];
+ char ccw_group[IFNAMSIZ];
};
/* retrieve on-board index number and label from firmware */
};
/* retrieve on-board index number and label from firmware */
@@
-353,18
+353,17
@@
static int names_bcma(struct udev_device *dev, struct netnames *names) {
static int names_virtio(struct udev_device *dev, struct netnames *names) {
struct udev_device *virtdev;
static int names_virtio(struct udev_device *dev, struct netnames *names) {
struct udev_device *virtdev;
- unsigned int
core
;
+ unsigned int
num
;
virtdev = udev_device_get_parent_with_subsystem_devtype(dev, "virtio", NULL);
if (!virtdev)
return -ENOENT;
virtdev = udev_device_get_parent_with_subsystem_devtype(dev, "virtio", NULL);
if (!virtdev)
return -ENOENT;
- /* core num */
- if (sscanf(udev_device_get_sysname(virtdev), "virtio%u", &core) != 1)
+ if (sscanf(udev_device_get_sysname(virtdev), "virtio%u", &num) != 1)
return -EINVAL;
return -EINVAL;
- /* suppress the common
core
== 0 */
- if (
core
> 0)
- snprintf(names->virtio
_core, sizeof(names->virtio_core), "v%u", core
);
+ /* suppress the common
num
== 0 */
+ if (
num
> 0)
+ snprintf(names->virtio
, sizeof(names->virtio), "v%u", num
);
names->type = NET_VIRTIO;
return 0;
names->type = NET_VIRTIO;
return 0;
@@
-402,8
+401,8
@@
static int names_ccw(struct udev_device *dev, struct netnames *names) {
return -EINVAL;
/* Store the CCW bus-ID for use as network device name */
return -EINVAL;
/* Store the CCW bus-ID for use as network device name */
- rc = snprintf(names->ccw_
core, sizeof(names->ccw_core
), "ccw%s", bus_id);
- if (rc >= 0 && rc < (int)sizeof(names->ccw_
core
))
+ rc = snprintf(names->ccw_
group, sizeof(names->ccw_group
), "ccw%s", bus_id);
+ if (rc >= 0 && rc < (int)sizeof(names->ccw_
group
))
names->type = NET_CCWGROUP;
return 0;
}
names->type = NET_CCWGROUP;
return 0;
}
@@
-517,7
+516,7
@@
static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
if (err >= 0 && names.type == NET_CCWGROUP) {
char str[IFNAMSIZ];
if (err >= 0 && names.type == NET_CCWGROUP) {
char str[IFNAMSIZ];
- if (snprintf(str, sizeof(str), "%s%s", prefix, names.ccw_
core
) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s", prefix, names.ccw_
group
) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
goto out;
}
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
goto out;
}
@@
-585,11
+584,11
@@
static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
char str[IFNAMSIZ];
if (names.pci_path[0])
char str[IFNAMSIZ];
if (names.pci_path[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_path, names.virtio
_core
) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_path, names.virtio) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
if (names.pci_slot[0])
udev_builtin_add_property(dev, test, "ID_NET_NAME_PATH", str);
if (names.pci_slot[0])
- if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_slot, names.virtio
_core
) < (int)sizeof(str))
+ if (snprintf(str, sizeof(str), "%s%s%s", prefix, names.pci_slot, names.virtio) < (int)sizeof(str))
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
goto out;
}
udev_builtin_add_property(dev, test, "ID_NET_NAME_SLOT", str);
goto out;
}