Sat Mar 31 16:06:56 2012 UTC ()
Bump PKGREVISION
* Fix build on FreeBSD 9.0
** Patches are borrowed from FreeBSD ports
** Split FreeBSD support from DragonFly/FreeBSD support
(ryoon)
diff -r1.59 -r1.60 pkgsrc/sysutils/hal/Makefile
diff -r0 -r1.1 pkgsrc/sysutils/hal/PLIST.DragonFly
diff -r1.3 -r1.4 pkgsrc/sysutils/hal/PLIST.FreeBSD
diff -r1.22 -r1.23 pkgsrc/sysutils/hal/distinfo
diff -r1.3 -r1.4 pkgsrc/sysutils/hal/patches/patch-ak
diff -r1.3 -r1.4 pkgsrc/sysutils/hal/patches/patch-ao
diff -r0 -r1.1 pkgsrc/sysutils/hal/patches/patch-hald_freebsd_addons_addon-storage.c
diff -r0 -r1.1 pkgsrc/sysutils/hal/patches/patch-hald_freebsd_hf-devd.c
diff -r0 -r1.1 pkgsrc/sysutils/hal/patches/patch-hald_freebsd_hf-usb2.c
diff -r0 -r1.1 pkgsrc/sysutils/hal/patches/patch-hald_freebsd_hf-volume.c
diff -r0 -r1.1 pkgsrc/sysutils/hal/patches/patch-hald_freebsd_probing_probe-usb2-device.c
diff -r0 -r1.1 pkgsrc/sysutils/hal/patches/patch-hald_freebsd_probing_probe-usb2-interface.c
--- pkgsrc/sysutils/hal/Makefile 2012/03/03 00:12:20 1.59
+++ pkgsrc/sysutils/hal/Makefile 2012/03/31 16:06:56 1.60
| @@ -1,17 +1,17 @@ | | | @@ -1,17 +1,17 @@ |
1 | # $NetBSD: Makefile,v 1.59 2012/03/03 00:12:20 wiz Exp $ | | 1 | # $NetBSD: Makefile,v 1.60 2012/03/31 16:06:56 ryoon Exp $ |
2 | | | 2 | |
3 | DISTNAME= hal-0.5.14 | | 3 | DISTNAME= hal-0.5.14 |
4 | PKGREVISION= 5 | | 4 | PKGREVISION= 6 |
5 | CATEGORIES= sysutils | | 5 | CATEGORIES= sysutils |
6 | MASTER_SITES= http://hal.freedesktop.org/releases/ | | 6 | MASTER_SITES= http://hal.freedesktop.org/releases/ |
7 | EXTRACT_SUFX= .tar.bz2 | | 7 | EXTRACT_SUFX= .tar.bz2 |
8 | | | 8 | |
9 | MAINTAINER= netbsd-desktop@NetBSD.org | | 9 | MAINTAINER= netbsd-desktop@NetBSD.org |
10 | HOMEPAGE= http://hal.freedesktop.org/ | | 10 | HOMEPAGE= http://hal.freedesktop.org/ |
11 | COMMENT= FreeDesktop hardware abstraction layer | | 11 | COMMENT= FreeDesktop hardware abstraction layer |
12 | LICENSE= gnu-gpl-v2 | | 12 | LICENSE= gnu-gpl-v2 |
13 | | | 13 | |
14 | BUILD_DEFS+= VARBASE PKG_SYSCONFBASE | | 14 | BUILD_DEFS+= VARBASE PKG_SYSCONFBASE |
15 | PKG_DESTDIR_SUPPORT= user-destdir | | 15 | PKG_DESTDIR_SUPPORT= user-destdir |
16 | | | 16 | |
17 | GNU_CONFIGURE= YES | | 17 | GNU_CONFIGURE= YES |
| @@ -26,27 +26,33 @@ SPECIAL_PERMS+= ${VARBASE}/cache/hald $ | | | @@ -26,27 +26,33 @@ SPECIAL_PERMS+= ${VARBASE}/cache/hald $ |
26 | | | 26 | |
27 | EGDIR= ${PREFIX}/share/examples/hal | | 27 | EGDIR= ${PREFIX}/share/examples/hal |
28 | | | 28 | |
29 | CONF_FILES= ${EGDIR}/hal.conf ${PKG_SYSCONFBASE}/dbus-1/system.d/hal.conf | | 29 | CONF_FILES= ${EGDIR}/hal.conf ${PKG_SYSCONFBASE}/dbus-1/system.d/hal.conf |
30 | | | 30 | |
31 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE} | | 31 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASE} |
32 | CONFIGURE_ARGS+= --localstatedir=${VARBASE} | | 32 | CONFIGURE_ARGS+= --localstatedir=${VARBASE} |
33 | CONFIGURE_ARGS+= --with-pci-ids=${PREFIX}/share/pciids | | 33 | CONFIGURE_ARGS+= --with-pci-ids=${PREFIX}/share/pciids |
34 | CONFIGURE_ARGS+= --with-usb-ids=${PREFIX}/share/usbids | | 34 | CONFIGURE_ARGS+= --with-usb-ids=${PREFIX}/share/usbids |
35 | CONFIGURE_ARGS+= --without-os-type | | 35 | CONFIGURE_ARGS+= --without-os-type |
36 | | | 36 | |
37 | .include "../../mk/bsd.prefs.mk" | | 37 | .include "../../mk/bsd.prefs.mk" |
38 | | | 38 | |
39 | .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly" | | 39 | .if ${OPSYS} == "DragonFly" |
| | | 40 | .include "../../devel/libvolume_id/buildlink3.mk" |
| | | 41 | CONFIGURE_ARGS+= --with-eject=/usr/sbin/cdcontrol |
| | | 42 | CONFIGURE_ARGS+= --with-backend=freebsd |
| | | 43 | PLIST_SRC= PLIST.DragonFly PLIST |
| | | 44 | |
| | | 45 | .elif ${OPSYS} == "FreeBSD" |
40 | .include "../../devel/libvolume_id/buildlink3.mk" | | 46 | .include "../../devel/libvolume_id/buildlink3.mk" |
41 | CONFIGURE_ARGS+= --with-eject=/usr/sbin/cdcontrol | | 47 | CONFIGURE_ARGS+= --with-eject=/usr/sbin/cdcontrol |
42 | CONFIGURE_ARGS+= --with-backend=freebsd | | 48 | CONFIGURE_ARGS+= --with-backend=freebsd |
43 | PLIST_SRC= PLIST.FreeBSD PLIST | | 49 | PLIST_SRC= PLIST.FreeBSD PLIST |
44 | | | 50 | |
45 | .elif !empty(MACHINE_PLATFORM:MNetBSD-[5-9]*) | | 51 | .elif !empty(MACHINE_PLATFORM:MNetBSD-[5-9]*) |
46 | .include "../../devel/libvolume_id/buildlink3.mk" | | 52 | .include "../../devel/libvolume_id/buildlink3.mk" |
47 | CONFIGURE_ARGS+= --with-backend=netbsd | | 53 | CONFIGURE_ARGS+= --with-backend=netbsd |
48 | HAL_GROUP= operator | | 54 | HAL_GROUP= operator |
49 | | | 55 | |
50 | .elif ${OPSYS} == "Linux" | | 56 | .elif ${OPSYS} == "Linux" |
51 | .include "../../devel/gperf/buildlink3.mk" | | 57 | .include "../../devel/gperf/buildlink3.mk" |
52 | .include "../../devel/libblkid/buildlink3.mk" | | 58 | .include "../../devel/libblkid/buildlink3.mk" |
@comment $NetBSD: PLIST.DragonFly,v 1.1 2012/03/31 16:06:56 ryoon Exp $
libexec/hald-addon-mouse-sysmouse
libexec/hald-addon-storage
libexec/hald-probe-hiddev
libexec/hald-probe-mouse
libexec/hald-probe-scsi
libexec/hald-probe-smbios
libexec/hald-probe-storage
libexec/hald-probe-volume
libexec/scripts/freebsd/hal-system-lcd-get-brightness-freebsd
libexec/scripts/freebsd/hal-system-lcd-set-brightness-freebsd
libexec/scripts/freebsd/hal-system-power-reboot-freebsd
libexec/scripts/freebsd/hal-system-power-set-power-save-freebsd
libexec/scripts/freebsd/hal-system-power-shutdown-freebsd
libexec/scripts/freebsd/hal-system-power-suspend-freebsd
--- pkgsrc/sysutils/hal/PLIST.FreeBSD 2011/01/08 13:00:13 1.3
+++ pkgsrc/sysutils/hal/PLIST.FreeBSD 2012/03/31 16:06:56 1.4
| @@ -1,15 +1,17 @@ | | | @@ -1,15 +1,17 @@ |
1 | @comment $NetBSD: PLIST.FreeBSD,v 1.3 2011/01/08 13:00:13 obache Exp $ | | 1 | @comment $NetBSD: PLIST.FreeBSD,v 1.4 2012/03/31 16:06:56 ryoon Exp $ |
2 | libexec/hald-addon-mouse-sysmouse | | 2 | libexec/hald-addon-mouse-sysmouse |
3 | libexec/hald-addon-storage | | 3 | libexec/hald-addon-storage |
4 | libexec/hald-probe-hiddev | | 4 | libexec/hald-probe-hiddev |
5 | libexec/hald-probe-mouse | | 5 | libexec/hald-probe-mouse |
6 | libexec/hald-probe-scsi | | 6 | libexec/hald-probe-scsi |
7 | libexec/hald-probe-smbios | | 7 | libexec/hald-probe-smbios |
8 | libexec/hald-probe-storage | | 8 | libexec/hald-probe-storage |
| | | 9 | libexec/hald-probe-usb2-device |
| | | 10 | libexec/hald-probe-usb2-interface |
9 | libexec/hald-probe-volume | | 11 | libexec/hald-probe-volume |
10 | libexec/scripts/freebsd/hal-system-lcd-get-brightness-freebsd | | 12 | libexec/scripts/freebsd/hal-system-lcd-get-brightness-freebsd |
11 | libexec/scripts/freebsd/hal-system-lcd-set-brightness-freebsd | | 13 | libexec/scripts/freebsd/hal-system-lcd-set-brightness-freebsd |
12 | libexec/scripts/freebsd/hal-system-power-reboot-freebsd | | 14 | libexec/scripts/freebsd/hal-system-power-reboot-freebsd |
13 | libexec/scripts/freebsd/hal-system-power-set-power-save-freebsd | | 15 | libexec/scripts/freebsd/hal-system-power-set-power-save-freebsd |
14 | libexec/scripts/freebsd/hal-system-power-shutdown-freebsd | | 16 | libexec/scripts/freebsd/hal-system-power-shutdown-freebsd |
15 | libexec/scripts/freebsd/hal-system-power-suspend-freebsd | | 17 | libexec/scripts/freebsd/hal-system-power-suspend-freebsd |
--- pkgsrc/sysutils/hal/distinfo 2011/10/04 10:31:37 1.22
+++ pkgsrc/sysutils/hal/distinfo 2012/03/31 16:06:56 1.23
| @@ -1,31 +1,37 @@ | | | @@ -1,31 +1,37 @@ |
1 | $NetBSD: distinfo,v 1.22 2011/10/04 10:31:37 dsainty Exp $ | | 1 | $NetBSD: distinfo,v 1.23 2012/03/31 16:06:56 ryoon Exp $ |
2 | | | 2 | |
3 | SHA1 (hal-0.5.14.tar.bz2) = a6ec098d78112e18e2773afa5f9ed642b00c4c59 | | 3 | SHA1 (hal-0.5.14.tar.bz2) = a6ec098d78112e18e2773afa5f9ed642b00c4c59 |
4 | RMD160 (hal-0.5.14.tar.bz2) = 0314dace9512bf49a62bd1556963fc60a6c9caf9 | | 4 | RMD160 (hal-0.5.14.tar.bz2) = 0314dace9512bf49a62bd1556963fc60a6c9caf9 |
5 | Size (hal-0.5.14.tar.bz2) = 942954 bytes | | 5 | Size (hal-0.5.14.tar.bz2) = 942954 bytes |
6 | SHA1 (patch-aa) = 83d20e99943be5c4e9eaeff7a86d79a8912d9c99 | | 6 | SHA1 (patch-aa) = 83d20e99943be5c4e9eaeff7a86d79a8912d9c99 |
7 | SHA1 (patch-ab) = 03723893f9219967a0e3b48c1a03592688389234 | | 7 | SHA1 (patch-ab) = 03723893f9219967a0e3b48c1a03592688389234 |
8 | SHA1 (patch-ac) = 5836bb68f4742bdccc9c61fbf8cc86020007a0a5 | | 8 | SHA1 (patch-ac) = 5836bb68f4742bdccc9c61fbf8cc86020007a0a5 |
9 | SHA1 (patch-ad) = d1ccd7c21008304998293031632f572f250033c1 | | 9 | SHA1 (patch-ad) = d1ccd7c21008304998293031632f572f250033c1 |
10 | SHA1 (patch-ae) = ebc98ede0b6e9535825434f2dc6185193d837f36 | | 10 | SHA1 (patch-ae) = ebc98ede0b6e9535825434f2dc6185193d837f36 |
11 | SHA1 (patch-af) = 161b59ee30d59dbc9e0c79f7f3162bcec5480d99 | | 11 | SHA1 (patch-af) = 161b59ee30d59dbc9e0c79f7f3162bcec5480d99 |
12 | SHA1 (patch-ag) = 3fd8b7d10b1a43311541d2c6ad67a944e286c5ec | | 12 | SHA1 (patch-ag) = 3fd8b7d10b1a43311541d2c6ad67a944e286c5ec |
13 | SHA1 (patch-ah) = 6d801a2c30cee6199b25acf46d7e9866f6004182 | | 13 | SHA1 (patch-ah) = 6d801a2c30cee6199b25acf46d7e9866f6004182 |
14 | SHA1 (patch-aj) = f20e4b1286d177e53a550b2ba1608d22e4b5c609 | | 14 | SHA1 (patch-aj) = f20e4b1286d177e53a550b2ba1608d22e4b5c609 |
15 | SHA1 (patch-ak) = c6e9f20df9230de1bbf599315ad7f32fe6433f48 | | 15 | SHA1 (patch-ak) = 2964207f8907229b5d00ecce7f56fb3359d01f0d |
16 | SHA1 (patch-al) = fe567d7504e961cb623e492f8dc155ef2f3b4c9e | | 16 | SHA1 (patch-al) = fe567d7504e961cb623e492f8dc155ef2f3b4c9e |
17 | SHA1 (patch-am) = 6a4940006e583300d9a983511bdcb05268f74b1a | | 17 | SHA1 (patch-am) = 6a4940006e583300d9a983511bdcb05268f74b1a |
18 | SHA1 (patch-an) = 0307b2f0f6bb5e4a6d7bf837163e74749b7d24b2 | | 18 | SHA1 (patch-an) = 0307b2f0f6bb5e4a6d7bf837163e74749b7d24b2 |
19 | SHA1 (patch-ao) = 2bbd39404284c5c05068e87c9d20b8f6a65c3503 | | 19 | SHA1 (patch-ao) = 5413ef5a9810dcf9dbed54243d5af26a4486a810 |
20 | SHA1 (patch-ap) = 9051ced9c00911b993198c98c6d02f5846c16728 | | 20 | SHA1 (patch-ap) = 9051ced9c00911b993198c98c6d02f5846c16728 |
21 | SHA1 (patch-aq) = 7d0b224b4b1e6052983a6512217eee4f530e0720 | | 21 | SHA1 (patch-aq) = 7d0b224b4b1e6052983a6512217eee4f530e0720 |
22 | SHA1 (patch-ar) = bf44c939b338359f18457b1e65434731c3605130 | | 22 | SHA1 (patch-ar) = bf44c939b338359f18457b1e65434731c3605130 |
23 | SHA1 (patch-as) = a6319e523affc90701f09266949cb7891c044ba7 | | 23 | SHA1 (patch-as) = a6319e523affc90701f09266949cb7891c044ba7 |
24 | SHA1 (patch-at) = 040a018a7be5b28a0dc23dd66a0c10bbb0abc6bf | | 24 | SHA1 (patch-at) = 040a018a7be5b28a0dc23dd66a0c10bbb0abc6bf |
25 | SHA1 (patch-au) = c9e843f57b8a31f1bdc42478d450ea5606b4d7db | | 25 | SHA1 (patch-au) = c9e843f57b8a31f1bdc42478d450ea5606b4d7db |
26 | SHA1 (patch-av) = 075ab5e265be4733d856a17184129d0b301bc0b8 | | 26 | SHA1 (patch-av) = 075ab5e265be4733d856a17184129d0b301bc0b8 |
27 | SHA1 (patch-ax) = 278cbf10dd288f7a4aeedd7545b325c1a82715db | | 27 | SHA1 (patch-ax) = 278cbf10dd288f7a4aeedd7545b325c1a82715db |
| | | 28 | SHA1 (patch-hald_freebsd_addons_addon-storage.c) = 0a9f63690224c11b38f2ad1c814e7b1433c5597d |
| | | 29 | SHA1 (patch-hald_freebsd_hf-devd.c) = 37394dfd49e56659cfe5282f66781d4845f5ee97 |
| | | 30 | SHA1 (patch-hald_freebsd_hf-usb2.c) = 9a1a612fe6f81078ea246fb49ec60157b8641e75 |
| | | 31 | SHA1 (patch-hald_freebsd_hf-volume.c) = 45f27050f2b0ef8825d32d2bbdcac168c8f5b2b5 |
| | | 32 | SHA1 (patch-hald_freebsd_probing_probe-usb2-device.c) = eb655ef42d02cd2c6a86004c309e20de942f033b |
| | | 33 | SHA1 (patch-hald_freebsd_probing_probe-usb2-interface.c) = 8ad0ac33ae366f7f470b2cb751a31bb99b2e6313 |
28 | SHA1 (patch-na) = 2786db8149a55dbd5ea11419d789f420bac1993c | | 34 | SHA1 (patch-na) = 2786db8149a55dbd5ea11419d789f420bac1993c |
29 | SHA1 (patch-nb) = 1693b7a2faa5bee20a594f0b60b8ff6caea0efdc | | 35 | SHA1 (patch-nb) = 1693b7a2faa5bee20a594f0b60b8ff6caea0efdc |
30 | SHA1 (patch-nc) = 32453e49734902749ce24eb4364fc7f531986227 | | 36 | SHA1 (patch-nc) = 32453e49734902749ce24eb4364fc7f531986227 |
31 | SHA1 (patch-nd) = 877dcbafaca0cebd3fdce74c5a622721823c153b | | 37 | SHA1 (patch-nd) = 877dcbafaca0cebd3fdce74c5a622721823c153b |
--- pkgsrc/sysutils/hal/patches/patch-ak 2011/01/08 13:00:13 1.3
+++ pkgsrc/sysutils/hal/patches/patch-ak 2012/03/31 16:06:56 1.4
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | $NetBSD: patch-ak,v 1.3 2011/01/08 13:00:13 obache Exp $ | | 1 | $NetBSD: patch-ak,v 1.4 2012/03/31 16:06:56 ryoon Exp $ |
2 | | | 2 | |
3 | --- hald/freebsd/probing/probe-volume.c.orig 2009-09-17 13:45:09.000000000 +0000 | | 3 | --- hald/freebsd/probing/probe-volume.c.orig 2009-09-17 13:45:09.000000000 +0000 |
4 | +++ hald/freebsd/probing/probe-volume.c | | 4 | +++ hald/freebsd/probing/probe-volume.c |
5 | @@ -33,7 +33,11 @@ | | 5 | @@ -33,7 +33,11 @@ |
6 | #include <fcntl.h> | | 6 | #include <fcntl.h> |
7 | #include <unistd.h> | | 7 | #include <unistd.h> |
8 | #include <sys/ioctl.h> | | 8 | #include <sys/ioctl.h> |
9 | +#ifdef __DragonFly__ | | 9 | +#ifdef __DragonFly__ |
10 | +#include <sys/diskslice.h> | | 10 | +#include <sys/diskslice.h> |
11 | +#else | | 11 | +#else |
12 | #include <sys/disk.h> | | 12 | #include <sys/disk.h> |
13 | +#endif | | 13 | +#endif |
14 | #include <sys/cdio.h> | | 14 | #include <sys/cdio.h> |
| @@ -75,35 +75,53 @@ $NetBSD: patch-ak,v 1.3 2011/01/08 13:00 | | | @@ -75,35 +75,53 @@ $NetBSD: patch-ak,v 1.3 2011/01/08 13:00 |
75 | char ufsid[64]; | | 75 | char ufsid[64]; |
76 | char **ufs_devs = NULL; | | 76 | char **ufs_devs = NULL; |
77 | int num_udis; | | 77 | int num_udis; |
78 | int i; | | 78 | int i; |
79 | | | 79 | |
80 | +#ifdef __DragonFly__ | | 80 | +#ifdef __DragonFly__ |
81 | + snprintf(ufsid, sizeof(ufsid), "%08x%08x", fs.fs_id[0], fs.fs_id[1]); | | 81 | + snprintf(ufsid, sizeof(ufsid), "%08x%08x", fs.fs_id[0], fs.fs_id[1]); |
82 | +#else | | 82 | +#else |
83 | snprintf(ufsid, sizeof(ufsid), "%08x%08x", ufsdisk.d_fs.fs_id[0], ufsdisk.d_fs.fs_id[1]); | | 83 | snprintf(ufsid, sizeof(ufsid), "%08x%08x", ufsdisk.d_fs.fs_id[0], ufsdisk.d_fs.fs_id[1]); |
84 | +#endif | | 84 | +#endif |
85 | libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.freebsd.ufsid", ufsid, &hfp_error); | | 85 | libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.freebsd.ufsid", ufsid, &hfp_error); |
86 | ufs_devs = libhal_manager_find_device_string_match(hfp_ctx, | | 86 | ufs_devs = libhal_manager_find_device_string_match(hfp_ctx, |
87 | "volume.freebsd.ufsid", | | 87 | "volume.freebsd.ufsid", |
88 | @@ -597,7 +632,9 @@ main (int argc, char **argv) | | 88 | @@ -582,7 +617,11 @@ main (int argc, char **argv) |
| | | 89 | dbus_error_free(&hfp_error); |
| | | 90 | for (i = 0; i < num_udis; i++) |
| | | 91 | { |
| | | 92 | +#if defined(__FreeBSD__) |
| | | 93 | + if (ufs_devs[i] != NULL && strcmp(ufs_devs[i], hfp_udi)) |
| | | 94 | +#else |
| | | 95 | if (ufs_devs[i] != NULL) |
| | | 96 | +#endif |
| | | 97 | { |
| | | 98 | gboolean mounted; |
| | | 99 | |
| | | 100 | @@ -592,12 +631,15 @@ main (int argc, char **argv) |
| | | 101 | { |
| | | 102 | libhal_device_set_property_bool(hfp_ctx, hfp_udi, "volume.ignore", TRUE, &hfp_error); |
| | | 103 | dbus_error_free(&hfp_error); |
| | | 104 | + break; |
| | | 105 | } |
| | | 106 | } |
89 | } | | 107 | } |
90 | if (ufs_devs) | | 108 | if (ufs_devs) |
91 | libhal_free_string_array(ufs_devs); | | 109 | libhal_free_string_array(ufs_devs); |
92 | +#ifndef __DragonFly__ | | 110 | +#ifndef __DragonFly__ |
93 | ufs_disk_close(&ufsdisk); | | 111 | ufs_disk_close(&ufsdisk); |
94 | +#endif | | 112 | +#endif |
95 | } | | 113 | } |
96 | } | | 114 | } |
97 | | | 115 | |
98 | @@ -628,7 +665,11 @@ main (int argc, char **argv) | | 116 | @@ -628,7 +670,11 @@ main (int argc, char **argv) |
99 | | | 117 | |
100 | libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.uuid", vid ? vid->uuid : "", &hfp_error); | | 118 | libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.uuid", vid ? vid->uuid : "", &hfp_error); |
101 | | | 119 | |
102 | +#ifdef __DragonFly__ | | 120 | +#ifdef __DragonFly__ |
103 | + sector_size = device_info.media_blksize; | | 121 | + sector_size = device_info.media_blksize; |
104 | +#else | | 122 | +#else |
105 | ioctl(fd, DIOCGSECTORSIZE, §or_size); | | 123 | ioctl(fd, DIOCGSECTORSIZE, §or_size); |
106 | +#endif | | 124 | +#endif |
107 | | | 125 | |
108 | if (sector_size != 0) | | 126 | if (sector_size != 0) |
109 | libhal_device_set_property_uint64(hfp_ctx, hfp_udi, "volume.block_size", sector_size, &hfp_error); | | 127 | libhal_device_set_property_uint64(hfp_ctx, hfp_udi, "volume.block_size", sector_size, &hfp_error); |
--- pkgsrc/sysutils/hal/patches/patch-ao 2011/01/08 13:00:13 1.3
+++ pkgsrc/sysutils/hal/patches/patch-ao 2012/03/31 16:06:56 1.4
| @@ -1,30 +1,51 @@ | | | @@ -1,30 +1,51 @@ |
1 | $NetBSD: patch-ao,v 1.3 2011/01/08 13:00:13 obache Exp $ | | 1 | $NetBSD: patch-ao,v 1.4 2012/03/31 16:06:56 ryoon Exp $ |
2 | | | 2 | |
3 | On DragonFly /dev/usb will be taken by usbd(8), but that does not | | 3 | On DragonFly /dev/usb will be taken by usbd(8), but that does not |
4 | mean that one cannot check usbX devices. The same behaviour was present | | 4 | mean that one cannot check usbX devices. The same behaviour was present |
5 | in older versions of hald(8). | | 5 | in older versions of hald(8). |
6 | | | 6 | |
7 | --- hald/freebsd/hf-usb.c.orig 2009-09-17 13:49:46.000000000 +0000 | | 7 | --- hald/freebsd/hf-usb.c.orig 2009-09-17 13:49:46.000000000 +0000 |
8 | +++ hald/freebsd/hf-usb.c | | 8 | +++ hald/freebsd/hf-usb.c |
9 | @@ -36,9 +36,13 @@ | | 9 | @@ -36,9 +36,13 @@ |
10 | #if __FreeBSD_version >= 800064 | | 10 | #if __FreeBSD_version >= 800064 |
11 | #include <legacy/dev/usb/usb.h> | | 11 | #include <legacy/dev/usb/usb.h> |
12 | #else | | 12 | #else |
13 | +#ifdef __DragonFly__ | | 13 | +#ifdef __DragonFly__ |
14 | +#include <bus/usb/usb.h> | | 14 | +#include <bus/usb/usb.h> |
15 | +#else | | 15 | +#else |
16 | #include <dev/usb/usb.h> | | 16 | #include <dev/usb/usb.h> |
17 | #endif | | 17 | #endif |
18 | #endif | | 18 | #endif |
19 | +#endif | | 19 | +#endif |
20 | | | 20 | |
21 | #include "../logger.h" | | 21 | #include "../logger.h" |
22 | #include "../osspec.h" | | 22 | #include "../osspec.h" |
23 | @@ -613,7 +617,6 @@ hf_usb_privileged_init (void) | | 23 | @@ -392,7 +396,11 @@ hf_usb_device_new (HalDevice *parent, |
| | | 24 | hf_devtree_device_set_name(device, di->udi_devnames[0]); |
| | | 25 | |
| | | 26 | if ((devname = hf_usb_get_devname(di, "ukbd"))) /* USB keyboard */ |
| | | 27 | +#if defined(__FreeBSD__) |
| | | 28 | + hf_device_set_input(device, "keyboard", "keys", NULL); |
| | | 29 | +#else |
| | | 30 | hf_device_set_input(device, "keyboard", "keys", devname); |
| | | 31 | +#endif |
| | | 32 | else if ((devname = hf_usb_get_devname(di, "ums"))) /* USB mouse */ |
| | | 33 | hf_device_set_input(device, "mouse", NULL, devname); |
| | | 34 | else if ((devname = hf_usb_get_devname(di, "uhid"))) /* UHID device */ |
| | | 35 | @@ -613,7 +621,6 @@ hf_usb_privileged_init (void) |
24 | if (hf_usb_fd < 0) | | 36 | if (hf_usb_fd < 0) |
25 | { | | 37 | { |
26 | HAL_INFO(("unable to open %s: %s", HF_USB_DEVICE, g_strerror(errno))); | | 38 | HAL_INFO(("unable to open %s: %s", HF_USB_DEVICE, g_strerror(errno))); |
27 | - return; | | 39 | - return; |
28 | } | | 40 | } |
29 | | | 41 | |
30 | for (i = 0; i < 16; i++) | | 42 | for (i = 0; i < 16; i++) |
| | | 43 | @@ -908,6 +915,8 @@ hf_usb_add_webcam_properties (HalDevice |
| | | 44 | |
| | | 45 | hal_device_property_set_string(device, "info.category", "video4linux"); |
| | | 46 | hal_device_add_capability(device, "video4linux"); |
| | | 47 | + hal_device_add_capability(device, "video4linux.video_capture"); |
| | | 48 | hf_device_property_set_string_printf(device, "video4linux.device", "/dev/video%i", unit); |
| | | 49 | hal_device_property_set_string(device, "info.product", "Video Device"); |
| | | 50 | + hal_device_property_set_string(device, "video4linux.version", "1"); |
| | | 51 | } |
$NetBSD: patch-hald_freebsd_addons_addon-storage.c,v 1.1 2012/03/31 16:06:56 ryoon Exp $
* From FreeBSD ports repository to fix build on FreeBSD 9.0 RELEASE.
--- hald/freebsd/addons/addon-storage.c.orig 2009-08-24 12:42:29.000000000 +0000
+++ hald/freebsd/addons/addon-storage.c
@@ -107,8 +107,12 @@ hf_addon_storage_update (void)
if (hf_addon_storage_cdrom_eject_pressed(cdrom))
{
+#if defined(__FreeBSD__)
+ libhal_device_emit_condition(hfp_ctx, hfp_udi, "EjectPressed", "", NULL);
+#else
libhal_device_emit_condition(hfp_ctx, hfp_udi, "EjectPressed", "", &hfp_error);
dbus_error_free(&hfp_error);
+#endif
}
hfp_cdrom_free(cdrom);
@@ -164,11 +168,17 @@ unmount_volumes (void)
"block.storage_device",
hfp_udi,
&num_volumes,
+#if defined(__FreeBSD__)
+ NULL)) != NULL)
+#else
&hfp_error)) != NULL)
+#endif
{
int i;
+#if !defined(__FreeBSD__)
dbus_error_free(&hfp_error);
+#endif
for (i = 0; i < num_volumes; i++)
{
@@ -176,7 +186,11 @@ unmount_volumes (void)
vol_udi = volumes[i];
+#if defined(__FreeBSD__)
+ if (libhal_device_get_property_bool(hfp_ctx, vol_udi, "volume.is_mounted", NULL))
+#else
if (libhal_device_get_property_bool(hfp_ctx, vol_udi, "volume.is_mounted", &hfp_error))
+#endif
{
DBusMessage *msg = NULL;
DBusMessage *reply = NULL;
@@ -185,7 +199,9 @@ unmount_volumes (void)
char **options = NULL;
char *devfile;
+#if !defined(__FreeBSD__)
dbus_error_free(&hfp_error);
+#endif
hfp_info("Forcing unmount of volume '%s'", vol_udi);
dbus_connection = libhal_ctx_get_dbus_connection(hfp_ctx);
@@ -265,10 +281,16 @@ poll_for_media (boolean check_only, bool
check_lock_state = FALSE;
hfp_info("Checking whether device %s is locked by HAL", addon.device_file);
+#if defined(__FreeBSD__)
+ if (libhal_device_is_locked_by_others(hfp_ctx, hfp_udi, "org.freedesktop.Hal.Device.Storage", NULL))
+#else
if (libhal_device_is_locked_by_others(hfp_ctx, hfp_udi, "org.freedesktop.Hal.Device.Storage", &hfp_error))
+#endif
{
hfp_info("... device %s is locked by HAL", addon.device_file);
+#if !defined(__FreeBSD__)
dbus_error_free(&hfp_error);
+#endif
is_locked_by_hal = TRUE;
update_proc_title(addon.device_file);
goto skip_check;
@@ -278,9 +300,13 @@ poll_for_media (boolean check_only, bool
hfp_info("... device %s is not locked by HAL", addon.device_file);
is_locked_by_hal = FALSE;
}
+#if defined(__FreeBSD__)
+ should_poll = libhal_device_get_property_bool(hfp_ctx, hfp_udi, "storage.media_check_enabled", NULL);
+#else
dbus_error_free(&hfp_error);
should_poll = libhal_device_get_property_bool(hfp_ctx, hfp_udi, "storage.media_check_enabled", &hfp_error);
+#endif
dbus_error_free(&hfp_error);
polling_disabled = ! should_poll;
update_proc_title(addon.device_file);
@@ -314,8 +340,12 @@ poll_for_media (boolean check_only, bool
unmount_volumes();
#endif
+#if defined(__FreeBSD__)
+ libhal_device_rescan(hfp_ctx, hfp_udi, NULL);
+#else
libhal_device_rescan(hfp_ctx, hfp_udi, &hfp_error);
dbus_error_free(&hfp_error);
+#endif
addon.had_media = has_media;
return TRUE;
@@ -412,12 +442,19 @@ main (int argc, char **argv)
! strcmp(driver, "cd")))) && ! strcmp(removable, "true");
addon.had_media = poll_for_media(TRUE, FALSE);
+#if defined(__FreeBSD__)
+ if (! libhal_device_addon_is_ready(hfp_ctx, hfp_udi, NULL))
+ goto end;
+
+ syscon = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
+#else
if (! libhal_device_addon_is_ready(hfp_ctx, hfp_udi, &hfp_error))
goto end;
dbus_error_free(&hfp_error);
syscon = dbus_bus_get(DBUS_BUS_SYSTEM, &hfp_error);
dbus_error_free(&hfp_error);
+#endif
assert(syscon != NULL);
dbus_connection_set_exit_on_disconnect(syscon, 0);
@@ -452,12 +489,18 @@ main (int argc, char **argv)
" <method name=\"CheckForMedia\">\n"
" <arg name=\"call_had_sideeffect\" direction=\"out\" type=\"b\"/>\n"
" </method>\n",
+#if defined(__FreeBSD__)
+ NULL))
+#else
&hfp_error))
+#endif
{
hfp_critical("Cannot claim interface 'org.freedesktop.Hal.Device.Storage.Removable'");
goto end;
}
+#if !defined(__FreeBSD__)
dbus_error_free(&hfp_error);
+#endif
while (TRUE)
{
$NetBSD: patch-hald_freebsd_hf-devd.c,v 1.1 2012/03/31 16:06:56 ryoon Exp $
* From FreeBSD ports repository to fix build on FreeBSD 9.0 RELEASE.
--- hald/freebsd/hf-devd.c.orig 2009-08-24 12:42:29.000000000 +0000
+++ hald/freebsd/hf-devd.c
@@ -122,7 +122,11 @@ hf_devd_parse_add_remove (const char *ev
g_return_val_if_fail(parent != NULL, FALSE);
if ((params_ptr = strchr(event, ' '))
+#if defined(__FreeBSD__)
+ && (at_ptr = strstr(params_ptr, "at "))
+#else
&& (at_ptr = strstr(params_ptr + 1, " at "))
+#endif
&& (parent_ptr = strstr(at_ptr + 4, " on ")))
{
char *params_str;
@@ -130,7 +134,11 @@ hf_devd_parse_add_remove (const char *ev
*name = g_strndup(event, params_ptr - event);
params_str = g_strndup(params_ptr + 1, at_ptr - params_ptr - 1);
+#if defined(__FreeBSD__)
+ at_str = g_strndup(at_ptr + 3, parent_ptr - at_ptr - 3);
+#else
at_str = g_strndup(at_ptr + 4, parent_ptr - at_ptr - 4);
+#endif
*parent = g_strdup(parent_ptr + 4);
if (! strcmp(*parent, ".")) /* sys/kern/subr_bus.c */
@@ -398,7 +406,11 @@ hf_devd_event_cb (GIOChannel *source, GI
hf_devd_process_event(event);
g_free(event);
}
+#if defined(__FreeBSD__)
+ else if (status == G_IO_STATUS_AGAIN || status == G_IO_STATUS_EOF)
+#else
else if (status == G_IO_STATUS_AGAIN)
+#endif
{
hf_devd_init();
if (hf_devd_inited)
$NetBSD: patch-hald_freebsd_hf-usb2.c,v 1.1 2012/03/31 16:06:56 ryoon Exp $
* From FreeBSD ports repository to fix build on FreeBSD 9.0 RELEASE.
--- hald/freebsd/hf-usb2.c.orig 2009-08-24 12:42:29.000000000 +0000
+++ hald/freebsd/hf-usb2.c
@@ -22,7 +22,7 @@
**************************************************************************/
#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
#endif
#include <string.h>
@@ -42,246 +42,200 @@
static struct libusb20_backend *hf_usb2_be = NULL;
static void
-hf_usb2_copy_parent (HalDevice *parent,
- const char *key,
- gpointer user_data)
+hf_usb2_probe_interfaces(HalDevice * parent)
{
- HalDevice *device;
+ int num_interfaces;
+ int i;
- g_return_if_fail(HAL_IS_DEVICE(parent));
- g_return_if_fail(HAL_IS_DEVICE(user_data));
+ g_return_if_fail(HAL_IS_DEVICE(parent));
- device = HAL_DEVICE(user_data);
-
- if (! strncmp(key, "usb_device.", strlen("usb_device.")))
- hal_device_copy_property(parent, key, device, key);
+ if (hal_device_property_get_bool(parent, "info.ignore"))
+ return;
+
+ num_interfaces = hal_device_property_get_int(parent,
+ "usb_device.num_interfaces");
+
+ for (i = 0; i < num_interfaces; i++) {
+ HalDevice *device;
+
+ device = hf_device_new(parent);
+
+ hal_device_property_set_string(device, "info.subsystem", "usb");
+ hal_device_property_set_int(device, "usb.interface.number", i);
+ hal_device_copy_property(parent, "info.product", device, "info.product");
+ hal_device_copy_property(parent, "info.vendor", device, "info.vendor");
+ hal_device_merge_with_rewrite(device, parent, "usb.", "usb_device.");
+
+ if (hf_device_preprobe(device)) {
+ const char *driver, *devname;
+
+ hf_runner_run_sync(device, 0, "hald-probe-usb2-interface", NULL);
+
+ devname = hal_device_property_get_string(device,
+ "usb.freebsd.devname");
+ if (devname)
+ hf_devtree_device_set_name(device, devname);
+
+ driver = hal_device_property_get_string(device, "freebsd.driver");
+ if (driver) {
+ if (!strcmp(driver, "ukbd"))
+ hf_device_set_input(device, "keyboard", "keys", NULL);
+ else if (!strcmp(driver, "ums") || !strcmp(driver, "atp")) {
+ hf_device_set_input(device, "mouse", NULL, devname);
+ hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL);
+ } else if (!strcmp(driver, "uhid")) {
+ hal_device_property_set_string(device, "info.category",
+ "hiddev");
+ hal_device_add_capability(device, "hiddev");
+ hf_device_property_set_string_printf(device, "hiddev.device",
+ "/dev/%s", devname);
+ hal_device_copy_property(device, "info.product", device,
+ "hiddev.product");
+ hf_runner_run_sync(device, 0, "hald-probe-hiddev", NULL);
+ } else if (!strcmp(driver, "ldev")) {
+ /* Linux driver (webcam) */
+
+ /*
+ * XXX This is a hack. Currently, all ldev devices are
+ * webcams. That may not always be the case. Hopefully,
+ * when other Linux driver support is added, there will be
+ * a sysctl or some other way to determine device class.
+ */
+ hf_usb_add_webcam_properties(device);
+ } else if (!strcmp(driver, "pwc")) {
+ /* Phillips Web Cam */
+ hf_usb_add_webcam_properties(device);
+ }
+ } else {
+ /* Try and detect webcamd devices. */
+ hf_runner_run_sync(device, 0, "hald-probe-video4linux", NULL);
+ }
+
+ hf_usb_device_compute_udi(device);
+ hf_device_add(device);
+ }
+ }
}
static void
-hf_usb2_probe_interfaces(HalDevice *parent)
+hf_usb2_probe_device(HalDevice * parent, int bus, int addr)
{
- int num_interfaces;
- int i;
+ HalDevice *device;
- g_return_if_fail(HAL_IS_DEVICE(parent));
+ g_return_if_fail(HAL_IS_DEVICE(parent));
- if (hal_device_property_get_bool(parent, "info.ignore"))
- return;
+ device = hf_device_new(parent);
- num_interfaces = hal_device_property_get_int(parent,
- "usb_device.num_interfaces");
-
- for (i = 0; i < num_interfaces; i++)
- {
- HalDevice *device;
-
- device = hf_device_new(parent);
-
- hal_device_property_set_string(device, "info.subsystem", "usb");
- hal_device_property_set_int(device, "usb.interface.number", i);
- hal_device_property_foreach(parent, hf_usb2_copy_parent, device);
- hal_device_copy_property(parent, "info.product", device, "info.product");
- hal_device_copy_property(parent, "info.vendor", device, "info.vendor");
-
- if (hf_device_preprobe(device))
- {
- const char *driver, *devname;
-
- hf_runner_run_sync(device, 0, "hald-probe-usb2-interface", NULL);
-
- devname = hal_device_property_get_string(device,
- "usb.freebsd.devname");
- if (devname)
- hf_devtree_device_set_name(device, devname);
-
- driver = hal_device_property_get_string(device, "freebsd.driver");
- if (driver)
- {
- if (! strcmp(driver, "ukbd"))
- hf_device_set_input(device, "keyboard", NULL);
- else if (! strcmp(driver, "ums"))
- {
- hf_device_set_input(device, "mouse", devname);
- hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL);
- }
- else if (! strcmp(driver, "uhid"))
- {
- hal_device_property_set_string(device, "info.category",
- "hiddev");
- hal_device_add_capability(device, "hiddev");
- hf_device_property_set_string_printf(device, "hiddev.device",
- "/dev/%s", devname);
- hal_device_copy_property(device, "info.product", device,
- "hiddev.product");
- hf_runner_run_sync(device, 0, "hald-probe-hiddev", NULL);
- }
- else if (! strcmp(driver, "ldev"))
- {
- /* Linux driver (webcam) */
-
- /*
- * XXX This is a hack. Currently, all ldev devices are
- * webcams. That may not always be the case. Hopefully,
- * when other Linux driver support is added, there will be
- * a sysctl or some other way to determine device class.
- */
- hf_usb_add_webcam_properties(device);
- }
- else if (! strcmp(driver, "pwc"))
- {
- /* Phillips Web Cam */
- hf_usb_add_webcam_properties(device);
- }
- }
+ hal_device_property_set_string(device, "info.subsystem", "usb_device");
+ hal_device_property_set_int(device, "usb_device.bus_number", bus);
+ hal_device_property_set_int(device, "usb_device.level_number", 1);
+ hal_device_property_set_int(device, "usb_device.port_number", addr);
- hf_usb_device_compute_udi(device);
- hf_device_add(device);
+ if (hf_device_preprobe(device)) {
+ hf_runner_run_sync(device, 0, "hald-probe-usb2-device", NULL);
+ hf_usb_device_compute_udi(device);
+ hf_device_add(device);
+ hf_usb2_probe_interfaces(device);
}
- }
}
static void
-hf_usb2_probe_device (HalDevice *parent, int bus, int addr)
+hf_usb2_privileged_init(void)
{
- HalDevice *device;
-
- g_return_if_fail(HAL_IS_DEVICE(parent));
-
- device = hf_device_new(parent);
+ hf_usb2_be = libusb20_be_alloc_default();
+ if (hf_usb2_be == NULL)
+ HAL_INFO(("unable to open USB backend: %s", g_strerror(errno)));
+}
- hal_device_property_set_string(device, "info.subsystem", "usb_device");
- hal_device_property_set_int(device, "usb_device.bus_number", bus);
- hal_device_property_set_int(device, "usb_device.level_number", addr - 1);
- hal_device_property_set_int(device, "usb_device.port_number", addr);
+static void
+hf_usb2_new_device(int bus, int addr)
+{
+ HalDevice *parent;
- if (hf_device_preprobe(device))
- {
- hf_runner_run_sync(device, 0, "hald-probe-usb2-device", NULL);
- hf_usb_device_compute_udi(device);
+ parent = hf_devtree_find_from_info(hald_get_gdl(), "usbus", bus);
- hf_device_add(device);
- }
- else
- return;
+ if (!parent || hal_device_property_get_bool(parent, "info.ignore"))
+ return;
- hf_usb2_probe_interfaces(device);
+ hf_usb2_probe_device(parent, bus, addr);
}
static void
-hf_usb2_privileged_init (void)
+hf_usb2_probe(void)
{
- hf_usb2_be = libusb20_be_alloc_default();
- if (hf_usb2_be == NULL)
- HAL_INFO(("unable to open USB backend: %s", g_strerror(errno)));
-}
+ struct libusb20_device *pdev = NULL;
-static void
-hf_usb2_probe (void)
-{
- struct libusb20_device *pdev = NULL;
+ if (hf_usb2_be == NULL)
+ return;
- if (hf_usb2_be == NULL)
- return;
+ while ((pdev = libusb20_be_device_foreach(hf_usb2_be, pdev))) {
+ hf_usb2_new_device(libusb20_dev_get_bus_number(pdev),
+ libusb20_dev_get_address(pdev));
+ }
- while ((pdev = libusb20_be_device_foreach(hf_usb2_be, pdev)))
- {
- HalDevice *parent;
- int bus, addr;
-
- bus = libusb20_dev_get_bus_number(pdev);
- addr = libusb20_dev_get_address(pdev);
-
- if (addr == 1)
- parent = hf_devtree_find_parent_from_info(hald_get_gdl(), "usbus", bus);
- else
- parent = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number",
- HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number",
- HAL_PROPERTY_TYPE_INT32, addr - 1, NULL);
- if (! parent || hal_device_property_get_bool(parent, "info.ignore"))
- continue;
+ libusb20_be_free(hf_usb2_be);
+ hf_usb2_be = NULL;
+}
- hf_usb2_probe_device(parent, bus, addr);
- }
+static gboolean
+hf_usb2_devd_notify(const char *system,
+ const char *subsystem,
+ const char *type,
+ const char *data)
+{
+ const char *ugen;
+ int bus;
+ int addr;
+
+ if (!data || strcmp(system, "USB") || strcmp(subsystem, "DEVICE") ||
+ (strcmp(type, "ATTACH") && strcmp(type, "DETACH")))
+ return FALSE;
+
+ ugen = strstr(data, "ugen=");
+ if (ugen == NULL) {
+ /*
+ * The following case is not required in
+ * FreeBSD 8-stable and newer:
+ */
+ ugen = strstr(data, "cdev=");
+ if (ugen == NULL)
+ return FALSE;
+
+ if (sscanf(ugen, "cdev=ugen%i.%i", &bus, &addr) != 2)
+ return FALSE;
+ } else {
+ if (sscanf(ugen, "ugen=ugen%i.%i", &bus, &addr) != 2)
+ return FALSE;
+ }
- libusb20_be_free(hf_usb2_be);
- hf_usb2_be = NULL;
-}
+ if (strcmp(type, "ATTACH") == 0) {
-static gboolean
-hf_usb2_devd_add (const char *name,
- GHashTable *params,
- GHashTable *at,
- const char *parent)
-{
- HalDevice *parent_device;
- int bus, addr, pbus, paddr;
+ HAL_INFO(("received devd attach event, device %s", data));
- if (strncmp(name, "ugen", strlen("ugen")))
- return FALSE;
- else if (strncmp(parent, "ugen", strlen("ugen")))
- return TRUE;
-
- if (sscanf(name, "ugen%i.%i", &bus, &addr) != 2)
- return FALSE;
-
- if (sscanf(parent, "ugen%i.%i", &pbus, &paddr) != 2)
- return FALSE;
-
- HAL_INFO(("received devd add event for device '%s' with parent '%s'",
- name, parent));
-
- parent_device = hf_device_store_match(hald_get_gdl(),
- "usb_device.bus_number", HAL_PROPERTY_TYPE_INT32, pbus,
- "usb_device.port_number", HAL_PROPERTY_TYPE_INT32, paddr, NULL);
-
- if (parent_device && ! hal_device_property_get_bool(parent_device,
- "info.ignore"))
- {
- hf_usb2_probe_device(parent_device, bus, addr);
- return TRUE;
- }
+ hf_usb2_new_device(bus, addr);
+ }
+ if (strcmp(type, "DETACH") == 0) {
- return FALSE;
-}
+ HalDevice *device;
-static gboolean
-hf_usb2_devd_remove (const char *name,
- GHashTable *params,
- GHashTable *at,
- const char *parent)
-{
- HalDevice *device;
- int bus, addr;
+ HAL_INFO(("received devd detach event, device %s", data));
- if (strncmp(name, "ugen", strlen("ugen")))
- return FALSE;
- else if (strncmp(parent, "ugen", strlen("ugen")))
- return TRUE;
-
- if (sscanf(name, "ugen%i.%i", &bus, &addr) != 2)
- return FALSE;
-
- HAL_INFO(("received devd remove event, device %s", name));
-
- device = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number",
- HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number",
- HAL_PROPERTY_TYPE_INT32, addr, NULL);
-
- if (device)
- {
- hf_device_remove_tree(device);
- return TRUE;
- }
+ device = hf_device_store_match(hald_get_gdl(),
+ "usb_device.bus_number", HAL_PROPERTY_TYPE_INT32, bus,
+ "usb_device.port_number", HAL_PROPERTY_TYPE_INT32, addr,
+ "info.bus", HAL_PROPERTY_TYPE_STRING, "usb_device", NULL);
- return FALSE;
+ if (device)
+ hf_device_remove_tree(device);
+ }
+ return TRUE;
}
HFHandler hf_usb2_handler = {
- .privileged_init = hf_usb2_privileged_init,
- .probe = hf_usb2_probe
+ .privileged_init = hf_usb2_privileged_init,
+ .probe = hf_usb2_probe
};
HFDevdHandler hf_usb2_devd_handler = {
- .add = hf_usb2_devd_add,
- .remove = hf_usb2_devd_remove
+ .notify = hf_usb2_devd_notify
};
$NetBSD: patch-hald_freebsd_hf-volume.c,v 1.1 2012/03/31 16:06:56 ryoon Exp $
* From FreeBSD ports repository to fix build on FreeBSD 9.0 RELEASE.
--- hald/freebsd/hf-volume.c.orig 2009-08-24 12:42:29.000000000 +0000
+++ hald/freebsd/hf-volume.c
@@ -86,9 +86,12 @@ hf_volume_resolve_fuse (const char *spec
{
if (strcmp(fields[0], special) == 0)
{
+ char *ret;
+
+ ret = g_strdup(fields[1]);
g_strfreev(fields);
g_strfreev(lines);
- return g_strdup(fields[1]);
+ return ret;
}
}
g_strfreev(fields);
$NetBSD: patch-hald_freebsd_probing_probe-usb2-device.c,v 1.1 2012/03/31 16:06:56 ryoon Exp $
* From FreeBSD ports repository to fix build on FreeBSD 9.0 RELEASE.
--- hald/freebsd/probing/probe-usb2-device.c.orig 2009-08-24 12:42:29.000000000 +0000
+++ hald/freebsd/probing/probe-usb2-device.c
@@ -147,16 +147,16 @@ main(int argc, char **argv)
speed = 12.0;
bcdspeed = 0x01200;
break;
- case LIBUSB20_SPEED_HIGH:
+ case LIBUSB20_SPEED_VARIABLE:
speed = 480.0;
bcdspeed = 0x48000;
break;
case LIBUSB20_SPEED_SUPER:
- speed = 4800.0;
- bcdspeed = 0x480000;
+ speed = 5000.0;
+ bcdspeed = 0x500000;
break;
default:
- ;
+ break;
}
libhal_device_set_property_double(hfp_ctx, hfp_udi, "usb_device.speed",
@@ -169,6 +169,9 @@ main(int argc, char **argv)
case UD_USB_2_0:
version = 2.0;
break;
+ case 0x0250:
+ version = 2.5;
+ break;
case UD_USB_3_0:
version = 3.0;
break;
@@ -184,7 +187,7 @@ main(int argc, char **argv)
libhal_device_set_property_int(hfp_ctx, hfp_udi,
"usb_device.vendor_id", di.udi_vendorNo, &hfp_error);
libhal_device_set_property_int(hfp_ctx, hfp_udi,
- "usb_device.device_revision_bcd", ddesc->bcdUSB, &hfp_error);
+ "usb_device.device_revision_bcd", ddesc->bcdDevice, &hfp_error);
libhal_device_set_property_string(hfp_ctx, hfp_udi,
"usb_device.serial", di.udi_serial, &hfp_error);
libhal_device_set_property_string(hfp_ctx, hfp_udi,
$NetBSD: patch-hald_freebsd_probing_probe-usb2-interface.c,v 1.1 2012/03/31 16:06:56 ryoon Exp $
* From FreeBSD ports repository to fix build on FreeBSD 9.0 RELEASE.
--- hald/freebsd/probing/probe-usb2-interface.c.orig 2009-08-24 12:42:29.000000000 +0000
+++ hald/freebsd/probing/probe-usb2-interface.c
@@ -58,11 +58,11 @@ main(int argc, char **argv)
if (pbe == NULL)
goto end;
- busstr = getenv("HAL_PROP_USB_DEVICE_BUS_NUMBER");
+ busstr = getenv("HAL_PROP_USB_BUS_NUMBER");
if (! busstr)
goto end;
- addrstr = getenv("HAL_PROP_USB_DEVICE_PORT_NUMBER");
+ addrstr = getenv("HAL_PROP_USB_PORT_NUMBER");
if (! addrstr)
goto end;