PLP(7) PLP(7)
plp - parallel line printer interface
#include <sys/plp.h>
/dev/plp
/dev/plpbi
The special file /dev/plp refers to the parallel printer interface on the
Indigo, Indy, Indigo2, Challenge/Onyx, O2, OCTANE, Origin200 and Onyx2
products. Special file /dev/plpbi is also available on the Indigo, Indy
and Indigo2 platforms and is used to access the parallel printer
interface in bidirectional access mode.
The plp device supports output to a Centronics-compatible printer
connected to the builtin parallel printer port. Normally, /dev/plp is
directly accessed only by a print spooling mechanism such as the lp(1)
subsystem. Multiple processes may open the device, but these processes
must synchronize writes to prevent intermingled data. Processes may open
the device read-only to obtain printer status. The special file
/dev/plpbi may be open for reading and writing by one process at a time.
A printer reset is automatically issued only once at system startup.
Different platforms support different operation modes and features as
described below.
The plp devices on the O2 are IEEE 1284-II compliant and supports all
three IEEE 1284-II interfaces: Compatibility(Centronics), bidirectional
Enhanced Parallel Port(EPP), and bidirectional Extended Capabilities
Port(ECP). Bidirectional Centronics mode is not supported. Compatibility
(Centronics) mode is actually available as two different types: PIO or
FIFO mode. FIFO Compatibility mode is a faster Centronics mode which uses
DMA access. PIO Compatibility mode uses standard PIO access (no DMA). PIO
Compatibility mode has been found to be more compatible with some types
of printers and should be used only if problems occur in FIFO
Compatibility mode. The O2 plp driver also has the capability to perform
auto-negotiation with printers (peripherals) to set up the proper
protocol. This auto-negotiation mode, or any other supported mode, can be
specified through /var/sysgen/master.d/ecplp to override the default mode
(Compatibility FIFO mode).
The plp devices on the OCTANE, Origin200, and Onyx2 are IEEE 1284-II
compliant devices. However only Compatibility(Centronics) and Extended
Capabilities Port(ECP) output mode are supported. Bidirectional
Centronics, bidirectional ECP, EPP and auto-negotiation mode are not
supported. As with the O2 platform, Compatibility mode is available as
either FIFO or PIO Compatibility mode. The default operation mode
(Compatibility FIFO mode) can be changed through
/var/sysgen/master.d/ecpplp.
Page 1
PLP(7) PLP(7)
The Indigo, Indigo2, and Indy support only Centronics and bidirectional
Centronics interfaces.
The following ioctls are defined in the include file <sys/plp.h> and may
be used to control the device:
PLPIOCRESET Asserts the reset signal to the printer.
PLPIOCSTROBE Sets the duration and duty cycle of the data strobe
output. A macro is provided, PLP_STROBE, which converts
strobe length to the argument format. See <sys/plp.h>.
Does not apply to O2, OCTANE, Origin200, and Onyx2.
PLPIOCESTROBE Sets the set-up, pulse, and hold times of the data strobe
output. A macro is provided, PLP_ESTROBE, which converts
strobe length to the argument format. See <sys/plp.h>.
Challenge/Onyx L/XL only.
PLPIOCIGNACK Argument of 1 causes the acknowledge input from the
interface to be ignored. Argument of 0 reenables the
acknowledge input. Challenge/Onyx, R4k-Indigo only.
PLPIOCWTO Set write timeout value, the length of time a write
command will wait before timing out, in seconds (default
is 0 seconds which indicates infinite timeout).
PLPIOCRTO Set read timeout value, the length of time a read command
will wait before timing out, in seconds. (default is 0
seconds which indicates infinite timeout).
PLPIOCREAD Enables the reads from the port (bidirectional mode). For
all Indy and Indigo2 products PLPIOMODE ioctl is a
prerequisite. Should only be set once at the time the
device is opened. Use the following code to set it (it
remains set until the port is closed).
....
if (ioctl (scanner, PLPIOCREAD, 1) < 0) {
close (scanner);
return -1;
}
....
For the O2 product, PLPIOCREAD ioctl is valid only in ECP
or EPP mode.
For OCTANE, Origin200, and Onyx2, this ioctl is not
supported.
PLPIOMODE This ioctl changes the operation mode of the driver. It
should be used only immediately after opening the device.
On Indy, Indigo and Indigo2 platforms, this ioctl sets
Page 2
PLP(7) PLP(7)
bidirectional Centronics mode. On O2, OCTANE, Origin200,
and Onyx2 products, this ioctl sets the operation mode to
any supported mode. Only operation modes supported on the
platforrm are valid. For example, on Octane, Origin200,
and Onyx2, only PLP_PIO, PLP_ECP and PLP_COMP are valid.
Use the following code to set it:
....
if (ioctl (scanner, PLPIOMODE, PLP_BI) < 0) {
close (scanner);
return -1;
}
....
Does not apply to Challenge/Onyx.
PLPIOCSTATUS This ioctl returns the printer status as an integer bitmask
based on constants defined in <sys/plp.h>. The
constants are described below:
FAULT Printer is in fault state
EOI End of Ink (Ribbon out)
EOP End of Paper
ONLINE Printer is on line
Not all printers/platforms support all of these status
indications.
/dev/plp, /dev/plpbi, /var/sysgen/master.d/ecplp,
/var/sysgen/master.d/ecpplp
On O2, OCTANE, Origin200 and Onyx2 /dev/plp[n] are linked to
/hw/parallel/plp[n]. On driver unregistration and subsequent reregistration,
the /hw/parallel entries may no longer exist. Rerun
ioconfig(1) to get the entries set up again.
lp(1), pfd(7m)
Page 3
PLP(7) PLP(7)
IEEE 1284-A 25-pin subminiature D-shell (standard DB-25) connector at the
host or the peripheral end.
IEEE 1284-A 25-PIN PARALLEL PORT CONNECTOR
______________________________________________________
| |
______|___________|___________________________________
| |
1 | nStrobe | Strobe Data
2 | Data1 | Data Bit 0
3 | Data2 | Data Bit 1
4 | Data3 | Data Bit 2
5 | Data4 | Data Bit 3
6 | Data5 | Data Bit 4
7 | Data6 | Data Bit 5
8 | Data7 | Data Bit 6
9 | Data8 | Data Bit 7
10 | nAck | Acknowledge
11 | Busy | Peripheral Busy
12 | PError | Page Error
13 | Select | Peripheral Online
14 | nAutoFd | Automatic Line Feed (or PR/SC)
15 | nFault | Peripheral Fault
16 | nInit | Peripheral Reset
17 | nSelectIn | Turn Peripheral Online (or No Ink)
18-25 | Gnd | Signal Ground
IEEE 1284-B 36-pin (normal Centronics) connector at the peripheral end.
IEEE 1284-B 36-PIN PARALLEL PORT CONNECTOR
___________________________________________________
| |
______|___________|________________________________
| |
1 | nStrobe | Strobe Data
2 | Data1 | Data Bit 0
3 | Data2 | Data Bit 1
4 | Data3 | Data Bit 2
5 | Data4 | Data Bit 3
6 | Data5 | Data Bit 4
7 | Data6 | Data Bit 5
8 | Data7 | Data Bit 6
9 | Data8 | Data Bit 7
10 | nAck | Acknowledge
11 | Busy | Peripheral Busy
12 | PError | Page Error
13 | Select | Peripheral Online
14 | nAutoFd | Automatic Line Feed (or PR/SC)
15 | - | Not Defined (or No Paper)
Page 4
PLP(7) PLP(7)
16 Gnd Logic Ground
17 | Gnd | Chassis Ground (or No Ink)
18 | PrnHigh | Peripheral Logic High (or N.C.)
19-30 | Gnd | Signal Ground
31 | nInit | Peripheral Reset
32 | nFault | Peripheral Fault
33-35 | - | Not Defined
36 | nSelectIn | Turn Peripheral Online
IEEE 1284-C 36-pin miniature connector at the host or the peripheral end.
IEEE 1284-C 36-PIN PARALLEL PORT CONNECTOR
__________________________________________
| |
______|___________|_______________________
| |
1 | Busy | Peripheral Busy
2 | Select | Peripheral Online
3 | nAck | Acknowledge
4 | nFault | Peripheral Fault
5 | PError | Page Error
6 | Data1 | Data Bit 0
7 | Data2 | Data Bit 1
8 | Data3 | Data Bit 2
9 | Data4 | Data Bit 3
10 | Data5 | Data Bit 4
11 | Data6 | Data Bit 5
12 | Data7 | Data Bit 6
13 | Data8 | Data Bit 7
14 | nInit | Peripheral Reset
15 | nStrobe | Strobe Data
16 | nSelectIn | Turn Peripheral Online
17 | nAutoFd | Automatic Line Feed
18 | HostHigh | Host Logic High
19-35 | Gnd | Signal Ground
36 | PrnHigh | Peripheral Logic High
PPPPaaaaggggeeee 5555 [ Back ]
|