1999-02-14 12:06:16 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1993 Christopher G. Demetriou
|
|
|
|
.\" Copyright (c) 1994 Geoffrey M. Rehmet
|
1999-02-14 16:22:27 +00:00
|
|
|
.\" Copyright (c) 1999 Nicolas Souchu
|
1999-02-14 12:06:16 +00:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1999-02-14 12:06:16 +00:00
|
|
|
.\"
|
|
|
|
.Dd February 14, 1999
|
|
|
|
.Dt LPT 4
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1999-02-14 12:06:16 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm lpt
|
2001-04-18 15:54:10 +00:00
|
|
|
.Nd generic printer device driver
|
1999-02-14 12:06:16 +00:00
|
|
|
.Sh SYNOPSIS
|
2000-01-23 15:04:20 +00:00
|
|
|
.Cd "device ppbus"
|
|
|
|
.Cd "device lpt"
|
1999-02-14 12:06:16 +00:00
|
|
|
.Pp
|
2000-01-17 14:50:59 +00:00
|
|
|
.Cd "device ppc0 at isa? port IO_LPT1 irq 7"
|
|
|
|
.Cd "device ppc1 at isa? port IO_LPT2 irq 7"
|
|
|
|
.Cd "device ppc2 at isa? port IO_LPT3 irq 7"
|
1999-02-14 12:06:16 +00:00
|
|
|
.Pp
|
|
|
|
For BIOS-probed ports:
|
2000-01-17 13:16:05 +00:00
|
|
|
.Cd "device ppc0 at isa? port? irq 7"
|
1999-02-14 12:06:16 +00:00
|
|
|
.Pp
|
|
|
|
For polled ports:
|
2000-01-17 13:16:05 +00:00
|
|
|
.Cd "device ppc0 at isa? port?"
|
2000-01-17 14:50:59 +00:00
|
|
|
.Cd "device ppc1 at isa? port IO_LPT2"
|
1999-02-14 12:06:16 +00:00
|
|
|
.Pp
|
|
|
|
For DMA capable parallel port:
|
2000-01-17 13:16:05 +00:00
|
|
|
.Cd "device ppc0 at isa? port? irq 7 drq 1"
|
1999-02-14 12:06:16 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The current
|
|
|
|
.Em lpt
|
|
|
|
driver is the port of the original lpt driver to the
|
|
|
|
.Xr ppbus 4
|
|
|
|
system.
|
|
|
|
.Pp
|
|
|
|
One purpose of this port was to allow parallel port sharing with other
|
2000-03-01 14:50:24 +00:00
|
|
|
parallel devices.
|
|
|
|
Secondly, inb()/outb() calls have been replaced by ppbus
|
|
|
|
function calls.
|
|
|
|
lpt is now arch-independent thanks to the ppbus interface.
|
|
|
|
See
|
1999-02-14 12:06:16 +00:00
|
|
|
.Xr ppbus 4
|
|
|
|
for more info about the ppbus system.
|
|
|
|
.Pp
|
|
|
|
The parallel port bus is allocated by lpt when the printer device is opened
|
|
|
|
and released only when the transfer is completed: either when the device
|
|
|
|
is closed or when the entire buffer is sent in interrupt driven mode.
|
|
|
|
.Pp
|
|
|
|
The driver can be configured to be either interrupt-driven, or
|
|
|
|
to poll the printer. Ports that are configured to be
|
|
|
|
interrupt-driven can be switched to polled mode by using the
|
|
|
|
.Xr lptcontrol 8
|
|
|
|
command.
|
|
|
|
.Pp
|
|
|
|
Depending on your hardware, extended capabilities may be configured with the
|
|
|
|
.Xr lptcontrol 8
|
2000-03-01 14:50:24 +00:00
|
|
|
command.
|
|
|
|
With an ECP/ISA port, you can take advantage
|
1999-02-14 12:06:16 +00:00
|
|
|
of FIFO and DMA.
|
1999-02-14 16:22:27 +00:00
|
|
|
.Pp
|
|
|
|
In order to retrieve printer info from /dev/lpt0, just apply the
|
|
|
|
.Nm cat
|
2000-03-01 14:50:24 +00:00
|
|
|
command to the device.
|
|
|
|
If the printer supports IEEE1284 nibble mode and has
|
1999-02-14 16:22:27 +00:00
|
|
|
data to send to the host, you'll get it.
|
1999-02-14 12:06:16 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ppbus 4 ,
|
|
|
|
.Xr lptcontrol 8
|
|
|
|
.Sh HISTORY
|
|
|
|
This driver replaces the functionality of the lpa
|
|
|
|
driver, which is now defunct.
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width Pa -compact
|
|
|
|
.It Pa /dev/lpt0
|
|
|
|
first parallel port driver
|
|
|
|
.El
|
|
|
|
.Sh BUGS
|
|
|
|
There are lots of them, especially in cheap parallel port implementations.
|
|
|
|
.Pp
|
|
|
|
It is only possible to open a lpt port when a printer is connected and
|
|
|
|
on-line, making it impossible to run
|
|
|
|
.Xr lptcontrol 8
|
|
|
|
when there is no printer connected.
|
|
|
|
.Pp
|
|
|
|
This driver could still stand a rewrite.
|