diff --git a/hald/linux/device.c b/hald/linux/device.c index 9f4ab3d..7d57c0c 100644 --- a/hald/linux/device.c +++ b/hald/linux/device.c @@ -3511,6 +3511,8 @@ usb_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de bus_id = hal_util_get_last_element (sysfs_path); if (strchr (bus_id, ':') == NULL) { gint bmAttributes; + char *vendor; + char *product; hal_device_property_set_string (d, "info.subsystem", "usb_device"); @@ -3530,6 +3532,18 @@ usb_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de hal_util_set_int_from_file (d, "usb_device.vendor_id", sysfs_path, "idVendor", 16); hal_util_set_int_from_file (d, "usb_device.product_id", sysfs_path, "idProduct", 16); + /* try to get the info first from sysfs */ + if ((vendor = hal_util_get_string_from_file (sysfs_path, "manufacturer")) != NULL) { + hal_device_property_set_string (d, "usb_device.vendor", vendor); + hal_device_property_set_string (d, "info.vendor", vendor); + } + if ((product = hal_util_get_string_from_file (sysfs_path, "product")) != NULL) { + hal_device_property_set_string (d, "usb_device.product", product); + hal_device_property_set_string (d, "info.product", product); + } + + /* check if to fall back to usb.ids*/ + if (!vendor || !product) { gchar buf[64]; char *vendor_name;