1LP(4)                      Linux Programmer's Manual                     LP(4)
2
3
4

NAME

6       lp - line printer devices
7

SYNOPSIS

9       #include <linux/lp.h>
10

CONFIGURATION

12       lp[0–2] are character devices for the parallel line printers; they have
13       major number 6 and minor number 0–2.  The minor numbers  correspond  to
14       the  printer  port  base addresses 0x03bc, 0x0378, and 0x0278.  Usually
15       they have mode 220 and are owned by user root and group  lp.   You  can
16       use  printer  ports either with polling or with interrupts.  Interrupts
17       are recommended when high traffic is expected, for example,  for  laser
18       printers.   For  typical  dot  matrix printers, polling will usually be
19       enough.  The default is polling.
20

DESCRIPTION

22       The following ioctl(2) calls are supported:
23
24       int ioctl(int fd, LPTIME, int arg)
25              Sets the amount of time that the driver sleeps before rechecking
26              the  printer  when  the printer's buffer appears to be filled to
27              arg.  If you have a fast printer, decrease this number;  if  you
28              have a slow printer, then increase it.  This is in hundredths of
29              a second, the default 2 being 0.02 seconds.  It influences  only
30              the polling driver.
31
32       int ioctl(int fd, LPCHAR, int arg)
33              Sets  the  maximum  number  of  busy-wait  iterations  which the
34              polling driver does while waiting for the printer to  get  ready
35              for  receiving a character to arg.  If printing is too slow, in‐
36              crease this number; if the system gets too slow,  decrease  this
37              number.   The  default  is 1000.  It influences only the polling
38              driver.
39
40       int ioctl(int fd, LPABORT, int arg)
41              If arg is 0, the printer driver will retry on errors,  otherwise
42              it will abort.  The default is 0.
43
44       int ioctl(int fd, LPABORTOPEN, int arg)
45              If  arg  is 0, open(2) will be aborted on error, otherwise error
46              will be ignored.  The default is to ignore it.
47
48       int ioctl(int fd, LPCAREFUL, int arg)
49              If arg is 0, then the out-of-paper, offline, and  error  signals
50              are  required  to be false on all writes, otherwise they are ig‐
51              nored.  The default is to ignore them.
52
53       int ioctl(int fd, LPWAIT, int arg)
54              Sets the number of busy waiting iterations to wait before strob‐
55              ing the printer to accept a just-written character, and the num‐
56              ber of iterations to wait before turning the strobe  off  again,
57              to  arg.   The  specification  says  this time should be 0.5 mi‐
58              croseconds, but experience has shown the  delay  caused  by  the
59              code  is  already enough.  For that reason, the default value is
60              0.  This is used for both the polling and the interrupt driver.
61
62       int ioctl(int fd, LPSETIRQ, int arg)
63              This ioctl(2) requires superuser privileges.  It  takes  an  int
64              containing  the  new  IRQ  as  argument.   As a side effect, the
65              printer will be reset.  When arg is 0, the polling  driver  will
66              be used, which is also default.
67
68       int ioctl(int fd, LPGETIRQ, int *arg)
69              Stores the currently used IRQ in arg.
70
71       int ioctl(int fd, LPGETSTATUS, int *arg)
72              Stores  the  value of the status port in arg.  The bits have the
73              following meaning:
74
75              LP_PBUSY     inverted busy input, active high
76              LP_PACK      unchanged acknowledge input, active low
77              LP_POUTPA    unchanged out-of-paper input, active high
78              LP_PSELECD   unchanged selected input, active high
79              LP_PERRORP   unchanged error input, active low
80
81              Refer to your printer manual for the  meaning  of  the  signals.
82              Note  that  undocumented bits may also be set, depending on your
83              printer.
84
85       int ioctl(int fd, LPRESET)
86              Resets the printer.  No argument is used.
87

FILES

89       /dev/lp*
90

SEE ALSO

92       chmod(1), chown(1), mknod(1), lpcntl(8), tunelp(8)
93

COLOPHON

95       This page is part of release 5.12 of the Linux  man-pages  project.   A
96       description  of  the project, information about reporting bugs, and the
97       latest    version    of    this    page,    can     be     found     at
98       https://www.kernel.org/doc/man-pages/.
99
100
101
102Linux                             2021-03-22                             LP(4)
Impressum