View | Details | Raw Unified | Return to bug 183236
Collapse All | Expand All

(-)Makefile (-4 / +4 lines)
Lines 4-10 Link Here
4
4
5
PORTNAME=	hal
5
PORTNAME=	hal
6
DISTVERSION=	0.5.14
6
DISTVERSION=	0.5.14
7
PORTREVISION=	21
7
PORTREVISION=	22
8
CATEGORIES=	sysutils
8
CATEGORIES=	sysutils
9
MASTER_SITES=	http://hal.freedesktop.org/releases/
9
MASTER_SITES=	http://hal.freedesktop.org/releases/
10
10
Lines 13-21 Link Here
13
13
14
BUILD_DEPENDS=	${LOCALBASE}/include/linux/videodev2.h:${PORTSDIR}/multimedia/v4l_compat
14
BUILD_DEPENDS=	${LOCALBASE}/include/linux/videodev2.h:${PORTSDIR}/multimedia/v4l_compat
15
# keep shlib version, to prevent confusion with polkit-* from sysutils/polkit
15
# keep shlib version, to prevent confusion with polkit-* from sysutils/polkit
16
LIB_DEPENDS=	polkit.2:${PORTSDIR}/sysutils/policykit \
16
LIB_DEPENDS=	libpolkit.so.2:${PORTSDIR}/sysutils/policykit \
17
		volume_id:${PORTSDIR}/devel/libvolume_id \
17
		libvolume_id.so:${PORTSDIR}/devel/libvolume_id \
18
		ck-connector:${PORTSDIR}/sysutils/consolekit
18
		libck-connector.so:${PORTSDIR}/sysutils/consolekit
19
RUN_DEPENDS=	${LOCALBASE}/share/pciids/pci.ids:${PORTSDIR}/misc/pciids
19
RUN_DEPENDS=	${LOCALBASE}/share/pciids/pci.ids:${PORTSDIR}/misc/pciids
20
20
21
USES=		pathfix gettext gmake pkgconfig
21
USES=		pathfix gettext gmake pkgconfig
(-)files/patch-hald_freebsd_Makefile.in (+36 lines)
Line 0 Link Here
1
--- ./hald/freebsd/Makefile.in.orig	2009-11-30 23:22:38.000000000 +0100
2
+++ ./hald/freebsd/Makefile.in	2013-10-22 02:07:00.268399458 +0200
3
@@ -59,13 +59,14 @@
4
 	hf-pcmcia.c hf-pcmcia.h hf-scsi.c hf-scsi.h hf-serial.c \
5
 	hf-serial.h hf-sound.c hf-sound.h hf-storage.c hf-storage.h \
6
 	hf-usb.c hf-usb.h hf-util.c hf-util.h hf-volume.c hf-volume.h \
7
-	osspec.c hal-file-monitor.c hf-usb2.c hf-usb2.h
8
+	osspec.c hal-file-monitor.c hf-usb2.c hf-usb2.h \
9
+	hf-memcard.c hf-memcard.h
10
 @HAVE_LIBUSB20_TRUE@am__objects_1 = hf-usb2.lo
11
 am_libhald_freebsd_la_OBJECTS = hf-acpi.lo hf-ata.lo hf-block.lo \
12
 	hf-computer.lo hf-devd.lo hf-devtree.lo hf-drm.lo hf-net.lo \
13
 	hf-pci.lo hf-pcmcia.lo hf-scsi.lo hf-serial.lo hf-sound.lo \
14
 	hf-storage.lo hf-usb.lo hf-util.lo hf-volume.lo osspec.lo \
15
-	hal-file-monitor.lo $(am__objects_1)
16
+	hf-memcard.lo hal-file-monitor.lo $(am__objects_1)
17
 libhald_freebsd_la_OBJECTS = $(am_libhald_freebsd_la_OBJECTS)
18
 AM_V_lt = $(am__v_lt_$(V))
19
 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
20
@@ -325,7 +326,7 @@
21
 	hf-scsi.c hf-scsi.h hf-serial.c hf-serial.h hf-sound.c \
22
 	hf-sound.h hf-storage.c hf-storage.h hf-usb.c hf-usb.h \
23
 	hf-util.c hf-util.h hf-volume.c hf-volume.h osspec.c \
24
-	hal-file-monitor.c $(am__append_1)
25
+	hf-memcard.c hf-memcard.h hal-file-monitor.c $(am__append_1)
26
 libhald_freebsd_la_LDFLAGS = -lcam $(am__append_2)
27
 EXTRA_DIST = README TODO
28
 all: all-recursive
29
@@ -388,6 +389,7 @@
30
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-devd.Plo@am__quote@
31
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-devtree.Plo@am__quote@
32
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-drm.Plo@am__quote@
33
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-memcard.Plo@am__quote@
34
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-net.Plo@am__quote@
35
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-pci.Plo@am__quote@
36
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hf-pcmcia.Plo@am__quote@
(-)files/patch-hald_freebsd_hf-devtree.c (+21 lines)
Line 0 Link Here
1
--- ./hald/freebsd/hf-devtree.c.orig	2009-09-17 15:47:14.000000000 +0200
2
+++ ./hald/freebsd/hf-devtree.c	2013-10-22 02:16:42.548388644 +0200
3
@@ -36,6 +36,7 @@
4
 #include "hf-ata.h"
5
 #include "hf-block.h"
6
 #include "hf-drm.h"
7
+#include "hf-memcard.h"
8
 #include "hf-pcmcia.h"
9
 #include "hf-storage.h"
10
 #include "hf-util.h"
11
@@ -388,7 +389,9 @@
12
   { "psm",		hf_devtree_psm_set_properties		},
13
   { "sio",		NULL					},
14
   { "speaker",		NULL					},
15
-  { "usbus",		NULL					}
16
+  { "usbus",		NULL					},
17
+  { "mmc",		hf_mmc_host_set_properties		},
18
+  { "mmcsd",		hf_mmc_set_properties			}
19
 };
20
 
21
 static void
(-)files/patch-hald_freebsd_hf-memcard.c (+109 lines)
Line 0 Link Here
1
--- ./hald/freebsd/hf-memcard.c.orig	2013-10-22 01:49:10.228430727 +0200
2
+++ ./hald/freebsd/hf-memcard.c	2013-10-22 01:48:06.869268391 +0200
3
@@ -0,0 +1,106 @@
4
+/***************************************************************************
5
+ * CVSID: $Id$
6
+ *
7
+ * hf-memcard.c : memory card support
8
+ *
9
+ * Copyright (C) 2013 Alberto Villa <avilla@FreeBSD.org>
10
+ *
11
+ * This program is free software; you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation; either version 2 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program; if not, write to the Free Software
23
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24
+ *
25
+ **************************************************************************/
26
+
27
+#ifdef HAVE_CONFIG_H
28
+#  include <config.h>
29
+#endif
30
+
31
+#include <string.h>
32
+#include <errno.h>
33
+#include <stdlib.h>
34
+#include <unistd.h>
35
+
36
+#include "../logger.h"
37
+
38
+#include "hf-memcard.h"
39
+#include "hf-block.h"
40
+#include "hf-devtree.h"
41
+#include "hf-storage.h"
42
+#include "hf-util.h"
43
+
44
+static HalDevice *
45
+hf_memcard_block_device_new (HalDevice *parent,
46
+                             const char *driver,
47
+                             int unit,
48
+                             const char *drive_type)
49
+{
50
+  HalDevice *device;
51
+  char devname[16];
52
+
53
+  snprintf(devname, sizeof(devname), "%s%d", driver, unit);
54
+
55
+  g_return_val_if_fail(HAL_IS_DEVICE(parent), NULL);
56
+  g_return_val_if_fail(devname != NULL, NULL);
57
+
58
+  device = hf_device_new(parent);
59
+
60
+  hf_devtree_device_set_name(device, devname);
61
+  hf_block_device_enable(device, devname);
62
+
63
+  hf_storage_device_enable(device);
64
+
65
+  hal_device_copy_property(parent, "info.subsystem", device, "storage.bus");
66
+  hal_device_property_set_string(device, "storage.originating_device", hal_device_get_udi(parent));
67
+  hal_device_property_set_bool(device, "storage.removable", TRUE);
68
+  hal_device_property_set_bool(device, "storage.media_check_enabled", TRUE);
69
+  hal_device_property_set_bool(device, "storage.removable.support_async_notification", FALSE);
70
+  hal_device_property_set_bool(device, "storage.hotpluggable", TRUE);
71
+  if (drive_type)
72
+    {
73
+      hal_device_property_set_string(device, "storage.drive_type", drive_type);
74
+    }
75
+
76
+  if (hf_device_preprobe(device))
77
+    {
78
+      hf_block_device_complete(device, device, FALSE);
79
+      hf_device_add(device);
80
+      hf_storage_device_probe(device, FALSE);
81
+    }
82
+
83
+  return device;
84
+}
85
+
86
+void
87
+hf_mmc_host_set_properties (HalDevice *device)
88
+{
89
+  hal_device_property_set_string(device, "info.subsystem", "mmc_host");
90
+  hal_device_copy_property(device, "freebsd.unit", device, "mmc_host.host");
91
+}
92
+
93
+void
94
+hf_mmc_set_properties (HalDevice *device)
95
+{
96
+  HalDevice *block_device;
97
+
98
+  hal_device_property_set_string(device, "info.subsystem", "mmc");
99
+
100
+  hf_memcard_block_device_new(device,
101
+                              hal_device_property_get_string(device, "freebsd.driver"),
102
+                              hal_device_property_get_int(device, "freebsd.unit"),
103
+                              "sd_mmc");
104
+
105
+  /* This information belongs to the block device. */
106
+  hal_device_property_remove(device, "freebsd.device_file");
107
+  hal_device_property_remove(device, "freebsd.driver");
108
+  hal_device_property_remove(device, "freebsd.unit");
109
+}
(-)files/patch-hald_freebsd_hf-memcard.h (+39 lines)
Line 0 Link Here
1
--- ./hald/freebsd/hf-memcard.h.orig	2013-10-22 01:49:12.608421644 +0200
2
+++ ./hald/freebsd/hf-memcard.h	2013-10-22 01:41:55.228962237 +0200
3
@@ -0,0 +1,36 @@
4
+/***************************************************************************
5
+ * CVSID: $Id$
6
+ *
7
+ * hf-memcard.h : memory card support
8
+ *
9
+ * Copyright (C) 2013 Alberto Villa <avilla@FreeBSD.org>
10
+ *
11
+ * This program is free software; you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation; either version 2 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program; if not, write to the Free Software
23
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24
+ *
25
+ **************************************************************************/
26
+
27
+#ifndef _HF_MEMCARD_H
28
+#define _HF_MEMCARD_H
29
+
30
+#ifdef HAVE_CONFIG_H
31
+#  include <config.h>
32
+#endif
33
+
34
+#include "../device.h"
35
+
36
+void hf_mmc_host_set_properties (HalDevice *device);
37
+void hf_mmc_set_properties (HalDevice *device);
38
+
39
+#endif /* _HF_MEMCARD_H */
(-)files/patch-hald_freebsd_hf-scsi.c (+28 lines)
Line 0 Link Here
1
--- ./hald/freebsd/hf-scsi.c.orig	2009-08-24 14:42:29.000000000 +0200
2
+++ ./hald/freebsd/hf-scsi.c	2013-10-23 13:11:08.979758920 +0200
3
@@ -223,7 +223,7 @@
4
 	      hal_device_copy_property(parent, "scsi.lun", device, "storage.lun");
5
 	      /* do not stop here, in case it's an umass device */
6
 	    }
7
-	  else if (! strcmp(bus, "usb"))
8
+	  else if (hal_device_has_property(parent, "scsi_host.freebsd.driver") && ! strcmp(hal_device_property_get_string(parent, "scsi_host.freebsd.driver"), "umass"))
9
 	    {
10
 	      hal_device_property_set_string(device, "storage.bus", "usb");
11
 	      hal_device_property_set_string(device, "storage.originating_device", hal_device_get_udi(parent));
12
@@ -508,6 +508,16 @@
13
 	      if (! parent || ! hal_device_property_get_bool(parent, "info.ignore"))
14
 		{
15
 		  device = hf_scsi_bus_device_new(parent, match);
16
+		  /*
17
+		   * Due to synchronization problems, the SCSI bus could be
18
+		   * created before the USB interface. Mark it as a USB mass
19
+		   * storage device to ensure it is detected as such.
20
+		   */
21
+		  if (! strcmp(match->dev_name, "umass-sim"))
22
+		    {
23
+		      hal_device_property_set_string(device, "scsi_host.freebsd.driver", "umass");
24
+		      hal_device_property_set_int(device, "scsi_host.freebsd.unit", match->unit_number);
25
+		    }
26
 		  hf_device_preprobe_and_add(device);
27
 		}
28
 	    }
(-)files/patch-hald_freebsd_hf-usb2.c (-3 / +16 lines)
Lines 1-5 Link Here
1
--- hald/freebsd/hf-usb2.c.orig	2009-08-24 14:42:29.000000000 +0200
1
--- ./hald/freebsd/hf-usb2.c.orig	2009-08-24 14:42:29.000000000 +0200
2
+++ hald/freebsd/hf-usb2.c	2011-06-28 16:18:02.000000000 +0200
2
+++ ./hald/freebsd/hf-usb2.c	2013-10-23 13:10:36.639758556 +0200
3
@@ -22,7 +22,7 @@
3
@@ -22,7 +22,7 @@
4
  **************************************************************************/
4
  **************************************************************************/
5
 
5
 
Lines 9-15 Link Here
9
 #endif
9
 #endif
10
 
10
 
11
 #include <string.h>
11
 #include <string.h>
12
@@ -42,246 +42,200 @@
12
@@ -42,246 +42,213 @@
13
 static struct libusb20_backend *hf_usb2_be = NULL;
13
 static struct libusb20_backend *hf_usb2_be = NULL;
14
 
14
 
15
 static void
15
 static void
Lines 94-99 Link Here
94
+
94
+
95
+			hf_usb_device_compute_udi(device);
95
+			hf_usb_device_compute_udi(device);
96
+			hf_device_add(device);
96
+			hf_device_add(device);
97
+
98
+			/*
99
+			 * The SCSI bus could already exist; make it a child of
100
+			 * this USB interface.
101
+			 */
102
+			if (driver && !strcmp(driver, "umass")) {
103
+				HalDevice *scsi_bus;
104
+				scsi_bus = hf_device_store_match(hald_get_gdl(),
105
+				    "scsi_host.freebsd.driver", HAL_PROPERTY_TYPE_STRING, driver,
106
+				    "scsi_host.freebsd.unit", HAL_PROPERTY_TYPE_INT32, hal_device_property_get_int(device, "freebsd.unit"), NULL);
107
+				if (scsi_bus)
108
+					hal_device_property_set_string(scsi_bus, "info.parent", hal_device_get_udi(device));
109
+			}
97
+		}
110
+		}
98
+	}
111
+	}
99
 }
112
 }

Return to bug 183236