From owner-freebsd-usb@FreeBSD.ORG Tue Jul 13 08:59:27 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 73E761065673; Tue, 13 Jul 2010 08:59:27 +0000 (UTC) (envelope-from peerst@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id CADF08FC16; Tue, 13 Jul 2010 08:59:26 +0000 (UTC) Received: by bwz12 with SMTP id 12so3601482bwz.13 for ; Tue, 13 Jul 2010 01:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=KArk2cEBTe1pmwnSHP/WKvoCZGhBWEX1h/ysiiprMAA=; b=MaWUyp8nhyd9oDCg5pwfpioi6BFIPyNabinuHwkJOy4tTm8++eR3zyy22pRKzIICVo FbWnOTYLV3+6FHD253qSTm9CMWahN8ZbKBlgXFTiF0FV/G99AUa+o6dp+OXQCilaGZjy GZsqTJV0D/08JxEq5LgB+3IXaKYKX3ZAMWTxw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=c4jSPliLQrj9Hw2lQk6fv2NjvSK3H4+nyQlH6HnJWnktPbhZRJSE0ofNrMqEs1kwLT lSX1sVb2+X6XZ2zHxWE1JH01F8rZdHaAG7MBAEXzXk8rXiJKw9/QPyHoJxCobaZtHb/q Sl9GBhaZAjQg0938JfxbgcV8f1zuk9sm53Wfc= MIME-Version: 1.0 Received: by 10.204.14.71 with SMTP id f7mr11801902bka.200.1279011565607; Tue, 13 Jul 2010 01:59:25 -0700 (PDT) Received: by 10.204.56.134 with HTTP; Tue, 13 Jul 2010 01:59:25 -0700 (PDT) In-Reply-To: References: <201007122020.02934.hselasky@freebsd.org> Date: Tue, 13 Jul 2010 10:59:25 +0200 Message-ID: From: Peer Stritzinger To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-usb@freebsd.org Subject: Re: read(2) always returns 0 when reading from /dev/usb/n.m.k bulk IN endpoint 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: Tue, 13 Jul 2010 08:59:27 -0000 Hi, FYI: just tried using the short xfer ioctl, but the behavior didn't change. in = open (argv[0], O_RDONLY); ioctl(in, USB_SET_RX_SHORT_XFER, 1); n = read(in, buf, NBUF); now trying libusb for this. -- Peer On Mon, Jul 12, 2010 at 10:41 PM, Peer Stritzinger wrote: > Hi, > > On Mon, Jul 12, 2010 at 8:20 PM, Hans Petter Selasky > wrote: > >> On Monday 12 July 2010 19:22:28 Peer Stritzinger wrote: >> > However the read always returns 0. >> > >> > Tried different buffer sizes etc. >> Hi, >> >> Maybe you are missing to set the short transfer OK flag. >> >> Else I recommend using LibUSB. >> >> --HPS >> > > Did'nt set this flag (not doing any ioctls on the ugen device at all). > > However I did try matching either the max packetlen, or the read buffer > size with the actual bytes sent, so I thought it shouldn't matter. > > I'll move on to libusb and not waste any more time with the raw interfaces. > > Thanks > -- Peer >