]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/man/man4/lp.4
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / man / man4 / lp.4
1 .\" -*- nroff -*-
2 .\"
3 .\" Copyright (c) 1996 A.R.Gordon, andrew.gordon@net-tel.co.uk
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgement:
16 .\"     This product includes software developed by the University of
17 .\"     California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\"    may be used to endorse or promote products derived from this software
20 .\"    without specific prior written permission.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" SUCH DAMAGE.
33 .\"
34 .\"     Id: man4.i386/lp.4,v 1.9 1999/02/14 12:06:16 nsouch Exp
35 .\" $FreeBSD$
36 .\"
37 .Dd March 4, 1996
38 .Dt LP 4
39 .Os
40 .Sh NAME
41 .Nm lp
42 .Nd printer port Internet Protocol driver
43 .Sh SYNOPSIS
44 .Nm ifconfig
45 .Ar plip0
46 .Ar myaddress hisaddress
47 .Op Fl link0
48 .Pp
49 .Cd "device ppbus"
50 .Cd "device plip"
51 .Cd "device ppc"
52 .Sh DESCRIPTION
53 The
54 .Nm
55 driver allows a PC parallel printer port to be used as a
56 point-to-point network interface between two similarly configured systems.
57 Data is transferred 4 bits at a time, using the printer status lines for
58 input: hence there is no requirement for special bidirectional hardware
59 and any standard AT-compatible printer port with working interrupts may be used.
60 .Pp
61 During the boot process, for each
62 .Nm plip
63 device which is probed and has an interrupt assigned, a corresponding
64 .Nm network
65 device is created.
66 .Pp
67 Configuring an
68 .Nm
69 device with
70 .Xr ifconfig 8
71 causes the corresponding
72 .Nm parallel port bus
73 to be reserved for PLIP until the network interface is configured 'down'.
74 .Pp
75 The communication protocol is selected by the
76 .Cm link0
77 flag:
78 .Bl -tag -width Fl
79 .It Fl link0
80 (default) Use
81 .Fx
82 mode (LPIP).
83 This is the simpler of the two modes
84 and therefore slightly more efficient.
85 .It Cm link0
86 Use Crynwr/Linux compatible mode (CLPIP).
87 This mode has a simulated Ethernet
88 packet header, and is easier to interface to other types of equipment.
89 .El
90 .Pp
91 The interface MTU defaults to 1500, but may be set to any value.
92 Both ends
93 of the link must be configured with the same MTU.
94 .Ss Cable Connections
95 The cable connecting the two parallel ports should be wired as follows:
96 .Bd -literal
97         Pin     Pin     Description
98         2       15      Data0 -> ERROR*
99         3       13      Data1 -> SLCT
100         4       12      Data2 -> PE
101         5       10      Data3 -> ACK*
102         6       11      Data4 -> BUSY
103         15      2       ERROR* -> Data0
104         13      3       SLCT   -> Data1
105         12      4       PE     -> Data2
106         10      5       ACK*   -> Data3
107         11      6       BUSY   -> Data4
108         18-25   18-25   Ground
109 .Ed
110 .Pp
111 Cables with this wiring are widely available as 'Laplink' cables, and
112 are often coloured yellow.
113 .Pp
114 The connections are symmetric, and provide 5 lines in each direction (four
115 data plus one handshake).
116 The two modes use the same wiring, but make a
117 different choice of which line to use as handshake.
118 .Ss FreeBSD LPIP mode
119 The signal lines are used as follows:
120 .Bl -tag -width dataxxxx(Pinxx)
121 .It Em Data0 (Pin 2)
122 Data out, bit 0.
123 .It Em Data1 (Pin 3)
124 Data out, bit 1.
125 .It Em Data2 (Pin 4)
126 Data out, bit 2.
127 .It Em Data3 (Pin 5)
128 Handshake out.
129 .It Em Data4 (Pin 6)
130 Data out, bit 3.
131 .It Em ERROR* (pin 15)
132 Data in, bit 0.
133 .It Em SLCT (pin 13)
134 Data in, bit 1.
135 .It Em PE (pin 12)
136 Data in, bit 2.
137 .It Em BUSY (pin 11)
138 Data in, bit 3.
139 .It Em ACK* (pin 10)
140 Handshake in.
141 .El
142 .Pp
143 When idle, all data lines are at zero.
144 Each byte is signalled in four steps:
145 sender writes the 4 most significant bits and raises the handshake line;
146 receiver reads the 4 bits and raises its handshake to acknowledge;
147 sender places the 4 least significant bits on the data lines and lowers
148 the handshake; receiver reads the data and lowers its handshake.
149 .Pp
150 The packet format has a two-byte header, comprising the fixed values 0x08,
151 0x00, immediately followed by the IP header and data.
152 .Pp
153 The start of a packet is indicated by simply signalling the first byte
154 of the header.
155 The end of the packet is indicated by inverting
156 the data lines (i.e., writing the ones-complement of the previous nibble
157 to be transmitted) without changing the state of the handshake.
158 .Pp
159 Note that the end-of-packet marker assumes that the handshake signal and
160 the data-out bits can be written in a single instruction - otherwise
161 certain byte values in the packet data would falsely be interpreted
162 as end-of-packet.
163 This is not a problem for the PC printer port,
164 but requires care when implementing this protocol on other equipment.
165 .Ss Crynwr/Linux CLPIP mode
166 The signal lines are used as follows:
167 .Bl -tag -width dataxxxx(Pinxx)
168 .It Em Data0 (Pin 2)
169 Data out, bit 0.
170 .It Em Data1 (Pin 3)
171 Data out, bit 1.
172 .It Em Data2 (Pin 4)
173 Data out, bit 2.
174 .It Em Data3 (Pin 5)
175 Data out, bit 3.
176 .It Em Data4 (Pin 6)
177 Handshake out.
178 .It Em ERROR* (pin 15)
179 Data in, bit 0.
180 .It Em SLCT (pin 13)
181 Data in, bit 1.
182 .It Em PE (pin 12)
183 Data in, bit 2.
184 .It Em ACK* (pin 10)
185 Data in, bit 3.
186 .It Em BUSY (pin 11)
187 Handshake in.
188 .El
189 .Pp
190 When idle, all data lines are at zero.
191 Each byte is signalled in four steps:
192 sender writes the 4 least significant bits and raises the handshake line;
193 receiver reads the 4 bits and raises its handshake to acknowledge;
194 sender places the 4 most significant bits on the data lines and lowers
195 the handshake; receiver reads the data and lowers its handshake.
196 [Note that this is the opposite nibble order to LPIP mode].
197 .Pp
198 Packet format is:
199 .Bd -literal
200 Length (least significant byte)
201 Length (most significant byte)
202 12 bytes of supposed MAC addresses (ignored by FreeBSD).
203 Fixed byte 0x08
204 Fixed byte 0x00
205 <IP datagram>
206 Checksum byte.
207 .Ed
208 .Pp
209 The length includes the 14 header bytes, but not the length bytes themselves
210 nor the checksum byte.
211 .Pp
212 The checksum is a simple arithmetic sum of all the bytes (again, including
213 the header but not checksum or length bytes).
214 .Fx
215 calculates
216 outgoing checksums, but does not validate incoming ones.
217 .Pp
218 The start of packet has to be signalled specially, since the line chosen
219 for handshake-in cannot be used to generate an interrupt.
220 The sender writes the value 0x08 to the data lines, and waits for the receiver
221 to respond by writing 0x01 to its data lines.
222 The sender then starts
223 signalling the first byte of the packet (the length byte).
224 .Pp
225 End of packet is deduced from the packet length and is not signalled
226 specially (although the data lines are restored to the zero, idle
227 state to avoid spuriously indicating the start of the next packet).
228 .Sh SEE ALSO
229 .Xr ppbus 4 ,
230 .Xr ppc 4 ,
231 .Xr ifconfig 8
232 .Sh BUGS
233 Busy-waiting loops are used while handshaking bytes, (and worse still when
234 waiting for the receiving system to respond to an interrupt for the start
235 of a packet).
236 Hence a fast system talking to a slow one will consume
237 excessive amounts of CPU.
238 This is unavoidable in the case of CLPIP mode
239 due to the choice of handshake lines; it could theoretically be improved
240 in the case of LPIP mode.
241 .Pp
242 Polling timeouts are controlled by counting loop iterations rather than
243 timers, and so are dependent on CPU speed.
244 This is somewhat stabilised
245 by the need to perform (slow) ISA bus cycles to actually read the port.