[Linux-parport] LPTIME?

Mark Hounschell dmarkh at cfl.rr.com
Sun Feb 8 14:02:07 GMT 2004

I can't seem to make the LPTIME ioctl to /dev/lp0 do what the
documentation says it's supposed to do. If I'm understanding the doc

  Set the amount  of time in jiffies that the driver waits
  if the printer doesn't take a character in the number
  of tries dictated by the LPCHAR ioctl

After looking through the kernel sources for my problem, in particular
ieee1284_ops.c parport_ieee1284_write_compat routine, I would expect
this LPTIME ioctl to affect the 
dev->timeout used in this routine. After inserting some printks in the
module, it doesn't seem to. 

I'm writting some software that will be using some old dataproducts line
printers. I'm using a centronics-to-dataproducts adapter. As long as I
don't use the LPABORT ioctl I don't get any timeouts. As soon as I
enable aborts on writes via the LPABORT ioctl I get timeouts when ever I
send a FF (0x0c) or LF (0x0a) char followed by anything else.
The parport_ieee1284_write_compat routine times out waiting for the
Form-Feed or Line-Feed from the previous byte to complete.

The data streams I have to send to these printers are text only with
normal CR, LF, and FF's in the data stream.

I've manually modified the above routine by setting the value of
dev->timeout to 1000, which appears to be the value used when I don't
use the (LPABORT, TRUE) ioctl. Then all works ok. No timeouts. When I
use the (LPABORT, TRUE) ioctl the valu of dev->timeout is 1. When I use
the (LPABORT, FALSE) it ends up being 1000. ?????

Oh, I'm using a 2.4.20 kernel.

My question I guess is why doesn't the LPTIME ioctl affect this the way
the doc says?
And, should it???

Thanks in advance

More information about the Linux-parport mailing list