From owner-freebsd-usb@FreeBSD.ORG Thu May 8 11:50:28 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7E801065672 for ; Thu, 8 May 2008 11:50:28 +0000 (UTC) (envelope-from vpa@bit4id.com) Received: from smtp4.aruba.it (smtpd3.aruba.it [62.149.128.208]) by mx1.freebsd.org (Postfix) with SMTP id 0BBA08FC18 for ; Thu, 8 May 2008 11:50:27 +0000 (UTC) (envelope-from vpa@bit4id.com) Received: (qmail 4880 invoked by uid 89); 8 May 2008 11:23:45 -0000 Received: by simscan 1.1.0 ppid: 4858, pid: 4866, t: 0.2871s scanners: clamav: 0.88.4/m:40/d:1722 Received: from unknown (HELO ?192.168.0.40?) (vpa@bit4id.com@82.51.237.40) by smtp4.aruba.it with SMTP; 8 May 2008 11:23:45 -0000 Message-ID: <4822E2C1.9040608@bit4id.com> Date: Thu, 08 May 2008 13:23:45 +0200 From: Vincenzo Palazzo User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: freebsd-usb@freebsd.org References: <4822E006.9080902@NOSPAMkurganme.cjb.net> In-Reply-To: <4822E006.9080902@NOSPAMkurganme.cjb.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: smtp4.aruba.it 1.6.2 0/1000/N Subject: Re: freebsd 6.3 smart card reader usb hang? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2008 11:50:28 -0000 Btw I've tested the code on a Virtual Machine, with the same kernel, same test code (I have copied the binaries) and, as you can see below, it WORKS! I obtain response from the usb reader, and it is correct! This is the log for the execution on the Virtual Machine. The VM is created with VMWare Server on a Windows XP host. > sudo ./a.out opening... writing... reading... 0100001041435233382d31313030ffff00060c00 closing... ---- BEGIN KERNEL LOG ---- ugenopen: flag=3, mode=8192, unit=0 endpt=2 ugenopen: sc=0xc2697000, endpt=2, dir=0, sce=0xc269739c usbd_open_pipe: iface=0xc2641440 address=0x2 flags=0x0 usbd_setup_pipe: dev=0xc268c080 iface=0xc2641440 ep=0xc267a5cc pipe=0xd153d964 uhci_open: pipe=0xc273cc80, addr=2, endpt=2 (1) ugenopen: sc=0xc2697000, endpt=2, dir=1, sce=0xc269747c usbd_open_pipe: iface=0xc2641440 address=0x82 flags=0x0 usbd_setup_pipe: dev=0xc268c080 iface=0xc2641440 ep=0xc267a5d8 pipe=0xd153d964 uhci_open: pipe=0xc27afa00, addr=2, endpt=130 (1) ugen0: ugenwrite: 2 usbd_alloc_xfer() = 0xc2645000 ugenwrite: transfer 4 bytes usbd_bulk_transfer: start transfer 4 bytes usbd_transfer: xfer=0xc2645000, flags=0, pipe=0xc273cc80, running=0 usbd_dump_queue: pipe=0xc273cc80 usb_allocmem: use frag=0xc2650f40 size=4 usb_insert_transfer: pipe=0xc273cc80 running=0 timeout=0 uhci_device_bulk_start: xfer=0xc2645000 len=4 flags=0 ii=0xc2645074 uhci_alloc_std_chain: addr=2 endpt=2 len=4 speed=2 flags=0x0 uhci_alloc_std_chain: maxp=64 ntd=1 uhci_alloc_std_chain: nexttog=0 uhci_device_bulk_transfer: data(1) TD(0xc264af80) at 0f39ef80 = link=0x00000005 status=0x198003ff token=0x006902e1 buffer=0x0f8e4f40 5 198003ff,errcnt=3,actlen=0 pid=e1,addr=2,endpt=2,D=1,maxlen=4 uhci_add_bulk: sqh=0xc264bf20 uhci_start_loop: add uhci_device_bulk_transfer: data(2) TD(0xc264af80) at 0f39ef80 = link=0x00000005 status=0x198003ff token=0x006902e1 buffer=0x0f8e4f40 5 198003ff,errcnt=3,actlen=0 pid=e1,addr=2,endpt=2,D=1,maxlen=4 usb_schedsoftintr: polling=0 usb0: uhci_softintr (0) uhci_check_intr: ii=0xc2645074 done uhci_idone: ii=0xc2645074 uhci_idone: ii=0xc2645074, xfer=0xc2645000, pipe=0xc273cc80 ready TD(0xc264af80) at 0f39ef80 = link=0x00000005 status=0x19000003 token=0x006902e1 buffer=0x0f8e4f40 5 19000003,errcnt=3,actlen=4 pid=e1,addr=2,endpt=2,D=1,maxlen=4 uhci_idone: actlen=4, status=0x0 usb_transfer_complete: pipe=0xc273cc80 xfer=0xc2645000 status=0 actlen=4 usb_freemem: frag=0xc2650f40 usb_transfer_complete: repeat=0 new head=0 uhci_device_bulk_done: xfer=0xc2645000 ii=0xc2645074 sc=0xc264f000 upipe=0xc273cc80 uhci_remove_bulk: sqh=0xc264bf20 uhci_end_loop: remove uhci_device_bulk_done: length=4 usbd_start_next: pipe=0xc273cc80, xfer=0 uhci_idone: ii=0xc2645074 done usbd_bulk_transfer: transferred 4 usbd_free_xfer: 0xc2645000 ugen0: ugenread: 2 usbd_alloc_xfer() = 0xc2645000 ugenread: start transfer 20 bytes usbd_bulk_transfer: start transfer 20 bytes usbd_transfer: xfer=0xc2645000, flags=0, pipe=0xc27afa00, running=0 usbd_dump_queue: pipe=0xc27afa00 usb_allocmem: use frag=0xc2650f40 size=20 usb_insert_transfer: pipe=0xc27afa00 running=0 timeout=0 uhci_device_bulk_start: xfer=0xc2645000 len=20 flags=0 ii=0xc2645074 uhci_alloc_std_chain: addr=2 endpt=2 len=20 speed=2 flags=0x0 uhci_alloc_std_chain: maxp=64 ntd=1 uhci_alloc_std_chain: nexttog=0 uhci_device_bulk_transfer: data(1) TD(0xc264af80) at 0f39ef80 = link=0x00000005 status=0x198003ff token=0x02690269 buffer=0x0f8e4f40 5 198003ff,errcnt=3,actlen=0 pid=69,addr=2,endpt=2,D=1,maxlen=20 uhci_add_bulk: sqh=0xc264bf40 uhci_start_loop: add uhci_device_bulk_transfer: data(2) TD(0xc264af80) at 0f39ef80 = link=0x00000005 status=0x198003ff token=0x02690269 buffer=0x0f8e4f40 5 198003ff,errcnt=3,actlen=0 pid=69,addr=2,endpt=2,D=1,maxlen=20 usb_schedsoftintr: polling=0 usb0: uhci_softintr (0) uhci_check_intr: ii=0xc2645074 done uhci_idone: ii=0xc2645074 uhci_idone: ii=0xc2645074, xfer=0xc2645000, pipe=0xc27afa00 ready TD(0xc264af80) at 0f39ef80 = link=0x00000005 status=0x19000013 token=0x02690269 buffer=0x0f8e4f40 5 19000013,errcnt=3,actlen=20 pid=69,addr=2,endpt=2,D=1,maxlen=20 uhci_idone: actlen=20, status=0x0 usb_transfer_complete: pipe=0xc27afa00 xfer=0xc2645000 status=0 actlen=20 usb_freemem: frag=0xc2650f40 usb_transfer_complete: repeat=0 new head=0 uhci_device_bulk_done: xfer=0xc2645000 ii=0xc2645074 sc=0xc264f000 upipe=0xc27afa00 uhci_remove_bulk: sqh=0xc264bf40 uhci_end_loop: remove uhci_device_bulk_done: length=20 usbd_start_next: pipe=0xc27afa00, xfer=0 uhci_idone: ii=0xc2645074 done usbd_bulk_transfer: transferred 20 ugenread: got 20 bytes usbd_free_xfer: 0xc2645000 ugenclose: flag=3, mode=8192, unit=0, endpt=2 ugenclose: endpt=2 dir=0 sce=0xc269739c usbd_ar_pipe: pipe=0xc273cc80 usbd_dump_queue: pipe=0xc273cc80 ugenclose: endpt=2 dir=1 sce=0xc269747c usbd_ar_pipe: pipe=0xc27afa00 usbd_dump_queue: pipe=0xc27afa00 ---- END KERNEL LOG ---- > dmesg | grep -iE '^.hci[0-9]|usb[0-9]' uhci0: port 0x1060-0x107f irq 19 at device 7.2 on pci0 uhci0: [GIANT-LOCKED] uhci0: LegSup = 0x003b usb0: on uhci0 usb0: USB revision 1.0