summaryrefslogtreecommitdiff
path: root/sysutils/hal/patches/patch-ao
blob: 030c290e31b5be421e6485c6a31d64d48c5819b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$NetBSD: patch-ao,v 1.4 2012/03/31 16:06:56 ryoon Exp $

On DragonFly /dev/usb will be taken by usbd(8), but that does not
mean that one cannot check usbX devices. The same behaviour was present
in older versions of hald(8).

--- hald/freebsd/hf-usb.c.orig	2009-09-17 13:49:46.000000000 +0000
+++ hald/freebsd/hf-usb.c
@@ -36,9 +36,13 @@
 #if __FreeBSD_version >= 800064
 #include <legacy/dev/usb/usb.h>
 #else
+#ifdef __DragonFly__
+#include <bus/usb/usb.h>
+#else
 #include <dev/usb/usb.h>
 #endif
 #endif
+#endif
 
 #include "../logger.h"
 #include "../osspec.h"
@@ -392,7 +396,11 @@ hf_usb_device_new (HalDevice *parent,
     hf_devtree_device_set_name(device, di->udi_devnames[0]);
 
   if ((devname = hf_usb_get_devname(di, "ukbd")))	/* USB keyboard */
+#if defined(__FreeBSD__)
+    hf_device_set_input(device, "keyboard", "keys", NULL);
+#else
     hf_device_set_input(device, "keyboard", "keys", devname);
+#endif
   else if ((devname = hf_usb_get_devname(di, "ums")))	/* USB mouse */
     hf_device_set_input(device, "mouse", NULL, devname);
   else if ((devname = hf_usb_get_devname(di, "uhid")))	/* UHID device */
@@ -613,7 +621,6 @@ hf_usb_privileged_init (void)
   if (hf_usb_fd < 0)
     {
       HAL_INFO(("unable to open %s: %s", HF_USB_DEVICE, g_strerror(errno)));
-      return;
     }
 
   for (i = 0; i < 16; i++)
@@ -908,6 +915,8 @@ hf_usb_add_webcam_properties (HalDevice 
 
   hal_device_property_set_string(device, "info.category", "video4linux");
   hal_device_add_capability(device, "video4linux");
+  hal_device_add_capability(device, "video4linux.video_capture");
   hf_device_property_set_string_printf(device, "video4linux.device", "/dev/video%i", unit);
   hal_device_property_set_string(device, "info.product", "Video Device");
+  hal_device_property_set_string(device, "video4linux.version", "1");
 }