Bug 57630

Summary: lptcontrol(8) gives "device busy" if device turned off
Product: Base System Reporter: Klaus-J.Wolf <yanestra>
Component: binAssignee: Kubilay Kocak <koobs>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: 5051sharma, adishar2525, avasmith0987, emaste, glen.murray.pro, moteesh, reviewsdapper, williamlucas12326
Priority: Normal    
Version: 5.1-RELEASE   
Hardware: Any   
OS: Any   

Description Klaus-J.Wolf 2003-10-06 03:00:36 UTC
"lptcontrol -ei -d /dev/lpt0" during boot time fails with "device busy"
if the printer is turned off at that time.

# dmesg|grep lpt
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port

Fix: 

unknown.
How-To-Repeat: Turn printer off. Type "lptcontrol -i -d /dev/lpt0".
Comment 1 Bruce Evans 2003-10-06 10:02:03 UTC
On Mon, 6 Oct 2003, Klaus-J.Wolf wrote:

> >Description:
> "lptcontrol -ei -d /dev/lpt0" during boot time fails with "device busy"
> if the printer is turned off at that time.

lptcontrol should be run on the control device (not /dev/lptN).

Support for using the control device automatically was broken in
rev.1.8 of lptcontrol.c.

Existence of the documented control device was broken in FreeBSD-5
as part of devfs lossage.  The documented control device is "/dev/lpctlN"
(see lptcontrol(8), but devfs creates "/dev/lptN.ctl".

The lpt driver also has support for control bits in the minor number.
(The control device is a special case of this -- it uses bit 0x80.)
There are 6 control bits, giving a total of 64 possible devices per
unit.  devfs only creates 2 of these.

Bruce
Comment 2 Klaus-J.Wolf 2003-10-08 02:19:58 UTC
 From the manual page:
     -d device
             Set the mode of the printer device specified by device.  The
             default value for device is /dev/lpt0.
:-(
Comment 3 Jens Schweikhardt freebsd_committer freebsd_triage 2004-10-01 21:12:18 UTC
State Changed
From-To: open->patched

C code and man page were overhauled. Should be clearer now.
Comment 4 Ulrich Spoerlein 2004-10-10 18:30:29 UTC
Hi,

this seems still broken on at least 5.3-BETA5

The manpage now says this:
 -d device
             Set the mode of the printer device specified by device.  The
             default value for device is /dev/lpt0.

But nothing works:
# lptcontrol -p
lptcontrol: open: Device busy
# lptcontrol -p -d /dev/lpt0
lptcontrol: open: Device busy
# lptcontrol -p -d /dev/lpt0.ctl
lptcontrol: ioctl: Operation not supported

Note that there is a pause before the error message gets displayed.

There is a Scanner attached to the parallel port, disconnecting the
scanner yields the same results.

Coupled with the fact, that acpi "claims" the ppc(4) device and ignores
settings in /boot/device.hints, this is rather annoying :(

Ulrich Spoerlein
-- 
PGP Key ID: F0DB9F44				Encrypted mail welcome!
PGP Fingerprint: F1CE D062 0CA9 ADE3 349B  2FE8 980A C6B5 F0DB 9F44
Ok, which part of "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn."
didn't you understand?
Comment 5 GlenMurray 2017-07-24 08:39:54 UTC
MARKED AS SPAM
Comment 6 Ava Smith 2018-03-05 05:20:15 UTC
MARKED AS SPAM
Comment 7 Ava Smith 2018-03-06 09:37:11 UTC
MARKED AS SPAM
Comment 8 Helly 2018-03-19 09:10:33 UTC
MARKED AS SPAM
Comment 9 William Lucas 2018-06-14 06:10:48 UTC
MARKED AS SPAM
Comment 10 aditya sharma 2019-06-03 06:23:30 UTC
MARKED AS SPAM
Comment 11 Cindy Nixon 2019-09-21 16:28:11 UTC
MARKED AS SPAM
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2019-10-08 01:55:26 UTC
@Reporter/Ulrich, If this is still an issue, please re-open with addition details (if different from the original report