]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | '\" t |
3d54a910 MK |
2 | .\" Copyright (c) Michael Haardt (michael@cantor.informatik.rwth-aachen.de), |
3 | .\" Sun Jan 15 19:16:33 1995 | |
fea681da | 4 | .\" |
1dd72f9c | 5 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
6 | .\" This is free documentation; you can redistribute it and/or |
7 | .\" modify it under the terms of the GNU General Public License as | |
8 | .\" published by the Free Software Foundation; either version 2 of | |
9 | .\" the License, or (at your option) any later version. | |
10 | .\" | |
11 | .\" The GNU General Public License's references to "object code" | |
12 | .\" and "executables" are to be interpreted as the output of any | |
13 | .\" document formatting or typesetting system, including | |
14 | .\" intermediate and printed output. | |
15 | .\" | |
16 | .\" This manual is distributed in the hope that it will be useful, | |
17 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | .\" GNU General Public License for more details. | |
20 | .\" | |
21 | .\" You should have received a copy of the GNU General Public | |
c715f741 MK |
22 | .\" License along with this manual; if not, see |
23 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 24 | .\" %%%LICENSE_END |
fea681da MK |
25 | .\" |
26 | .\" Modified, Sun Feb 26 15:02:58 1995, faith@cs.unc.edu | |
69289f8a | 27 | .TH LP 4 1995-01-15 "Linux" "Linux Programmer's Manual" |
fea681da MK |
28 | .SH NAME |
29 | lp \- line printer devices | |
30 | .SH SYNOPSIS | |
31 | .B #include <linux/lp.h> | |
32 | .SH CONFIGURATION | |
33 | \fBlp\fP[0\(en2] are character devices for the parallel line printers; | |
c13182ef MK |
34 | they have major number 6 and minor number 0\(en2. |
35 | The minor numbers | |
fea681da | 36 | correspond to the printer port base addresses 0x03bc, 0x0378 and 0x0278. |
c13182ef MK |
37 | Usually they have mode 220 and are owned by root and group lp. |
38 | You can use printer ports either with polling or with interrupts. | |
75b94dc3 MK |
39 | Interrupts are recommended when high traffic is expected, for example, |
40 | for laser printers. | |
01e51a70 | 41 | For typical dot matrix printers, polling will usually be enough. |
c13182ef | 42 | The default is polling. |
fea681da MK |
43 | .SH DESCRIPTION |
44 | The following | |
45 | .BR ioctl (2) | |
46 | calls are supported: | |
47 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPTIME, int \fP\fIarg\fP\fB)\fP" | |
48 | Sets the amount of time that the driver sleeps before rechecking the printer | |
35cfd378 MK |
49 | when the printer's buffer appears to be filled to |
50 | .IR arg . | |
c13182ef | 51 | If you have a fast printer, decrease this number; |
7f627874 | 52 | if you have a slow printer, then increase it. |
c13182ef MK |
53 | This is in hundredths of a second, the default 2 |
54 | being 0.02 seconds. | |
02f47ea7 | 55 | It influences only the polling driver. |
fea681da MK |
56 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCHAR, int \fP\fIarg\fP\fB)\fP" |
57 | Sets the maximum number of busy-wait iterations which the polling driver does | |
58 | while waiting for the printer to get ready for receiving a character to | |
35cfd378 | 59 | .IR arg . |
c13182ef MK |
60 | If printing is too slow, increase this number; if the |
61 | system gets too slow, decrease this number. | |
62 | The default is 1000. | |
02f47ea7 | 63 | It influences only the polling driver. |
fea681da | 64 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORT, int \fP\fIarg\fP\fB)\fP" |
35cfd378 MK |
65 | If |
66 | .I arg | |
67 | is 0, the printer driver will retry on errors, otherwise | |
c13182ef MK |
68 | it will abort. |
69 | The default is 0. | |
fea681da | 70 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPABORTOPEN, int \fP\fIarg\fP\fB)\fP" |
35cfd378 MK |
71 | If |
72 | .I arg | |
73 | is 0, | |
fea681da | 74 | .BR open (2) |
c13182ef MK |
75 | will be aborted on error, otherwise error will be ignored. |
76 | The default is to ignore it. | |
fea681da | 77 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPCAREFUL, int \fP\fIarg\fP\fB)\fP" |
35cfd378 MK |
78 | If |
79 | .I arg | |
e05f3710 | 80 | is 0, then the out-of-paper, offline, and error signals are |
c13182ef MK |
81 | required to be false on all writes, otherwise they are ignored. |
82 | The default is to ignore them. | |
fea681da MK |
83 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPWAIT, int \fP\fIarg\fP\fB)\fP" |
84 | Sets the number of busy waiting iterations to wait before strobing the | |
85 | printer to accept a just-written character, and the number of iterations to | |
86 | wait before turning the strobe off again, | |
35cfd378 MK |
87 | to |
88 | .IR arg . | |
c13182ef | 89 | The specification says this time should be 0.5 |
fea681da | 90 | microseconds, but experience has shown the delay caused by the code is |
c13182ef MK |
91 | already enough. |
92 | For that reason, the default value is 0. | |
86683c22 | 93 | .\" FIXME . Actually, since Linux 2.2, the default is 1 |
c13182ef | 94 | This is used for both the polling and the interrupt driver. |
fea681da | 95 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPSETIRQ, int \fP\fIarg\fP\fB)\fP" |
c13182ef | 96 | This |
5e21af3a | 97 | .BR ioctl (2) |
c13182ef | 98 | requires superuser privileges. |
f88233dd MK |
99 | It takes an |
100 | .I int | |
101 | containing the new IRQ as argument. | |
c13182ef | 102 | As a side effect, the printer will be reset. |
35cfd378 MK |
103 | When |
104 | .I arg | |
105 | is 0, the polling driver will be used, which is also default. | |
fea681da | 106 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETIRQ, int *\fP\fIarg\fP\fB)\fP" |
35cfd378 MK |
107 | Stores the currently used IRQ in |
108 | .IR arg . | |
fea681da | 109 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPGETSTATUS, int *\fP\fIarg\fP\fB)\fP" |
35cfd378 MK |
110 | Stores the value of the status port in |
111 | .IR arg . | |
c13182ef | 112 | The bits have the following meaning: |
fea681da MK |
113 | .TS |
114 | l l. | |
115 | LP_PBUSY inverted busy input, active high | |
116 | LP_PACK unchanged acknowledge input, active low | |
117 | LP_POUTPA unchanged out-of-paper input, active high | |
118 | LP_PSELECD unchanged selected input, active high | |
119 | LP_PERRORP unchanged error input, active low | |
120 | .TE | |
602ecf86 | 121 | .IP |
fea681da MK |
122 | Refer to your printer manual for the meaning of the signals. |
123 | Note that undocumented bits may also be set, depending on your printer. | |
124 | .IP "\fBint ioctl(int \fP\fIfd\fP\fB, LPRESET)\fP" | |
c13182ef MK |
125 | Resets the printer. |
126 | No argument is used. | |
fea681da | 127 | .SH FILES |
fc70ff30 | 128 | .I /dev/lp* |
d2dc6294 MK |
129 | .\" .SH AUTHORS |
130 | .\" The printer driver was originally written by Jim Weigand and Linus | |
131 | .\" Torvalds. | |
132 | .\" It was further improved by Michael K.\& Johnson. | |
133 | .\" The interrupt code was written by Nigel Gamble. | |
134 | .\" Alan Cox modularized it. | |
135 | .\" LPCAREFUL, LPABORT, LPGETSTATUS were added by Chris Metcalf. | |
47297adb | 136 | .SH SEE ALSO |
fea681da MK |
137 | .BR chmod (1), |
138 | .BR chown (1), | |
139 | .BR mknod (1), | |
140 | .BR lpcntl (8), | |
141 | .BR tunelp (8) |