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
|
$NetBSD: patch-ag,v 1.4 2005/11/17 19:55:55 joerg Exp $
--- src/unix/joystick-drivers/joy_usb.c.orig 2005-11-17 16:19:51.000000000 +0000
+++ src/unix/joystick-drivers/joy_usb.c
@@ -22,7 +22,7 @@ struct rc_option joy_usb_opts[] = {
#ifdef USB_JOYSTICK
-#if !defined(__ARCH_openbsd) && !defined(__ARCH_netbsd) && !defined(__ARCH_freebsd)
+#if !defined(__ARCH_openbsd) && !defined(__ARCH_netbsd) && !defined(__ARCH_freebsd) && !defined(__ARCH_dragonfly)
#error "USB joysticks are only supported under OpenBSD, NetBSD and FreeBSD. Patches to support other archs are welcome ;)"
#endif
@@ -47,8 +47,13 @@ struct rc_option joy_usb_opts[] = {
#include <sys/ioctl.h>
#endif
+#ifdef __ARCH_dragonfly
+#include <bus/usb/usb.h>
+#include <bus/usb/usbhid.h>
+#else
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
+#endif
int axis_usage[] = {
HUG_X, HUG_Y, HUG_Z,
@@ -118,7 +123,7 @@ static int joy_initialize_hid(int i)
}
#if defined(HAVE_USBHID_H) || defined(HAVE_LIBUSBHID_H)
-#if defined(__ARCH_openbsd) || defined(__ARCH_netbsd) || (defined(__ARCH_freebsd) && __FreeBSD_version > 500000)
+#if defined(__ARCH_openbsd) || defined(__ARCH_netbsd) || (defined(__ARCH_freebsd) && __FreeBSD_version > 500000) || defined(__ARCH_dragonfly)
if (ioctl(joy_data[i].fd, USB_GET_REPORT_ID, &report_id) < 0)
{
fprintf(stderr_file, "error: /dev/uhid%d: %s", i, strerror(errno));
|