From owner-p4-projects@FreeBSD.ORG Wed Jun 17 20:44:33 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1C34F1065673; Wed, 17 Jun 2009 20:44:33 +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 CA73F106566C for ; Wed, 17 Jun 2009 20:44:32 +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 9D9A28FC16 for ; Wed, 17 Jun 2009 20:44:32 +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 n5HKiWFQ000678 for ; Wed, 17 Jun 2009 20:44:32 GMT (envelope-from syl@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5HKiWPO000675 for perforce@freebsd.org; Wed, 17 Jun 2009 20:44:32 GMT (envelope-from syl@FreeBSD.org) Date: Wed, 17 Jun 2009 20:44:32 GMT Message-Id: <200906172044.n5HKiWPO000675@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 164624 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: Wed, 17 Jun 2009 20:44:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=164624 Change 164624 by syl@syl_atuin on 2009/06/17 20:43:34 Get closer from first control transfer : - Add more transfer debug. - only LIBUSB20_TRANSFER_ERROR equals to LIBUSB_TRANSFER_ERROR. - make test1 output sexier. Affected files ... .. //depot/projects/soc2009/syl_usb/libusb-tests/transfers/test1/test1.c#3 edit .. //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10.c#39 edit .. //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10_io.c#14 edit Differences ... ==== //depot/projects/soc2009/syl_usb/libusb-tests/transfers/test1/test1.c#3 (text+ko) ==== @@ -15,7 +15,7 @@ uint8_t data[2] = {0,0}; printf("This program will try to issue a GET_STATUS" - "on the PID_TEST VID_TEST device control endpoint"); + " request on the PID_TEST VID_TEST device control endpoint\n"); if (libusb_init(&ctx) != 0) { ==== //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10.c#39 (text+ko) ==== @@ -851,12 +851,14 @@ usb_xfer->actual_length = 0; switch (usb_xfer->type) { case LIBUSB_TRANSFER_TYPE_CONTROL: + dprintf(ctx, LIBUSB_DEBUG_TRANSFER, "TYPE CTR"); libusb20_tr_setup_control(xfer, usb_xfer->buffer, (void *)(((uint8_t *) usb_xfer->buffer) + sizeof(libusb_control_setup)), usb_xfer->timeout); break ; case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: + dprintf(ctx, LIBUSB_DEBUG_TRANSFER, "TYPE ISO"); iso_packets = libusb20_tr_get_max_frames(xfer); if (usb_xfer->num_iso_packets > iso_packets) usb_xfer->num_iso_packets = iso_packets; @@ -867,15 +869,18 @@ libusb20_tr_set_total_frames(xfer, i); break ; case LIBUSB_TRANSFER_TYPE_BULK: + dprintf(ctx, LIBUSB_DEBUG_TRANSFER, "TYPE BULK"); libusb20_tr_setup_bulk(xfer, usb_xfer->buffer, usb_xfer->length, usb_xfer->timeout); break ; case LIBUSB_TRANSFER_TYPE_INTERRUPT: + dprintf(ctx, LIBUSB_DEBUG_TRANSFER, "TYPE INTR"); libusb20_tr_setup_intr(xfer, usb_xfer->buffer, usb_xfer->length, usb_xfer->timeout); break ; } libusb20_tr_submit(xfer); + dprintf(ctx, LIBUSB_DEBUG_TRANSFER, "LIBUSB20 SUBMITED"); break ; default: usb_xfer->actual_length = 0; @@ -908,8 +913,12 @@ dprintf(ctx, LIBUSB_DEBUG_TRANSFER, "STATUS TR TIMEOUT"); xfer->status = LIBUSB_TRANSFER_TIMED_OUT; break ; + case LIBUSB20_TRANSFER_ERROR: + dprintf(ctx, LIBUSB_DEBUG_TRANSFER, "ERROR"); + xfer->status = LIBUSB_TRANSFER_ERROR; + break ; default: - xfer->status = LIBUSB_TRANSFER_ERROR; + printf("other status : %i\n", status); } pthread_mutex_unlock(&libusb20_lock); ==== //depot/projects/soc2009/syl_usb/src/lib/libusb/libusb10_io.c#14 (text+ko) ==== @@ -189,6 +189,7 @@ } pthread_mutex_lock(&libusb20_lock); + dprintf(ctx, LIBUSB_DEBUG_TRANSFER, "LIBUSB20_PROCESS"); ret = libusb20_dev_process(devh->os_priv); pthread_mutex_unlock(&libusb20_lock);