hal: Branch 'hal-0_5_9-branch' - 3 commits

David Zeuthen david at kemper.freedesktop.org
Mon Apr 16 12:41:57 PDT 2007


 hald/freebsd/hf-pci.c     |   13 ++++++++++---
 hald/freebsd/hf-storage.c |   26 +++++++++++++++++++++++++-
 hald/freebsd/hf-usb.c     |    8 +++++---
 partutil/Makefile.am      |   11 +++--------
 4 files changed, 43 insertions(+), 15 deletions(-)

New commits:
diff-tree c8e4249b64b0a46b052ab3a83effc8986404e70c (from 639e6e5d3b048aa4b768b41dc3fc99f7c566384c)
Author: Doug Goldstein <cardoe at gentoo.org>
Date:   Mon Apr 16 15:40:05 2007 -0400

    fix how we build partutil
    
    05_freebsd_partutil_make_fix.patch corrects the syntax in the
    Makefile.am (don't forget to autoreconf) and I just inverted the logic
    in it since we only want that code to compile on Linux so it'll fix it
    for Solaris as well.

diff --git a/partutil/Makefile.am b/partutil/Makefile.am
index bf48de6..5c7b8f3 100644
--- a/partutil/Makefile.am
+++ b/partutil/Makefile.am
@@ -1,17 +1,12 @@
-if HALD_COMPILE_SOLARIS 
-# do nothing
-else if HALD_COMPILE_FREEBSD
-# do nothing
-else 
+if HALD_COMPILE_LINUX
+noinst_LTLIBRARIES = libpartutil.la
+endif
 
 INCLUDES = @GLIB_CFLAGS@
 
-noinst_LTLIBRARIES = libpartutil.la
-
 libpartutil_la_SOURCES = partutil.h partutil.c ../hald/logger.c
 
 libpartutil_la_LIBADD = @GLIB_LIBS@ @PARTED_LIBS@
 
 clean-local :
 	rm -f *~
-endif
diff-tree 639e6e5d3b048aa4b768b41dc3fc99f7c566384c (from 00a651c28c552d207178e1b6be1dc2fef80b211d)
Author: Joe Marcus Clarke <marcus at FreeBSD.org>
Date:   Sat Apr 14 17:21:52 2007 -0400

    fix compilation on FreeBSD
    
    Fix issues with the FreeBSD backend using functions that were removed from
    HAL prior to the 0.5.9 release. This patch wouldn't be available without the
    help of Roy Marples.
    
    Submitted by:	Doug Goldstein <cardoe at gentoo.org>

diff --git a/hald/freebsd/hf-pci.c b/hald/freebsd/hf-pci.c
index 400f183..8709913 100644
--- a/hald/freebsd/hf-pci.c
+++ b/hald/freebsd/hf-pci.c
@@ -38,6 +38,7 @@
 
 #include "../hald.h"
 #include "../ids.h"
+#include "../device.h"
 #include "../logger.h"
 #include "../util.h"
 
@@ -210,9 +211,15 @@ hf_pci_probe_bus (HalDevice *parent, int
 
 	  info = g_new(DeviceInfo, 1);
 	  info->device = hf_device_store_match(hald_get_gdl(),
-			                       hal_property_new_int("pci.freebsd.bus", p->pc_sel.pc_bus),
-					       hal_property_new_int("pci.freebsd.device", p->pc_sel.pc_dev),
-					       hal_property_new_int("pci.freebsd.function", p->pc_sel.pc_func),
+			  		       "pci.freebsd.bus",
+					       HAL_PROPERTY_TYPE_INT32,
+					       p->pc_sel.pc_bus,
+					       "pci.freebsd.device",
+					       HAL_PROPERTY_TYPE_INT32,
+					       p->pc_sel.pc_dev,
+					       "pci.freebsd.function",
+					       HAL_PROPERTY_TYPE_INT32,
+					       p->pc_sel.pc_func,
 					       NULL);
 	  info->p = *p;
 	  info->secondary_bus = hf_pci_get_register(p, PCIR_SECBUS_1);
diff --git a/hald/freebsd/hf-usb.c b/hald/freebsd/hf-usb.c
index f7b2bf0..b7991b5 100644
--- a/hald/freebsd/hf-usb.c
+++ b/hald/freebsd/hf-usb.c
@@ -372,11 +372,11 @@ hf_usb_device_new (HalDevice *parent,
       can_wake_up = (config_desc.bmAttributes & UC_REMOTE_WAKEUP) != 0;
       num_interfaces = config_desc.bNumInterface;
 
-      if (config_desc->iConfiguration != 0)
+      if (config_desc.iConfiguration != 0)
 	{
 	  char *configuration;
 
-	  configuration = hf_usb_get_string_descriptor(controller->fd, di->udi_addr, config_desc->iConfiguration, NULL);
+	  configuration = hf_usb_get_string_descriptor(controller->fd, di->udi_addr, config_desc.iConfiguration, NULL);
 	  if (configuration)
 	    {
 	      hal_device_property_set_string(device, "usb_device.configuration", configuration);
@@ -424,6 +424,8 @@ hf_usb_device_new (HalDevice *parent,
 
 static HalDevice *
 hf_usb_interface_device_new (HalDevice *parent,
+			     Controller *controller,
+			     const struct usb_device_info *di,
 			     const usb_interface_descriptor_t *desc)
 {
   HalDevice *device;
@@ -576,7 +578,7 @@ hf_usb_probe_device (HalDevice *parent,
 	      break;
 	    }
 
-	  if_device = hf_usb_interface_device_new(device, if_desc);
+	  if_device = hf_usb_interface_device_new(device, controller, device_info, if_desc);
 	  hf_device_preprobe_and_add(if_device);
 
 	  p += USB_INTERFACE_DESCRIPTOR_SIZE + if_desc->bNumEndpoints * USB_ENDPOINT_DESCRIPTOR_SIZE;
diff-tree 00a651c28c552d207178e1b6be1dc2fef80b211d (from 1078461043f99e2f9adc51d9101e3c343a04ff6d)
Author: Joe Marcus Clarke <marcus at FreeBSD.org>
Date:   Sat Apr 14 17:14:15 2007 -0400

    do not re-probe devices that are managed by hald-addon-storage
    
    Do not re-probe devices that are managed by hald-addon-storage since that
    will result in a double-probe and data corruption.  In particular, this
    fixes a problem with CD unmounting when ATAPICAM is enabled.

diff --git a/hald/freebsd/hf-storage.c b/hald/freebsd/hf-storage.c
index 19c3ad7..347aef3 100644
--- a/hald/freebsd/hf-storage.c
+++ b/hald/freebsd/hf-storage.c
@@ -65,6 +65,7 @@ static GNode *hf_storage_geom_tree = NUL
 static GHashTable *hf_storage_geom_hash = NULL;
 
 static void hf_storage_init_geom (void);
+static gboolean hf_storage_device_has_addon (HalDevice *device);
 
 static void
 hf_storage_geom_free (gpointer data)
@@ -587,7 +588,8 @@ hf_storage_conftxt_timeout_cb (gpointer 
 		{
 		  /* disk changed */
 		  device = hf_devtree_find_from_name(hald_get_gdl(), disk->name);
-		  if (device && hal_device_has_capability(device, "storage"))
+		  if (device && hal_device_has_capability(device, "storage") &&
+		      ! hf_storage_device_has_addon(device))
 		    hf_storage_device_rescan_real(device);
 		}
 	    }
@@ -768,6 +770,28 @@ hf_storage_device_rescan (HalDevice *dev
     return FALSE;
 }
 
+static gboolean
+hf_storage_device_has_addon (HalDevice *device)
+{
+  HalDeviceStrListIter iter;
+
+  g_return_val_if_fail(device != NULL, FALSE);
+
+  for (hal_device_property_strlist_iter_init(device, "info.addons", &iter);
+       hal_device_property_strlist_iter_is_valid(&iter);
+       hal_device_property_strlist_iter_next(&iter))
+    {
+      const char *addon;
+
+      addon = hal_device_property_strlist_iter_get_value(&iter);
+
+      if (! strcmp(addon, "hald-addon-storage"))
+        return TRUE;
+    }
+
+  return FALSE;
+}
+
 HFHandler hf_storage_handler = {
   .init =		hf_storage_init,
   .probe =		hf_storage_probe,


More information about the hal-commit mailing list