Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lp(7D) — SunOS 5.5.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sysbus(4)

streamio(7I)

lp(7D)

NAME

lp − driver for parallel port

SYNOPSIS

include <sys/bpp_io.h>

fd = open("/dev/lpn", flags);

x86

name=lp
class=sysbus
ioaddr=0x378 interrupts=3,7;

name=lp
class=sysbus
ioaddr=0x278 interrupts=3,5;

PowerPC

name=lp
class=sysbus
ioaddr=0x3bc interrupts=3,7;

AVAILABILITY

x86 and PowerPC Edition

DESCRIPTION

The lp driver provides the interface to the parallel ports used by printers for x86 and PowerPC systems.  The lp driver is implemented as a STREAMS device.  Up to three parallel ports can be accessed by the driver. The lp driver accesses the /platform/i86pc/kernel/drv/lp.conf file on x86 systems, and the /platform/prep/kernel/drv/lp.conf file on PowerPC systems for specifications about these parallel ports. The specifications include:

name

class

ioaddr The I/O port base address for this port. 

interrupts The IRQ level of the port.  interrupts is analogous to intr. 

For more information about lp.conf, refer to sysbus(4). 

IOCTLS

BPPIOC_TESTIO Test transfer readiness.  This command checks to see if a read or write transfer would succeed based on pin status.  If a transfer would succeed, 0 is returned. If a transfer would fail, −1 is returned, and errno is set to EIO. The error status can be retrieved using the BPPIOC_GETERR ioctl() call. 

BPPIOC_GETERR Get last error status.  The argument is a pointer to a struct bpp_error_status.  See below for a description of the elements of this structure.  This structure indicates the status of all the appropriate status bits at the time of the most recent error condition during a read(2) or write(2) call, or the status of the bits at the most recent BPPIOC_TESTIO ioctl(2) call. The application can check transfer readiness without attempting another transfer using the BPPIOC_TESTIO ioctl(). 

Error Pins Structure

This structure and symbols are defined in the include file <sys/bpp_io.h>:

struct bpp_error_status {
chartimeout_occurred;/∗ Not use ∗/
charbus_error;/∗ Not use ∗/
u_charpin_status; /∗ Status of pins which could
∗ cause an error ∗/
};
/∗ Values for pin_status field ∗/
#defineBPP_ERR_ERR0x01/∗ Error pin active ∗/
#defineBPP_SLCT_ERR0x02/∗ Select pin active ∗/
#defineBPP_PE_ERR0x04/∗ Paper empty pin active ∗/

Note: Other pin statuses are defined in <sys/bpp_io.h>, but BPP_ERR_ERR, BPP_SLCT_ERR and BPP_PE_ERR are the only ones valid for the x86 and PowerPC lp driver. 

ERRORS

EIO A BPPIOC_TESTIO ioctl() call is attempted while a condition exists that would prevent a transfer (such as a peripheral error). 

EINVAL An ioctl() is attempted with an invalid value in the command argument. 

FILES

x86

/platform/i86pc/kernel/drv/lp.conf
configuration file for lp driver.  For a description of each field, refer to sysbus(4). 

PowerPC

/platform/prep/kernel/drv/lp.conf
configuration file for lp driver.  For a description of each field, refer to sysbus(4). 

SEE ALSO

sysbus(4), streamio(7I)

DIAGNOSTICS

"lp_attach: cannot add intr."
An invalid intr= or interrupts= property has been specified in the lp.conf file. 

NOTES

A read operation on a bi-directional parallel port is not supported. 

SunOS 5.5.1  —  Last change: 30 Nov 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026