hal/hald/linux2 classdev.c,1.24,1.25 physdev.c,1.13,1.14

David Zeuthen david at freedesktop.org
Tue Mar 22 10:43:20 PST 2005


Update of /cvs/hal/hal/hald/linux2
In directory gabe:/tmp/cvs-serv31743/hald/linux2

Modified Files:
	classdev.c physdev.c 
Log Message:
2005-03-22  David Zeuthen  <davidz at redhat.com>

	* hald/linux2/probing/probe-storage.c (main): Add some extra debugging
	to help me with RH bug #151762

	* hald/linux2/physdev.c: Set <bustype>.linux.driver for all bus devices

	* hald/linux2/classdev.c (net_add): Don't set net.linux.driver, first
	of all because it doesn't make sense (drivers don't bind to class
	devices, they bind to physical devices), second because the Linux
	kernel moved around where the driver symlink is.



Index: classdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/classdev.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- classdev.c	16 Mar 2005 20:09:47 -0000	1.24
+++ classdev.c	22 Mar 2005 18:43:18 -0000	1.25
@@ -185,9 +185,6 @@
 	hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
 	hal_device_property_set_string (d, "info.parent", physdev->udi);
 
-	if (!hal_util_set_driver (d, "net.linux.driver", sysfs_path))
-		goto error;
-
 	hal_device_property_set_string (d, "info.category", "net");
 	hal_device_add_capability (d, "net");
 
@@ -589,7 +586,7 @@
 			hal_device_property_set_string (d, "info.product", "USB Serial Port");
 		}
 	} else {
-		size_t len;
+		int len;
 		int i;
 
 		len = strlen (last_elem);

Index: physdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/physdev.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- physdev.c	21 Mar 2005 00:08:01 -0000	1.13
+++ physdev.c	22 Mar 2005 18:43:18 -0000	1.14
@@ -58,6 +58,8 @@
 
 #include "pcmcia_utils.h"
 
+#include "osspec_linux.h"
+
 /*--------------------------------------------------------------------------------------------------------------*/
 
 static HalDevice *
@@ -78,6 +80,8 @@
 
 	hal_device_property_set_string (d, "pci.linux.sysfs_path", sysfs_path);
 
+	hal_util_set_driver (d, "pci.linux.driver", sysfs_path);
+
 	hal_util_set_int_from_file (d, "pci.product_id", sysfs_path, "device", 16);
 	hal_util_set_int_from_file (d, "pci.vendor_id", sysfs_path, "vendor", 16);
 	hal_util_set_int_from_file (d, "pci.subsys_product_id", sysfs_path, "subsystem_device", 16);
@@ -243,6 +247,8 @@
 
 		hal_device_property_set_string (d, "info.bus", "usb_device");
 
+		hal_util_set_driver (d, "usb_device.linux.driver", sysfs_path);
+
 		hal_device_property_set_string (d, "usb_device.linux.sysfs_path", sysfs_path);
 
 		hal_util_set_int_from_file (d, "usb_device.configuration_value", sysfs_path, "bConfigurationValue", 10);
@@ -319,9 +325,11 @@
 		hal_device_property_set_string (d, "info.bus", "usb");
 
 		/* take all usb_device.* properties from parent and make them usb.* on this object */
-		if (parent)
+		if (parent != NULL)
 			hal_device_merge_with_rewrite (d, parent, "usb.", "usb_device.");
 
+		hal_util_set_driver (d, "usb.linux.driver", sysfs_path);
+
 		hal_device_property_set_string (d, "usb.linux.sysfs_path", sysfs_path);
 
 		hal_util_set_int_from_file (d, "usb.interface.number", sysfs_path, "bInterfaceNumber", 10);
@@ -385,6 +393,8 @@
 		hal_device_property_set_string (d, "info.parent", "/org/freedesktop/Hal/devices/computer");
 	}
 
+	hal_util_set_driver (d, "ide.linux.driver", sysfs_path);
+
 	bus_id = hal_util_get_last_element (sysfs_path);
 
 	sscanf (bus_id, "%d.%d", &host, &channel);
@@ -434,6 +444,8 @@
 		hal_device_property_set_string (d, "info.parent", "/org/freedesktop/Hal/devices/computer");
 	}
 
+	hal_util_set_driver (d, "pnp.linux.driver", sysfs_path);
+
 	hal_util_set_string_from_file (d, "pnp.id", sysfs_path, "id");
 	if (hal_device_has_property (d, "pnp.id")) {
 		gchar *pnp_description;
@@ -487,6 +499,8 @@
 		hal_device_property_set_string (d, "info.parent", "/org/freedesktop/Hal/devices/computer");
 	}
 
+	hal_util_set_driver (d, "serio.linux.driver", sysfs_path);
+
 	bus_id = hal_util_get_last_element (sysfs_path);
 	hal_device_property_set_string (d, "serio.id", bus_id);
 	if (!hal_util_set_string_from_file (d, "serio.description", sysfs_path, "description")) {
@@ -533,6 +547,8 @@
 
 	bus_id = hal_util_get_last_element (sysfs_path);
 
+	hal_util_set_driver (d, "pcmcia.linux.driver", sysfs_path);
+
 	/* not sure if %d.%d means socket function - need to revisit */
 	sscanf (bus_id, "%d.%d", &socket, &function);
 	hal_device_property_set_int (d, "pcmcia.socket_number", socket);
@@ -638,6 +654,8 @@
 	hal_device_property_set_int (d, "scsi.target", target_num);
 	hal_device_property_set_int (d, "scsi.lun", lun_num);
 
+	hal_util_set_driver (d, "scsi.linux.driver", sysfs_path);
+
 	/* guestimate product name */
 	hal_device_property_set_string (d, "info.product", "SCSI Device");
 
@@ -681,6 +699,8 @@
 	hal_device_property_set_string (d, "info.bus", "mmc");
 	hal_device_property_set_string (d, "info.parent", parent->udi);
 
+	hal_util_set_driver (d, "mmc.linux.driver", sysfs_path);
+
 	bus_id = hal_util_get_last_element (sysfs_path);
 	sscanf (bus_id, "mmc%d:%x", &host_num, &rca);
 	hal_device_property_set_int (d, "mmc.rca", rca);
@@ -770,6 +790,8 @@
 	hal_device_property_set_string (d, "info.bus", "ieee1394");
 	hal_device_property_set_string (d, "info.parent", parent->udi);
 
+	hal_util_set_driver (d, "ieee1394.linux.driver", sysfs_path);
+
 	hal_device_property_set_uint64 (d, "ieee1394.guid", guid);
 	hal_util_set_int_from_file    (d, "ieee1394.vendor_id", sysfs_path, "../vendor_id", 16);
 	hal_util_set_int_from_file    (d, "ieee1394.specifier_id", sysfs_path, "specifier_id", 16);




More information about the hal-commit mailing list