Bug#668669: brltty: FTBFS[kfreebsd]:
tags 668669 + upstream help
forwarded 668669 brltty@mielke.cc
thanks
Samuel Thibault, le Sat 14 Apr 2012 00:32:16 +0200, a écrit :
> Christoph Egger, le Sat 14 Apr 2012 00:16:39 +0200, a écrit :
> > Your package failed to build on the kfreebsd-* buildds:
>
> I have seen that, yes. I guess we will probably need help from FreeBSD
> people to fix (again) the USB drivers to the yet newer FreeBSD USB
> layer.
Actually it's simply that the legacy interface is not provided by the
kfreebsd-kernel-headers package any more, so we actually have to port to
the new interface. I have attached a patch that handles macro renaming
and such. The #include part needs some conditionals on the presence of
the headers, to be added to configure.ac.
There is however a remaining issue: the new interface does not have
the udi_devnames field, used in usb_bsd.h's usbFindDevice, so I don't
know how the matching loop done in brltty has to be rewritten. Also
/dev/usb%d do not exist any more, /dev/usb/%d.%d.%d do ; I guess brltty
should just iterate over these instead.
Unless somebody handles fixing it, I guess we'll have to just disable
usb support on kfreebsd debian ports for now.
Samuel
Index: Programs/usb_bsd.h
===================================================================
--- Programs/usb_bsd.h (r??vision 6321)
+++ Programs/usb_bsd.h (copie de travail)
@@ -35,7 +35,12 @@
usbSetTimeout (int file, int new, int *old) {
if (!old || (new != *old)) {
int arg = new;
- if (ioctl(file, USB_SET_TIMEOUT, &arg) == -1) {
+#ifdef USB_SET_TIMEOUT
+ if (ioctl(file, USB_SET_TIMEOUT, &arg) == -1)
+#else
+ if (ioctl(file, USB_SET_RX_TIMEOUT, &arg) == -1)
+#endif
+ {
logSystemError("USB timeout set");
return 0;
}
@@ -46,7 +51,11 @@
static int
usbSetShortTransfers (int file, int arg) {
+#ifdef USB_SET_SHORT_XFER
if (ioctl(file, USB_SET_SHORT_XFER, &arg) != -1) return 1;
+#else
+ if (ioctl(file, USB_SET_RX_SHORT_XFER, &arg) != -1) return 1;
+#endif
logSystemError("USB set short transfers");
return 0;
}
@@ -113,7 +122,11 @@
struct usb_alt_interface arg;
memset(&arg, 0, sizeof(arg));
arg.uai_interface_index = interface;
+#ifdef HAVE_ALT_NO
arg.uai_alt_no = alternative;
+#else
+ arg.uai_alt_index = alternative;
+#endif
if (ioctl(devx->file, USB_SET_ALTINTERFACE, &arg) != -1) return 1;
logSystemError("USB alternative set");
return 0;
@@ -151,7 +164,11 @@
USETW(arg.ucr_request.wIndex, index);
USETW(arg.ucr_request.wLength, length);
arg.ucr_data = buffer;
+#ifdef USBD_SHORT_XFER_OK
arg.ucr_flags = USBD_SHORT_XFER_OK;
+#else
+ arg.ucr_flags = USB_SHORT_XFER_OK;
+#endif
if (usbSetTimeout(devx->file, timeout, &devx->timeout)) {
if (ioctl(devx->file, USB_DO_REQUEST, &arg) != -1) return arg.ucr_actlen;
logSystemError("USB control transfer");
Index: Programs/usb_kfreebsd.c
===================================================================
--- Programs/usb_kfreebsd.c (r??vision 6321)
+++ Programs/usb_kfreebsd.c (copie de travail)
@@ -29,6 +29,8 @@
#include <legacy/dev/usb/usb.h>
#else /* HAVE_LEGACY_DEV_USB_USB_H */
#include <dev/usb/usb.h>
+#include <dev/usb/usb_ioctl.h>
+#include <dev/usb/usbdi.h>
#endif /* HAVE_LEGACY_DEV_USB_USB_H */
#include "io_usb.h"
Reply to: