* Sync pages with FreeBSD 4.x
[dragonfly.git] / share / man / man4 / lpt.4
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 .\" $FreeBSD: src/share/man/man4/lpt.4,v 1.9.2.2 2001/08/17 13:08:38 ru Exp $
29 .\" $DragonFly: src/share/man/man4/lpt.4,v 1.2 2003/06/17 04:36:59 dillon Exp $
30 .\"
31 .Dd February 14, 1999
32 .Dt LPT 4
33 .Os
34 .Sh NAME
35 .Nm lpt
36 .Nd generic printer device driver
37 .Sh SYNOPSIS
38 .Cd "device ppbus"
39 .Cd "device lpt"
40 .Pp
41 .Cd "device     ppc0    at isa? port IO_LPT1 irq 7"
42 .Cd "device     ppc1    at isa? port IO_LPT2 irq 7"
43 .Cd "device     ppc2    at isa? port IO_LPT3 irq 7"
44 .Pp
45 For BIOS-probed ports:
46 .Cd "device ppc0 at isa? port? irq 7"
47 .Pp
48 For polled ports:
49 .Cd "device ppc0 at isa? port?"
50 .Cd "device ppc1 at isa? port IO_LPT2"
51 .Pp
52 For DMA capable parallel port:
53 .Cd "device ppc0 at isa? port? irq 7 drq 1"
54 .Sh DESCRIPTION
55 The current
56 .Em lpt
57 driver is the port of the original lpt driver to the
58 .Xr ppbus 4
59 system.
60 .Pp
61 One purpose of this port was to allow parallel port sharing with other
62 parallel devices.
63 Secondly, inb()/outb() calls have been replaced by ppbus
64 function calls.
65 lpt is now arch-independent thanks to the ppbus interface.
66 See
67 .Xr ppbus 4
68 for more info about the ppbus system.
69 .Pp
70 The parallel port bus is allocated by lpt when the printer device is opened
71 and released only when the transfer is completed: either when the device
72 is closed or when the entire buffer is sent in interrupt driven mode.
73 .Pp
74 The driver can be configured to be either interrupt-driven, or
75 to poll the printer.  Ports that are configured to be
76 interrupt-driven can be switched to polled mode by using the
77 .Xr lptcontrol 8
78 command.
79 .Pp
80 Depending on your hardware, extended capabilities may be configured with the
81 .Xr lptcontrol 8
82 command.
83 With an ECP/ISA port, you can take advantage
84 of FIFO and DMA.
85 .Pp
86 In order to retrieve printer info from /dev/lpt0, just apply the
87 .Nm cat
88 command to the device.
89 If the printer supports IEEE1284 nibble mode and has
90 data to send to the host, you'll get it.
91 .Sh SEE ALSO
92 .Xr ppbus 4 ,
93 .Xr lptcontrol 8
94 .Sh HISTORY
95 This driver replaces the functionality of the lpa
96 driver, which is now defunct.
97 .Sh FILES
98 .Bl -tag -width Pa -compact
99 .It Pa /dev/lpt0
100 first parallel port driver
101 .El
102 .Sh BUGS
103 There are lots of them, especially in cheap parallel port implementations.
104 .Pp
105 It is only possible to open a lpt port when a printer is connected and
106 on-line, making it impossible to run
107 .Xr lptcontrol 8
108 when there is no printer connected.
109 .Pp
110 This driver could still stand a rewrite.