hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Fri Apr 18 03:22:11 PDT 2008


 doc/spec/hal-spec-properties.xml |   20 ++++++++++++++++++--
 hald/linux/device.c              |    6 ++++++
 2 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit d094bdc1026a350d2ff5e072115470409ed8d85d
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Fri Apr 18 12:19:54 2008 +0200

    added new properties to vmbus and updated spec
    
    Added new properties (vmbus.bus_number, vmbus.device_number) for
    VMBus devices and updated the SPEC with examples and the new
    properties.

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 050f54a..8153206 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -3137,20 +3137,36 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
               <entry>
                 <literal>vmbus.bus_id</literal> (string)
               </entry>
-              <entry></entry>
+              <entry>example: vmbus_0_0, vmbus_0_1</entry>
               <entry>Yes</entry>
               <entry>ID of the bus.</entry>
             </row>
             <row>
               <entry>
-                <literal>vmbus.device_id</literal> (string)
+                <literal>vmbus.bus_number</literal> (int)
               </entry>
               <entry></entry>
               <entry>Yes</entry>
+              <entry>The VMBus the device is attached to.</entry>
+            </row>
+            <row>
+              <entry>
+                <literal>vmbus.device_id</literal> (string)
+              </entry>
+              <entry>example: {5558a04b-62a7-48f5-ae07f1d51ae62faa}</entry>
+              <entry>Yes</entry>
               <entry>ID of the device.</entry>
             </row>
             <row>
               <entry>
+                <literal>vmbus.device_number</literal> (int)
+              </entry>
+              <entry></entry>
+              <entry>Yes</entry>
+              <entry>The number of the device on a bus.</entry>
+            </row>
+            <row>
+              <entry>
                 <literal>vmbus.class_id</literal> (string)
               </entry>
               <entry>example: {f8615163-df3e-46c5-913ff2d2f965ed0e}</entry>
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 368b1cc..2014b88 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -3721,6 +3721,7 @@ vmbus_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_
 	const gchar *bus_id;
 	const gchar *class_id;
 	const gchar *device_id;
+	int busnum, devicenum;
 
 	HAL_INFO (("vmbus_add: sysfs_path=%s device_file=%s parent_dev=0x%08x parent_path=%s", sysfs_path, device_file, parent_dev, parent_path));
 
@@ -3738,6 +3739,11 @@ vmbus_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_
 
 	bus_id = hal_util_get_last_element (sysfs_path);
 	hal_device_property_set_string (d, "vmbus.bus_id", bus_id);
+	if (sscanf (bus_id, "vmbus_%d_%d", &busnum, &devicenum) == 2) {
+		hal_device_property_set_int (d, "vmbus.bus_number", busnum);
+		hal_device_property_set_int (d, "vmbus.device_number", devicenum);
+	}
+
 	device_id = hal_util_get_string_from_file (sysfs_path, "device_id");
 	hal_device_property_set_string (d, "vmbus.device_id", device_id);
 	class_id = hal_util_get_string_from_file (sysfs_path, "class_id");


More information about the hal-commit mailing list