Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jul 2009 00:50:02 +0200
From:      Patrick Lamaiziere <patfbsd@davenulle.org>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-current@freebsd.org
Subject:   Re: ulpt problem (USB_ERR_IOERROR)
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>

next in thread | previous in thread | raw e-mail | index | archive | help
Le Thu, 16 Jul 2009 22:22:10 +0200,
Hans Petter Selasky <hselasky@c2i.net> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090717005002.1ffccfff>