[7/13] Add support for the S/390 iucv bus.

Cornelia Huck cohuck at de.ibm.com
Mon Jun 27 01:45:38 PDT 2005


[7/13] Add support for the S/390 iucv bus.

The iucv bus is for virtual devices under z/VM - currently only
netiucv is implemented.

 physdev.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+)

Index: hald/linux2/physdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/physdev.c,v
retrieving revision 1.16
diff -u -r1.16 physdev.c
--- hald/linux2/physdev.c	25 Mar 2005 03:24:51 -0000	1.16
+++ hald/linux2/physdev.c	23 Jun 2005 13:59:57 -0000
@@ -1142,6 +1142,64 @@
 
 /*--------------------------------------------------------------------------------------------------------------*/
 
+static inline void
+iucv_add_netiucv_properties (HalDevice *d, const gchar *sysfs_path)
+{
+	hal_util_set_string_from_file (d, "iucv.netiucv.user", sysfs_path,
+				       "user");
+	hal_util_set_int_from_file (d, "iucv.netiucv.buffer", sysfs_path,
+				    "buffer", 10);
+}
+
+static HalDevice *
+iucv_add (const gchar *sysfs_path, HalDevice *parent)
+{
+	HalDevice *d;
+	const gchar *bus_id;
+	gchar driver_name[256];
+
+	bus_id = hal_util_get_last_element (sysfs_path);
+
+	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", "iucv");
+	if (parent != NULL)
+                hal_device_property_set_string (d, "info.parent", parent->udi);
+        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_device_property_set_string (d, "iucv.bus_id", bus_id);
+
+	if (hal_util_get_driver_name (sysfs_path, driver_name)) {
+		if (!strncmp (driver_name, "netiucv", 7))
+			iucv_add_netiucv_properties (d, sysfs_path);
+	}
+	return d;
+}
+
+static gboolean
+iucv_compute_udi (HalDevice *d)
+{
+	gchar udi[256];
+
+	hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
+			      "/org/freedesktop/Hal/devices/iucv_%s",
+			      hal_device_property_get_string
+			      (d, "iucv.bus_id"));
+	hal_device_set_udi (d, udi);
+	hal_device_property_set_string (d, "info.udi", udi);
+	return TRUE;
+
+}
+
+/*--------------------------------------------------------------------------------------------------------------*/
+
 static gboolean
 physdev_remove (HalDevice *d)
 {
@@ -1236,6 +1595,13 @@
 	.compute_udi = ccwgroup_compute_udi,
 	.remove      = physdev_remove
 };
+
+static PhysDevHandler physdev_handler_iucv = {
+	.subsystem   = "iucv",
+	.add         = iucv_add,
+	.compute_udi = iucv_compute_udi,
+	.remove      = physdev_remove
+};
 
 static PhysDevHandler *phys_handlers[] = {
 	&physdev_handler_pci,
@@ -1249,6 +1630,7 @@
 	&physdev_handler_ieee1394,
 	&physdev_handler_ccw,
 	&physdev_handler_ccwgroup,
+	&physdev_handler_iucv,
 	NULL
 };
 
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list