mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 11:00:09 +01:00
hal: find driver for ibmebus-type 'ehea' devices
This commit is contained in:
parent
d74ab39671
commit
b9bdc5da4b
1 changed files with 30 additions and 5 deletions
|
|
@ -128,16 +128,41 @@ get_creator (NMHalManager *self, const char *udi)
|
|||
|
||||
/* Common helpers for built-in device creators */
|
||||
|
||||
static char *
|
||||
hal_get_subsystem (LibHalContext *ctx, const char *udi)
|
||||
{
|
||||
char *subsys;
|
||||
|
||||
subsys = libhal_device_get_property_string (ctx, udi, "info.subsystem", NULL);
|
||||
if (!subsys) {
|
||||
/* info.bus is deprecated */
|
||||
subsys = libhal_device_get_property_string (ctx, udi, "info.bus", NULL);
|
||||
}
|
||||
return subsys;
|
||||
}
|
||||
|
||||
static char *
|
||||
nm_get_device_driver_name (LibHalContext *ctx, const char *origdev_udi)
|
||||
{
|
||||
char *driver_name = NULL;
|
||||
char *driver_name = NULL, *subsystem, *drv, *od_parent = NULL;
|
||||
|
||||
if (origdev_udi && libhal_device_property_exists (ctx, origdev_udi, "info.linux.driver", NULL)) {
|
||||
char *drv = libhal_device_get_property_string (ctx, origdev_udi, "info.linux.driver", NULL);
|
||||
driver_name = g_strdup (drv);
|
||||
libhal_free_string (drv);
|
||||
if (!origdev_udi)
|
||||
return NULL;
|
||||
|
||||
/* s390 driver name is on the grandparent of the net device */
|
||||
subsystem = hal_get_subsystem (ctx, origdev_udi);
|
||||
if (subsystem && !strcmp (subsystem, "ibmebus")) {
|
||||
od_parent = libhal_device_get_property_string (ctx, origdev_udi, "info.parent", NULL);
|
||||
origdev_udi = (const char *) od_parent;
|
||||
}
|
||||
|
||||
drv = libhal_device_get_property_string (ctx, origdev_udi, "info.linux.driver", NULL);
|
||||
if (drv)
|
||||
driver_name = g_strdup (drv);
|
||||
|
||||
libhal_free_string (drv);
|
||||
libhal_free_string (od_parent);
|
||||
libhal_free_string (subsystem);
|
||||
return driver_name;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue