Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Import Gary Thorpe's netbsd-ppbus 1.3. This is NetBSD port
details: https://anonhg.NetBSD.org/src/rev/df2641634c8d
branches: trunk
changeset: 557851:df2641634c8d
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Mon Jan 19 23:22:23 2004 +0000
description:
Import Gary Thorpe's netbsd-ppbus 1.3. This is NetBSD port
of FreeBSD Parallel Port Bus framework. Work in progress.
diffstat:
share/man/man4/atppc.4 | 94 +
share/man/man4/lp.4 | 268 ++++
share/man/man4/lpbb.4 | 83 +
share/man/man4/lpt.4 | 106 +
share/man/man4/ppbus.4 | 341 +++++
share/man/man4/ppi.4 | 73 +
share/man/man4/vpo.4 | 97 +
share/man/man9/microseq.9 | 494 ++++++++
share/man/man9/ppi.9 | 112 +
sys/dev/ic/atppc.c | 2457 ++++++++++++++++++++++++++++++++++++++++++
sys/dev/ic/atppcreg.h | 313 +++++
sys/dev/ic/atppcvar.h | 256 ++++
sys/dev/isa/atppc_isa.c | 216 +++
sys/dev/isa/atppc_isa_subr.c | 227 +++
sys/dev/isa/atppc_isa_subr.h | 71 +
sys/dev/ppbus/files.ppbus | 27 +
sys/dev/ppbus/if_plip.c | 949 ++++++++++++++++
sys/dev/ppbus/lpt.c | 789 +++++++++++++
sys/dev/ppbus/lptio.h | 27 +
sys/dev/ppbus/lptreg.h | 76 +
sys/dev/ppbus/lptvar.h | 98 +
sys/dev/ppbus/ppbus_1284.c | 682 +++++++++++
sys/dev/ppbus/ppbus_1284.h | 129 ++
sys/dev/ppbus/ppbus_base.c | 646 +++++++++++
sys/dev/ppbus/ppbus_base.h | 165 ++
sys/dev/ppbus/ppbus_conf.c | 259 ++++
sys/dev/ppbus/ppbus_conf.h | 133 ++
sys/dev/ppbus/ppbus_device.h | 49 +
sys/dev/ppbus/ppbus_io.h | 124 ++
sys/dev/ppbus/ppbus_msq.c | 363 ++++++
sys/dev/ppbus/ppbus_msq.h | 237 ++++
sys/dev/ppbus/ppbus_var.h | 52 +
usr.sbin/lptctl/Makefile | 10 +
usr.sbin/lptctl/lptctl.8 | 97 +
usr.sbin/lptctl/lptctl.c | 180 +++
35 files changed, 10300 insertions(+), 0 deletions(-)
diffs (truncated from 10440 to 300 lines):
diff -r ab5099192ec8 -r df2641634c8d share/man/man4/atppc.4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/atppc.4 Mon Jan 19 23:22:23 2004 +0000
@@ -0,0 +1,94 @@
+.\" $NetBSD: atppc.4,v 1.1.1.1 2004/01/19 23:22:23 jdolecek Exp $
+.\"
+.\" Copyright (C) Gary Thorpe 2003
+.\" All rights reserved.
+.\"
+.Dd December 24, 2003
+.Dt ATPPC 4
+.Os
+.Sh NAME
+.Nm atppc
+.Nd driver for AT-style parallel port chip sets.
+.Sh SYNOPSIS
+.Cd "atppc0 at isa? port 0x378 irq 7 drq 3 flags 0x00"
+.Cd options ATPPC_VERBOSE
+.Cd options ATPPC_DEBUG
+.Sh DESCRIPTION
+.Nm
+supports parallel ports and provides the low level support needed
+by higher level drivers such as
+.Xr ppbus 4 .
+This driver attaches where the traditional NetBSD
+.Xr lpt 4
+driver would ordinarily. It provides the data transport and chip set
+manipulation needed by higher driver layers. This driver is designed to be
+one of many possible implementations supporting machine independent parallel
+device support via
+.Xr ppbus 4 .
+.Ss IEEE 1284 support
+.Nm
+is intended to provide to data-link like services to higher level IEEE 1284
+device drivers (such as
+.Xr ppbus 4 ).
+.Nm
+does not directly support IEEE 1284 features such as mode negotiation but
+rather provides the necessary infrastructure to allow a higher level driver to
+provide these services.
+.Pp
+.Nm
+does provide chip set manipulation, device handshakes (where appropriate),
+low-level error detection, and data transfer.
+.Ss Supported data transfer modes
+.Nm
+supports the following data transfer modes: Centronics Compatible (Standard),
+Nibble, Byte (PS2), Fast Centronics, ECP, and EPP. Standard and Fast Centronics modes are write only, Nibble and Byte modes are read only, and ECP and EPP
+modes are bidirectional.
+.Ss Software Interfaces
+The driver provides some generic methods that can apply to many AT-like
+parallel port devices (such as non-generic chip sets): see
+.Xr atppc 9 .
+.Nm
+implements the parport interface defined in
+.Xr ppbus 9 .
+.Ss Supported Devices
+.Nm
+supports only generic chip sets on the ISA bus. The original FreeBSD
+.Xr ppc 4
+driver included support for other chip sets, but this driver is still under
+development. Generic chip sets configured by other means besides ISA are also
+not supported, but are being planned.
+.\" .Sh FILES
+.\" .Sh EXAMPLES
+.Sh SEE ALSO
+.\" Cross-references should be ordered by section (low to high), then in
+.\" alphabetical order.
+.Xr isa 4 ,
+.Xr isapnp 4 ,
+.Xr lp 4 ,
+.Xr lpbb 4 ,
+.Xr lpt 4 ,
+.Xr ppbus 4 ,
+.Xr ppi 4 ,
+.Xr vpo 4 ,
+.Xr atppc 9 ,
+.Xr microseq 9
+.Sh HISTORY
+The
+.Nm
+driver is based on the
+.Xr ppc 4
+driver, which originally appeared in FreeBSD.
+.Sh AUTHORS
+This manual page is based on the FreeBSD
+.Xr ppc 4
+manual page. The information has been updated for NetBSD's port by Gary
+Thorpe.
+.Sh BUGS
+.Bl -item
+.It
+ISA PnP, PnP BIOS, ACPI attachments are missing. Support is being planned.
+.It
+Only standard and FAST mode writes are tested. Nibble reads also tested.
+.It
+Only generic chip sets are currently supported.
+.El
diff -r ab5099192ec8 -r df2641634c8d share/man/man4/lp.4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/lp.4 Mon Jan 19 23:22:23 2004 +0000
@@ -0,0 +1,268 @@
+.\" -*- nroff -*-
+.\"
+.\" Copyright (c) 1996 A.R.Gordon, andrew.gordon%net-tel.co.uk@localhost
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" Id: man4.i386/lp.4,v 1.9 1999/02/14 12:06:16 nsouch Exp
+.\" $FreeBSD: src/share/man/man4/lp.4,v 1.5.2.3 2000/12/29 10:18:00 ru Exp $
+.\"
+.Dd December 24, 2003
+.Os
+.Dt LP 4
+.Sh NAME
+.Nm lp
+.Nd printer port Internet Protocol driver
+.Sh SYNOPSIS
+.Cd "lp* at ppbus?"
+.Cd options PLIP_DEBUG
+.Sh DESCRIPTION
+The
+.Nm
+driver allows a PC parallel printer port to be used as a
+point-to-point network interface between two similarly configured systems.
+Data is transferred 4 bits at a time, using the printer status lines for
+input: hence there is no requirement for special bidirectional hardware
+and any standard AT-compatible printer port with working interrupts may be used.
+.Pp
+During the boot process, for each
+.Nm ppbus
+device which is attached and has an interrupt capability, a corresponding
+.Nm
+device is attached. The
+.Nm
+device is configured using
+.Xr ifconfig 8
+using the options for a point-to-point network interface:
+.Pp
+.Nm ifconfig
+.Ar lp0
+.Ar hostaddress destaddress
+.Op Fl link0|link0
+.Op up|down
+.Op ...
+.Pp
+Configuring a
+.Nm
+device 'up' with
+.Xr ifconfig 8
+causes the corresponding
+.Nm ppbus
+to be reserved for PLIP until the network interface is configured 'down'.
+.Pp
+The communication protocol is selected by the
+.Cm link0
+flag:
+.Bl -tag -width Fl
+.It Fl link0
+(default) Use
+.Fx
+mode (LPIP). This is the simpler of the two modes
+and therefore slightly more efficient.
+.It Cm link0
+Use Crynwr/Linux compatible mode (CLPIP). This mode has a simulated ethernet
+packet header, and is easier to interface to other types of equipment.
+.El
+.Pp
+The interface MTU defaults to 1500, but may be set to any value. Both ends
+of the link must be configured with the same MTU. See
+.Xr ifconfig 8
+for details on configuring network interfaces.
+.Ss Cable Connections
+The cable connecting the two parallel ports should be wired as follows:
+.Bd -literal
+ Pin Pin Description
+ 2 15 Data0 -> ERROR*
+ 3 13 Data1 -> SLCT
+ 4 12 Data2 -> PE
+ 5 10 Data3 -> ACK*
+ 6 11 Data4 -> BUSY
+ 15 2 ERROR* -> Data0
+ 13 3 SLCT -> Data1
+ 12 4 PE -> Data2
+ 10 5 ACK* -> Data3
+ 11 6 BUSY -> Data4
+ 18-25 18-25 Ground
+.Ed
+.Pp
+Cables with this wiring are widely available as 'Laplink' cables, and
+are often colored yellow.
+.Pp
+The connections are symmetric, and provide 5 lines in each direction (four
+data plus one handshake). The two modes use the same wiring, but make a
+different choice of which line to use as handshake.
+.Ss FreeBSD LPIP mode
+The signal lines are used as follows:
+.Bl -tag -width dataxxxx(Pinxx)
+.It Em Data0 (Pin 2)
+Data out, bit 0.
+.It Em Data1 (Pin 3)
+Data out, bit 1.
+.It Em Data2 (Pin 4)
+Data out, bit 2.
+.It Em Data3 (Pin 5)
+Handshake out.
+.It Em Data4 (Pin 6)
+Data out, bit 3.
+.It Em ERROR* (pin 15)
+Data in, bit 0.
+.It Em SLCT (pin 13)
+Data in, bit 1.
+.It Em PE (pin 12)
+Data in, bit 2.
+.It Em BUSY (pin 11)
+Data in, bit 3.
+.It Em ACK* (pin 10)
+Handshake in.
+.El
+.Pp
+When idle, all data lines are at zero. Each byte is signaled in four steps:
+sender writes the 4 most significant bits and raises the handshake line;
+receiver reads the 4 bits and raises its handshake to acknowledge;
+sender places the 4 least significant bits on the data lines and lowers
+the handshake; receiver reads the data and lowers its handshake.
+.Pp
+The packet format has a two-byte header, comprising the fixed values 0x08,
+0x00, immediately followed by the IP header and data.
+.Pp
+The start of a packet is indicated by simply signaling the first byte
+of the header. The end of the packet is indicated by inverting
+the data lines (i.e. writing the ones-complement of the previous nibble
+to be transmitted) without changing the state of the handshake.
+.Pp
+Note that the end-of-packet marker assumes that the handshake signal and
+the data-out bits can be written in a single instruction - otherwise
+certain byte values in the packet data would falsely be interpreted
+as end-of-packet. This is not a problem for the PC printer port,
+but requires care when implementing this protocol on other equipment.
+.Ss Crynwr/Linux CLPIP mode
+The signal lines are used as follows:
+.Bl -tag -width dataxxxx(Pinxx)
+.It Em Data0 (Pin 2)
+Data out, bit 0.
+.It Em Data1 (Pin 3)
+Data out, bit 1.
+.It Em Data2 (Pin 4)
+Data out, bit 2.
+.It Em Data3 (Pin 5)
+Data out, bit 3.
+.It Em Data4 (Pin 6)
+Handshake out.
+.It Em ERROR* (pin 15)
+Data in, bit 0.
+.It Em SLCT (pin 13)
+Data in, bit 1.
+.It Em PE (pin 12)
+Data in, bit 2.
+.It Em ACK* (pin 10)
+Data in, bit 3.
+.It Em BUSY (pin 11)
+Handshake in.
+.El
+.Pp
+When idle, all data lines are at zero. Each byte is signaled in four steps:
+sender writes the 4 least significant bits and raises the handshake line;
+receiver reads the 4 bits and raises its handshake to acknowledge;
+sender places the 4 most significant bits on the data lines and lowers
+the handshake; receiver reads the data and lowers its handshake.
+[Note that this is the opposite nibble order to LPIP mode].
+.Pp
+Packet format is:
+.Bd -literal
Home |
Main Index |
Thread Index |
Old Index