Date: Fri, 17 Jul 2009 08:54:34 +0200 From: Hans Petter Selasky <hselasky@c2i.net> To: Patrick Lamaiziere <patfbsd@davenulle.org> Cc: freebsd-current@freebsd.org Subject: Re: ulpt problem (USB_ERR_IOERROR) Message-ID: <200907170854.35902.hselasky@c2i.net> In-Reply-To: <20090717005002.1ffccfff@baby-jane.lamaiziere.net> References: <20090703172600.1971111e@baby-jane.lamaiziere.net> <200907162222.11736.hselasky@c2i.net> <20090717005002.1ffccfff@baby-jane.lamaiziere.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 17 July 2009 00:50:02 Patrick Lamaiziere wrote: > Le Thu, 16 Jul 2009 22:22:10 +0200, > Hi, > Hans Petter Selasky <hselasky@c2i.net> a =E9crit : > > Could you try to add an "if (sc->sc_fflags =3D=3D 0)" in front, like th= is: > > > > /* > > * 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! I think this is the final patch. > 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 I think your USB device has a hardware bug, where if a control transfer and= a=20 bulk transfer is started at the same time, it will crash the USB hardware i= n=20 your printer. The status is read like a control transfer and the printer da= ta=20 is sent like bulk transfers. > > > > 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?). > > > > 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) > Ok. =2D-HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907170854.35902.hselasky>