From 6e12912deab37ed9a2f17dfdd10bcfbcc2528ea0 Mon Sep 17 00:00:00 2001 From: Stefan Walter Date: Sun, 30 Jul 2006 11:48:24 +0000 Subject: [PATCH] - Add usb_clear_halt implementation. - Bump PORTREVISION. PR: 100718 Submitted by: Robert Nilsson Approved by: maintainer arved (mentor) --- devel/libusb/Makefile | 1 + devel/libusb/files/patch-bsd.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 devel/libusb/files/patch-bsd.c diff --git a/devel/libusb/Makefile b/devel/libusb/Makefile index fb1cdf8b9e2f..b1520e46898f 100644 --- a/devel/libusb/Makefile +++ b/devel/libusb/Makefile @@ -7,6 +7,7 @@ PORTNAME= libusb PORTVERSION= 0.1.12 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/devel/libusb/files/patch-bsd.c b/devel/libusb/files/patch-bsd.c new file mode 100644 index 000000000000..6e8afde3fdf7 --- /dev/null +++ b/devel/libusb/files/patch-bsd.c @@ -0,0 +1,26 @@ +--- bsd.c.orig Sun Jul 30 11:18:07 2006 ++++ bsd.c Sun Jul 30 11:20:30 2006 +@@ -623,9 +623,21 @@ + + int usb_clear_halt(usb_dev_handle *dev, unsigned int ep) + { +- /* Not yet done, because I haven't needed it. */ ++ int ret; ++ struct usb_ctl_request ctl_req; + +- USB_ERROR_STR(-ENOSYS, "usb_clear_halt called, unimplemented on BSD"); ++ ctl_req.ucr_addr = 0; // Not used for this type of request ++ ctl_req.ucr_request.bmRequestType = UT_WRITE_ENDPOINT; ++ ctl_req.ucr_request.bRequest = UR_CLEAR_FEATURE; ++ USETW(ctl_req.ucr_request.wValue, UF_ENDPOINT_HALT); ++ USETW(ctl_req.ucr_request.wIndex, ep); ++ USETW(ctl_req.ucr_request.wLength, 0); ++ ctl_req.ucr_flags = 0; ++ ++ if ((ret = ioctl(dev->fd, USB_DO_REQUEST, &ctl_req)) < 0) ++ USB_ERROR_STR(-errno, "clear_halt: failed for %d", ep); ++ ++ return ret; + } + + int usb_reset(usb_dev_handle *dev)