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