From owner-freebsd-usb@FreeBSD.ORG Sat Jun 17 07:50:07 2006 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C49916A479 for ; Sat, 17 Jun 2006 07:50:07 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from mail48.e.nsc.no (mail48.e.nsc.no [193.213.115.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9D6143D49 for ; Sat, 17 Jun 2006 07:50:06 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from Unknown-00-c0-9f-49-78-d8.lan (ti131310a080-6417.bb.online.no [85.165.217.17]) by mail48.nsc.no (8.13.6/8.13.5) with ESMTP id k5H7o4oh009147; Sat, 17 Jun 2006 09:50:04 +0200 (CEST) From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sat, 17 Jun 2006 09:50:08 +0200 User-Agent: KMail/1.7 References: <200606161724.21722.mistry.7@osu.edu> In-Reply-To: <200606161724.21722.mistry.7@osu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606170950.10062.hselasky@c2i.net> Cc: Subject: Re: ugen partial write() amount 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: Sat, 17 Jun 2006 07:50:07 -0000 On Friday 16 June 2006 23:24, Anish Mistry wrote: > I'm trying to reliably recover from a write() timeout using ugen. > The problem that I'm having is that when using write() to write data > to an endpoint and the write times out there seems no way to figure > out the amount of that data that was actually written. This is a > problem when trying to write data to a printer and the paper runs > out. write() will timeout and you are left with no way to figure out > where to start sending data since you don't know how much was > received by the device before the paper ran out. > It seems this could be possible by modifying the driver by adding and > ioctl that would allow you to call bulk transfer and then return the > number of bytes written. Is there a better way of doing? What about disabling the timeout ? --HPS