JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 7: Device and Network Interfaces
search filter icon
search icon

Document Information

Preface

Introduction

Device and Network Interfaces

6to4(7M)

6to4tun(7M)

aac(7D)

adp(7D)

adpu320(7D)

afb(7d)

agpgart_io(7I)

AH(7P)

ahci(7D)

allkmem(7D)

amd8111s(7D)

amr(7D)

ARP(7P)

arp(7P)

asy(7D)

ata(7D)

atun(7M)

audio1575(7D)

audio(7I)

audio810(7D)

audiocs(7D)

audioens(7D)

audiohd(7D)

audioixp(7D)

audio_support(7I)

audiots(7D)

audiovia823x(7D)

av1394(7D)

bbc_beep(7D)

bcm_sata(7D)

bd(7M)

bge(7D)

bnx(7D)

bpp(7D)

bscbus(7D)

bscv(7D)

bufmod(7M)

cadp160(7D)

cadp(7D)

cdio(7I)

ce(7D)

cgsix(7D)

chxge(7D)

cmdk(7D)

connld(7M)

console(7D)

cpqary3(7D)

cpr(7)

cpuid(7D)

ctfs(7FS)

ctsmc(7D)

cvc(7D)

cvcredir(7D)

dad(7D)

daplt(7D)

dbri(7D)

dca(7D)

dcam1394(7D)

dcfs(7FS)

devfs(7FS)

devinfo(7D)

dkio(7I)

dlcosmk(7ipp)

dlpi(7P)

dm2s(7D)

dmfe(7D)

dnet(7D)

dpt(7D)

dr(7d)

drmach(7d)

dscpmk(7ipp)

dtrace(7D)

e1000(7D)

e1000g(7D)

ecpp(7D)

ehci(7D)

elxl(7D)

emlxs(7D)

eri(7D)

esp(7D)

ESP(7P)

fas(7D)

fasttrap(7D)

fbio(7I)

fbt(7D)

fcip(7D)

fcp(7D)

fctl(7D)

fd(7D)

fdc(7D)

fdio(7I)

ffb(7D)

firewire(7D)

flowacct(7ipp)

fp(7d)

FSS(7)

ge(7D)

gld(7D)

glm(7D)

gpio_87317(7D)

grbeep(7d)

hci1394(7D)

hdio(7I)

hermon(7D)

hid(7D)

hme(7D)

hpfc(7D)

hsfs(7FS)

hubd(7D)

hxge(7D)

i2bsc(7D)

i2o_bs(7D)

i2o_scsi(7D)

ib(7D)

ibcm(7D)

ibd(7D)

ibdm(7D)

ibmf(7)

ibtl(7D)

icmp6(7P)

ICMP(7P)

icmp(7P)

idn(7d)

ieee1394(7D)

if(7P)

ifb(7d)

ifp(7D)

if_tcp(7P)

igb(7D)

inet6(7P)

inet(7P)

ip6(7P)

IP(7P)

ip(7P)

ipge(7D)

ipgpc(7ipp)

ipnat(7I)

ipqos(7ipp)

iprb(7D)

ipsec(7P)

ipsecah(7P)

ipsecesp(7P)

iscsi(7D)

isdnio(7I)

iser(7D)

isp(7D)

ixgb(7d)

ixgbe(7D)

jfb(7D)

jfca(7D)

kb(7M)

kdmouse(7D)

kfb(7D)

kmdb(7d)

kmem(7D)

kstat(7D)

ksyms(7D)

ldterm(7M)

llc1(7D)

llc2(7D)

lockstat(7D)

lofi(7D)

lofs(7FS)

log(7D)

logi(7D)

lp(7D)

lsimega(7D)

lx_systrace(7D)

m64(7D)

marvell88sx(7D)

mc-opl(7D)

md(7D)

mediator(7D)

mega_sas(7D)

mem(7D)

mhd(7i)

mixer(7I)

mpt(7D)

mpt_sas(7D)

mr_sas(7D)

msglog(7D)

msm(7D)

mt(7D)

mtio(7I)

n2cp(7d)

n2rng(7d)

ncp(7D)

ncrs(7D)

nfb(7D)

ngdr(7d)

ngdrmach(7d)

nge(7D)

npe(7D)

ntwdt(7D)

ntxn(7D)

null(7D)

nulldriver(7D)

nv_sata(7D)

nxge(7D)

objfs(7FS)

oce(7D)

ocf_ibutton(7D)

ohci(7D)

openprom(7D)

oplkmdrv(7D)

oplmsu(7D)

oplpanel(7D)

pcata(7D)

pcelx(7D)

pcfs(7FS)

pcic(7D)

pcicmu(7D)

pcie_pci(7D)

pckt(7M)

pcmcia(7D)

pcmem(7D)

pcn(7D)

pcram(7D)

pcscsi(7D)

pcser(7D)

pfb(7D)

pf_key(7P)

pfmod(7M)

physmem(7D)

pipemod(7M)

pm(7D)

poll(7d)

prnio(7I)

profile(7D)

ptem(7M)

ptm(7D)

pts(7D)

pty(7D)

qfe(7d)

qlc(7D)

qlge(7D)

quotactl(7I)

qus(7D)

ramdisk(7D)

random(7D)

RARP(7P)

rarp(7P)

rge(7D)

route(7P)

routing(7P)

rtls(7D)

sad(7D)

sata(7D)

sbpro(7D)

scfd(7D)

scmi2c(7d)

scsa1394(7D)

scsa2usb(7D)

scsi_vhci(7D)

SCTP(7P)

sctp(7P)

sd(7D)

SDC(7)

sdp(7D)

sdt(7D)

se(7D)

se_hdlc(7D)

ses(7D)

sesio(7I)

sf(7D)

sgen(7D)

sharefs(7FS)

si3124(7D)

sip(7P)

sk98sol(7D)

skfp(7D)

slp(7P)

smbios(7D)

smbus(7D)

socal(7D)

sockio(7I)

sol_ofs(7D)

sol_ucma(7D)

sol_uverbs(7D)

sppptun(7M)

spwr(7D)

ssd(7D)

st(7D)

stp4020(7D)

streamio(7I)

su(7D)

sxp(7D)

symhisl(7D)

sysmsg(7D)

systrace(7D)

tavor(7D)

TCP(7P)

tcp(7P)

termio(7I)

termiox(7I)

ticlts(7D)

ticots(7D)

ticotsord(7D)

timod(7M)

tirdwr(7M)

tmpfs(7FS)

todopol(7D)

tokenmt(7ipp)

tpf(7D)

tsalarm(7D)

tswtclmt(7ipp)

ttcompat(7M)

tty(7D)

ttymux(7D)

tun(7M)

tzmon(7d)

uata(7D)

udfs(7FS)

UDP(7P)

udp(7P)

ufs(7FS)

ugen(7D)

uhci(7D)

urandom(7D)

usb(7D)

usba(7D)

usb_ac(7D)

usb_ah(7M)

usb_as(7D)

usbecm(7D)

usbkbm(7M)

usb_mid(7D)

usbms(7M)

usbprn(7D)

usbsacm(7D)

usbser_edge(7D)

usbsksp(7D)

usbsprl(7D)

uscsi(7I)

usoc(7D)

virtualkm(7D)

visual_io(7I)

vni(7d)

volfs(7FS)

vuid2ps2(7M)

vuid3ps2(7M)

vuidm3p(7M)

vuidm4p(7M)

vuidm5p(7M)

vuidmice(7M)

wrsm(7D)

wrsmd(7D)

wscons(7D)

xge(7D)

xmemfs(7FS)

zcons(7D)

zero(7D)

zs(7D)

zsh(7D)

zulu(7d)

ecpp

- IEEE 1284 compliant parallel port driver

Synopsis

#include <sys/types.h> 
#include <sys/ecppio.h> 
ecpp@unit-address

Description

The ecpp driver provides a bi-directional interface to IEEE 1284 compliant devices as well as a forward single-directional interface to Centronics devices. In addition to the Centronics protocol, the ecpp driver supports the IEEE 1284Compatibility, Nibble, and ECP protocols. ECPP_COMPAT_MODE and ECPP_CENTRONICS modes of operation have logically identical handshaking protocols, however devices that support ECPP_COMPAT_MODE are IEEE 1284 compliant devices. IEEE 1284 compliant devices support at least ECPP_COMPAT_MODE and ECPP_NIBBLE_MODE. Centronics devices support only ECPP_CENTRONICS mode.

By default, ECPP_COMPAT_MODE devices have a strobe handshaking pulse width of 500ns. For this mode, forward data transfers are conducted by DMA. By default, the strobe pulse width for ECPP_CENTRONICS devices is two microseconds. Forward transfers for these devices are managed through PIO. The default characteristics for both ECPP_COMPAT_MODE and ECPP_CENTRONICS devices may be changed through tunable variables defined in ecpp.conf.

The ecpp driver is an exclusive-use device, meaning that if the device is already open, subsequent opens fail with EBUSY.

Default Operation

Each time the ecpp device is opened, the device is marked as EBUSY and the configuration variables are set to their default values. The write_timeout period is set to 90 seconds.

The driver sets the mode variable according to the following algorithm: The driver initially attempts to negotiate the link into ECPP_ECP_MODE during open(2). If it fails, the driver tries to negotiate into ECPP_NIBBLE_MODE mode. If that fails, the driver operates in ECPP_CENTRONICS mode. Upon successfully opening the device, IEEE 1284 compliant devices will be left idle in either reverse idle phase of ECPP_ECP_MODE or in ECPP_NIBBLE_MODE. Subsequent calls to write(2) invokes the driver to move the link into either ECPP_COMPAT_MODE or the forward phase of ECPP_ECP_MODE. After the transfer completes, the link returns to idle state.

The application may attempt to negotiate the device into a specific mode or set the write_timeout values through the ECPPIOC_SETPARMS ioctl(2) call. For mode negotiation to be successful, both the host workstation and the peripheral must support the requested mode.

Tunables

Characteristics of the ecpp driver may be tuned by the variables described in /kernel/drv/ecpp.conf. These variables are read by the kernel during system startup. To tune the variables, edit the ecpp.conf file and invoke update_drv(1M) to have the kernel read the file again.

Some Centronics peripherals and certain IEEE 1284 compatible peripherals will not operate with the parallel port operating in a fast handshaking mode. If printing problems occur, set "fast-centronics" and "fast-1284-compatible" to "false.” See /kernel/drv/ecpp.conf for more information.

Read/Write Operation

The ecpp driver is a full duplex STREAMS device driver. While an application is writing to an IEEE 1284 compliant device, another thread may read from it.

Write Operation

A write(2) operation returns the number of bytes successfully written to the stream head. If a failure occurs while a Centronics device is transferring data, the content of the status bits will be captured at the time of the error and can be retrieved by the application program using the BPPIOC_GETERR ioctl(2) call. The captured status information is overwritten each time an attempted transfer or a BPPIOC_TESTIO ioctl(2) occurs.

Read Operation

If a failure or error condition occurs during a read(2), the number of bytes successfully read is returned (short read). When attempting to read a port that has no data currently available, read(2) returns 0 if O_NDELAY is set. If O_NONBLOCK is set, read(2) returns -1 and sets errno to EAGAIN. If O_NDELAY and O_NONBLOCK are clear, read(2) blocks until data become available.

ioctls

The ioctl(2) calls described below are supported. Note that when ecpp is transferring data, the driver waits until the data has been sent to the device before processing the ioctl(2) call.

The ecpp driver supports prnio(7I) interfaces.


Note - The PRNIOC_RESET command toggles the nInit signal for 2 ms, followed by default negotiation.


The following ioctl(2) calls are supported for backward compatibility and are not recommended for new applications:

ECPPIOC_GETPARMS

Get current transfer parameters. The argument is a pointer to a struct ecpp_transfer_parms. See below for a description of the elements of this structure. If no parameters have been configured since the device was opened, the structure will be set to its default configuration. See Default Operation above for more information.

ECPPIOC_SETPARMS

Set transfer parameters. The argument is a pointer to a struct ecpp_transfer_parms. If a parameter is out of range, EINVAL is returned. If the peripheral or host device cannot support the requested mode, EPROTONOSUPPORT is returned. See below for a description of ecpp_transfer_parms and its valid parameters.

The Transfer Parameters Structure is defined in <sys/ecppio.h>.

struct ecpp_transfer_parms {
    int  write_timeout;
    int  mode;
};

The write_timeout field is set to the value of ecpp-transfer-timeout specified in the ecpp.conf. The write_timeout field specifies how long the driver will wait for the peripheral to respond to a transfer request. The value must be greater than 0 and less than ECPP_MAX_TIMEOUT. All other values are out of range.

The mode field reflects the IEEE 1284 mode to which the parallel port is currently configured. The mode may be set to one of the following values only: ECPP_CENTRONICS, ECPP_COMPAT_MODE, ECPP_NIBBLE_MODE, ECPP_ECP_MODE. All other values are invalid. If the requested mode is not supported, ECPPIOC_SETPARMS will return EPROTONOSUPPORT and the mode will be set to ECPP_CENTRONICS mode. Afterwards, the application may change the mode back to the original mode with ECPPIOC_SETPARMS.

ECPPIOC_GETDEVID

This ioctl gets the IEEE 1284 device ID from the peripheral in specified mode. Currently, the device ID can be retrieved only in Nibble mode. A pointer to the structure defined in <sys/ecppsys.h> must be passed as an argument.

The 1284 device ID structure:

struct ecpp_device_id {
  int  mode; /* mode to use for reading device id */
  int  len;  /* length of buffer */
  int  rlen;  /* actual length of device id string */
  char *addr; /* buffer address */
};

The mode is the IEEE 1284 mode into which the port will be negotiated to retrieve device ID information. If the peripheral or host do not support the mode, EPROTONOSUPPORT is returned. Applications should set mode to ECPP_NIBBLE_MODE. len is the length of the buffer pointed to by addr. rlen is the actual length of the device ID string returned from the peripheral. If the returned rlen is greater than len, the application can call ECPPIOC_GETDEVID again with a buffer length equal or greater than rlen. Note that the two length bytes of the IEEE 1284 device ID are not taken into account and are not returned in the user buffer.

After ECPPIOC_GETDEVID successfully completes, the driver returns the link to ECPP_COMPAT_MODE. The application is responsible for determining the previous mode the link was operating in and returning the link to that mode.

BPPIOC_TESTIO

Tests the forward transfer readiness of a peripheral operating in Centronics or Compatibility mode.

TESTIO determines if the peripheral is ready to receive data by checking the open flags and the Centronics status signals. If the current mode of the device is ECPP_NIBBLE_MODE, the driver negotiates the link into ECPP_COMPAT_MODE, check the status signals and then return the link to ECPP_NIBBLE_MODE mode. If the current mode is ECPP_CENTRONICS or ECPP_COMPAT_MODE, TESTIO examines the Centronics status signals in the current mode. To receive data, the device must have the nErr and Select signals asserted and must not have the PE and Busy signals asserted. If ecpp is transferring data, TESTIO waits until the previous data sent to the driver is delivered before executing TESTIO. However if an error condition occurs while a TESTIO is waiting, TESTIO returns immediately. If TESTIO determines that the conditions are ok, 0 is returned. Otherwise, -1 is returned, errno is set to EIO and the state of the status pins is captured. The captured status can be retrieved using the BPPIOC_GETERR ioctl(2) call. The timeout_occurred and bus_error fields will never be set by this ioctl(2). BPPIOC_TESTIO and BPPIOC_GETERR are compatible to the ioctls specified in bpp(7D).

BPPIOC_GETERR

Get last error status. The argument is a pointer to a struct bpp_error_status defined in <sys/bpp_io.h> header file. The error status structure is:

struct bpp_error_status {
   char    timeout_occurred; /* 1=timeout */
   char    bus_error;        /* not used */
   uchar_t pin_status;       /* status of pins which 
                             /* could cause error */
};

The pin_status field indicates possible error conditions. The valid bits for pin_status are: BPP_ERR_ERR, BPP_SLCT_ERR, BPP_PE_ERR, BPP_BUSY_ERR. A set bit indicates that the associated pin is asserted.

This structure indicates the status of all the appropriate status bits at the time of the most recent error condition during a write(2) call, or the status of the bits at the most recent BPPIOC_TESTIO ioctl(2)call.

pin_status indicates possible error conditions under ECPP_CENTRONICS or ECPP_COMPAT_MODE. Under these modes, the state of the status pins will indicate the state of the device. For instance, many Centronics printers lower the nErr signal when a paper jam occurs. The behavior of the status pins depends on the device. Additional status information may be retrieved through the backchannel.

The timeout_occurred value is set when a timeout occurs during write(2). bus_error is not used in this interface.

The following ioctls are used to directly read and write the parallel port status and control signals. If the current mode of the device is ECPP_ECP_MODE or ECPP_NIBBLE_MODE, the driver negotiates the link into ECPP_COMPAT_MODE, gets or sets the registers and then returns the link to ECPP_NIBBLE_MODE. If the current mode is ECPP_CENTRONICS or ECPP_COMPAT_MODE, these ioctls will get/set the register values in the current mode.

ECPPIOC_GETREGS

Read register values. The argument is a pointer to a struct ecpp_regs. See below for a description of this structure.

ECPPIOC_SETREGS

Set ecpp register values. The argument is a pointer to a struct ecpp_regs. See below for a description of this structure. If a parameter is out of range, EINVAL is returned.

The Port Register Structure is defined in <sys/ecppio.h>.

struct ecpp_regs {
    uchar     dsr;  /* status reg */
    u_char    dcr;  /* control reg */
};

The status register is read-only. The ECPPIOC_SETREGS ioctl has no affect on this register. Valid bit values for dsr are: ECPP_nERR, ECPP_SLCT, ECPP_PE, ECPP_nACK, ECPP_nBUSY. All other bits are reserved and always return 1.

The control register is read/write. Valid bit values for dcr are: ECPP_STB, ECPP_AFX, ECPP_nINIT, ECPP_SLCTIN. All other bits are reserved. Reading reserved bits always return 1. An attempt to write 0s into these bits results in EINVAL.

Device Special Files

/dev/lpN

Solaris x86 only. (Backwards compatibility with former lp(7D) devices.)

/dev/printers/N

1284 compliant parallel port device special files appears in both namespaces.

Files

kernel/drv/ecpp

32–bit ELF kernel module

kernel/drv/sparcv9/ecpp

64–bit SPARC ELF kernel module

kernel/drv/amd64/ecpp

64–bit x86 ELF kernel module

kernel/drv/ecpp.conf

driver configuration file

kernel/drv/sparcv9/ecpp.conf

driver configuration file for 64–bit SPARC

kernel/drv/amd64/ecpp.conf

driver configuration file for 64–bit x86

Errors

EBADF

The device is opened for write-only access and a read is attempted, or the device is opened for read-only access and a write is attempted.

EBUSY

The device has been opened and another open is attempted. An attempt has been made to unload the driver while one of the units is open.

EINVAL

A ECPPIOC_SETPARMS ioctl() is attempted with an out-of-range value in the ecpp_transfer_parms structure. A ECPPIOC_SETREGS ioctl() is attempted with an invalid value in the ecpp_regs structure. An ioctl() is attempted with an invalid value in the command argument.An invalid command argument is received during modload(1M) or modunload(1M).

EIO

The driver encountered a bus error when attempting an access. A read or write did not complete properly, due to a peripheral error or a transfer timeout.

ENXIO

The driver has received an open request for a unit for which the attach failed. The driver has received a write request for a unit which has an active peripheral error.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Architecture
PCI-based systems
ISA-based systems (x86)
Availability
SUNWpd (Sparc)
SUNWpsdcr (x86)
Interface stability
Evolving

See Also

modload(1M), modunload(1M), update_drv(1M)ioctl(2), open(2), read(2), write(2), attributes(5), bpp(7D), usbprn(7D), prnio(7I), streamio(7I)

IEEE Std 1284–1994

http://www.sun.com/io

Diagnostics

Parallel port controller not supported

Driver does not support parallel port controller on the given host. Attach failed.