From owner-freebsd-current@FreeBSD.ORG Thu Jul 16 22:50:07 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A6611065670 for ; Thu, 16 Jul 2009 22:50:07 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [91.121.44.19]) by mx1.freebsd.org (Postfix) with ESMTP id 5C44F8FC18 for ; Thu, 16 Jul 2009 22:50:07 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from baby-jane.lamaiziere.net (105.10.87-79.rev.gaoland.net [79.87.10.105]) by smtp.lamaiziere.net (Postfix) with ESMTPA id 83E8463317E; Fri, 17 Jul 2009 00:50:06 +0200 (CEST) Received: from baby-jane.lamaiziere.net (localhost [127.0.0.1]) by baby-jane.lamaiziere.net (Postfix) with ESMTP id 8DEF9C0D2; Fri, 17 Jul 2009 00:50:07 +0200 (CEST) Date: Fri, 17 Jul 2009 00:50:02 +0200 From: Patrick Lamaiziere To: Hans Petter Selasky Message-ID: <20090717005002.1ffccfff@baby-jane.lamaiziere.net> In-Reply-To: <200907162222.11736.hselasky@c2i.net> References: <20090703172600.1971111e@baby-jane.lamaiziere.net> <200907130846.51980.hselasky@c2i.net> <20090716215528.271fc177@baby-jane.lamaiziere.net> <200907162222.11736.hselasky@c2i.net> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.4; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: ulpt problem (USB_ERR_IOERROR) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2009 22:50:07 -0000 Le Thu, 16 Jul 2009 22:22:10 +0200, Hans Petter Selasky a =E9crit : > Could you try to add an "if (sc->sc_fflags =3D=3D 0)" in front, like this: >=20 > /*=20 > * Only read status while the device is not opened, due to > * possible hardware or firmware bug in some printers. > */ > if (sc->sc_fflags =3D=3D 0) > usbd_transfer_start(sc->sc_xfer[ULPT_INTR_DT_RD]); It works fine with this check. Cool! But why, that is not clear. FreeBSD 7.2 checks the status of the printer only when the device is opened and before each write. http://fxr.watson.org/fxr/source/dev/usb/ulpt.c?v=3DFREEBSD7#L637 > > Not related but I noticed that usb_write() in usb_dev.c returns -1 > > if I hit Ctrl-C when doing a "cat file > /dev/unlpt0". Because > > usb_fifo_wait(f) returns -1 (should be EINTR?). >=20 > If cv_wait_sig() returns -1, then they do not behave like in the > manual page: Yes I saw, I will try to dig more into the code. (will open a new thread for this) Thank you very much, regards.