From nobody@FreeBSD.org  Sat Jul 22 13:14:21 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A9B5516A5D4
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Jul 2006 13:14:21 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3454D43D53
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Jul 2006 13:14:21 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k6MDELZe061164
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Jul 2006 13:14:21 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k6MDELJN061162;
	Sat, 22 Jul 2006 13:14:21 GMT
	(envelope-from nobody)
Message-Id: <200607221314.k6MDELJN061162@www.freebsd.org>
Date: Sat, 22 Jul 2006 13:14:21 GMT
From: Robert Nilsson <rnilsson@mac.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: libusb usb_clear_halt implementation
X-Send-Pr-Version: www-2.3

>Number:         100718
>Category:       ports
>Synopsis:       libusb usb_clear_halt implementation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    stefan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 22 13:20:14 GMT 2006
>Closed-Date:    Sun Jul 30 11:49:21 GMT 2006
>Last-Modified:  Sun Jul 30 11:49:21 GMT 2006
>Originator:     Robert Nilsson
>Release:        6.1-RELEASE
>Organization:
Nilsson Studios
>Environment:
FreeBSD bsdtest.home.nilssonstudios.com 6.1-RELEASE FreeBSD 6.1-RELEASE #4: Fri Jul 21 11:40:44 CDT 2006     robert@bsdtest.home.nilssonstudios.com:/usr/obj/usr/src/sys/DEBUG  i386

>Description:
While porting owfs over to BSD I realized the usb_clear_halt function was not implemented in libusb for BSD.
>How-To-Repeat:

>Fix:
--- libusb-0.1.12/bsd.c Fri Mar  3 20:52:46 2006
+++ libusb-0.1.12.rob/bsd.c     Fri Jul 21 22:47:55 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)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: stefan 
State-Changed-When: Sat Jul 29 17:10:08 UTC 2006 
State-Changed-Why:  
Awaiting maintainer's feedback. 


Responsible-Changed-From-To: freebsd-ports-bugs->stefan 
Responsible-Changed-By: stefan 
Responsible-Changed-When: Sat Jul 29 17:10:08 UTC 2006 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100718 

From: Stefan Walter <stefan@freebsd.org>
To: r.c.ladan@gmail.com
Cc: GNATS <FreeBSD-gnats-submit@FreeBSD.org>
Subject: Re: ports/100718: libusb usb_clear_halt implementation
Date: Sat, 29 Jul 2006 19:09:57 +0200

 Dear maintainer of devel/libusb,
 
 a PR containing a patch for this port is waiting for your approval. It can
 be found at http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/100718.
 Please send a followup to the PR to state your opinion regarding the
 changes.
 
 Regards,
 Stefan

From: Rene Ladan <r.c.ladan@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/100718: libusb usb_clear_halt implementation
Date: Sat, 29 Jul 2006 19:43:17 +0200

 I approve the patch, because the libusb list has been silent on this
 since a week and imo the extra functionality can't hurt.
 
 Regards,
 Rene
 -- 
 GPG fingerprint = E738 5471 D185 7013 0EE0  4FC8 3C1D 6F83 12E1 84F6
 (subkeys.pgp.net)
 
 "It won't fit on the line."
 		-- me, 2001
 
State-Changed-From-To: feedback->closed 
State-Changed-By: stefan 
State-Changed-When: Sun Jul 30 11:48:36 UTC 2006 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100718 
>Unformatted:
