aboutsummaryrefslogtreecommitdiff
path: root/devel/libusb
diff options
context:
space:
mode:
authorStefan Walter <stefan@FreeBSD.org>2006-07-30 11:48:24 +0000
committerStefan Walter <stefan@FreeBSD.org>2006-07-30 11:48:24 +0000
commit6e12912deab37ed9a2f17dfdd10bcfbcc2528ea0 (patch)
tree083eba92709fbc0b097a71840a8ff90371f914ac /devel/libusb
parent4e754778fdf99f094a1ce55f5d855a09be2b811c (diff)
downloadports-6e12912deab37ed9a2f17dfdd10bcfbcc2528ea0.tar.gz
ports-6e12912deab37ed9a2f17dfdd10bcfbcc2528ea0.zip
- Add usb_clear_halt implementation.
- Bump PORTREVISION. PR: 100718 Submitted by: Robert Nilsson <rnilsson@mac.com> Approved by: maintainer arved (mentor)
Notes
Notes: svn path=/head/; revision=169122
Diffstat (limited to 'devel/libusb')
-rw-r--r--devel/libusb/Makefile1
-rw-r--r--devel/libusb/files/patch-bsd.c26
2 files changed, 27 insertions, 0 deletions
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)