summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <david@fubar.dk>2004-04-26 16:52:54 +0000
committerDavid Zeuthen <david@fubar.dk>2004-04-26 16:52:54 +0000
commit2c043493418bd3d8420f9d31a9e52b09140c5234 (patch)
tree560ca835d64473c3347a6bda6a5ad1ab07e53d76
parent1fd4f037c460bcd08ff21692c953b7ff4bfe8818 (diff)
new file because with the recent change in how probing is handled, myHAL_0_2_90
CD-ROM wasn't added until 30 seconds late into the process as the macio glue wasn't handled add linux/macio_bus_device.c add macio_bus_handler to bus_device_handlers Add macio mapping
-rw-r--r--ChangeLog12
-rw-r--r--hald/Makefile.am1
-rw-r--r--hald/linux/macio_bus_device.c96
-rw-r--r--hald/linux/osspec.c2
-rw-r--r--tools/device-manager/Const.py.in1
5 files changed, 112 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 65713b21..505185d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-04-26 David Zeuthen <david@fubar.dk>
+
+ * hald/linux/macio_bus_device.c: new file because with the recent
+ change in how probing is handled, my CD-ROM wasn't added until 30
+ seconds late into the process as the macio glue wasn't handled
+
+ * hald/Makefile.am (hald_SOURCES): add linux/macio_bus_device.c
+
+ * hald/linux/osspec.c: add macio_bus_handler to bus_device_handlers
+
+ * tools/device-manager/Const.py.in (BUS_NAMES): Add macio mapping
+
2004-04-25 David Zeuthen <david@fubar.dk>
* doc/TODO: Add our notes about current issues with the Linux 2.6
diff --git a/hald/Makefile.am b/hald/Makefile.am
index eae26a4a..c83199c2 100644
--- a/hald/Makefile.am
+++ b/hald/Makefile.am
@@ -44,6 +44,7 @@ hald_SOURCES += \
linux/ide_host_bus_device.c \
linux/ide_bus_device.c \
linux/pcmcia_socket_class_device.c \
+ linux/macio_bus_device.c \
linux/linux_dvd_rw_utils.h linux/linux_dvd_rw_utils.c
# linux/ieee1394_host_class_device.c
diff --git a/hald/linux/macio_bus_device.c b/hald/linux/macio_bus_device.c
new file mode 100644
index 00000000..ecb1ad01
--- /dev/null
+++ b/hald/linux/macio_bus_device.c
@@ -0,0 +1,96 @@
+/***************************************************************************
+ * CVSID: $Id$
+ *
+ * MacIO bus device
+ *
+ * Copyright (C) 2004 David Zeuthen, <david@fubar.dk>
+ *
+ * Licensed under the Academic Free License version 2.0
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ **************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <getopt.h>
+#include <assert.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+#include "../logger.h"
+#include "../device_store.h"
+#include "bus_device.h"
+#include "common.h"
+
+/**
+ * @defgroup HalDaemonLinuxIde IDE
+ * @ingroup HalDaemonLinux
+ * @brief IDE
+ * @{
+ */
+
+
+static char *
+macio_device_compute_udi (HalDevice *d, int append_num)
+{
+ static char buf[256];
+
+ if (append_num == -1)
+ sprintf (buf, "/org/freedesktop/Hal/devices/ide_%s",
+ hal_device_property_get_string (d, "macio.bus_id"));
+ else
+ sprintf (buf, "/org/freedesktop/Hal/devices/ide_%s/%d",
+ hal_device_property_get_string (d, "macio.bus_id"),
+ append_num);
+
+ return buf;
+}
+
+static void
+macio_device_pre_process (BusDeviceHandler *self,
+ HalDevice *d,
+ const char *sysfs_path,
+ struct sysfs_device *device)
+{
+ hal_device_property_set_string (d, "macio.bus_id", device->bus_id);
+ hal_device_property_set_bool (d, "info.virtual", TRUE);
+}
+
+
+/** Method specialisations for bustype pci */
+BusDeviceHandler macio_bus_handler = {
+ bus_device_init, /**< init function */
+ bus_device_detection_done, /**< detection is done */
+ bus_device_shutdown, /**< shutdown function */
+ bus_device_tick, /**< timer function */
+ bus_device_accept, /**< accept function */
+ bus_device_visit, /**< visitor function */
+ bus_device_removed, /**< device is removed */
+ macio_device_compute_udi, /**< UDI computing function */
+ macio_device_pre_process, /**< add more properties */
+ bus_device_got_udi, /**< got UDI */
+ "macio", /**< sysfs bus name */
+ "macio" /**< namespace */
+};
+
+
+/** @} */
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index 1364b14e..ad3467d9 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -68,6 +68,7 @@ extern BusDeviceHandler usb_bus_handler;
extern BusDeviceHandler usbif_bus_handler;
extern BusDeviceHandler ide_host_bus_handler;
extern BusDeviceHandler ide_bus_handler;
+extern BusDeviceHandler macio_bus_handler;
/*
* NOTE! Order can be significant here, especially at startup time
@@ -95,6 +96,7 @@ static BusDeviceHandler* bus_device_handlers[] = {
&usbif_bus_handler,
&ide_host_bus_handler,
&ide_bus_handler,
+ &macio_bus_handler,
NULL
};
diff --git a/tools/device-manager/Const.py.in b/tools/device-manager/Const.py.in
index a5e1af4a..9b6e5f3d 100644
--- a/tools/device-manager/Const.py.in
+++ b/tools/device-manager/Const.py.in
@@ -27,6 +27,7 @@ BUS_NAMES = {"usb" : "USB",
"block" : "Block",
"ide" : "IDE",
"ide_host" : "IDE Host",
+ "macio" : "MacIO",
"ieee1394_host" : "IEEE1394 Host",
"ieee1394_node" : "IEEE1394 Node",
"ieee1394" : "IEEE1394 Device"}