Subject: A centronix interface
To: 532bsd Mailing List <port-pc532@sun-lamp.cs.berkeley.edu>
From: Matthias Pfaller <leo@marco.de>
List: port-pc532
Date: 08/22/1994 10:09:07
Hi,

I built a simple centronix interface for my pc532. I'd like to get the
driver into the standard release so I don't have to patch the kernel
again and again :-) A short doc file how to build the interface is
provided as well. If someone would like to build the interface I'd be
glad to provide some handhelding :-)

	Matthias

#!/bin/sh
# This is a shell archive (shar 3.24)
# made 08/22/1994 08:08 UTC by leo@ra.marco.de
# Source directory /node/ra/leo/tmp/532
#
# existing files WILL be overwritten
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#     41 -rw-r--r-- config.example
#    484 -rw-r--r-- files.pc532.cd
#   1035 -rw-r--r-- locore.s.cd
#   9139 -rw-r--r-- lpt.c
#   1908 -rw-r--r-- lpt.doc
#   2751 -rw-r--r-- lptreg.h
#
if touch 2>&1 | fgrep '[-amc]' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
# ============= config.example ==============
echo "x - extracting config.example (Text)"
sed 's/^X//' << 'SHAR_EOF' > config.example &&
Xcontroller	lpt0
Xdevice		par0	at lpt0 tty
SHAR_EOF
$TOUCH -am 0821112894 config.example &&
chmod 0644 config.example ||
echo "restore of config.example failed"
set `wc -c config.example`;Wc_c=$1
if test "$Wc_c" != "41"; then
	echo original size 41, current size $Wc_c
fi
# ============= files.pc532.cd ==============
echo "x - extracting files.pc532.cd (Text)"
sed 's/^X//' << 'SHAR_EOF' > files.pc532.cd &&
X*** files.pc532.orig	Wed Aug  3 19:23:00 1994
X***************
X*** 17,22 ****
X--- 17,23 ----
X  arch/pc532/pc532/in_cksum.c		optional inet
X  arch/pc532/pc532/oc_cksum.s		optional inet
X  arch/pc532/dev/scn.c			optional scn device-driver
X+ arch/pc532/dev/lpt.c			optional lpt device-driver
X  arch/pc532/dev/dp.c			optional dp device-driver 
X  arch/pc532/dev/ncr.c			optional ncr device-driver 
X  arch/pc532/dev/aic.c			optional aic device-driver 
SHAR_EOF
$TOUCH -am 0821112794 files.pc532.cd &&
chmod 0644 files.pc532.cd ||
echo "restore of files.pc532.cd failed"
set `wc -c files.pc532.cd`;Wc_c=$1
if test "$Wc_c" != "484"; then
	echo original size 484, current size $Wc_c
fi
# ============= locore.s.cd ==============
echo "x - extracting locore.s.cd (Text)"
sed 's/^X//' << 'SHAR_EOF' > locore.s.cd &&
X*** locore.s.orig	Wed Aug  3 19:23:00 1994
X***************
X*** 47,52 ****
X--- 47,53 ----
X  #include <machine/asm.h>
X  #include <machine/icu.h>
X  #include "assym.h"
X+ #include "lpt.h"
X  #include "aic.h"
X  #include "dp.h"
X  #include "ncr.h"
X***************
X*** 140,146 ****
X--- 141,151 ----
X  	.long __int_scsi1	/* 4 - NCR DP8490 */
X  	.long __int_scsi0	/* 5 - Adaptec 6250 */
X  	.long __int_bad		/* 6 */
X+ #if NLPT > 0
X+ 	.long __int_lpt		/* 7 - i8255 */
X+ #else
X  	.long __int_uart3	/* 7 - uart 3*/
X+ #endif
X  	.long __int_bad		/* 8 */
X  	.long __int_uart2	/* 9  - uart 2*/
X  	.long __int_bad		/* 10 */
X***************
X*** 1109,1114 ****
X--- 1114,1130 ----
X  	movqd	3,tos
X  	bsr _scnintr
X  	br	exit_int
X+ #if NLPT > 0
X+ ENTRY(_int_lpt)
X+ 	enter	[r0,r1,r2,r3,r4,r5,r6,r7],8
X+ 	sprd	usp, REGS_USP(sp)
X+ 	sprd	sb, REGS_SB(sp)
X+ 	lprd	sb, 0
X+ 	movd	Cur_pl(pc), tos
X+ 	movqd	0,tos
X+ 	bsr _lptintr
X+ 	br	exit_int
X+ #endif
X  ENTRY(_int_bad)
X  	enter	[r0,r1,r2,r3,r4,r5,r6,r7],8
X  	sprd	usp, REGS_USP(sp)
SHAR_EOF
$TOUCH -am 0821112594 locore.s.cd &&
chmod 0644 locore.s.cd ||
echo "restore of locore.s.cd failed"
set `wc -c locore.s.cd`;Wc_c=$1
if test "$Wc_c" != "1035"; then
	echo original size 1035, current size $Wc_c
fi
# ============= lpt.c ==============
echo "x - extracting lpt.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > lpt.c &&
X/*
X * Copyright (c) 1994 Matthias Pfaller.
X * Copyright (c) 1993, 1994 Charles Hannum.
X * Copyright (c) 1990 William F. Jolitz, TeleMuse
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *	This software is a component of "386BSD" developed by 
X *	William F. Jolitz, TeleMuse.
X * 4. Neither the name of the developer nor the name "386BSD"
X *    may be used to endorse or promote products derived from this software
X *    without specific prior written permission.
X *
X * THIS SOFTWARE IS A COMPONENT OF 386BSD DEVELOPED BY WILLIAM F. JOLITZ 
X * AND IS INTENDED FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY. THIS 
X * SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT. 
X * THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT 
X * NOT MAKE USE OF THIS WORK.
X *
X * FOR USERS WHO WISH TO UNDERSTAND THE 386BSD SYSTEM DEVELOPED
X * BY WILLIAM F. JOLITZ, WE RECOMMEND THE USER STUDY WRITTEN 
X * REFERENCES SUCH AS THE  "PORTING UNIX TO THE 386" SERIES 
X * (BEGINNING JANUARY 1991 "DR. DOBBS JOURNAL", USA AND BEGINNING 
X * JUNE 1991 "UNIX MAGAZIN", GERMANY) BY WILLIAM F. JOLITZ AND 
X * LYNNE GREER JOLITZ, AS WELL AS OTHER BOOKS ON UNIX AND THE 
X * ON-LINE 386BSD USER MANUAL BEFORE USE. A BOOK DISCUSSING THE INTERNALS 
X * OF 386BSD ENTITLED "386BSD FROM THE INSIDE OUT" WILL BE AVAILABLE LATE 1992.
X *
X * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED.  IN NO EVENT SHALL THE DEVELOPER BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X *	$Id$
X */
X
X/*
X * Device Driver for Matthias's parallel printer port.
X * This driver is based on the i386 lpt driver.
X */
X
X#include "lpt.h"
X
X#include <sys/param.h>
X#include <sys/systm.h>
X#include <sys/proc.h>
X#include <sys/user.h>
X#include <sys/buf.h>
X#include <sys/kernel.h>
X#include <sys/ioctl.h>
X#include <sys/uio.h>
X#include <sys/device.h>
X#include <sys/syslog.h>
X
X#include <machine/cpu.h>
X
X#include "device.h"
X#include "lptreg.h"
X
X#define	TIMEOUT		hz*16	/* wait up to 16 seconds for a ready */
X#define	STEP		hz/4
X
X#define	LPTPRI		(PZERO+8)
X#define	LPT_BSIZE	1024
X
X#ifndef DEBUG
X#define lprintf
X#else
X#define lprintf		if (lptdebug) printf
Xint lptdebug = 1;
X#endif
X
Xstruct lpt_softc {
X	struct device sc_dev;
X	size_t sc_count;
X	struct buf *sc_inbuf;
X	u_char *sc_cp;
X	u_char sc_state;
X	u_char sc_status;
X#define	LPT_OPEN	0x01	/* device is open */
X#define	LPT_INIT	0x02	/* waiting to initialize for open */
X
X	u_char sc_flags;
X#define	LPT_AUTOLF	0x20	/* automatic LF on CR */
X#define	LPT_NOPRIME	0x40	/* don't prime on open */
X} lpt_softc[NLPT];
X
Xint lptprobe __P((struct pc532_device *));
Xint lptattach __P((struct pc532_device *));
Xint lptintr __P((int));
X
Xstruct pc532_driver lptdriver = {
X	lptprobe, lptattach, "lpt"
X};
X
X#define	LPTUNIT(s)	(minor(s) & 0x1f)
X#define	LPTFLAGS(s)	(minor(s) & 0xe0)
X
X#define	LPT_INVERT	(LPC_NBUSY|LPC_NERROR|LPC_NACK|LPC_ONLINE)
X#define	LPT_MASK	(LPC_NBUSY|LPC_NERROR|LPC_NACK|LPC_NOPAPER|LPC_ONLINE)
X#define DIAGNOSTIC
X#ifndef DIAGNOSTIC
X#define	NOT_READY()	((lpt_i8255->port_c ^ LPT_INVERT) & LPT_MASK)
X#else
X#define	NOT_READY()	notready(lpt_i8255->port_c, sc)
Xstatic int notready __P((u_char, struct lpt_softc *));
X#endif
X
Xstatic void lptout __P((void *arg));
Xstatic int pushbytes __P((struct lpt_softc *));
X
Xint
Xlptprobe(dev)
X	struct pc532_device *dev;
X{
X	if (LPTUNIT(dev->pd_unit) > 0)
X		return 0;
X
X	lpt_i8255->port_control = LPT_PROBE_MODE;
X
X	lpt_i8255->port_control = LPT_PROBE_CLR;
X	if (lpt_i8255->port_c & LPT_PROBE_MASK)
X		return 0;
X	
X	lpt_i8255->port_control = LPT_PROBE_SET;
X	if (!(lpt_i8255->port_c & LPT_PROBE_MASK))
X		return 0;
X
X	lpt_i8255->port_control = LPT_PROBE_CLR;
X	if (lpt_i8255->port_c & LPT_PROBE_MASK)
X		return 0;
X
X	lpt_i8255->port_control = LPT_MODE;
X	
X	return 1;
X}
X
Xint
Xlptattach(dev)
X	struct pc532_device *dev;
X{
X	struct lpt_softc *sc = &lpt_softc[dev->pd_unit];
X
X	/* XXX HACK */
X	sprintf(sc->sc_dev.dv_xname, "%s%d", lptdriver.name, dev->pd_unit);
X	sc->sc_dev.dv_unit = dev->pd_unit;
X	sc->sc_state = 0;
X	PL_tty |= SPL_UART3;
X	PL_zero |= PL_tty;
X	lpt_i8255->port_control = LPT_MODE;
X	printf ("lpt0 at mainbus0 addr 0x%x\n", lpt_i8255);
X}
X
X/*
X * Reset the printer, then wait until it's selected and not busy.
X */
Xint
Xlptopen(dev, flag)
X	dev_t dev;
X	int flag;
X{
X	int unit = LPTUNIT(dev);
X	u_char flags = LPTFLAGS(dev);
X	struct lpt_softc *sc;
X	int error;
X	int spin;
X
X	if (unit >= NLPT)
X		return ENXIO;
X
X	sc = &lpt_softc[unit];
X
X	if (sc->sc_state)
X		return EBUSY;
X
X	sc->sc_state = LPT_INIT;
X	sc->sc_flags = flags;
X	lprintf("%s: open: flags=0x%x\n", sc->sc_dev.dv_xname, flags);
X
X	if ((flags & LPT_NOPRIME) == 0) {
X		/* assert INIT for 100 usec to start up printer */
X		lpt_i8255->port_a = LPA_PRIME;
X		DELAY(100);
X	}
X
X	if (flags & LPT_AUTOLF)
X		lpt_i8255->port_a = LPA_SELECT | LPA_ALF;
X	else
X		lpt_i8255->port_a = LPA_SELECT;
X
X	/* wait till ready (printer running diagnostics) */
X	for (spin = 0; NOT_READY(); spin += STEP) {
X		if (spin >= TIMEOUT) {
X			sc->sc_state = 0;
X			return EBUSY;
X		}
X
X		/* wait 1/4 second, give up if we get a signal */
X		if (error = tsleep((caddr_t)sc, LPTPRI | PCATCH, "lptopen",
X		    STEP) != EWOULDBLOCK) {
X			sc->sc_state = 0;
X			return error;
X		}
X	}
X
X	sc->sc_inbuf  = geteblk(LPT_BSIZE);
X	sc->sc_status =
X	sc->sc_count  = 0;
X	sc->sc_state  = LPT_OPEN;
X
X	lprintf("%s: opened\n", sc->sc_dev.dv_xname);
X	return 0;
X}
X
X#ifdef DIAGNOSTIC
Xint
Xnotready(status, sc)
X	u_char status;
X	struct lpt_softc *sc;
X{
X	status ^= LPT_INVERT;
X
X	if (status != sc->sc_status) {
X		if (status & LPC_NOPAPER)
X			log(LOG_NOTICE, "%s: out of paper\n", sc->sc_dev.dv_xname);
X		else if (status & LPC_ONLINE)
X			log(LOG_NOTICE, "%s: offline\n", sc->sc_dev.dv_xname);
X		else if (status & LPC_NERROR)
X			log(LOG_NOTICE, "%s: output error\n", sc->sc_dev.dv_xname);
X		sc->sc_status = status;
X	}
X	return status & LPT_MASK;
X}
X#endif
X
Xvoid
Xlptout(arg)
X	void *arg;
X{
X	lpt_i8255->port_control = LPT_IRQENABLE;
X}
X
X/*
X * Close the device, and free the local line buffer.
X */
Xlptclose(dev, flag)
X	dev_t dev;
X	int flag;
X{
X	int unit = LPTUNIT(dev);
X	struct lpt_softc *sc = &lpt_softc[unit];
X
X	if (sc->sc_count)
X		(void) pushbytes(sc);
X
X	lpt_i8255->port_control = LPT_IRQDISABLE;
X	sc->sc_state = 0;
X	brelse(sc->sc_inbuf);
X
X	lprintf("%s: closed\n", sc->sc_dev.dv_xname);
X	return 0;
X}
X
Xint
Xpushbytes(sc)
X	struct lpt_softc *sc;
X{
X	int error;
X
X	while (sc->sc_count > 0) {
X		lpt_i8255->port_control = LPT_IRQENABLE;
X		if (error = tsleep((caddr_t)sc, LPTPRI | PCATCH,
X		    "lptwrite", 0))
X			return error;
X	}
X	return 0;
X}
X
X/* 
X * Copy a line from user space to a local buffer, then call putc to get the
X * chars moved to the output queue.
X */
Xlptwrite(dev, uio)
X	dev_t dev;
X	struct uio *uio;
X{
X	struct lpt_softc *sc = &lpt_softc[LPTUNIT(dev)];
X	size_t n;
X	int error = 0;
X
X	if (sc->sc_count) return EBUSY;
X	while (n = min(LPT_BSIZE, uio->uio_resid)) {
X		uiomove(sc->sc_cp = sc->sc_inbuf->b_un.b_addr, n, uio);
X		sc->sc_count = n;
X		error = pushbytes(sc);
X		if (error) {
X			/*
X			 * Return accurate residual if interrupted or timed
X			 * out.
X			 */
X			uio->uio_resid += sc->sc_count;
X			sc->sc_count = 0;
X			return error;
X		}
X	}
X	return 0;
X}
X
X/*
X * Handle printer interrupts which occur when the printer is ready to accept
X * another char.
X */
Xint
Xlptintr(unit)
X	int unit;
X{
X	struct lpt_softc *sc = &lpt_softc[unit];
X	int loops = 0;
X
X	if ((sc->sc_state & LPT_OPEN) == 0) {
X		lpt_i8255->port_control = LPT_IRQDISABLE;
X		return 0;
X	}
X
X	if (sc->sc_count) {
X		/* is prshar: saving lpt.doc (Text)
shar: saving lptreg.h (Text)
inter online and ready for output? */
X		if (NOT_READY()) {
X			lpt_i8255->port_control = LPT_IRQDISABLE;
X			timeout(lptout, (caddr_t)sc, STEP);
X			return 0;
X		}
X		/* send char */
X		lpt_i8255->port_b = *sc->sc_cp++;
X		sc->sc_count--;
X	}
X
X	if (sc->sc_count == 0) {
X		/* none, wake up the top half to get more */
X		lpt_i8255->port_control = LPT_IRQDISABLE;
X		wakeup((caddr_t)sc);
X	}
X
X	return 1;
X}
X
Xint
Xlptioctl(dev, cmd, data, flag)
X	dev_t dev;
X	int cmd;
X	caddr_t data;
X	int flag;
X{
X	int error = 0;
X
X	switch (cmd) {
X	default:
X		error = ENODEV;
X	}
X
X	return error;
X}
SHAR_EOF
$TOUCH -am 0821112494 lpt.c &&
chmod 0644 lpt.c ||
echo "restore of lpt.c failed"
set `wc -c lpt.c`;Wc_c=$1
if test "$Wc_c" != "9139"; then
	echo original size 9139, current size $Wc_c
fi
# ============= lpt.doc ==============
echo "x - extracting lpt.doc (Text)"
sed 's/^X//' << 'SHAR_EOF' > lpt.doc &&
X	$Id$
X
X     #    X X X x A X
X     t* B C X X x D X X
X     s  E F     x   X G
X     v  H X     x   X I
X     d  J K     a   # L
X     q  M N     p   X X
X     h  O X X X o P X X
X     g    X X X b X Q 
X     i          n
X     w          c   hw
X     @          m   h@
X     z          e   hy
X     u   8255   k   hz
X     r          f   h0
X     8          l   h1
X     y*         7   h2
X     y*         6   h3
X     0          5   h4
X     1          4   s5
X     2          3   t6
X                    u7
X                    v8
X
X
X       Top View (Pin 1 marked with #, inverted signals marked with *)
X
X
X	CPU Interface
X
Xa = /W          j = /INT
Xb = D1          k = D6
Xc = D3          l = Vcc
Xd = /R          m = D4
Xe = D5          n = D2
Xf = D7          o = D0
Xg = A1          p = /RESET
Xh = GND         q = /CS
Xi = A0          r = INT
X
XConnect r and j through an open collector inverter.
X
X
X	Centronix Interface
X
Xh = GND 	0 = D0
Xs = Select	1 = D1
Xt = Prime	2 = D2
Xu = /Error	3 = D3
Xv = Autofeed	4 = D4
Xw = Online	5 = D5
X@ = No Paper	6 = D6
Xy = Busy	7 = D7
Xz = /Ack	8 = /Strobe
X
X	8255 Usage
X
XPort A0 is connected to Centronix Autofeed
XPort A1 is connected to Centronix Select
XPort A2 is connected to Centronix Prime through an inverter.
X
XPort B of the 8255 is connected to Centronix D0-D7
X
XPort C0 is connected to the CPU Interrupt through an open collector
X	inverter.
XPort C1 is connected to Centronix /Strobe
XPort C2 is connected to Centronix Busy through an inverter.
XPort C3 is connected to Port C2.
XPort C4 is connected to Centronix /Error
XPort C5 is connected to Centronix /Ack
XPort C6 is connected to Centronix No Paper
XPort C7 is connected to Centronix Online
X
XAll outputs are connected to the Centronix bus through a 100 Ohm
Xresistor. All inputs are connected to the Centronix bus through a 1k Ohm
Xresistor.
XBusy and Online get a 4k7 pullup.
X/Error, No Paper and Port A2 get a 4k7 pulldown.
X
X	Matthias (leo@marco.de)
SHAR_EOF
$TOUCH -am 0821112494 lpt.doc &&
chmod 0644 lpt.doc ||
echo "restore of lpt.doc failed"
set `wc -c lpt.doc`;Wc_c=$1
if test "$Wc_c" != "1908"; then
	echo original size 1908, current size $Wc_c
fi
# ============= lptreg.h ==============
echo "x - extracting lptreg.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > lptreg.h &&
X/* 
X * Copyright (c) 1994 Matthias Pfaller.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X *    must display the following acknowledgement:
X *	This product includes software developed by Philip A. Nelson.
X * 4. The name of Philip A. Nelson may not be used to endorse or promote
X *    products derived from this software without specific prior written
X *    permission.
X *
X * THIS SOFTWARE IS PROVIDED BY PHILIP NELSON ``AS IS'' AND ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL PHILIP NELSON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
X * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
X * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
X * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
X * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
X * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
X *
X *	lptreg.h: definitions for the lpt driver.
X *
X *	$Id$
X */
X
Xstruct i8255 {
X	unsigned char port_a;		/* Port A data  (r/w) */
X	unsigned char port_b;		/* Port B data  (r/w) */
X	unsigned char port_c;		/* Port C data  (r/w) */
X	unsigned char port_control;	/* Port control (-/w) */
X};
X
X/* port_a */
X#define LPA_ALF		0x01
X#define LPA_SELECT	0x02
X#define LPA_PRIME	0x04		/* Positive logic! */
X
X/* port_c */
X#define LPC_IRQ		0x01
X#define LPC_NSTROBE	0x02
X#define LPC_NBUSY	0x08		/* Negative logic! */
X#define LPC_NERROR	0x10
X#define LPC_NACK	0x20
X#define LPC_NOPAPER	0x40
X#define LPC_ONLINE	0x80
X
X/* port_control */
X#define LPT_PROBE_MODE	0x8c
X#define LPT_MODE	0x8d		/* Port A: Output, Mode 0 */
X					/* Port B: Output, Mode 1 */
X					/* Port C: Input */
X#define LPT_IRQENABLE	0x05		/* Enable LPT interrupts */
X#define LPT_IRQDISABLE	0x04		/* Disable LPT interrupts */
X
X#define LPT_PROBE_MASK	0x08
X#define LPT_PROBE_SET	0x07
X#define LPT_PROBE_CLR	0x06
X
X#define LPT_MAP_ADR 0xFFC80030		/* Mapped address of the i8255 */
X
X#define lpt_i8255	((volatile struct i8255 *)LPT_MAP_ADR)
SHAR_EOF
$TOUCH -am 0821112494 lptreg.h &&
chmod 0644 lptreg.h ||
echo "restore of lptreg.h failed"
set `wc -c lptreg.h`;Wc_c=$1
if test "$Wc_c" != "2751"; then
	echo original size 2751, current size $Wc_c
fi
exit 0

------------------------------------------------------------------------------