diff options
| author | Marcus von Appen <mva@FreeBSD.org> | 2009-03-13 16:32:57 +0000 |
|---|---|---|
| committer | Marcus von Appen <mva@FreeBSD.org> | 2009-03-13 16:32:57 +0000 |
| commit | 28cf0d495811a05c12cdb0f7ffa0ffb26a06eacc (patch) | |
| tree | 1ba407d3c5507c6009fabc48b0f382e7f4d8466f /devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c | |
| parent | - Update to 20090301 (diff) | |
Reactivate USB joystick support on -CURRENT.
PR: ports/132150
Submitted by: hps
Approved by: miwi (mentor)
Diffstat (limited to 'devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c')
| -rw-r--r-- | devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c b/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c new file mode 100644 index 000000000000..e7e503fad2ab --- /dev/null +++ b/devel/sdl12/files/patch-src_joystick_bsd_SDL_sysjoystick.c @@ -0,0 +1,40 @@ +--- src/joystick/bsd/SDL_sysjoystick.c.orig 2009-03-12 22:54:57.000000000 +0100 ++++ src/joystick/bsd/SDL_sysjoystick.c 2009-03-12 23:04:53.000000000 +0100 +@@ -74,6 +74,13 @@ + #define MAX_JOY_JOYS 2 + #define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS) + ++#if defined(__FREEBSD__) && (__FreeBSD_version > 800063) ++struct usb_ctl_report { ++ int ucr_report; ++ u_char ucr_data[1024]; /* filled data size will vary */ ++}; ++#endif ++ + struct report { + struct usb_ctl_report *buf; /* Buffer */ + size_t size; /* Buffer size */ +@@ -137,7 +144,7 @@ + static int report_alloc(struct report *, struct report_desc *, int); + static void report_free(struct report *); + +-#ifdef USBHID_UCR_DATA ++#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_version > 800063)) + #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data) + #else + #define REP_BUF_DATA(rep) ((rep)->buf->data) +@@ -292,9 +299,13 @@ + strerror(errno)); + goto usberr; + } +- ++#if defined(__FREEBSD__) && (__FreeBSD_version > 800063) ++ rep->rid = hid_get_report_id(fd); ++ if (rep->rid < 0) { ++#else + rep = &hw->inreport; + if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) { ++#endif + rep->rid = -1; /* XXX */ + } + if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) { |
