lptctl /dev/device [-d on|off] [-i on|off] [-m standard|ps2|nibble|fast|ecp|epp] [-M ps2|nibble|ecp] [-s] [-r] [...]
lptctl is used to manipulate lpt devices so that a user can change how a printer that is attached to a parallel port works. If no command-argument pairs are specified, the status of the device is printed to standard output using the following format:
dma=[on|off] ieee=[on|off] mode=[standard|nibble|ps2|fast|ecp|epp]
The status information is also output after commands are carried out.
Commands can be specified in any order. The commands are executed as the command line is parsed until the arguments are exhausted or an error occurs. Commands can be repeated with different arguments on the same command line: all are executed as the arguments are parsed and the last successfully executed command will have the lasting effect (if the command changes the device's state).
Available commands are:
lptctl returns 0 on success, and values > 0 on failure: see DIAGNOSTICS.
To enable DMA, enable IEEE negotiations, and set the mode to Fast Centronics for lpt0:
lptctl /dev/lpt0 -d on -i on -m fast
To disable DMA, disable IEEE negotiations, and set the mode to nibble for lpt1:
lptctl /dev/lpt1 -i off -mode nibble -d off
Note that the order of the arguments affects the outcome: disabling IEEE negotiations before changing the mode means that the change will NOT be negotiated with the device.
Because of the way lptctl parses it's arguments, it is possible to enable/disable DMA in the same command:
/dev/lpa0 -d on -d off
Errors are accompanied by diagnostic messages written to standard error.
ioctl(2), lpt(4), ppbus(4)
A similar utility called lptcontrol exists in FreeBSD to control the lpt device. While similar in concept, the implementations are independent.
This man page and the lptctl utility were written by Gary Thorpe <email@example.com>.
lptctl opens the printer device and causes device initialization if /dev/lpa? or /dev/lpt? are used. Therefore, a printer must be connected and functioning to use this utility or you will have to create a lpt device with an appropriate minor number (see lpt(4) for more details).