summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Naregundi <pavan@linux.vnet.ibm.com>2009-07-13 13:38:27 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-07-13 13:38:27 +0200
commitf710e0fda727d102291a44d1ce153ea22eac6c3e (patch)
treea53ff441150af1009803175dac2e775572e75c05
parent1c508f890ff209aedbb33f45cb6ed8bb2ae93491 (diff)
add suport for /sys/bus/ibmebus
HAL was failing to recognize ehea ethernet adapters under /sys/bus/ibmebus. https://bugzilla.redhat.com/show_bug.cgi?id=496820 After the patch ehea adapters are under ibmebus in the lshal --tree ibmebus/lhea_23c00200 ibmebus/lhea_23c00200/ethernet_23e00100 net_00_21_5e_03_1d_21
-rw-r--r--hald/linux/device.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 653c9fe0..28236506 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -758,6 +758,44 @@ firewire_compute_udi (HalDevice *d)
}
+/*--------------------------------------------------------------------------------------------------------------*/
+
+static HalDevice *
+ibmebus_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_dev, const gchar *parent_path)
+{
+ HalDevice *d;
+
+ d = hal_device_new ();
+ hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "linux.sysfs_path_device", sysfs_path);
+ hal_device_property_set_string (d, "info.bus", "ibmebus");
+ if (parent_dev != NULL) {
+ hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
+ } else {
+ hal_device_property_set_string (d, "info.parent", "/org/freedesktop/Hal/devices/computer");
+ }
+
+ hal_util_set_driver (d, "info.linux.driver", sysfs_path);
+
+ hal_util_set_string_from_file (d, "ibmebus.devspec", sysfs_path, "devspec");
+ hal_util_set_string_from_file (d, "ibmebus.type", sysfs_path, "type");
+
+ return d;
+}
+
+
+static gboolean
+ibmebus_compute_udi (HalDevice *d)
+{
+ gchar udi[256];
+
+ hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
+ "/org/freedesktop/Hal/devices/ibmebus%s",
+ hal_device_property_get_string (d, "ibmebus.devspec"));
+ hal_device_set_udi (d, udi);
+ hal_device_property_set_string (d, "info.udi", udi);
+ return TRUE;
+}
/*--------------------------------------------------------------------------------------------------------------*/
@@ -4288,6 +4326,13 @@ static DevHandler dev_handler_firewire = {
.remove = dev_remove
};
+static DevHandler dev_handler_ibmebus = {
+ .subsystem = "ibmebus",
+ .add = ibmebus_add,
+ .compute_udi = ibmebus_compute_udi,
+ .remove = dev_remove
+};
+
static DevHandler dev_handler_ide = {
.subsystem = "ide",
.add = ide_add,
@@ -4610,6 +4655,7 @@ static DevHandler *dev_handlers[] = {
&dev_handler_drm,
&dev_handler_dvb,
&dev_handler_firewire,
+ &dev_handler_ibmebus,
&dev_handler_ide,
&dev_handler_ieee1394,
&dev_handler_input,