From owner-freebsd-ports@FreeBSD.ORG Sun Mar 1 19:41:22 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20EA2106564A for ; Sun, 1 Mar 2009 19:41:22 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.freebsd.org (Postfix) with ESMTP id 7BEE38FC1F for ; Sun, 1 Mar 2009 19:41:20 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=dDWAIkSaYRQA:10 a=WEmzK17sHcYA:10 a=MXw7gxVQKqGXY79tIT8aFQ==:17 a=e7DhKfEIB9MlVx0aaNUA:9 a=_cRYtBZmZHFXiSJQwIkA:7 a=e5hjuKLQcIAyMiFqH72zEzAldzsA:4 a=LY0hPdMaydYA:10 a=ES_hapMy7a7KWwKdeisA:9 a=ffTU-SFYKYh1mWGCMX8A:7 a=KkWftBjEUf95coZrmnWh4fSOtgkA:4 a=rPt6xJ-oxjAA:10 Received: from [62.113.132.61] (account mc467741@c2i.net HELO laptop) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 152567160; Sun, 01 Mar 2009 19:41:18 +0100 From: Hans Petter Selasky To: Mark Linimon Date: Sun, 1 Mar 2009 19:43:46 +0100 User-Agent: KMail/1.9.7 References: <20090227014400.GA27047@lonesome.com> <20090227100813.14l6mfo7tws04sw0@0x20.net> <20090227171257.GA8408@lonesome.com> In-Reply-To: <20090227171257.GA8408@lonesome.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_jdtqJjIuCaEYJhA" Message-Id: <200903011943.47410.hselasky@c2i.net> Cc: freebsd-ports@freebsd.org Subject: Re: list of ports broken by USB switchover? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2009 19:41:22 -0000 --Boundary-00=_jdtqJjIuCaEYJhA Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Friday 27 February 2009, Mark Linimon wrote: > On Fri, Feb 27, 2009 at 10:08:13AM +0100, Lars Engels wrote: > > multimedia/pwcbsd is broken. If I can find the new FreeBSD version I > > will mark it broken for USB2. > > 800064 > > mcl Quick and dirty patch for "/usr/ports/devel/sdl12" is attached. Here's one more: .libs/SDL_sysjoystick.o ./src/joystick/bsd/SDL_sysjoystick.c: In function 'SDL_SYS_JoystickOpen': ./src/joystick/bsd/SDL_sysjoystick.c:297: error: 'USB_GET_REPORT_ID' undeclared (first use in this function) ./src/joystick/bsd/SDL_sysjoystick.c:297: error: (Each undeclared identifier is reported only once ./src/joystick/bsd/SDL_sysjoystick.c:297: error: for each function it appears in .) ./src/joystick/bsd/SDL_sysjoystick.c: In function 'SDL_SYS_JoystickUpdate': ./src/joystick/bsd/SDL_sysjoystick.c:445: error: dereferencing pointer to incomp lete type ./src/joystick/bsd/SDL_sysjoystick.c:469: error: dereferencing pointer to incomp lete type ./src/joystick/bsd/SDL_sysjoystick.c:477: error: dereferencing pointer to incomp lete type ./src/joystick/bsd/SDL_sysjoystick.c:485: error: dereferencing pointer to incomp Solution: Use new functions from libusbhid. See "man libusbhid" ! --HPS --Boundary-00=_jdtqJjIuCaEYJhA Content-Type: text/x-diff; charset="iso-8859-1"; name="SDL_sysjoystick.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="SDL_sysjoystick.c.diff" --- work/SDL-1.2.13/./src/joystick/bsd/SDL_sysjoystick.c 2007-12-31 05:47:55.000000000 +0100 +++ ./SDL_sysjoystick.c 2009-03-01 19:06:23.000000000 +0100 @@ -36,24 +36,8 @@ #include #include -#if defined(HAVE_USB_H) -#include -#endif -#ifdef __DragonFly__ -#include -#include -#else -#include -#include -#endif - -#if defined(HAVE_USBHID_H) #include -#elif defined(HAVE_LIBUSB_H) -#include -#elif defined(HAVE_LIBUSBHID_H) -#include -#endif +#include #ifdef __FREEBSD__ #ifndef __DragonFly__ @@ -74,6 +58,11 @@ #define MAX_JOY_JOYS 2 #define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS) +struct usb_ctl_report { + int ucr_report; + u_char ucr_data[1024]; /* filled data size will vary */ +}; + struct report { struct usb_ctl_report *buf; /* Buffer */ size_t size; /* Buffer size */ @@ -137,11 +126,7 @@ static int report_alloc(struct report *, struct report_desc *, int); static void report_free(struct report *); -#ifdef USBHID_UCR_DATA #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data) -#else -#define REP_BUF_DATA(rep) ((rep)->buf->data) -#endif int SDL_SYS_JoystickInit(void) @@ -294,7 +279,8 @@ } rep = &hw->inreport; - if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) { + rep->rid = hid_get_report_id(fd); + if (rep->rid < 0) { rep->rid = -1; /* XXX */ } if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) { @@ -306,11 +292,7 @@ goto usberr; } -#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111) hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid); -#else - hdata = hid_start_parse(hw->repdesc, 1 << hid_input); -#endif if (hdata == NULL) { SDL_SetError("%s: Cannot start HID parser", hw->path); goto usberr; @@ -390,7 +372,7 @@ int nbutton, naxe = -1; Sint32 v; -#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#if defined(__FreeBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H struct joystick gameport; if (joy->hwdata->type == BSDJOY_JOY) { @@ -445,11 +427,7 @@ if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) { return; } -#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111) hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid); -#else - hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input); -#endif if (hdata == NULL) { fprintf(stderr, "%s: Cannot start HID parser\n", joy->hwdata->path); @@ -538,25 +516,7 @@ { int len; -#ifdef __DragonFly__ - len = hid_report_size(rd, r->rid, repinfo[repind].kind); -#elif __FREEBSD__ -# if (__FreeBSD_version >= 460000) -# if (__FreeBSD_version <= 500111) - len = hid_report_size(rd, r->rid, repinfo[repind].kind); -# else - len = hid_report_size(rd, repinfo[repind].kind, r->rid); -# endif -# else - len = hid_report_size(rd, repinfo[repind].kind, &r->rid); -# endif -#else -# ifdef USBHID_NEW len = hid_report_size(rd, repinfo[repind].kind, r->rid); -# else - len = hid_report_size(rd, repinfo[repind].kind, &r->rid); -# endif -#endif if (len < 0) { SDL_SetError("Negative HID report size"); --Boundary-00=_jdtqJjIuCaEYJhA--