From owner-p4-projects@FreeBSD.ORG Thu Jun 18 18:58:30 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 65644106579D; Thu, 18 Jun 2009 18:58:29 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 055C7106576E for ; Thu, 18 Jun 2009 18:58:28 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DDC868FC12 for ; Thu, 18 Jun 2009 18:58:28 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IIwSdh029318 for ; Thu, 18 Jun 2009 18:58:28 GMT (envelope-from syl@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5IIwSt0029316 for perforce@freebsd.org; Thu, 18 Jun 2009 18:58:28 GMT (envelope-from syl@FreeBSD.org) Date: Thu, 18 Jun 2009 18:58:28 GMT Message-Id: <200906181858.n5IIwSt0029316@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to syl@FreeBSD.org using -f From: Sylvestre Gallon To: Perforce Change Reviews Cc: Subject: PERFORCE change 164679 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 18:58:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=164679 Change 164679 by syl@syl_atuin on 2009/06/18 18:58:23 - Invert libusb_get_buffsize and libusb_get_maxframe. - add some debug. Affected files ... .. //depot/projects/soc2009/syl_usb/libusb-tests/transfers/test1/test1.c#4 edit .. //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10.c#41 edit Differences ... ==== //depot/projects/soc2009/syl_usb/libusb-tests/transfers/test1/test1.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ if ((devh = libusb_open_device_with_vid_pid(ctx, VID_TEST, PID_TEST)) != NULL) { libusb_detach_kernel_driver(devh, 1); dev = libusb_get_device(devh); - libusb_control_transfer(devh, 0x80, 0x01, 0x00, 0x00, data, 2, 10); + libusb_control_transfer(devh, 0x80, 0x01, 0x00, 0x00, data, 2, 100000); printf("data = 0x%.2x 0x%.2x\n", data[0], data[1]); } else { fprintf(stderr, "\nNo device match or lack of permissions.\n"); ==== //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10.c#41 (text+ko) ==== @@ -926,7 +926,7 @@ } static int -libusb_get_buffsize(struct libusb20_device *pdev, libusb_transfer *xfer) +libusb_get_maxframe(struct libusb20_device *pdev, libusb_transfer *xfer) { int ret; int usb_speed; @@ -945,6 +945,9 @@ break ; } break ; + case LIBUSB_TRANSFER_TYPE_CONTROL: + ret = 2; + break ; default: ret = 1; break ; @@ -954,7 +957,7 @@ } static int -libusb_get_maxframe(struct libusb20_device *pdev, libusb_transfer *xfer) +libusb_get_buffsize(struct libusb20_device *pdev, libusb_transfer *xfer) { int ret; int usb_speed; @@ -1082,7 +1085,8 @@ buffsize = libusb_get_buffsize(pdev, xfer); maxframe = libusb_get_maxframe(pdev, xfer); - + printf("buffsize : 0x%.8x maxframe : 0x%.8x\n", buffsize, maxframe); + ret = libusb20_tr_open(usb20_xfer[0], buffsize, maxframe, xfer->endpoint); if (xfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS)