hal: Branch 'origin' - 2 commits
Danny Kukawka
dkukawka at kemper.freedesktop.org
Fri Feb 9 10:54:24 PST 2007
doc/conf/match-USB-camera.fdi | 2
doc/conf/match-USB-mp3-player.fdi | 2
doc/conf/match-cardreader.fdi | 4 -
doc/spec/hal-spec-fdi-files.xml | 6 +-
doc/spec/hal-spec-properties.xml | 89 +++++++++++++++------------------
hald/device_info.c | 3 -
hald/dummy/osspec.c | 1
hald/freebsd/hf-ata.c | 3 +
hald/freebsd/hf-block.c | 3 -
hald/freebsd/hf-computer.c | 1
hald/freebsd/hf-devtree.c | 4 -
hald/freebsd/hf-net.c | 1
hald/freebsd/hf-pci.c | 1
hald/freebsd/hf-pcmcia.c | 1
hald/freebsd/hf-scsi.c | 6 +-
hald/freebsd/hf-serial.c | 1
hald/freebsd/hf-sound.c | 1
hald/freebsd/hf-storage.c | 1
hald/freebsd/hf-usb.c | 1
hald/linux/blockdev.c | 14 ++---
hald/linux/device.c | 27 +++++++++-
hald/linux/osspec.c | 1
hald/linux/probing/probe-input.c | 2
hald/solaris/devinfo_ieee1394.c | 1
hald/solaris/devinfo_misc.c | 2
hald/solaris/devinfo_pci.c | 3 -
hald/solaris/devinfo_storage.c | 7 ++
hald/solaris/devinfo_usb.c | 2
libhal-storage/libhal-storage.c | 2
tools/device-manager/Device.py | 2
tools/device-manager/DeviceManager.py | 14 ++---
tools/device-manager/Representation.py | 6 +-
tools/gen-libgphoto-hal-fdi | 2
33 files changed, 134 insertions(+), 82 deletions(-)
New commits:
diff-tree b26ba073131b944b9ad3760ecc7b60834ee585a0 (from parents)
Merge: ee6df61171ccd8492904e768725cc7bd2539bb67 7186ceb6b2f2cd509c156a045a05c86e7418f135
Author: Kay Sievers <kay.sievers at vrfy.org>
Date: Wed Feb 7 21:21:17 2007 +0100
Merge branch 'master' of git+ssh://git.freedesktop.org/git/hal
diff-tree ee6df61171ccd8492904e768725cc7bd2539bb67 (from f92db4967e050bbecd5775802fb6ffb7c963958b)
Author: Kay Sievers <kay.sievers at vrfy.org>
Date: Wed Feb 7 20:58:11 2007 +0100
rename "bus" and "physical" properties to something more abstract
Current systems make it almost impossible to distinguish between
"virtual" and "physical" devices. Current HAL, just like the Linux
kernel, tries to export such properties - which in reality, is almost
impossible to get right. The growing use of virtualization will just
make it even more incorrect.
HAL also carries, just like the Linux kernel, completely misleading bus
names like: platform-bus, xen-bus, usb_device-bus, ... Most of these
subsystems are no bus at all, and will never be one.
Renames:
info.bus -> info.subsystem
*.physical_device -> *.originating_device
The old values are deprecated, but still available and kept as long as
needed, but will be removed some day.
diff --git a/doc/conf/match-USB-camera.fdi b/doc/conf/match-USB-camera.fdi
index a3f6508..d29c7c1 100644
--- a/doc/conf/match-USB-camera.fdi
+++ b/doc/conf/match-USB-camera.fdi
@@ -5,7 +5,7 @@
<deviceinfo version="0.2">
<device>
- <match key="info.bus" string="usb">
+ <match key="info.subsystem" string="usb">
<match key="usb.vendor_id" int="0x054c">
<match key="usb.product_id" int="0x0010">
<merge key="info.category" type="string">camera</merge>
diff --git a/doc/conf/match-USB-mp3-player.fdi b/doc/conf/match-USB-mp3-player.fdi
index 5797d73..6c5ac39 100644
--- a/doc/conf/match-USB-mp3-player.fdi
+++ b/doc/conf/match-USB-mp3-player.fdi
@@ -5,7 +5,7 @@
<deviceinfo version="0.2">
<device>
- <match key="info.bus" string="usb">
+ <match key="info.subsystem" string="usb">
<match key="usb.vendor_id" int="0x066f">
<match key="usb.product_id" int="0x8000">
<merge key="info.category" type="string">portable_audio_player</merge>
diff --git a/doc/conf/match-cardreader.fdi b/doc/conf/match-cardreader.fdi
index 9ae7b2e..3600854 100644
--- a/doc/conf/match-cardreader.fdi
+++ b/doc/conf/match-cardreader.fdi
@@ -6,8 +6,8 @@
<deviceinfo version="0.2">
<device>
<match key="storage.bus" string="usb">
- <match key="@storage.physical_device:usb.vendor_id" int="0x0424">
- <match key="@storage.physical_device:usb.product_id" int="0x20fc">
+ <match key="@storage.originating_device:usb.vendor_id" int="0x0424">
+ <match key="@storage.originating_device:usb.product_id" int="0x20fc">
<match key="storage.lun" int="0">
<merge key="storage.drive_type" type="string">compact_flash</merge>
</match>
diff --git a/doc/spec/hal-spec-fdi-files.xml b/doc/spec/hal-spec-fdi-files.xml
index 07411ad..667171a 100644
--- a/doc/spec/hal-spec-fdi-files.xml
+++ b/doc/spec/hal-spec-fdi-files.xml
@@ -7,7 +7,7 @@
Device information files (<literal>.fdi</literal> files is a
shorthand) are used to merge arbitrary properties onto device
objects. The way device information files works is that once all
- physical properties are merged onto a device object it is tried
+ device properties are merged onto a device object it is tried
against the set of installed device information files. Device
information files are used for both merging facts and policy
settings about devices.
@@ -44,7 +44,7 @@
<literal>info.parent</literal> should be used to query the
property <literal>baz</literal>. It is also possible to use
multiple indirections, e.g. for a volume on a USB memory stick
- the indirection <literal>@block.storage_device:@storage.physical_device:usb.vendor_id</literal>
+ the indirection <literal>@block.storage_device:@storage.originating_device:usb.vendor_id</literal>
will reference the <literal>usb.vendor_id</literal> property
on the device object representing the USB interface.
</para>
@@ -318,7 +318,7 @@
</programlisting>
<para>
As described in the documentation for the
- <literal>storage.physical_device</literal> property in
+ <literal>storage.originating_device</literal> property in
<xref linkend="device-properties-storage"/> this device information
file export information about each storage port through the
property <literal>storage.drive_type</literal>. Thus, one
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index c28e477..214ffa9 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -40,11 +40,11 @@
<tbody>
<row>
<entry>
- <literal>info.bus</literal> (string)
+ <literal>info.subsystem</literal> (string)
</entry>
<entry>pci, usb, ide_host, ide, block, usb, usbif, scsi_host, scsi</entry>
<entry>Yes</entry>
- <entry>Describes what ''physical'' bus the device is connected to</entry>
+ <entry>Describes what subsystem the device is connected to</entry>
</row>
<row>
<entry>
@@ -220,7 +220,7 @@
<entry>examples: /sys/block/sda/sda1, /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0</entry>
<entry>Yes (only if available for the device) </entry>
<entry>A fully-qualified path into the sysfs filesystem for the
- physical device
+ device
</entry>
</row>
<row>
@@ -268,16 +268,16 @@
</sect2>
</sect1>
- <sect1 id="properties-bus">
- <title>Physical Properties</title>
+ <sect1 id="properties-subsystem">
+ <title>Properties</title>
<para>
In this section properties for device objects that represent
- physically addressable hardware is described. Availability of
- these depends on the value of the <literal>info.bus</literal>
+ addressable hardware is described. Availability of
+ these depends on the value of the <literal>info.subsystem</literal>
property. These properties are not of particular interest to
application developers, instead they are useful for libraries
and userspace drivers that needs to interact with the device
- given a UDI. Knowledge of various bus interconnect
+ given a UDI. Knowledge of various subsystem-specific
technologies is assumed for this section to be useful.
</para>
<sect2 id="device-properties-pci">
@@ -287,7 +287,7 @@
<para>
This namespace contains properties for device objects representing
functions on devices on a PCI bus. These properties are available
- exactly when <literal>info.bus</literal> equals <literal>pci</literal>.
+ exactly when <literal>info.subsystem</literal> equals <literal>pci</literal>.
</para>
<informaltable>
<tgroup cols="2">
@@ -427,13 +427,13 @@
<tbody>
<row>
<entry>
- <literal>serial.physical_device</literal> (string)
+ <literal>serial.originating_device</literal> (string)
</entry>
<entry>
example: <literal>/org/freedesktop/Hal/devices/pnp_PNP0501</literal>
</entry>
<entry>Yes</entry>
- <entry>UDI of the physical device the serial device is bound to.</entry>
+ <entry>UDI of the device the serial device is bound to.</entry>
</row>
<row>
<entry>
@@ -472,7 +472,7 @@
</title>
<para>
For device objects representing USB devices the property
- <literal>info.bus</literal> will be <literal>usb_device</literal>,
+ <literal>info.subsystem</literal> will be <literal>usb_device</literal>,
and the following properties will be available. Note that the
corresponding USB interfaces are represented by separate
device objects as children.
@@ -612,7 +612,7 @@
</entry>
<entry>example: 2</entry>
<entry>Yes</entry>
- <entry>Depth in physical USB tree, where the virtual root hub
+ <entry>Depth in USB tree, where the virtual root hub
is at depth 0
</entry>
</row>
@@ -706,7 +706,7 @@
</title>
<para>
Device objects that represent USB interfaces, ie. when
- <literal>info.bus</literal> assumes <literal>usb</literal>,
+ <literal>info.subsystem</literal> assumes <literal>usb</literal>,
are represented by the properties below. In addition all
the <literal>usb_device.*</literal> properties from the parent
USB device is available in this namespace but only with
@@ -777,7 +777,7 @@
<para>
Devices that are built into the platform or present on busses that
cannot be properly enumerated (e.g. ISA) are represented by device
- objects where <literal>info.bus</literal> equals
+ objects where <literal>info.subsystem</literal> equals
<literal>platform</literal>. These kind of devices are commonly,
somewhat incorrectly, called legacy devices.
</para>
@@ -810,7 +810,7 @@
</title>
<para>
The <literal>ide_host</literal> namespace is present for
- device objects where <literal>info.bus</literal> is set
+ device objects where <literal>info.subsystem</literal> is set
to <literal>ide_host</literal>. Such device objects represent
IDE and ATA host adaptors for harddisks and optical drives as
found in the majority of computer systems.
@@ -854,7 +854,7 @@
</title>
<para>
ATA and IDE drives are represented by device objects where
- <literal>info.bus</literal> equals <literal>ide</literal>. The
+ <literal>info.subsystem</literal> equals <literal>ide</literal>. The
following properties are available for such device objects.
</para>
<informaltable>
@@ -898,7 +898,7 @@
</title>
<para>
The <literal>scsi_host</literal> namespace is present for
- device objects where <literal>info.bus</literal> is set
+ device objects where <literal>info.subsystem</literal> is set
to <literal>scsi_host</literal>. Such device objects represent
SCSI host adaptors for SCSI devices as found in some computer
systems.
@@ -932,7 +932,7 @@
</title>
<para>
SCSI devices are represented by device objects where
- <literal>info.bus</literal> equals <literal>scsi</literal>.
+ <literal>info.subsystem</literal> equals <literal>scsi</literal>.
The following properties are available for such device objects.
</para>
<informaltable>
@@ -1059,7 +1059,7 @@
<literal>ieee1394_host</literal> namespace
</title>
<para>
- Device objects with <literal>info.bus</literal> set to
+ Device objects with <literal>info.subsystem</literal> set to
<literal>ieee1394_host</literal> represent IEEE 1394 host
adaptors. The following properties are available for such
device objects.
@@ -1124,7 +1124,7 @@
<literal>ieee1394_node</literal> namespace
</title>
<para>
- Device objects with <literal>info.bus</literal> set to
+ Device objects with <literal>info.subsystem</literal> set to
<literal>ieee1394_node</literal> represent IEEE 1394 nodes on
a IEEE 1394 bus. The following properties are available for
such device objects.
@@ -1189,7 +1189,7 @@
<literal>ieee1394</literal> namespace
</title>
<para>
- Device objects with <literal>info.bus</literal> set to
+ Device objects with <literal>info.subsystem</literal> set to
<literal>ieee1394</literal> represent IEEE 1394 devices. The
following properties are available for such device objects.
</para>
@@ -1221,7 +1221,7 @@
<literal>mmc_host</literal> namespace
</title>
<para>
- Device objects with <literal>info.bus</literal> set to
+ Device objects with <literal>info.subsystem</literal> set to
<literal>mmc_host</literal> represent MultiMediaCard or
Secure Digital host adaptors. The following properties
are available for such device objects.
@@ -1254,7 +1254,7 @@
<literal>mmc</literal> namespace
</title>
<para>
- Device objects with <literal>info.bus</literal> set to
+ Device objects with <literal>info.subsystem</literal> set to
<literal>mmc</literal> represent MultiMediaCard or Secure
Digital cards. The following properties are available for
such device objects.
@@ -1353,7 +1353,7 @@
<literal>ccw</literal> namespace
</title>
<para>
- Device objects that represent s390 ccw devices (when <literal>info.bus
+ Device objects that represent s390 ccw devices (when <literal>info.subsystem
</literal>
is set to <literal>ccw</literal>) are represented by the
properties below.
@@ -1643,7 +1643,7 @@
</title>
<para>
Device objects that represent groups of <literal>ccw</literal> devices
- (when <literal>info.bus</literal> is set to <literal>ccwgroup</literal>
+ (when <literal>info.subsystem</literal> is set to <literal>ccwgroup</literal>
have the properties specified below.
</para>
<informaltable>
@@ -2007,7 +2007,7 @@
<literal>iucv</literal> namespace
</title>
<para>
- Device objects with <literal>info.bus</literal> set to <literal>iucv
+ Device objects with <literal>info.subsystem</literal> set to <literal>iucv
</literal>
are using the "Intra-User Comminication Vehicle" and are
described by the following properties.
@@ -2075,7 +2075,7 @@
</title>
<para>
Device objects representing addressable block devices, such as
- drives and partitions, will have <literal>info.bus</literal>
+ drives and partitions, will have <literal>info.subsystem</literal>
set to <literal>block</literal> and will export a number of
properties in the <literal>block</literal> namespace.
</para>
@@ -2172,7 +2172,7 @@
<para>
Device objects representing virtual devices under the Xen
Virtual Machine Monitor, such as frontend network or block
- devices, will have <literal>info.bus</literal> set to
+ devices, will have <literal>info.subsystem</literal> set to
<literal>block</literal> and will export a number of
properties in then <literal>xen</literal> namespace.
</para>
@@ -2216,7 +2216,7 @@
<para>
The section describe functional properties of device objects,
that is, properties that are merged onto device objects
- representing physically addressable hardware. In most
+ representing addressable hardware. In most
circumstances such properties stem from a kernel level
driver attached to the device represented by the device object,
however, as HAL can merge properties from anywhere, they
@@ -2641,7 +2641,7 @@
is set to <literal>TRUE</literal>.
</entry>
<entry>
- If available, the offset where the physical partition starts on the media or the fixed disk in the storage device.
+ If available, the offset where the partition starts on the media or the fixed disk in the storage device.
</entry>
</row>
</tbody>
@@ -3009,7 +3009,7 @@
<literal>storage</literal> namespace
</title>
<para>
- This namespace is used to describe physical storage devices
+ This namespace is used to describe storage devices
and their capabilities. Such device objects will have the
capability <literal>storage</literal> and
they will export the properties below. Note that device
@@ -3040,7 +3040,7 @@
</entry>
<entry></entry>
<entry>Yes</entry>
- <entry>Physical interface the storage device is attached to</entry>
+ <entry>Interface the storage device is attached to</entry>
</row>
<row>
<entry></entry>
@@ -3268,18 +3268,18 @@
</row>
<row>
<entry>
- <literal>storage.physical_device</literal> (string)
+ <literal>storage.originating_device</literal> (string)
</entry>
<entry></entry>
<entry>Yes</entry>
<entry>
This contains the UDI of the device object
- representing the physical device or blank if
+ representing the device or blank if
there is no such device (which is TRUE for legacy
devices such as x86 floppy drives). Additionally, a
number of properties are merged from that device
object. Specifically, all properties prefixed
- with <literal>storage</literal> and, if the physical
+ with <literal>storage</literal> and, if the
device has several storage ports,
<literal>storage_lunX</literal> (where X is number of
the port starting from zero) are merged and will have
@@ -3607,11 +3607,11 @@
</row>
<row>
<entry>
- <literal>net.physical_device</literal> (string)
+ <literal>net.originating_device</literal> (string)
</entry>
<entry></entry>
<entry>Yes</entry>
- <entry>UDI of the physical device the network device is bound to.</entry>
+ <entry>UDI of the device the network device is bound to.</entry>
</row>
<row>
<entry>
@@ -4182,12 +4182,12 @@
</row>
<row>
<entry>
- <literal>alsa.physical_device</literal> (string)
+ <literal>alsa.originating_device</literal> (string)
</entry>
<entry></entry>
<entry>Yes</entry>
<entry>
- UDI of the physical device the ALSA device is bound to.
+ UDI of the device the ALSA device is bound to.
</entry>
</row>
<row>
@@ -4297,11 +4297,6 @@
represent all the streams available through OSS on a soundcard.
OSS devices could be emulated by ALSA.
</para>
- <para>
- Note: All OSS devices, except the global devices, are only added if the
- kernel supports links from oss device to physical device in sysfs. For a patch
- see: http://thread.gmane.org/gmane.comp.freedesktop.hal/2862.
- </para>
<informaltable>
<tgroup cols="2">
<thead>
@@ -4369,12 +4364,12 @@
</row>
<row>
<entry>
- <literal>oss.physical_device</literal> (string)
+ <literal>oss.originating_device</literal> (string)
</entry>
<entry></entry>
<entry>Yes</entry>
<entry>
- UDI of the physical device the OSS device is bound to.
+ UDI of the device the OSS device is bound to.
</entry>
</row>
<row>
diff --git a/hald/device_info.c b/hald/device_info.c
index b69c574..c4891cf 100644
--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -112,7 +112,7 @@ get_match_type_str (enum match_type type
* info.udi
* /org/freedesktop/Hal/devices/computer:kernel.name
* @block.storage_device:storage.bus
- * @block.storage_device:@storage.physical_device:ide.channel
+ * @block.storage_device:@storage.originating_device:ide.channel
*
* @param source_udi UDI of source device
* @param path The given path
@@ -804,6 +804,7 @@ handle_merge (struct rule *rule, HalDevi
HAL_INFO (("Spawning new device object '%s' caused by <spawn> on udi '%s'",
key, hal_device_get_udi (d)));
spawned = hal_device_new ();
+ hal_device_property_set_string (spawned, "info.subsystem", "unknown");
hal_device_property_set_string (spawned, "info.bus", "unknown");
hal_device_property_set_string (spawned, "info.udi", key);
hal_device_property_set_string (spawned, "info.parent", hal_device_get_udi (d));
diff --git a/hald/dummy/osspec.c b/hald/dummy/osspec.c
index af7b326..c4bc3c9 100644
--- a/hald/dummy/osspec.c
+++ b/hald/dummy/osspec.c
@@ -60,6 +60,7 @@ osspec_probe (void)
HalDevice *root;
root = hal_device_new ();
+ hal_device_property_set_string (root, "info.subsystem", "unknown");
hal_device_property_set_string (root, "info.bus", "unknown");
hal_device_property_set_string (root, "info.product", "Computer");
hal_device_property_set_string (root, "info.udi", "/org/freedesktop/Hal/devices/computer");
diff --git a/hald/freebsd/hf-ata.c b/hald/freebsd/hf-ata.c
index 5257683..0c9d327 100644
--- a/hald/freebsd/hf-ata.c
+++ b/hald/freebsd/hf-ata.c
@@ -77,6 +77,7 @@ hf_ata_ide_device_new (HalDevice *parent
host = hal_device_property_get_int(parent, "ide_host.number");
hf_device_set_udi(device, "ide_%i_%i", host, ms);
+ hal_device_property_set_string(device, "info.subsystem", "ide");
hal_device_property_set_string(device, "info.bus", "ide");
hf_device_property_set_string_printf(device, "info.product", "IDE Device (%s)", ms == 0 ? "Master" : "Slave");
@@ -148,6 +149,7 @@ hf_ata_block_device_new (HalDevice *pare
if ((params->support.command1 & ATA_SUPPORT_REMOVABLE) != 0)
hal_device_property_set_bool(device, "storage.removable", TRUE);
+ hal_device_property_set_string(device, "storage.originating_device", hal_device_get_udi(parent));
hal_device_property_set_string(device, "storage.physical_device", hal_device_get_udi(parent));
hal_device_property_set_string(device, "storage.model", params->model);
hal_device_property_set_string(device, "storage.vendor", vendor);
@@ -295,6 +297,7 @@ hf_ata_channel_set_properties (HalDevice
hf_device_set_udi(device, "ide_host_%i", unit);
+ hal_device_property_set_string(device, "info.subsystem", "ide_host");
hal_device_property_set_string(device, "info.bus", "ide_host");
hal_device_property_set_int(device, "ide_host.number", unit);
}
diff --git a/hald/freebsd/hf-block.c b/hald/freebsd/hf-block.c
index fd6ba03..60ece33 100644
--- a/hald/freebsd/hf-block.c
+++ b/hald/freebsd/hf-block.c
@@ -100,7 +100,7 @@ hf_block_device_compute_udi (HalDevice *
model = hal_device_property_get_string(device, "storage.model");
serial = hal_device_property_get_string(device, "storage.serial");
- physical_device = hal_device_property_get_string(device, "storage.physical_device");
+ physical_device = hal_device_property_get_string(device, "storage.originating_device");
if (serial && *serial)
hf_device_set_udi(device, "storage_serial_%s", serial);
@@ -153,6 +153,7 @@ hf_block_device_enable (HalDevice *devic
hal_device_add_capability(device, "block");
+ hal_device_property_set_string(device, "info.subsystem", "block");
hal_device_property_set_string(device, "info.bus", "block");
hal_device_property_set_string(device, "info.category", "block"); /* FIXME? */
diff --git a/hald/freebsd/hf-computer.c b/hald/freebsd/hf-computer.c
index 37496e9..a311f7e 100644
--- a/hald/freebsd/hf-computer.c
+++ b/hald/freebsd/hf-computer.c
@@ -124,6 +124,7 @@ hf_computer_device_add (void)
device = hal_device_new();
hf_device_set_udi(device, "computer");
+ hal_device_property_set_string(device, "info.subsystem", "unknown");
hal_device_property_set_string(device, "info.bus", "unknown");
hal_device_property_set_string(device, "info.product", "Computer");
diff --git a/hald/freebsd/hf-devtree.c b/hald/freebsd/hf-devtree.c
index 7660cac..964df09 100644
--- a/hald/freebsd/hf-devtree.c
+++ b/hald/freebsd/hf-devtree.c
@@ -267,9 +267,9 @@ hf_devtree_device_new (HalDevice *parent
if (handler->set_properties)
handler->set_properties(device);
- if (! hal_device_has_property(device, "info.bus"))
+ if (! hal_device_has_property(device, "info.subsystem"))
{
- hal_device_property_set_string(device, "info.bus", "platform");
+ hal_device_property_set_string(device, "info.subsystem", "platform");
hf_device_property_set_string_printf(device, "platform.id", "%s.%i", handler->driver, unit);
}
diff --git a/hald/freebsd/hf-net.c b/hald/freebsd/hf-net.c
index 2a92e7f..79e0a04 100644
--- a/hald/freebsd/hf-net.c
+++ b/hald/freebsd/hf-net.c
@@ -131,6 +131,7 @@ hf_net_device_new (const char *interface
hal_device_add_capability(device, "net");
hal_device_property_set_string(device, "net.address", mac ? mac : "00:00:00:00:00:00");
hal_device_property_set_string(device, "net.interface", interface);
+ hal_device_property_set_string(device, "net.originating_device", hal_device_get_udi(parent));
hal_device_property_set_string(device, "net.physical_device", hal_device_get_udi(parent));
hal_device_property_set_string(device, "net.media", media);
if (hf_devtree_is_driver(interface, "fwe"))
diff --git a/hald/freebsd/hf-pci.c b/hald/freebsd/hf-pci.c
index d721819..b3b7bd8 100644
--- a/hald/freebsd/hf-pci.c
+++ b/hald/freebsd/hf-pci.c
@@ -92,6 +92,7 @@ hf_pci_device_new (HalDevice *parent, co
device = hf_device_new(parent);
hf_device_set_udi(device, "pci_%.4x_%.4x", p->pc_vendor, p->pc_device);
+ hal_device_property_set_string(device, "info.subsystem", "pci");
hal_device_property_set_string(device, "info.bus", "pci");
hal_device_property_set_int(device, "pci.device_class", p->pc_class);
hal_device_property_set_int(device, "pci.device_subclass", p->pc_subclass);
diff --git a/hald/freebsd/hf-pcmcia.c b/hald/freebsd/hf-pcmcia.c
index c98642e..c24b327 100644
--- a/hald/freebsd/hf-pcmcia.c
+++ b/hald/freebsd/hf-pcmcia.c
@@ -142,6 +142,7 @@ void
hf_pcmcia_set_properties (HalDevice *device)
{
+ hal_device_property_set_string(device, "info.subsystem", "pcmcia");
hal_device_property_set_string(device, "info.bus", "pcmcia");
hal_device_add_capability(device, "pcmcia_socket");
hal_device_property_set_string(device, "info.category", "pcmcia_socket");
diff --git a/hald/freebsd/hf-scsi.c b/hald/freebsd/hf-scsi.c
index 7c8bd3b..70102fc 100644
--- a/hald/freebsd/hf-scsi.c
+++ b/hald/freebsd/hf-scsi.c
@@ -67,6 +67,7 @@ hf_scsi_bus_device_new (HalDevice *paren
device = hf_device_new(parent);
+ hal_device_property_set_string(device, "info.subsystem", "scsi_host");
hal_device_property_set_string(device, "info.bus", "scsi_host");
hal_device_property_set_int(device, "scsi_host.host", match->path_id);
hal_device_property_set_string(device, "info.product", "SCSI Host Adapter");
@@ -91,6 +92,7 @@ hf_scsi_scsi_device_new (HalDevice *pare
device = hf_device_new(parent);
+ hal_device_property_set_string(device, "info.subsystem", "scsi");
hal_device_property_set_string(device, "info.bus", "scsi");
hal_device_property_set_int(device, "scsi.host", match->path_id);
hal_device_property_set_int(device, "scsi.bus", match->path_id);
@@ -210,12 +212,13 @@ hf_scsi_block_device_new (HalDevice *par
const char *bus;
const char *parent_udi;
- bus = hal_device_property_get_string(parent, "info.bus");
+ bus = hal_device_property_get_string(parent, "info.subsystem");
if (bus)
{
if (! strcmp(bus, "scsi"))
{
hal_device_property_set_string(device, "storage.bus", "scsi");
+ hal_device_property_set_string(device, "storage.originating_device", hal_device_get_udi(parent));
hal_device_property_set_string(device, "storage.physical_device", hal_device_get_udi(parent));
hal_device_copy_property(parent, "scsi.lun", device, "storage.lun");
/* do not stop here, in case it's an umass device */
@@ -223,6 +226,7 @@ hf_scsi_block_device_new (HalDevice *par
else if (! strcmp(bus, "usb"))
{
hal_device_property_set_string(device, "storage.bus", "usb");
+ hal_device_property_set_string(device, "storage.originating_device", hal_device_get_udi(parent));
hal_device_property_set_string(device, "storage.physical_device", hal_device_get_udi(parent));
hal_device_property_set_bool(device, "storage.hotpluggable", TRUE);
break; /* done */
diff --git a/hald/freebsd/hf-serial.c b/hald/freebsd/hf-serial.c
index 325c14b..08c855a 100644
--- a/hald/freebsd/hf-serial.c
+++ b/hald/freebsd/hf-serial.c
@@ -46,6 +46,7 @@ hf_serial_device_new (HalDevice *parent)
hal_device_property_set_string(device, "info.category", "serial");
hal_device_add_capability(device, "serial");
+ hal_device_property_set_string(device, "serial.originating_device", hal_device_get_udi(parent));
hal_device_property_set_string(device, "serial.physical_device", hal_device_get_udi(parent));
/* callin devices: /dev/ttyd[0-9a-v] -- see sio(4) */
diff --git a/hald/freebsd/hf-sound.c b/hald/freebsd/hf-sound.c
index 738f151..a896a6c 100644
--- a/hald/freebsd/hf-sound.c
+++ b/hald/freebsd/hf-sound.c
@@ -72,6 +72,7 @@ hf_sound_oss_device_new (HalDevice *pare
device = hf_device_new(parent);
+ hal_device_property_set_string(device, "oss.originating_device", hal_device_get_udi(parent));
hal_device_property_set_string(device, "oss.physical_device", hal_device_get_udi(parent));
pproduct = hal_device_property_get_string(parent, "info.product");
diff --git a/hald/freebsd/hf-storage.c b/hald/freebsd/hf-storage.c
index 24f58ad..19c3ad7 100644
--- a/hald/freebsd/hf-storage.c
+++ b/hald/freebsd/hf-storage.c
@@ -651,6 +651,7 @@ hf_storage_device_enable (HalDevice *dev
hal_device_property_set_bool(device, "storage.automount_enabled_hint", TRUE);
hal_device_property_set_bool(device, "storage.no_partitions_hint", FALSE);
+ hal_device_property_set_string(device, "storage.originating_device", NULL);
hal_device_property_set_string(device, "storage.physical_device", NULL);
hal_device_property_set_string(device, "storage.model", NULL);
hal_device_property_set_string(device, "storage.vendor", NULL);
diff --git a/hald/freebsd/hf-usb.c b/hald/freebsd/hf-usb.c
index c287f92..7a30a61 100644
--- a/hald/freebsd/hf-usb.c
+++ b/hald/freebsd/hf-usb.c
@@ -314,6 +314,7 @@ hf_usb_device_new (HalDevice *parent,
device = hf_device_new(parent);
+ hal_device_property_set_string(device, "info.subsystem", "usb_device");
hal_device_property_set_string(device, "info.bus", "usb_device");
hal_device_property_set_string(device, "info.product", di->udi_product);
diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index 55f22f1..6c43ba2 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -108,7 +108,7 @@ blockdev_compute_udi (HalDevice *d)
} else {
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
"%s_storage",
- hal_device_property_get_string (d, "storage.physical_device"));
+ hal_device_property_get_string (d, "storage.originating_device"));
}
}
@@ -735,8 +735,8 @@ hotplug_event_begin_add_blockdev (const
hal_device_property_set_int (d, "block.minor", minor);
hal_device_property_set_bool (d, "block.is_volume", is_partition || is_device_mapper || is_fakevolume);
- if (hal_device_has_property(parent, "info.bus") &&
- (strcmp(hal_device_property_get_string(parent, "info.bus"), "platform") == 0) &&
+ if (hal_device_has_property(parent, "info.subsystem") &&
+ (strcmp(hal_device_property_get_string(parent, "info.subsystem"), "platform") == 0) &&
(sscanf(hal_device_property_get_string(parent, "platform.id"), "floppy.%d", &floppy_num) == 1)) {
/* for now, just cheat here for floppy drives */
@@ -751,6 +751,7 @@ hotplug_event_begin_add_blockdev (const
hal_device_property_set_string (d, "info.vendor", "");
hal_device_property_set_string (d, "info.product", "PC Floppy Drive");
hal_device_property_set_string (d, "storage.drive_type", "floppy");
+ hal_device_property_set_string (d, "storage.originating_device", hal_device_get_udi (parent));
hal_device_property_set_string (d, "storage.physical_device", hal_device_get_udi (parent));
hal_device_property_set_bool (d, "storage.removable", TRUE);
hal_device_property_set_bool (d, "storage.removable.media_available", FALSE);
@@ -836,8 +837,8 @@ hotplug_event_begin_add_blockdev (const
}
}
- /* Check info.bus */
- if ((bus = hal_device_property_get_string (d_it, "info.bus")) != NULL) {
+ /* Check info.subsystem */
+ if ((bus = hal_device_property_get_string (d_it, "info.subsystem")) != NULL) {
if (strcmp (bus, "scsi") == 0) {
scsidev = d_it;
physdev = d_it;
@@ -895,6 +896,7 @@ hotplug_event_begin_add_blockdev (const
goto error;
}
+ hal_device_property_set_string (d, "storage.originating_device", physdev_udi);
hal_device_property_set_string (d, "storage.physical_device", physdev_udi);
if (!hal_util_get_int_from_file (sysfs_path, "removable", (gint *) &is_removable, 10)) {
@@ -922,7 +924,7 @@ hotplug_event_begin_add_blockdev (const
*/
hal_device_property_set_bool (d, "storage.media_check_enabled", is_removable);
- parent_bus = hal_device_property_get_string (parent, "info.bus");
+ parent_bus = hal_device_property_get_string (parent, "info.subsystem");
if (parent_bus == NULL) {
HAL_INFO (("parent_bus is NULL - wrong parent?"));
goto error;
diff --git a/hald/linux/device.c b/hald/linux/device.c
index f6fe900..da76ef0 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -65,6 +65,7 @@ input_add (const gchar *sysfs_path, cons
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
if (parent_dev != NULL) {
+ hal_device_property_set_string (d, "input.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "input.physical_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
} else {
@@ -125,6 +126,7 @@ bluetooth_add (const gchar *sysfs_path,
hal_device_property_set_string (d, "info.category", "bluetooth_hci");
hal_device_add_capability (d, "bluetooth_hci");
+ hal_device_property_set_string (d, "bluetooth_hci.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "bluetooth_hci.physical_device", hal_device_get_udi (parent_dev));
hal_util_set_string_from_file (d, "bluetooth_hci.interface_name", sysfs_path, "name");
@@ -169,6 +171,7 @@ net_add (const gchar *sysfs_path, const
hal_device_property_set_string (d, "info.category", "net");
hal_device_add_capability (d, "net");
+ hal_device_property_set_string (d, "net.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "net.physical_device", hal_device_get_udi (parent_dev));
ifname = hal_util_get_last_element (sysfs_path);
@@ -269,7 +272,7 @@ net_compute_udi (HalDevice *d)
id = hal_device_property_get_string (d, "net.address");
if (id == NULL || (strcmp (id, "00:00:00:00:00:00") == 0)) {
/* Need to fall back to something else if mac not available. */
- id = hal_util_get_last_element(hal_device_property_get_string(d, "net.physical_device"));
+ id = hal_util_get_last_element(hal_device_property_get_string(d, "net.originating_device"));
}
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
"/org/freedesktop/Hal/devices/net_%s",
@@ -402,6 +405,7 @@ usbclass_add (const gchar *sysfs_path, c
hal_device_property_set_string (d, "info.product", "Printer");
hal_device_property_set_string (d, "printer.device", device_file);
+ hal_device_property_set_string (d, "printer.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "printer.physical_device", hal_device_get_udi (parent_dev));
}
@@ -639,6 +643,7 @@ sound_add (const gchar *sysfs_path, cons
hal_device_add_capability (d, "alsa");
hal_device_property_set_string (d, "alsa.device_file", device_file);
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
+ hal_device_property_set_string (d, "alsa.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "alsa.physical_device", hal_device_get_udi (parent_dev));
hal_device_property_set_int (d, "alsa.card", cardnum);
hal_device_property_set_string (d, "alsa.type", "control");
@@ -655,6 +660,7 @@ sound_add (const gchar *sysfs_path, cons
hal_device_add_capability (d, "alsa");
hal_device_property_set_string (d, "alsa.device_file", device_file);
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
+ hal_device_property_set_string (d, "alsa.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "alsa.physical_device", hal_device_get_udi (parent_dev));
hal_device_property_set_int (d, "alsa.card", cardnum);
hal_device_property_set_int (d, "alsa.device", devicenum);
@@ -699,6 +705,7 @@ sound_add (const gchar *sysfs_path, cons
hal_device_add_capability (d, "alsa");
hal_device_property_set_string (d, "alsa.device_file", device_file);
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
+ hal_device_property_set_string (d, "alsa.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "alsa.physical_device", hal_device_get_udi (parent_dev));
hal_device_property_set_int (d, "alsa.card", cardnum);
hal_device_property_set_int (d, "alsa.device", devicenum);
@@ -744,6 +751,7 @@ sound_add (const gchar *sysfs_path, cons
hal_device_add_capability (d, "oss");
hal_device_property_set_string (d, "oss.device_file", device_file);
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
+ hal_device_property_set_string (d, "oss.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "oss.physical_device", hal_device_get_udi (parent_dev));
hal_device_property_set_int (d, "oss.card", cardnum);
@@ -880,6 +888,7 @@ serial_add (const gchar *sysfs_path, con
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "info.category", "serial");
hal_device_add_capability (d, "serial");
+ hal_device_property_set_string (d, "serial.originating_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "serial.physical_device", hal_device_get_udi (parent_dev));
hal_device_property_set_string (d, "serial.device", device_file);
@@ -1056,6 +1065,7 @@ pci_add (const gchar *sysfs_path, const
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "pci");
hal_device_property_set_string (d, "info.bus", "pci");
if (parent_dev != NULL) {
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1229,6 +1239,7 @@ usb_add (const gchar *sysfs_path, const
if (strchr (bus_id, ':') == NULL) {
gint bmAttributes;
+ hal_device_property_set_string (d, "info.subsystem", "usb_device");
hal_device_property_set_string (d, "info.bus", "usb_device");
hal_util_set_driver (d, "info.linux.driver", sysfs_path);
@@ -1306,6 +1317,7 @@ usb_add (const gchar *sysfs_path, const
/* TODO: .level_number .parent_number */
} else {
+ hal_device_property_set_string (d, "info.subsystem", "usb");
hal_device_property_set_string (d, "info.bus", "usb");
/* take all usb_device.* properties from parent and make them usb.* on this object */
@@ -1369,6 +1381,7 @@ ide_add (const gchar *sysfs_path, const
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "ide");
hal_device_property_set_string (d, "info.bus", "ide");
if (parent_dev != NULL) {
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1419,6 +1432,7 @@ pnp_add (const gchar *sysfs_path, const
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "pnp");
hal_device_property_set_string (d, "info.bus", "pnp");
if (parent_dev != NULL) {
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1474,6 +1488,7 @@ platform_add (const gchar *sysfs_path, c
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "platform");
hal_device_property_set_string (d, "info.bus", "platform");
if (parent_dev != NULL) {
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1518,6 +1533,7 @@ serio_add (const gchar *sysfs_path, cons
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "serio");
hal_device_property_set_string (d, "info.bus", "serio");
if (parent_dev != NULL) {
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1565,6 +1581,7 @@ pcmcia_add (const gchar *sysfs_path, con
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "pcmcia");
hal_device_property_set_string (d, "info.bus", "pcmcia");
if (parent_dev != NULL) {
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1645,6 +1662,7 @@ scsi_add (const gchar *sysfs_path, const
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "scsi");
hal_device_property_set_string (d, "info.bus", "scsi");
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1738,6 +1756,7 @@ mmc_add (const gchar *sysfs_path, const
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "mmc");
hal_device_property_set_string (d, "info.bus", "mmc");
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1812,6 +1831,7 @@ xen_add (const gchar *sysfs_path, const
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "xen");
hal_device_property_set_string (d, "info.bus", "xen");
if (parent_dev != NULL) {
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -1893,6 +1913,7 @@ ieee1394_add (const gchar *sysfs_path, c
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "ieee1394");
hal_device_property_set_string (d, "info.bus", "ieee1394");
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -2029,6 +2050,7 @@ ccw_add (const gchar *sysfs_path, const
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "ccw");
hal_device_property_set_string (d, "info.bus", "ccw");
if (parent_dev != NULL)
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -2199,6 +2221,7 @@ ccwgroup_add (const gchar *sysfs_path, c
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "ccwgroup");
hal_device_property_set_string (d, "info.bus", "ccwgroup");
if (parent_dev != NULL)
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -2264,6 +2287,7 @@ iucv_add (const gchar *sysfs_path, const
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "iucv");
hal_device_property_set_string (d, "info.bus", "iucv");
if (parent_dev != NULL)
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
@@ -2347,6 +2371,7 @@ pseudo_add (const gchar *sysfs_path, con
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "pseudo");
hal_device_property_set_string (d, "info.bus", "pseudo");
if (parent_dev != NULL) {
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent_dev));
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index 7a8409f..c226a38 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -579,6 +579,7 @@ osspec_probe (void)
hald_runner_set_method_run_notify
((HaldRunnerRunNotify*) hotplug_event_process_queue, NULL);
root = hal_device_new ();
+ hal_device_property_set_string (root, "info.subsystem", "unknown");
hal_device_property_set_string (root, "info.bus", "unknown");
hal_device_property_set_string (root, "info.product", "Computer");
hal_device_property_set_string (root, "info.udi", "/org/freedesktop/Hal/devices/computer");
diff --git a/hald/linux/probing/probe-input.c b/hald/linux/probing/probe-input.c
index 6a18990..aff12d8 100644
--- a/hald/linux/probing/probe-input.c
+++ b/hald/linux/probing/probe-input.c
@@ -183,7 +183,7 @@ main (int argc, char *argv[])
HAL_ERROR (("Error: EVIOCGID failed: %s\n", strerror(errno)));
goto out;
}
- physical_device = getenv ("HAL_PROP_INPUT_PHYSICAL_DEVICE");
+ physical_device = getenv ("HAL_PROP_INPUT_ORIGINATING_DEVICE");
HAL_DEBUG (("probe-input: id.bustype=%i", id.bustype));
if (physical_device == NULL) {
diff --git a/hald/solaris/devinfo_ieee1394.c b/hald/solaris/devinfo_ieee1394.c
index 240af8c..4b85f41 100644
--- a/hald/solaris/devinfo_ieee1394.c
+++ b/hald/solaris/devinfo_ieee1394.c
@@ -80,6 +80,7 @@ devinfo_scsa1394_add(HalDevice *parent,
d = hal_device_new ();
devinfo_set_default_properties (d, parent, node, devfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "ieee1394");
hal_device_property_set_string (d, "info.bus", "ieee1394");
hal_device_property_set_string (d, "info.product", "FireWire SBP-2 device");
diff --git a/hald/solaris/devinfo_misc.c b/hald/solaris/devinfo_misc.c
index 2e1be2b..78498d9 100644
--- a/hald/solaris/devinfo_misc.c
+++ b/hald/solaris/devinfo_misc.c
@@ -69,6 +69,7 @@ devinfo_computer_add(HalDevice *parent,
d = hal_device_new ();
+ hal_device_property_set_string (d, "info.subsystem", "unknown");
hal_device_property_set_string (d, "info.bus", "unknown");
hal_device_property_set_string (d, "info.product", "Computer");
hal_device_property_set_string (d, "info.udi", "/org/freedesktop/Hal/devices/computer");
@@ -87,6 +88,7 @@ devinfo_computer_add(HalDevice *parent,
local_d = hal_device_new ();
hal_device_property_set_string (local_d, "info.parent", hal_device_get_udi (d));
+ hal_device_property_set_string (local_d, "info.subsystem", "unknown");
hal_device_property_set_string (local_d, "info.bus", "unknown");
hal_device_property_set_string (local_d, "info.product", "Local devices");
hal_device_property_set_string (local_d, "info.udi", "/org/freedesktop/Hal/devices/local");
diff --git a/hald/solaris/devinfo_pci.c b/hald/solaris/devinfo_pci.c
index 8bd026b..9b3c2d6 100644
--- a/hald/solaris/devinfo_pci.c
+++ b/hald/solaris/devinfo_pci.c
@@ -52,7 +52,7 @@ HalDevice *devinfo_pci_add (HalDevice *p
if (parent == NULL) {
return (NULL);
} else {
- s = (char *)hal_device_property_get_string (parent, "info.bus");
+ s = (char *)hal_device_property_get_string (parent, "info.subsystem");
if ((s == NULL) || (strcmp (s, "pci") != 0)) {
return (NULL);
}
@@ -62,6 +62,7 @@ HalDevice *devinfo_pci_add (HalDevice *p
d = hal_device_new ();
devinfo_set_default_properties (d, parent, node, devfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "pci");
hal_device_property_set_string (d, "info.bus", "pci");
vid = pid = svid = spid = 0;
diff --git a/hald/solaris/devinfo_storage.c b/hald/solaris/devinfo_storage.c
index 0026b70..f7d6512 100644
--- a/hald/solaris/devinfo_storage.c
+++ b/hald/solaris/devinfo_storage.c
@@ -165,6 +165,7 @@ devinfo_ide_host_add(HalDevice *parent,
devinfo_set_default_properties (d, parent, node, devfs_path);
hal_device_property_set_string (d, "info.product", "IDE host controller");
+ hal_device_property_set_string (d, "info.subsystem", "ide_host");
hal_device_property_set_string (d, "info.bus", "ide_host");
hal_device_property_set_int (d, "ide_host.number", 0); /* XXX */
@@ -182,6 +183,7 @@ devinfo_ide_device_add(HalDevice *parent
devinfo_set_default_properties (d, parent, node, devfs_path);
hal_device_property_set_string (parent, "info.product", "IDE device");
+ hal_device_property_set_string (parent, "info.subsystem", "ide");
hal_device_property_set_string (parent, "info.bus", "ide");
hal_device_property_set_int (parent, "ide.host", 0); /* XXX */
hal_device_property_set_int (parent, "ide.channel", 0);
@@ -253,6 +255,7 @@ devinfo_scsi_add(HalDevice *parent, di_n
d = hal_device_new ();
devinfo_set_default_properties (d, parent, node, devfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "scsi");
hal_device_property_set_string (d, "info.bus", "scsi");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
@@ -540,6 +543,7 @@ devinfo_lofi_add_major(HalDevice *parent
d = hal_device_new ();
devinfo_set_default_properties (d, parent, node, devfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "pseudo");
hal_device_property_set_string (d, "info.bus", "pseudo");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
@@ -1112,7 +1116,7 @@ devinfo_storage_hotplug_begin_add (HalDe
p_d = parent;
for (;;) {
- bus = hal_device_property_get_string (p_d, "info.bus");
+ bus = hal_device_property_get_string (p_d, "info.subsystem");
if (bus != NULL) {
for (i = 0; i < NELEM(busses); i++) {
if (strcmp(bus, busses[i]) == 0) {
@@ -1133,6 +1137,7 @@ devinfo_storage_hotplug_begin_add (HalDe
HAL_INFO (("no physical device %s", hal_device_get_udi (d)));
goto error;
}
+ hal_device_property_set_string (d, "storage.originating_device", hal_device_get_udi (phys_d));
hal_device_property_set_string (d, "storage.physical_device", hal_device_get_udi (phys_d));
hal_device_property_set_string (d, "storage.bus", phys_bus);
diff --git a/hald/solaris/devinfo_usb.c b/hald/solaris/devinfo_usb.c
index b3359a2..2f82e2b 100644
--- a/hald/solaris/devinfo_usb.c
+++ b/hald/solaris/devinfo_usb.c
@@ -66,6 +66,7 @@ devinfo_usb_add(HalDevice *parent, di_no
d = hal_device_new ();
devinfo_set_default_properties (d, parent, node, devfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "usb_device");
hal_device_property_set_string (d, "info.bus", "usb_device");
PROP_STR(d, node, s, "usb-product-name", "info.product");
PROP_STR(d, node, s, "usb-product-name", "usb_device.product");
@@ -117,6 +118,7 @@ devinfo_usb_if_add(HalDevice *parent, di
d = hal_device_new ();
devinfo_set_default_properties (d, parent, node, devfs_path);
+ hal_device_property_set_string (d, "info.subsystem", "usb");
hal_device_property_set_string (d, "info.bus", "usb");
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
diff --git a/libhal-storage/libhal-storage.c b/libhal-storage/libhal-storage.c
index 39bdc53..caae4b2 100644
--- a/libhal-storage/libhal-storage.c
+++ b/libhal-storage/libhal-storage.c
@@ -956,7 +956,7 @@ libhal_drive_from_udi (LibHalContext *ha
LIBHAL_PROP_EXTRACT_STRING ("storage.partitioning_scheme", drive->partition_scheme);
- LIBHAL_PROP_EXTRACT_STRING ("storage.physical_device", drive->physical_device);
+ LIBHAL_PROP_EXTRACT_STRING ("storage.originating_device", drive->physical_device);
LIBHAL_PROP_EXTRACT_STRING ("storage.firmware_version", drive->firmware_version);
LIBHAL_PROP_EXTRACT_STRING ("storage.serial", drive->serial);
diff --git a/tools/device-manager/Device.py b/tools/device-manager/Device.py
index 9ead11b..9cbcf01 100644
--- a/tools/device-manager/Device.py
+++ b/tools/device-manager/Device.py
@@ -24,7 +24,7 @@ class Device:
try:
if self.properties["info.virtual"]:
# do show all block devices, ide channels
- if not self.properties["info.bus"] in ["block", "ide_host"]:
+ if not self.properties["info.subsystem"] in ["block", "ide_host"]:
self.row = self.parent_device.row
# and recurse the childs
for c in self.children:
diff --git a/tools/device-manager/DeviceManager.py b/tools/device-manager/DeviceManager.py
index 7a3977b..3477b64 100644
--- a/tools/device-manager/DeviceManager.py
+++ b/tools/device-manager/DeviceManager.py
@@ -300,13 +300,13 @@ class DeviceManager(LibGladeApplication)
bus.set_label("Unknown")
d = device
while d:
- if d.properties.has_key("info.bus"):
- bus.set_label(Const.BUS_NAMES[d.properties["info.bus"]])
+ if d.properties.has_key("info.subsystem"):
+ bus.set_label(Const.BUS_NAMES[d.properties["info.subsystem"]])
break
d = self.udi_to_device(d.properties["info.parent"])
# guestimate product and vendor if we have no device information file
- if device.properties.has_key("info.bus") and device.properties["info.bus"]=="usb":
+ if device.properties.has_key("info.subsystem") and device.properties["info.subsystem"]=="usb":
if device.properties.has_key("info.product"):
product.set_label("%s"%device.properties["info.product"])
elif device.properties.has_key("usb.product"):
@@ -326,7 +326,7 @@ class DeviceManager(LibGladeApplication)
vendor.set_label("Unknown")
- elif device.properties.has_key("info.bus") and device.properties["info.bus"]=="pci":
+ elif device.properties.has_key("info.subsystem") and device.properties["info.subsystem"]=="pci":
if device.properties.has_key("info.product"):
product.set_label("%s"%device.properties["info.product"])
elif device.properties.has_key("pci.product"):
@@ -344,7 +344,7 @@ class DeviceManager(LibGladeApplication)
vendor.set_label("Unknown (0x%x)"%device.properties["pci.vendor_id"])
else:
vendor.set_label("Unknown")
- elif device.properties.has_key("info.bus") and device.properties["info.bus"]=="block":
+ elif device.properties.has_key("info.subsystem") and device.properties["info.subsystem"]=="block":
if device.properties.has_key("info.product"):
product.set_label("%s"%device.properties["info.product"])
else:
@@ -373,7 +373,7 @@ class DeviceManager(LibGladeApplication)
def update_tab_usb(self, device):
"""Updates the 'USB' tab given a Device object; may hide it"""
page = self.xml.get_widget("device_notebook").get_nth_page(1)
- if not device.properties.has_key("info.bus") or device.properties["info.bus"]!="usb":
+ if not device.properties.has_key("info.subsystem") or device.properties["info.subsystem"]!="usb":
page.hide_all()
return
@@ -407,7 +407,7 @@ class DeviceManager(LibGladeApplication)
def update_tab_pci(self, device):
"""Updates the 'PCI' tab given a Device object; may hide it"""
page = self.xml.get_widget("device_notebook").get_nth_page(2)
- if not device.properties.has_key("info.bus") or device.properties["info.bus"]!="pci":
+ if not device.properties.has_key("info.subsystem") or device.properties["info.subsystem"]!="pci":
page.hide_all()
return
diff --git a/tools/device-manager/Representation.py b/tools/device-manager/Representation.py
index d6736d6..70c1978 100644
--- a/tools/device-manager/Representation.py
+++ b/tools/device-manager/Representation.py
@@ -57,9 +57,9 @@ class Representation:
if product=="Computer":
return self.icons["computer"]
- # First look at bus type, every device got Bus property
- if device.properties.has_key("info.bus"):
- bus = device.properties["info.bus"]
+ # First look at bus type, every device got subsystem property
+ if device.properties.has_key("info.subsystem"):
+ bus = device.properties["info.subsystem"]
if bus=="usb_device":
icon = self.icons["bus_usb"]
elif bus=="pci":
diff --git a/tools/gen-libgphoto-hal-fdi b/tools/gen-libgphoto-hal-fdi
index d26ff88..7cd3eb8 100755
--- a/tools/gen-libgphoto-hal-fdi
+++ b/tools/gen-libgphoto-hal-fdi
@@ -18,7 +18,7 @@ cat <<EOF
-->
<deviceinfo version="0.2">
<device>
- <match key="info.bus" string="usb">
+ <match key="info.subsystem" string="usb">
EOF
/usr/lib/libgphoto2/print-usb-usermap | grep -v '^#' | tr -s ' ' | cut -d' ' -f 3,4 | sort -u | grep -v "^0x0000" | while read ven dev; do
More information about the hal-commit
mailing list