From owner-freebsd-usb@FreeBSD.ORG Wed Jul 14 07:38:28 2010 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 1D21C1065672 for ; Wed, 14 Jul 2010 07:38:28 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.tele2.se [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id 75E838FC18 for ; Wed, 14 Jul 2010 07:38:27 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=cesdk5w18HYA:10 a=ygRHs6EKU7oA:10 a=8nJEP1OIZ-IA:10 a=M8b_wTzEtboA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=cIZCSEmovbmDRW584tAA:9 a=k6pWixVsIFAjEFmGNU-oxHka0c4A:4 a=wPNLvfGTeEIA:10 a=P3qLrTBu_0-CnHLR:21 a=ZbNZk4U38BqvE6XB:21 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1208058560; Wed, 14 Jul 2010 09:38:25 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 14 Jul 2010 09:35:29 +0200 User-Agent: KMail/1.12.4 (FreeBSD/8.1-PRERELEASE; KDE/4.3.4; amd64; ; ) References: In-Reply-To: X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?iso-8859-1?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?iso-8859-1?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7Co?= =?iso-8859-1?q?TlKMusi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201007140935.29738.hselasky@c2i.net> Cc: Subject: Re: libusb10: libusb_bulk_transfer returns LIBUSB_ERROR_OTHER caused by USB_FS_OPEN ioctl in ugen20_tr_open 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: Wed, 14 Jul 2010 07:38:28 -0000 On Tuesday 13 July 2010 23:40:43 Peer Stritzinger wrote: > Hi, > > with the setup from my post of yesterday I'm trying IN transfers with > libusb 1.0 and now I'm a bit stuck. > > In essence I'm doing: > > cnt = libusb_get_device_list(NULL, &list); > > ... find device -> now in found > > if (found) { > libusb_device_handle *handle; > ... > rv = libusb_open(found, &handle); > trans_len = 0; > rv = libusb_bulk_transfer(handle, ep, buf, NBUF, &trans_len, 0); > > > What I get is rv -> LIBUSB_ERROR_OTHER to get closer to re reason for > this I debugged the last call into libusb > > The error return is caused in ugen20_tr_open(): > > ioctl(xfer->pdev->file, USB_FS_OPEN, &temp) > > returns != 0, errno -> EINVAL > > Params to this ioctl are: > > (gdb) p temp > $1 = {max_bufsize = 16384, max_frames = 1, max_packet_length = 0, > dev_index = 0 '\0', ep_index = 24 '\030', ep_no = 6 '\006'} > > (gdb) p *xfer > $2 = {pdev = 0x282033c0, callback = 0x28094190 , > priv_sc0 = 0x282033c0, priv_sc1 = 0x28221060, ppBuffer = 0x2822208c, > pLength = 0x28222088, maxTotalLength = 0, maxFrames = 1, nFrames = 0, > aFrames = 0, timeout = 0, timeComplete = 0, trIndex = 24, maxPacketLen = > 0, flags = 0 '\0', status = 0 '\0', is_opened = 0 '\0', is_pending = 0 > '\0', is_cancel = 0 '\0', is_draining = 0 '\0', is_restart = 0 '\0'} > (gdb) p *xfer->pdev > $3 = {ddesc = {LIBUSB20_DEVICE_DESC_FORMAT = 0x2809abd4, bLength = 18 > '\022', bDescriptorType = 1 '\001', bcdUSB = 512, bDeviceClass = 0 '\0', > bDeviceSubClass = 0 '\0', bDeviceProtocol = 0 '\0', > bMaxPacketSize0 = 64 '@', idVendor = 1133, idProduct = 49177, > bcdDevice = 0, iManufacturer = 1 '\001', iProduct = 2 '\002', > iSerialNumber = 0 '\0', bNumConfigurations = 1 '\001'}, session_data = > { session_data = 1731721030, tv = {tv_sec = 1731721030, tv_nsec = 0}, > plugtime = 1731721030}, dev_entry = {tqe_next = 0x0, > tqe_prev = 0x28202030}, methods = 0x2809aac0, beMethods = 0x2809aa80, > pTransfer = 0x28209c00, privBeData = 0x28215300, privLuData = 0x28207100, > claimed_interface = 0 '\0', file = 12, file_ctrl = 11, debug = 0, > nTransfer = 64, bus_number = 3 '\003', device_address = 2 '\002', > usb_mode = 0 '\0', usb_speed = 3 '\003', is_opened = 1 '\001', > usb_desc = "ugen3.2: at usbus3", '\0' times>} > > BTW usb_desc is showing the right device. > > Any suggestions? IN endpoints must be OR'ed with 0x80. Could you dump the configuration descriptor of your device? Also you might need to claim the interfaces. --HPS