udev-builtin-net_id: support getting usb path off the host

To support predictable interface names in various embeeded systems
add support for an additional naming scheming using the USB host
interface. Several asics have usb controllers that are platform
devices and not children of a pci interface. These embedded systems
should be able to enumerate interfaces by udev path as well to support
configurations and policies.

Signed-off-by: Charles Hardin <charles.hardin@chargepoint.com>
This commit is contained in:
Charles Hardin
2022-10-31 21:11:24 +01:00
committed by Luca Boccassi
parent 0cf1692493
commit a0961675d3
4 changed files with 28 additions and 2 deletions
+1
View File
@@ -25,6 +25,7 @@ static const NamingScheme naming_schemes[] = {
{ "v250", NAMING_V250 },
{ "v251", NAMING_V251 },
{ "v252", NAMING_V252 },
{ "v253", NAMING_V253 },
/* … add more schemes here, as the logic to name devices is updated … */
EXTRA_NET_NAMING_MAP
+2
View File
@@ -38,6 +38,7 @@ typedef enum NamingSchemeFlags {
NAMING_XEN_VIF = 1 << 13, /* Generate names for Xen netfront devices */
NAMING_BRIDGE_MULTIFUNCTION_SLOT = 1 << 14, /* Use PCI hotplug slot information associated with bridge, but only if PCI device is multifunction */
NAMING_DEVICETREE_ALIASES = 1 << 15, /* Generate names from devicetree aliases */
NAMING_USB_HOST = 1 << 16, /* Generate names for usb host */
/* And now the masks that combine the features above */
NAMING_V238 = 0,
@@ -51,6 +52,7 @@ typedef enum NamingSchemeFlags {
NAMING_V250 = NAMING_V249 | NAMING_XEN_VIF,
NAMING_V251 = NAMING_V250 | NAMING_BRIDGE_MULTIFUNCTION_SLOT,
NAMING_V252 = NAMING_V251 | NAMING_DEVICETREE_ALIASES,
NAMING_V253 = NAMING_V252 | NAMING_USB_HOST,
EXTRA_NET_NAMING_SCHEMES