xref: /freebsd/share/man/man4/lpt.4 (revision 6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1)
1.\"
2.\" Copyright (c) 1993 Christopher G. Demetriou
3.\" Copyright (c) 1994 Geoffrey M. Rehmet
4.\" Copyright (c) 1999 Nicolas Souchu
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"
29.Dd February 14, 1999
30.Dt LPT 4
31.Os FreeBSD
32.Sh NAME
33.Nm lpt
34.Nd
35Generic printer device driver
36.Sh SYNOPSIS
37.Cd "controller ppbus0"
38.Cd "device lpt0 at ppbus?"
39.Pp
40.Cd "controller	ppc0	at isa? port" \&"IO_LPT1\&" tty irq 7
41.Cd "controller	ppc1	at isa? port" \&"IO_LPT2\&" tty irq 7
42.Cd "controller	ppc2	at isa? port" \&"IO_LPT3\&" tty irq 7
43.Pp
44For BIOS-probed ports:
45.Cd "controller ppc0 at isa? port? tty irq 7"
46.Pp
47For polled ports:
48.Cd "controller ppc0 at isa? port? tty"
49.Cd "controller ppc1 at isa? port" \&"IO_LPT2\&" tty
50.Pp
51For DMA capable parallel port:
52.Cd "controller ppc0 at isa? port? tty irq 7 drq 1"
53.Sh DESCRIPTION
54The current
55.Em lpt
56driver is the port of the original lpt driver to the
57.Xr ppbus 4
58system.
59.Pp
60One purpose of this port was to allow parallel port sharing with other
61parallel devices. Secondly, inb()/outb() calls have been replaced by ppbus
62function calls. lpt is now arch-independent thanks to the ppbus interface. See
63.Xr ppbus 4
64for more info about the ppbus system.
65.Pp
66The parallel port bus is allocated by lpt when the printer device is opened
67and released only when the transfer is completed: either when the device
68is closed or when the entire buffer is sent in interrupt driven mode.
69.Pp
70The driver can be configured to be either interrupt-driven, or
71to poll the printer.  Ports that are configured to be
72interrupt-driven can be switched to polled mode by using the
73.Xr lptcontrol 8
74command.
75.Pp
76Depending on your hardware, extended capabilities may be configured with the
77.Xr lptcontrol 8
78command. With an ECP/ISA port, you can take advantage
79of FIFO and DMA.
80.Pp
81In order to retrieve printer info from /dev/lpt0, just apply the
82.Nm cat
83command to the device. If the printer supports IEEE1284 nibble mode and has
84data to send to the host, you'll get it.
85.Sh SEE ALSO
86.Xr ppbus 4 ,
87.Xr lptcontrol 8
88.Sh HISTORY
89This driver replaces the functionality of the lpa
90driver, which is now defunct.
91.Sh FILES
92.Bl -tag -width Pa -compact
93.It Pa /dev/lpt0
94first parallel port driver
95.El
96.Sh BUGS
97There are lots of them, especially in cheap parallel port implementations.
98.Pp
99It is only possible to open a lpt port when a printer is connected and
100on-line, making it impossible to run
101.Xr lptcontrol 8
102when there is no printer connected.
103.Pp
104Please, ensure the
105.Xr ppc 4
106entry in you MACHINE file has the tty interrupt mask.
107.Pp
108This driver could still stand a rewrite.
109