ulpt problem (USB_ERR_IOERROR)
    Hans Petter Selasky 
    hselasky at c2i.net
       
    Tue Jul  7 18:39:53 UTC 2009
    
    
  
On Monday 06 July 2009 17:50:37 Hans Petter Selasky wrote:
> On Monday 06 July 2009 16:11:54 Patrick Lamaiziere wrote:
> >
> > Shall I setup another box with current to be sure that's a problem
> > with the printer and not with the hardware?
>
> Hi,
>
> urlpt was just for backwards compatibility.
>
> Could you try printing using /dev/unlpt0 ? And send me resulting dmesg?
>
> Power cycle your printer before testing.
Hi,
There was a small bug in my patch. Could you post-patching edit 
/sys/dev/serial/ulpt.c
And move the:
        /* set raw write mode */
        if (fflags & FWRITE) {
                usb_fifo_set_write_defrag(fifo, 0);
        }
And:
        /* set defrag write mode */
        if (fflags & FWRITE) {
                usb_fifo_set_write_defrag(fifo, 1);
        }
outside the "if (sc->sc_fflags == 0)", so that the code looks like this:
static int
urlpt_open(struct usb_fifo *fifo, int fflags)
{
        struct ulpt_softc *sc = usb_fifo_softc(fifo);
        /* we assume that open is a serial process */
        if (sc->sc_fflags == 0) {
                /* reset USB paralell port */
                ulpt_reset(sc);
        }
        /* set raw write mode */
        if (fflags & FWRITE) {
                usb_fifo_set_write_defrag(fifo, 0);
        }
        return (unlpt_open(fifo, fflags));
}
static int
ulpt_open(struct usb_fifo *fifo, int fflags)
{
        struct ulpt_softc *sc = usb_fifo_softc(fifo);
        /* we assume that open is a serial process */
        if (sc->sc_fflags == 0) {
                /* reset USB paralell port */
                ulpt_reset(sc);
        }
        /* set defrag write mode */
        if (fflags & FWRITE) {
                usb_fifo_set_write_defrag(fifo, 1);
        }
        return (unlpt_open(fifo, fflags));
}
--HPS
    
    
More information about the freebsd-current
mailing list