Subject: Re: lpt question
To: MLH <MLH@goathill.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 06/17/2003 22:43:12
On 18 Jun 2003, MLH wrote:

> The NetBSD lpa/lpt won't open without proper handshake on the
> parallel port (apparently).
>
> How does one open the parallel port to directly control it without
> expecting printer handshake?
>
> $ uisp -v -dlpt=/dev/lpa0 -dprog=maxi --wr_fuse_l=0xda
> /dev/lpa0: Device busy

This is just like the error I used to get with CUPS last year.

CUPS's parallel was doing:
 open(device, O_WRONLY)

And for my working lpt0 and lpa0 it was returning error 16, "Device busy".
This happened on different hardware. Randomly, when I turned on or off the
printer and ran that ./parallel at the same time (within the one second),
it successfully opened the /dev/lpt0 or /dev/lpa0 (and no "Device busy)

My workaround was to ignore EBUSY (16).

   Jeremy C. Reed
   http://bsd.reedmedia.net/