Commit bb2a97e9 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: delete generic_serial drivers

No one has steped up to claim them, so as described in commit
4c377058 (tty: move obsolete and broken
generic_serial drivers to drivers/staging/generic_serial/), they are now
deleted from the system.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8eb26942
......@@ -26,8 +26,6 @@ if STAGING
source "drivers/staging/tty/Kconfig"
source "drivers/staging/generic_serial/Kconfig"
source "drivers/staging/et131x/Kconfig"
source "drivers/staging/slicoss/Kconfig"
......
......@@ -4,7 +4,6 @@
obj-$(CONFIG_STAGING) += staging.o
obj-y += tty/
obj-y += generic_serial/
obj-$(CONFIG_ET131X) += et131x/
obj-$(CONFIG_SLICOSS) += slicoss/
obj-$(CONFIG_VIDEO_GO7007) += go7007/
......
config A2232
tristate "Commodore A2232 serial support (EXPERIMENTAL)"
depends on EXPERIMENTAL && ZORRO && BROKEN
---help---
This option supports the 2232 7-port serial card shipped with the
Amiga 2000 and other Zorro-bus machines, dating from 1989. At
a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip
each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The
ports were connected with 8 pin DIN connectors on the card bracket,
for which 8 pin to DB25 adapters were supplied. The card also had
jumpers internally to toggle various pinning configurations.
This driver can be built as a module; but then "generic_serial"
will also be built as a module. This has to be loaded before
"ser_a2232". If you want to do this, answer M here.
config SX
tristate "Specialix SX (and SI) card support"
depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA) && BROKEN
help
This is a driver for the SX and SI multiport serial cards.
Please read the file <file:Documentation/serial/sx.txt> for details.
This driver can only be built as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called sx. If you want to do that, say M here.
config RIO
tristate "Specialix RIO system support"
depends on SERIAL_NONSTANDARD && BROKEN
help
This is a driver for the Specialix RIO, a smart serial card which
drives an outboard box that can support up to 128 ports. Product
information is at <http://www.perle.com/support/documentation.html#multiport>.
There are both ISA and PCI versions.
config RIO_OLDPCI
bool "Support really old RIO/PCI cards"
depends on RIO
help
Older RIO PCI cards need some initialization-time configuration to
determine the IRQ and some control addresses. If you have a RIO and
this doesn't seem to work, try setting this to Y.
obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o
obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o
obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o
obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o
obj-$(CONFIG_SX) += sx.o generic_serial.o
obj-$(CONFIG_RIO) += rio/ generic_serial.o
These are a few tty/serial drivers that either do not build,
or work if they do build, or if they seem to work, are for obsolete
hardware, or are full of unfixable races and no one uses them anymore.
If no one steps up to adopt any of these drivers, they will be removed
in the 2.6.41 release.
This diff is collapsed.
#
# Makefile for the linux rio-subsystem.
#
# (C) R.E.Wolff@BitWizard.nl
#
# This file is GPL. See other files for the full Blurb. I'm lazy today.
#
obj-$(CONFIG_RIO) += rio.o
rio-y := rio_linux.o rioinit.o rioboot.o riocmd.o rioctrl.o riointr.o \
rioparam.o rioroute.o riotable.o riotty.o
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : board.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:07
** Retrieved : 11/6/98 11:34:20
**
** ident @(#)board.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_board_h__
#define __rio_board_h__
/*
** board.h contains the definitions for the *hardware* of the host cards.
** It describes the memory overlay for the dual port RAM area.
*/
#define DP_SRAM1_SIZE 0x7C00
#define DP_SRAM2_SIZE 0x0200
#define DP_SRAM3_SIZE 0x7000
#define DP_SCRATCH_SIZE 0x1000
#define DP_PARMMAP_ADDR 0x01FE /* offset into SRAM2 */
#define DP_STARTUP_ADDR 0x01F8 /* offset into SRAM2 */
/*
** The shape of the Host Control area, at offset 0x7C00, Write Only
*/
struct s_Ctrl {
u8 DpCtl; /* 7C00 */
u8 Dp_Unused2_[127];
u8 DpIntSet; /* 7C80 */
u8 Dp_Unused3_[127];
u8 DpTpuReset; /* 7D00 */
u8 Dp_Unused4_[127];
u8 DpIntReset; /* 7D80 */
u8 Dp_Unused5_[127];
};
/*
** The PROM data area on the host (0x7C00), Read Only
*/
struct s_Prom {
u16 DpSlxCode[2];
u16 DpRev;
u16 Dp_Unused6_;
u16 DpUniq[4];
u16 DpJahre;
u16 DpWoche;
u16 DpHwFeature[5];
u16 DpOemId;
u16 DpSiggy[16];
};
/*
** Union of the Ctrl and Prom areas
*/
union u_CtrlProm { /* This is the control/PROM area (0x7C00) */
struct s_Ctrl DpCtrl;
struct s_Prom DpProm;
};
/*
** The top end of memory!
*/
struct s_ParmMapS { /* Area containing Parm Map Pointer */
u8 Dp_Unused8_[DP_PARMMAP_ADDR];
u16 DpParmMapAd;
};
struct s_StartUpS {
u8 Dp_Unused9_[DP_STARTUP_ADDR];
u8 Dp_LongJump[0x4];
u8 Dp_Unused10_[2];
u8 Dp_ShortJump[0x2];
};
union u_Sram2ParmMap { /* This is the top of memory (0x7E00-0x7FFF) */
u8 DpSramMem[DP_SRAM2_SIZE];
struct s_ParmMapS DpParmMapS;
struct s_StartUpS DpStartUpS;
};
/*
** This is the DP RAM overlay.
*/
struct DpRam {
u8 DpSram1[DP_SRAM1_SIZE]; /* 0000 - 7BFF */
union u_CtrlProm DpCtrlProm; /* 7C00 - 7DFF */
union u_Sram2ParmMap DpSram2ParmMap; /* 7E00 - 7FFF */
u8 DpScratch[DP_SCRATCH_SIZE]; /* 8000 - 8FFF */
u8 DpSram3[DP_SRAM3_SIZE]; /* 9000 - FFFF */
};
#define DpControl DpCtrlProm.DpCtrl.DpCtl
#define DpSetInt DpCtrlProm.DpCtrl.DpIntSet
#define DpResetTpu DpCtrlProm.DpCtrl.DpTpuReset
#define DpResetInt DpCtrlProm.DpCtrl.DpIntReset
#define DpSlx DpCtrlProm.DpProm.DpSlxCode
#define DpRevision DpCtrlProm.DpProm.DpRev
#define DpUnique DpCtrlProm.DpProm.DpUniq
#define DpYear DpCtrlProm.DpProm.DpJahre
#define DpWeek DpCtrlProm.DpProm.DpWoche
#define DpSignature DpCtrlProm.DpProm.DpSiggy
#define DpParmMapR DpSram2ParmMap.DpParmMapS.DpParmMapAd
#define DpSram2 DpSram2ParmMap.DpSramMem
#endif
/****************************************************************************
******* *******
******* CIRRUS.H *******
******* *******
****************************************************************************
Author : Jeremy Rolls
Date : 3 Aug 1990
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
***************************************************************************/
#ifndef _cirrus_h
#define _cirrus_h 1
/* Bit fields for particular registers shared with driver */
/* COR1 - driver and RTA */
#define RIOC_COR1_ODD 0x80 /* Odd parity */
#define RIOC_COR1_EVEN 0x00 /* Even parity */
#define RIOC_COR1_NOP 0x00 /* No parity */
#define RIOC_COR1_FORCE 0x20 /* Force parity */
#define RIOC_COR1_NORMAL 0x40 /* With parity */
#define RIOC_COR1_1STOP 0x00 /* 1 stop bit */
#define RIOC_COR1_15STOP 0x04 /* 1.5 stop bits */
#define RIOC_COR1_2STOP 0x08 /* 2 stop bits */
#define RIOC_COR1_5BITS 0x00 /* 5 data bits */
#define RIOC_COR1_6BITS 0x01 /* 6 data bits */
#define RIOC_COR1_7BITS 0x02 /* 7 data bits */
#define RIOC_COR1_8BITS 0x03 /* 8 data bits */
#define RIOC_COR1_HOST 0xef /* Safe host bits */
/* RTA only */
#define RIOC_COR1_CINPCK 0x00 /* Check parity of received characters */
#define RIOC_COR1_CNINPCK 0x10 /* Don't check parity */
/* COR2 bits for both RTA and driver use */
#define RIOC_COR2_IXANY 0x80 /* IXANY - any character is XON */
#define RIOC_COR2_IXON 0x40 /* IXON - enable tx soft flowcontrol */
#define RIOC_COR2_RTSFLOW 0x02 /* Enable tx hardware flow control */
/* Additional driver bits */
#define RIOC_COR2_HUPCL 0x20 /* Hang up on close */
#define RIOC_COR2_CTSFLOW 0x04 /* Enable rx hardware flow control */
#define RIOC_COR2_IXOFF 0x01 /* Enable rx software flow control */
#define RIOC_COR2_DTRFLOW 0x08 /* Enable tx hardware flow control */
/* RTA use only */
#define RIOC_COR2_ETC 0x20 /* Embedded transmit options */
#define RIOC_COR2_LOCAL 0x10 /* Local loopback mode */
#define RIOC_COR2_REMOTE 0x08 /* Remote loopback mode */
#define RIOC_COR2_HOST 0xc2 /* Safe host bits */
/* COR3 - RTA use only */
#define RIOC_COR3_SCDRNG 0x80 /* Enable special char detect for range */
#define RIOC_COR3_SCD34 0x40 /* Special character detect for SCHR's 3 + 4 */
#define RIOC_COR3_FCT 0x20 /* Flow control transparency */
#define RIOC_COR3_SCD12 0x10 /* Special character detect for SCHR's 1 + 2 */
#define RIOC_COR3_FIFO12 0x0c /* 12 chars for receive FIFO threshold */
#define RIOC_COR3_FIFO10 0x0a /* 10 chars for receive FIFO threshold */
#define RIOC_COR3_FIFO8 0x08 /* 8 chars for receive FIFO threshold */
#define RIOC_COR3_FIFO6 0x06 /* 6 chars for receive FIFO threshold */
#define RIOC_COR3_THRESHOLD RIOC_COR3_FIFO8 /* MUST BE LESS THAN MCOR_THRESHOLD */
#define RIOC_COR3_DEFAULT (RIOC_COR3_FCT | RIOC_COR3_THRESHOLD)
/* Default bits for COR3 */
/* COR4 driver and RTA use */
#define RIOC_COR4_IGNCR 0x80 /* Throw away CR's on input */
#define RIOC_COR4_ICRNL 0x40 /* Map CR -> NL on input */
#define RIOC_COR4_INLCR 0x20 /* Map NL -> CR on input */
#define RIOC_COR4_IGNBRK 0x10 /* Ignore Break */
#define RIOC_COR4_NBRKINT 0x08 /* No interrupt on break (-BRKINT) */
#define RIOC_COR4_RAISEMOD 0x01 /* Raise modem output lines on non-zero baud */
/* COR4 driver only */
#define RIOC_COR4_IGNPAR 0x04 /* IGNPAR (ignore characters with errors) */
#define RIOC_COR4_PARMRK 0x02 /* PARMRK */
#define RIOC_COR4_HOST 0xf8 /* Safe host bits */
/* COR4 RTA only */
#define RIOC_COR4_CIGNPAR 0x02 /* Thrown away bad characters */
#define RIOC_COR4_CPARMRK 0x04 /* PARMRK characters */
#define RIOC_COR4_CNPARMRK 0x03 /* Don't PARMRK */
/* COR5 driver and RTA use */
#define RIOC_COR5_ISTRIP 0x80 /* Strip input chars to 7 bits */
#define RIOC_COR5_LNE 0x40 /* Enable LNEXT processing */
#define RIOC_COR5_CMOE 0x20 /* Match good and errored characters */
#define RIOC_COR5_ONLCR 0x02 /* NL -> CR NL on output */
#define RIOC_COR5_OCRNL 0x01 /* CR -> NL on output */
/*
** Spare bits - these are not used in the CIRRUS registers, so we use
** them to set various other features.
*/
/*
** tstop and tbusy indication
*/
#define RIOC_COR5_TSTATE_ON 0x08 /* Turn on monitoring of tbusy and tstop */
#define RIOC_COR5_TSTATE_OFF 0x04 /* Turn off monitoring of tbusy and tstop */
/*
** TAB3
*/
#define RIOC_COR5_TAB3 0x10 /* TAB3 mode */
#define RIOC_COR5_HOST 0xc3 /* Safe host bits */
/* CCSR */
#define RIOC_CCSR_TXFLOFF 0x04 /* Tx is xoffed */
/* MSVR1 */
/* NB. DTR / CD swapped from Cirrus spec as the pins are also reversed on the
RTA. This is because otherwise DCD would get lost on the 1 parallel / 3
serial option.
*/
#define RIOC_MSVR1_CD 0x80 /* CD (DSR on Cirrus) */
#define RIOC_MSVR1_RTS 0x40 /* RTS (CTS on Cirrus) */
#define RIOC_MSVR1_RI 0x20 /* RI */
#define RIOC_MSVR1_DTR 0x10 /* DTR (CD on Cirrus) */
#define RIOC_MSVR1_CTS 0x01 /* CTS output pin (RTS on Cirrus) */
/* Next two used to indicate state of tbusy and tstop to driver */
#define RIOC_MSVR1_TSTOP 0x08 /* Set if port flow controlled */
#define RIOC_MSVR1_TEMPTY 0x04 /* Set if port tx buffer empty */
#define RIOC_MSVR1_HOST 0xf3 /* The bits the host wants */
/* Defines for the subscripts of a CONFIG packet */
#define RIOC_CONFIG_COR1 1 /* Option register 1 */
#define RIOC_CONFIG_COR2 2 /* Option register 2 */
#define RIOC_CONFIG_COR4 3 /* Option register 4 */
#define RIOC_CONFIG_COR5 4 /* Option register 5 */
#define RIOC_CONFIG_TXXON 5 /* Tx XON character */
#define RIOC_CONFIG_TXXOFF 6 /* Tx XOFF character */
#define RIOC_CONFIG_RXXON 7 /* Rx XON character */
#define RIOC_CONFIG_RXXOFF 8 /* Rx XOFF character */
#define RIOC_CONFIG_LNEXT 9 /* LNEXT character */
#define RIOC_CONFIG_TXBAUD 10 /* Tx baud rate */
#define RIOC_CONFIG_RXBAUD 11 /* Rx baud rate */
#define RIOC_PRE_EMPTIVE 0x80 /* Pre-emptive bit in command field */
/* Packet types going from Host to remote - with the exception of OPEN, MOPEN,
CONFIG, SBREAK and MEMDUMP the remaining bytes of the data array will not
be used
*/
#define RIOC_OPEN 0x00 /* Open a port */
#define RIOC_CONFIG 0x01 /* Configure a port */
#define RIOC_MOPEN 0x02 /* Modem open (block for DCD) */
#define RIOC_CLOSE 0x03 /* Close a port */
#define RIOC_WFLUSH (0x04 | RIOC_PRE_EMPTIVE) /* Write flush */
#define RIOC_RFLUSH (0x05 | RIOC_PRE_EMPTIVE) /* Read flush */
#define RIOC_RESUME (0x06 | RIOC_PRE_EMPTIVE) /* Resume if xoffed */
#define RIOC_SBREAK 0x07 /* Start break */
#define RIOC_EBREAK 0x08 /* End break */
#define RIOC_SUSPEND (0x09 | RIOC_PRE_EMPTIVE) /* Susp op (behave as tho xoffed) */
#define RIOC_FCLOSE (0x0a | RIOC_PRE_EMPTIVE) /* Force close */
#define RIOC_XPRINT 0x0b /* Xprint packet */
#define RIOC_MBIS (0x0c | RIOC_PRE_EMPTIVE) /* Set modem lines */
#define RIOC_MBIC (0x0d | RIOC_PRE_EMPTIVE) /* Clear modem lines */
#define RIOC_MSET (0x0e | RIOC_PRE_EMPTIVE) /* Set modem lines */
#define RIOC_PCLOSE 0x0f /* Pseudo close - Leaves rx/tx enabled */
#define RIOC_MGET (0x10 | RIOC_PRE_EMPTIVE) /* Force update of modem status */
#define RIOC_MEMDUMP (0x11 | RIOC_PRE_EMPTIVE) /* Send back mem from addr supplied */
#define RIOC_READ_REGISTER (0x12 | RIOC_PRE_EMPTIVE) /* Read CD1400 register (debug) */
/* "Command" packets going from remote to host COMPLETE and MODEM_STATUS
use data[4] / data[3] to indicate current state and modem status respectively
*/
#define RIOC_COMPLETE (0x20 | RIOC_PRE_EMPTIVE)
/* Command complete */
#define RIOC_BREAK_RECEIVED (0x21 | RIOC_PRE_EMPTIVE)
/* Break received */
#define RIOC_MODEM_STATUS (0x22 | RIOC_PRE_EMPTIVE)
/* Change in modem status */
/* "Command" packet that could go either way - handshake wake-up */
#define RIOC_HANDSHAKE (0x23 | RIOC_PRE_EMPTIVE)
/* Wake-up to HOST / RTA */
#endif
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : cmdblk.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:09
** Retrieved : 11/6/98 11:34:20
**
** ident @(#)cmdblk.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_cmdblk_h__
#define __rio_cmdblk_h__
/*
** the structure of a command block, used to queue commands destined for
** a rup.
*/
struct CmdBlk {
struct CmdBlk *NextP; /* Pointer to next command block */
struct PKT Packet; /* A packet, to copy to the rup */
/* The func to call to check if OK */
int (*PreFuncP) (unsigned long, struct CmdBlk *);
int PreArg; /* The arg for the func */
/* The func to call when completed */
int (*PostFuncP) (unsigned long, struct CmdBlk *);
int PostArg; /* The arg for the func */
};
#define NUM_RIO_CMD_BLKS (3 * (MAX_RUP * 4 + LINKS_PER_UNIT * 4))
#endif
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : cmdpkt.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:09
** Retrieved : 11/6/98 11:34:20
**
** ident @(#)cmdpkt.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_cmdpkt_h__
#define __rio_cmdpkt_h__
/*
** overlays for the data area of a packet. Used in both directions
** (to build a packet to send, and to interpret a packet that arrives)
** and is very inconvenient for MIPS, so they appear as two separate
** structures - those used for modifying/reading packets on the card
** and those for modifying/reading packets in real memory, which have an _M
** suffix.
*/
#define RTA_BOOT_DATA_SIZE (PKT_MAX_DATA_LEN-2)
/*
** The boot information packet looks like this:
** This structure overlays a PktCmd->CmdData structure, and so starts
** at Data[2] in the actual pkt!
*/
struct BootSequence {
u16 NumPackets;
u16 LoadBase;
u16 CodeSize;
};
#define BOOT_SEQUENCE_LEN 8
struct SamTop {
u8 Unit;
u8 Link;
};
struct CmdHdr {
u8 PcCommand;
union {
u8 PcPhbNum;
u8 PcLinkNum;
u8 PcIDNum;
} U0;
};
struct PktCmd {
union {
struct {
struct CmdHdr CmdHdr;
struct BootSequence PcBootSequence;
} S1;
struct {
u16 PcSequence;
u8 PcBootData[RTA_BOOT_DATA_SIZE];
} S2;
struct {
u16 __crud__;
u8 PcUniqNum[4]; /* this is really a uint. */
u8 PcModuleTypes; /* what modules are fitted */
} S3;
struct {
struct CmdHdr CmdHdr;
u8 __undefined__;
u8 PcModemStatus;
u8 PcPortStatus;
u8 PcSubCommand; /* commands like mem or register dump */
u16 PcSubAddr; /* Address for command */
u8 PcSubData[64]; /* Date area for command */
} S4;
struct {
struct CmdHdr CmdHdr;
u8 PcCommandText[1];
u8 __crud__[20];
u8 PcIDNum2; /* It had to go somewhere! */
} S5;
struct {
struct CmdHdr CmdHdr;
struct SamTop Topology[LINKS_PER_UNIT];
} S6;
} U1;
};
struct PktCmd_M {
union {
struct {
struct {
u8 PcCommand;
union {
u8 PcPhbNum;
u8 PcLinkNum;
u8 PcIDNum;
} U0;
} CmdHdr;
struct {
u16 NumPackets;
u16 LoadBase;
u16 CodeSize;
} PcBootSequence;
} S1;
struct {
u16 PcSequence;
u8 PcBootData[RTA_BOOT_DATA_SIZE];
} S2;
struct {
u16 __crud__;
u8 PcUniqNum[4]; /* this is really a uint. */
u8 PcModuleTypes; /* what modules are fitted */
} S3;
struct {
u16 __cmd_hdr__;
u8 __undefined__;
u8 PcModemStatus;
u8 PcPortStatus;
u8 PcSubCommand;
u16 PcSubAddr;
u8 PcSubData[64];
} S4;
struct {
u16 __cmd_hdr__;
u8 PcCommandText[1];
u8 __crud__[20];
u8 PcIDNum2; /* Tacked on end */
} S5;
struct {
u16 __cmd_hdr__;
struct Top Topology[LINKS_PER_UNIT];
} S6;
} U1;
};
#define Command U1.S1.CmdHdr.PcCommand
#define PhbNum U1.S1.CmdHdr.U0.PcPhbNum
#define IDNum U1.S1.CmdHdr.U0.PcIDNum
#define IDNum2 U1.S5.PcIDNum2
#define LinkNum U1.S1.CmdHdr.U0.PcLinkNum
#define Sequence U1.S2.PcSequence
#define BootData U1.S2.PcBootData
#define BootSequence U1.S1.PcBootSequence
#define UniqNum U1.S3.PcUniqNum
#define ModemStatus U1.S4.PcModemStatus
#define PortStatus U1.S4.PcPortStatus
#define SubCommand U1.S4.PcSubCommand
#define SubAddr U1.S4.PcSubAddr
#define SubData U1.S4.PcSubData
#define CommandText U1.S5.PcCommandText
#define RouteTopology U1.S6.Topology
#define ModuleTypes U1.S3.PcModuleTypes
#endif
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : daemon.h
** SID : 1.3
** Last Modified : 11/6/98 11:34:09
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)daemon.h 1.3
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_daemon_h__
#define __rio_daemon_h__
/*
** structures used on /dev/rio
*/
struct Error {
unsigned int Error;
unsigned int Entry;
unsigned int Other;
};
struct DownLoad {
char __user *DataP;
unsigned int Count;
unsigned int ProductCode;
};
/*
** A few constants....
*/
#ifndef MAX_VERSION_LEN
#define MAX_VERSION_LEN 256
#endif
#ifndef MAX_XP_CTRL_LEN
#define MAX_XP_CTRL_LEN 16 /* ALSO IN PORT.H */
#endif
struct PortSetup {
unsigned int From; /* Set/Clear XP & IXANY Control from this port.... */
unsigned int To; /* .... to this port */
unsigned int XpCps; /* at this speed */
char XpOn[MAX_XP_CTRL_LEN]; /* this is the start string */
char XpOff[MAX_XP_CTRL_LEN]; /* this is the stop string */
u8 IxAny; /* enable/disable IXANY */
u8 IxOn; /* enable/disable IXON */
u8 Lock; /* lock port params */
u8 Store; /* store params across closes */
u8 Drain; /* close only when drained */
};
struct LpbReq {
unsigned int Host;
unsigned int Link;
struct LPB __user *LpbP;
};
struct RupReq {
unsigned int HostNum;
unsigned int RupNum;
struct RUP __user *RupP;
};
struct PortReq {
unsigned int SysPort;
struct Port __user *PortP;
};
struct StreamInfo {
unsigned int SysPort;
int RQueue;
int WQueue;
};
struct HostReq {
unsigned int HostNum;
struct Host __user *HostP;
};
struct HostDpRam {
unsigned int HostNum;
struct DpRam __user *DpRamP;
};
struct DebugCtrl {
unsigned int SysPort;
unsigned int Debug;
unsigned int Wait;
};
struct MapInfo {
unsigned int FirstPort; /* 8 ports, starting from this (tty) number */
unsigned int RtaUnique; /* reside on this RTA (unique number) */
};
struct MapIn {
unsigned int NumEntries; /* How many port sets are we mapping? */
struct MapInfo *MapInfoP; /* Pointer to (user space) info */
};
struct SendPack {
unsigned int PortNum;
unsigned char Len;
unsigned char Data[PKT_MAX_DATA_LEN];
};
struct SpecialRupCmd {
struct PKT Packet;
unsigned short Host;
unsigned short RupNum;
};
struct IdentifyRta {
unsigned long RtaUnique;
u8 ID;
};
struct KillNeighbour {
unsigned long UniqueNum;
u8 Link;
};
struct rioVersion {
char version[MAX_VERSION_LEN];
char relid[MAX_VERSION_LEN];
int buildLevel;
char buildDate[MAX_VERSION_LEN];
};
/*
** RIOC commands are for the daemon type operations
**
** 09.12.1998 ARG - ESIL 0776 part fix
** Definition for 'RIOC' also appears in rioioctl.h, so we'd better do a
** #ifndef here first.
** rioioctl.h also now has #define 'RIO_QUICK_CHECK' as this ioctl is now
** allowed to be used by customers.
*/
#ifndef RIOC
#define RIOC ('R'<<8)|('i'<<16)|('o'<<24)
#endif
/*
** Boot stuff
*/
#define RIO_GET_TABLE (RIOC | 100)
#define RIO_PUT_TABLE (RIOC | 101)
#define RIO_ASSIGN_RTA (RIOC | 102)
#define RIO_DELETE_RTA (RIOC | 103)
#define RIO_HOST_FOAD (RIOC | 104)
#define RIO_QUICK_CHECK (RIOC | 105)
#define RIO_SIGNALS_ON (RIOC | 106)
#define RIO_SIGNALS_OFF (RIOC | 107)
#define RIO_CHANGE_NAME (RIOC | 108)
#define RIO_DOWNLOAD (RIOC | 109)
#define RIO_GET_LOG (RIOC | 110)
#define RIO_SETUP_PORTS (RIOC | 111)
#define RIO_ALL_MODEM (RIOC | 112)
/*
** card state, debug stuff
*/
#define RIO_NUM_HOSTS (RIOC | 120)
#define RIO_HOST_LPB (RIOC | 121)
#define RIO_HOST_RUP (RIOC | 122)
#define RIO_HOST_PORT (RIOC | 123)
#define RIO_PARMS (RIOC | 124)
#define RIO_HOST_REQ (RIOC | 125)
#define RIO_READ_CONFIG (RIOC | 126)
#define RIO_SET_CONFIG (RIOC | 127)
#define RIO_VERSID (RIOC | 128)
#define RIO_FLAGS (RIOC | 129)
#define RIO_SETDEBUG (RIOC | 130)
#define RIO_GETDEBUG (RIOC | 131)
#define RIO_READ_LEVELS (RIOC | 132)
#define RIO_SET_FAST_BUS (RIOC | 133)
#define RIO_SET_SLOW_BUS (RIOC | 134)
#define RIO_SET_BYTE_MODE (RIOC | 135)
#define RIO_SET_WORD_MODE (RIOC | 136)
#define RIO_STREAM_INFO (RIOC | 137)
#define RIO_START_POLLER (RIOC | 138)
#define RIO_STOP_POLLER (RIOC | 139)
#define RIO_LAST_ERROR (RIOC | 140)
#define RIO_TICK (RIOC | 141)
#define RIO_TOCK (RIOC | 241) /* I did this on purpose, you know. */
#define RIO_SEND_PACKET (RIOC | 142)
#define RIO_SET_BUSY (RIOC | 143)
#define SPECIAL_RUP_CMD (RIOC | 144)
#define RIO_FOAD_RTA (RIOC | 145)
#define RIO_ZOMBIE_RTA (RIOC | 146)
#define RIO_IDENTIFY_RTA (RIOC | 147)
#define RIO_KILL_NEIGHBOUR (RIOC | 148)
#define RIO_DEBUG_MEM (RIOC | 149)
/*
** 150 - 167 used..... See below
*/
#define RIO_GET_PORT_SETUP (RIOC | 168)
#define RIO_RESUME (RIOC | 169)
#define RIO_MESG (RIOC | 170)
#define RIO_NO_MESG (RIOC | 171)
#define RIO_WHAT_MESG (RIOC | 172)
#define RIO_HOST_DPRAM (RIOC | 173)
#define RIO_MAP_B50_TO_50 (RIOC | 174)
#define RIO_MAP_B50_TO_57600 (RIOC | 175)
#define RIO_MAP_B110_TO_110 (RIOC | 176)
#define RIO_MAP_B110_TO_115200 (RIOC | 177)
#define RIO_GET_PORT_PARAMS (RIOC | 178)
#define RIO_SET_PORT_PARAMS (RIOC | 179)
#define RIO_GET_PORT_TTY (RIOC | 180)
#define RIO_SET_PORT_TTY (RIOC | 181)
#define RIO_SYSLOG_ONLY (RIOC | 182)
#define RIO_SYSLOG_CONS (RIOC | 183)
#define RIO_CONS_ONLY (RIOC | 184)
#define RIO_BLOCK_OPENS (RIOC | 185)
/*
** 02.03.1999 ARG - ESIL 0820 fix :
** RIOBootMode is no longer use by the driver, so these ioctls
** are now obsolete :
**
#define RIO_GET_BOOT_MODE (RIOC | 186)
#define RIO_SET_BOOT_MODE (RIOC | 187)
**
*/
#define RIO_MEM_DUMP (RIOC | 189)
#define RIO_READ_REGISTER (RIOC | 190)
#define RIO_GET_MODTYPE (RIOC | 191)
#define RIO_SET_TIMER (RIOC | 192)
#define RIO_READ_CHECK (RIOC | 196)
#define RIO_WAITING_FOR_RESTART (RIOC | 197)
#define RIO_BIND_RTA (RIOC | 198)
#define RIO_GET_BINDINGS (RIOC | 199)
#define RIO_PUT_BINDINGS (RIOC | 200)
#define RIO_MAKE_DEV (RIOC | 201)
#define RIO_MINOR (RIOC | 202)
#define RIO_IDENTIFY_DRIVER (RIOC | 203)
#define RIO_DISPLAY_HOST_CFG (RIOC | 204)
/*
** MAKE_DEV / MINOR stuff
*/
#define RIO_DEV_DIRECT 0x0000
#define RIO_DEV_MODEM 0x0200
#define RIO_DEV_XPRINT 0x0400
#define RIO_DEV_MASK 0x0600
/*
** port management, xprint stuff
*/
#define rIOCN(N) (RIOC|(N))
#define rIOCR(N,T) (RIOC|(N))
#define rIOCW(N,T) (RIOC|(N))
#define RIO_GET_XP_ON rIOCR(150,char[16]) /* start xprint string */
#define RIO_SET_XP_ON rIOCW(151,char[16])
#define RIO_GET_XP_OFF rIOCR(152,char[16]) /* finish xprint string */
#define RIO_SET_XP_OFF rIOCW(153,char[16])
#define RIO_GET_XP_CPS rIOCR(154,int) /* xprint CPS */
#define RIO_SET_XP_CPS rIOCW(155,int)
#define RIO_GET_IXANY rIOCR(156,int) /* ixany allowed? */
#define RIO_SET_IXANY rIOCW(157,int)
#define RIO_SET_IXANY_ON rIOCN(158) /* allow ixany */
#define RIO_SET_IXANY_OFF rIOCN(159) /* disallow ixany */
#define RIO_GET_MODEM rIOCR(160,int) /* port is modem/direct line? */
#define RIO_SET_MODEM rIOCW(161,int)
#define RIO_SET_MODEM_ON rIOCN(162) /* port is a modem */
#define RIO_SET_MODEM_OFF rIOCN(163) /* port is direct */
#define RIO_GET_IXON rIOCR(164,int) /* ixon allowed? */
#define RIO_SET_IXON rIOCW(165,int)
#define RIO_SET_IXON_ON rIOCN(166) /* allow ixon */
#define RIO_SET_IXON_OFF rIOCN(167) /* disallow ixon */
#define RIO_GET_SIVIEW ((('s')<<8) | 106) /* backwards compatible with SI */
#define RIO_IOCTL_UNKNOWN -2
#endif
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : errors.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:10
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)errors.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_errors_h__
#define __rio_errors_h__
/*
** error codes
*/
#define NOTHING_WRONG_AT_ALL 0
#define BAD_CHARACTER_IN_NAME 1
#define TABLE_ENTRY_ISNT_PROPERLY_NULL 2
#define UNKNOWN_HOST_NUMBER 3
#define ZERO_RTA_ID 4
#define BAD_RTA_ID 5
#define DUPLICATED_RTA_ID 6
#define DUPLICATE_UNIQUE_NUMBER 7
#define BAD_TTY_NUMBER 8
#define TTY_NUMBER_IN_USE 9
#define NAME_USED_TWICE 10
#define HOST_ID_NOT_ZERO 11
#define BOOT_IN_PROGRESS 12
#define COPYIN_FAILED 13
#define HOST_FILE_TOO_LARGE 14
#define COPYOUT_FAILED 15
#define NOT_SUPER_USER 16
#define RIO_ALREADY_POLLING 17
#define ID_NUMBER_OUT_OF_RANGE 18
#define PORT_NUMBER_OUT_OF_RANGE 19
#define HOST_NUMBER_OUT_OF_RANGE 20
#define RUP_NUMBER_OUT_OF_RANGE 21
#define TTY_NUMBER_OUT_OF_RANGE 22
#define LINK_NUMBER_OUT_OF_RANGE 23
#define HOST_NOT_RUNNING 24
#define IOCTL_COMMAND_UNKNOWN 25
#define RIO_SYSTEM_HALTED 26
#define WAIT_FOR_DRAIN_BROKEN 27
#define PORT_NOT_MAPPED_INTO_SYSTEM 28
#define EXCLUSIVE_USE_SET 29
#define WAIT_FOR_NOT_CLOSING_BROKEN 30
#define WAIT_FOR_PORT_TO_OPEN_BROKEN 31
#define WAIT_FOR_CARRIER_BROKEN 32
#define WAIT_FOR_NOT_IN_USE_BROKEN 33
#define WAIT_FOR_CAN_ADD_COMMAND_BROKEN 34
#define WAIT_FOR_ADD_COMMAND_BROKEN 35
#define WAIT_FOR_NOT_PARAM_BROKEN 36
#define WAIT_FOR_RETRY_BROKEN 37
#define HOST_HAS_ALREADY_BEEN_BOOTED 38
#define UNIT_IS_IN_USE 39
#define COULDNT_FIND_ENTRY 40
#define RTA_UNIQUE_NUMBER_ZERO 41
#define CLOSE_COMMAND_FAILED 42
#define WAIT_FOR_CLOSE_BROKEN 43
#define CPS_VALUE_OUT_OF_RANGE 44
#define ID_ALREADY_IN_USE 45
#define SIGNALS_ALREADY_SET 46
#define NOT_RECEIVING_PROCESS 47
#define RTA_NUMBER_WRONG 48
#define NO_SUCH_PRODUCT 49
#define HOST_SYSPORT_BAD 50
#define ID_NOT_TENTATIVE 51
#define XPRINT_CPS_OUT_OF_RANGE 52
#define NOT_ENOUGH_CORE_FOR_PCI_COPY 53
#endif /* __rio_errors_h__ */
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : func.h
** SID : 1.3
** Last Modified : 11/6/98 11:34:10
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)func.h 1.3
**
** -----------------------------------------------------------------------------
*/
#ifndef __func_h_def
#define __func_h_def
#include <linux/kdev_t.h>
/* rioboot.c */
int RIOBootCodeRTA(struct rio_info *, struct DownLoad *);
int RIOBootCodeHOST(struct rio_info *, struct DownLoad *);
int RIOBootCodeUNKNOWN(struct rio_info *, struct DownLoad *);
void msec_timeout(struct Host *);
int RIOBootRup(struct rio_info *, unsigned int, struct Host *, struct PKT __iomem *);
int RIOBootOk(struct rio_info *, struct Host *, unsigned long);
int RIORtaBound(struct rio_info *, unsigned int);
void rio_fill_host_slot(int, int, unsigned int, struct Host *);
/* riocmd.c */
int RIOFoadRta(struct Host *, struct Map *);
int RIOZombieRta(struct Host *, struct Map *);
int RIOCommandRta(struct rio_info *, unsigned long, int (*func) (struct Host *, struct Map *));
int RIOIdentifyRta(struct rio_info *, void __user *);
int RIOKillNeighbour(struct rio_info *, void __user *);
int RIOSuspendBootRta(struct Host *, int, int);
int RIOFoadWakeup(struct rio_info *);
struct CmdBlk *RIOGetCmdBlk(void);
void RIOFreeCmdBlk(struct CmdBlk *);
int RIOQueueCmdBlk(struct Host *, unsigned int, struct CmdBlk *);
void RIOPollHostCommands(struct rio_info *, struct Host *);
int RIOWFlushMark(unsigned long, struct CmdBlk *);
int RIORFlushEnable(unsigned long, struct CmdBlk *);
int RIOUnUse(unsigned long, struct CmdBlk *);
/* rioctrl.c */
int riocontrol(struct rio_info *, dev_t, int, unsigned long, int);
int RIOPreemptiveCmd(struct rio_info *, struct Port *, unsigned char);
/* rioinit.c */
void rioinit(struct rio_info *, struct RioHostInfo *);
void RIOInitHosts(struct rio_info *, struct RioHostInfo *);
void RIOISAinit(struct rio_info *, int);
int RIODoAT(struct rio_info *, int, int);
caddr_t RIOCheckForATCard(int);
int RIOAssignAT(struct rio_info *, int, void __iomem *, int);
int RIOBoardTest(unsigned long, void __iomem *, unsigned char, int);
void RIOAllocDataStructs(struct rio_info *);
void RIOSetupDataStructs(struct rio_info *);
int RIODefaultName(struct rio_info *, struct Host *, unsigned int);
struct rioVersion *RIOVersid(void);
void RIOHostReset(unsigned int, struct DpRam __iomem *, unsigned int);
/* riointr.c */
void RIOTxEnable(char *);
void RIOServiceHost(struct rio_info *, struct Host *);
int riotproc(struct rio_info *, struct ttystatics *, int, int);
/* rioparam.c */
int RIOParam(struct Port *, int, int, int);
int RIODelay(struct Port *PortP, int);
int RIODelay_ni(struct Port *PortP, int);
void ms_timeout(struct Port *);
int can_add_transmit(struct PKT __iomem **, struct Port *);
void add_transmit(struct Port *);
void put_free_end(struct Host *, struct PKT __iomem *);
int can_remove_receive(struct PKT __iomem **, struct Port *);
void remove_receive(struct Port *);
/* rioroute.c */
int RIORouteRup(struct rio_info *, unsigned int, struct Host *, struct PKT __iomem *);
void RIOFixPhbs(struct rio_info *, struct Host *, unsigned int);
unsigned int GetUnitType(unsigned int);
int RIOSetChange(struct rio_info *);
int RIOFindFreeID(struct rio_info *, struct Host *, unsigned int *, unsigned int *);
/* riotty.c */
int riotopen(struct tty_struct *tty, struct file *filp);
int riotclose(void *ptr);
int riotioctl(struct rio_info *, struct tty_struct *, int, caddr_t);
void ttyseth(struct Port *, struct ttystatics *, struct old_sgttyb *sg);
/* riotable.c */
int RIONewTable(struct rio_info *);
int RIOApel(struct rio_info *);
int RIODeleteRta(struct rio_info *, struct Map *);
int RIOAssignRta(struct rio_info *, struct Map *);
int RIOReMapPorts(struct rio_info *, struct Host *, struct Map *);
int RIOChangeName(struct rio_info *, struct Map *);
#if 0
/* riodrvr.c */
struct rio_info *rio_install(struct RioHostInfo *);
int rio_uninstall(struct rio_info *);
int rio_open(struct rio_info *, int, struct file *);
int rio_close(struct rio_info *, struct file *);
int rio_read(struct rio_info *, struct file *, char *, int);
int rio_write(struct rio_info *, struct file *f, char *, int);
int rio_ioctl(struct rio_info *, struct file *, int, char *);
int rio_select(struct rio_info *, struct file *f, int, struct sel *);
int rio_intr(char *);
int rio_isr_thread(char *);
struct rio_info *rio_info_store(int cmd, struct rio_info *p);
#endif
extern void rio_copy_to_card(void *from, void __iomem *to, int len);
extern int rio_minor(struct tty_struct *tty);
extern int rio_ismodem(struct tty_struct *tty);
extern void rio_start_card_running(struct Host *HostP);
#endif /* __func_h_def */
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : host.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:10
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)host.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_host_h__
#define __rio_host_h__
/*
** the host structure - one per host card in the system.
*/
#define MAX_EXTRA_UNITS 64
/*
** Host data structure. This is used for the software equiv. of
** the host.
*/
struct Host {
struct pci_dev *pdev;
unsigned char Type; /* RIO_EISA, RIO_MCA, ... */
unsigned char Ivec; /* POLLED or ivec number */
unsigned char Mode; /* Control stuff */
unsigned char Slot; /* Slot */
void __iomem *Caddr; /* KV address of DPRAM */
struct DpRam __iomem *CardP; /* KV address of DPRAM, with overlay */
unsigned long PaddrP; /* Phys. address of DPRAM */
char Name[MAX_NAME_LEN]; /* The name of the host */
unsigned int UniqueNum; /* host unique number */
spinlock_t HostLock; /* Lock structure for MPX */
unsigned int WorkToBeDone; /* set to true each interrupt */
unsigned int InIntr; /* Being serviced? */
unsigned int IntSrvDone; /* host's interrupt has been serviced */
void (*Copy) (void *, void __iomem *, int); /* copy func */
struct timer_list timer;
/*
** I M P O R T A N T !
**
** The rest of this data structure is cleared to zero after
** a RIO_HOST_FOAD command.
*/
unsigned long Flags; /* Whats going down */
#define RC_WAITING 0
#define RC_STARTUP 1
#define RC_RUNNING 2
#define RC_STUFFED 3
#define RC_READY 7
#define RUN_STATE 7
/*
** Boot mode applies to the way in which hosts in this system will
** boot RTAs
*/
#define RC_BOOT_ALL 0x8 /* Boot all RTAs attached */
#define RC_BOOT_OWN 0x10 /* Only boot RTAs bound to this system */
#define RC_BOOT_NONE 0x20 /* Don't boot any RTAs (slave mode) */
struct Top Topology[LINKS_PER_UNIT]; /* one per link */
struct Map Mapping[MAX_RUP]; /* Mappings for host */
struct PHB __iomem *PhbP; /* Pointer to the PHB array */
unsigned short __iomem *PhbNumP; /* Ptr to Number of PHB's */
struct LPB __iomem *LinkStrP; /* Link Structure Array */
struct RUP __iomem *RupP; /* Sixteen real rups here */
struct PARM_MAP __iomem *ParmMapP; /* points to the parmmap */
unsigned int ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */
unsigned int NumExtraBooted; /* how many of the above */
/*
** Twenty logical rups.
** The first sixteen are the real Rup entries (above), the last four
** are the link RUPs.
*/
struct UnixRup UnixRups[MAX_RUP + LINKS_PER_UNIT];
int timeout_id; /* For calling 100 ms delays */
int timeout_sem; /* For calling 100 ms delays */
unsigned long locks; /* long req'd for set_bit --RR */
char ____end_marker____;
};
#define Control CardP->DpControl
#define SetInt CardP->DpSetInt
#define ResetTpu CardP->DpResetTpu
#define ResetInt CardP->DpResetInt
#define Signature CardP->DpSignature
#define Sram1 CardP->DpSram1
#define Sram2 CardP->DpSram2
#define Sram3 CardP->DpSram3
#define Scratch CardP->DpScratch
#define __ParmMapR CardP->DpParmMapR
#define SLX CardP->DpSlx
#define Revision CardP->DpRevision
#define Unique CardP->DpUnique
#define Year CardP->DpYear
#define Week CardP->DpWeek
#define RIO_DUMBPARM 0x0860 /* what not to expect */
#endif
/****************************************************************************
******* *******
******* L I N K
******* *******
****************************************************************************
Author : Ian Nandhra / Jeremy Rolls
Date :
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
***************************************************************************/
#ifndef _link_h
#define _link_h 1
/*************************************************
* Define the Link Status stuff
************************************************/
/* Boot request stuff */
#define BOOT_REQUEST ((ushort) 0) /* Request for a boot */
#define BOOT_ABORT ((ushort) 1) /* Abort a boot */
#define BOOT_SEQUENCE ((ushort) 2) /* Packet with the number of packets
and load address */
#define BOOT_COMPLETED ((ushort) 3) /* Boot completed */
struct LPB {
u16 link_number; /* Link Number */
u16 in_ch; /* Link In Channel */
u16 out_ch; /* Link Out Channel */
u8 attached_serial[4]; /* Attached serial number */
u8 attached_host_serial[4];
/* Serial number of Host who
booted the other end */
u16 descheduled; /* Currently Descheduled */
u16 state; /* Current state */
u16 send_poll; /* Send a Poll Packet */
u16 ltt_p; /* Process Descriptor */
u16 lrt_p; /* Process Descriptor */
u16 lrt_status; /* Current lrt status */
u16 ltt_status; /* Current ltt status */
u16 timeout; /* Timeout value */
u16 topology; /* Topology bits */
u16 mon_ltt;
u16 mon_lrt;
u16 WaitNoBoot; /* Secs to hold off booting */
u16 add_packet_list; /* Add packets to here */
u16 remove_packet_list; /* Send packets from here */
u16 lrt_fail_chan; /* Lrt's failure channel */
u16 ltt_fail_chan; /* Ltt's failure channel */
/* RUP structure for HOST to driver communications */
struct RUP rup;
struct RUP link_rup; /* RUP for the link (POLL,
topology etc.) */
u16 attached_link; /* Number of attached link */
u16 csum_errors; /* csum errors */
u16 num_disconnects; /* number of disconnects */
u16 num_sync_rcvd; /* # sync's received */
u16 num_sync_rqst; /* # sync requests */
u16 num_tx; /* Num pkts sent */
u16 num_rx; /* Num pkts received */
u16 module_attached; /* Module tpyes of attached */
u16 led_timeout; /* LED timeout */
u16 first_port; /* First port to service */
u16 last_port; /* Last port to service */
};
#endif
/*********** end of file ***********/
/*
* (C) 2000 R.E.Wolff@BitWizard.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/interrupt.h>
#define DEBUG_ALL
struct ttystatics {
struct termios tm;
};
extern int rio_debug;
#define RIO_DEBUG_INIT 0x000001
#define RIO_DEBUG_BOOT 0x000002
#define RIO_DEBUG_CMD 0x000004
#define RIO_DEBUG_CTRL 0x000008
#define RIO_DEBUG_INTR 0x000010
#define RIO_DEBUG_PARAM 0x000020
#define RIO_DEBUG_ROUTE 0x000040
#define RIO_DEBUG_TABLE 0x000080
#define RIO_DEBUG_TTY 0x000100
#define RIO_DEBUG_FLOW 0x000200
#define RIO_DEBUG_MODEMSIGNALS 0x000400
#define RIO_DEBUG_PROBE 0x000800
#define RIO_DEBUG_CLEANUP 0x001000
#define RIO_DEBUG_IFLOW 0x002000
#define RIO_DEBUG_PFE 0x004000
#define RIO_DEBUG_REC 0x008000
#define RIO_DEBUG_SPINLOCK 0x010000
#define RIO_DEBUG_DELAY 0x020000
#define RIO_DEBUG_MOD_COUNT 0x040000
/* Copied over from riowinif.h . This is ugly. The winif file declares
also much other stuff which is incompatible with the headers from
the older driver. The older driver includes "brates.h" which shadows
the definitions from Linux, and is incompatible... */
/* RxBaud and TxBaud definitions... */
#define RIO_B0 0x00 /* RTS / DTR signals dropped */
#define RIO_B50 0x01 /* 50 baud */
#define RIO_B75 0x02 /* 75 baud */
#define RIO_B110 0x03 /* 110 baud */
#define RIO_B134 0x04 /* 134.5 baud */
#define RIO_B150 0x05 /* 150 baud */
#define RIO_B200 0x06 /* 200 baud */
#define RIO_B300 0x07 /* 300 baud */
#define RIO_B600 0x08 /* 600 baud */
#define RIO_B1200 0x09 /* 1200 baud */
#define RIO_B1800 0x0A /* 1800 baud */
#define RIO_B2400 0x0B /* 2400 baud */
#define RIO_B4800 0x0C /* 4800 baud */
#define RIO_B9600 0x0D /* 9600 baud */
#define RIO_B19200 0x0E /* 19200 baud */
#define RIO_B38400 0x0F /* 38400 baud */
#define RIO_B56000 0x10 /* 56000 baud */
#define RIO_B57600 0x11 /* 57600 baud */
#define RIO_B64000 0x12 /* 64000 baud */
#define RIO_B115200 0x13 /* 115200 baud */
#define RIO_B2000 0x14 /* 2000 baud */
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : map.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:11
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)map.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_map_h__
#define __rio_map_h__
/*
** mapping structure passed to and from the config.rio program to
** determine the current topology of the world
*/
#define MAX_MAP_ENTRY 17
#define TOTAL_MAP_ENTRIES (MAX_MAP_ENTRY*RIO_SLOTS)
#define MAX_NAME_LEN 32
struct Map {
unsigned int HostUniqueNum; /* Supporting hosts unique number */
unsigned int RtaUniqueNum; /* Unique number */
/*
** The next two IDs must be swapped on big-endian architectures
** when using a v2.04 /etc/rio/config with a v3.00 driver (when
** upgrading for example).
*/
unsigned short ID; /* ID used in the subnet */
unsigned short ID2; /* ID of 2nd block of 8 for 16 port */
unsigned long Flags; /* Booted, ID Given, Disconnected */
unsigned long SysPort; /* First tty mapped to this port */
struct Top Topology[LINKS_PER_UNIT]; /* ID connected to each link */
char Name[MAX_NAME_LEN]; /* Cute name by which RTA is known */
};
/*
** Flag values:
*/
#define RTA_BOOTED 0x00000001
#define RTA_NEWBOOT 0x00000010
#define MSG_DONE 0x00000020
#define RTA_INTERCONNECT 0x00000040
#define RTA16_SECOND_SLOT 0x00000080
#define BEEN_HERE 0x00000100
#define SLOT_TENTATIVE 0x40000000
#define SLOT_IN_USE 0x80000000
/*
** HostUniqueNum is the unique number from the host card that this RTA
** is to be connected to.
** RtaUniqueNum is the unique number of the RTA concerned. It will be ZERO
** if the slot in the table is unused. If it is the same as the HostUniqueNum
** then this slot represents a host card.
** Flags contains current boot/route state info
** SysPort is a value in the range 0-504, being the number of the first tty
** on this RTA. Each RTA supports 8 ports. The SysPort value must be modulo 8.
** SysPort 0-127 correspond to /dev/ttyr001 to /dev/ttyr128, with minor
** numbers 0-127. SysPort 128-255 correspond to /dev/ttyr129 to /dev/ttyr256,
** again with minor numbers 0-127, and so on for SysPorts 256-383 and 384-511
** ID will be in the range 0-16 for a `known' RTA. ID will be 0xFFFF for an
** unused slot/unknown ID etc.
** The Topology array contains the ID of the unit connected to each of the
** four links on this unit. The entry will be 0xFFFF if NOTHING is connected
** to the link, or will be 0xFF00 if an UNKNOWN unit is connected to the link.
** The Name field is a null-terminated string, up to 31 characters, containing
** the 'cute' name that the sysadmin/users know the RTA by. It is permissible
** for this string to contain any character in the range \040 to \176 inclusive.
** In particular, ctrl sequences and DEL (0x7F, \177) are not allowed. The
** special character '%' IS allowable, and needs no special action.
**
*/
#endif
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : param.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:12
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)param.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_param_h__
#define __rio_param_h__
/*
** the param command block, as used in OPEN and PARAM calls.
*/
struct phb_param {
u8 Cmd; /* It is very important that these line up */
u8 Cor1; /* with what is expected at the other end. */
u8 Cor2; /* to confirm that you've got it right, */
u8 Cor4; /* check with cirrus/cirrus.h */
u8 Cor5;
u8 TxXon; /* Transmit X-On character */
u8 TxXoff; /* Transmit X-Off character */
u8 RxXon; /* Receive X-On character */
u8 RxXoff; /* Receive X-Off character */
u8 LNext; /* Literal-next character */
u8 TxBaud; /* Transmit baudrate */
u8 RxBaud; /* Receive baudrate */
};
#endif
/****************************************************************************
******* *******
******* H O S T M E M O R Y M A P
******* *******
****************************************************************************
Author : Ian Nandhra / Jeremy Rolls
Date :
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
6/4/1991 jonb Made changes to accommodate Mips R3230 bus
***************************************************************************/
#ifndef _parmap_h
#define _parmap_h
typedef struct PARM_MAP PARM_MAP;
struct PARM_MAP {
u16 phb_ptr; /* Pointer to the PHB array */
u16 phb_num_ptr; /* Ptr to Number of PHB's */
u16 free_list; /* Free List pointer */
u16 free_list_end; /* Free List End pointer */
u16 q_free_list_ptr; /* Ptr to Q_BUF variable */
u16 unit_id_ptr; /* Unit Id */
u16 link_str_ptr; /* Link Structure Array */
u16 bootloader_1; /* 1st Stage Boot Loader */
u16 bootloader_2; /* 2nd Stage Boot Loader */
u16 port_route_map_ptr; /* Port Route Map */
u16 route_ptr; /* Unit Route Map */
u16 map_present; /* Route Map present */
s16 pkt_num; /* Total number of packets */
s16 q_num; /* Total number of Q packets */
u16 buffers_per_port; /* Number of buffers per port */
u16 heap_size; /* Initial size of heap */
u16 heap_left; /* Current Heap left */
u16 error; /* Error code */
u16 tx_max; /* Max number of tx pkts per phb */
u16 rx_max; /* Max number of rx pkts per phb */
u16 rx_limit; /* For high / low watermarks */
s16 links; /* Links to use */
s16 timer; /* Interrupts per second */
u16 rups; /* Pointer to the RUPs */
u16 max_phb; /* Mostly for debugging */
u16 living; /* Just increments!! */
u16 init_done; /* Initialisation over */
u16 booting_link;
u16 idle_count; /* Idle time counter */
u16 busy_count; /* Busy counter */
u16 idle_control; /* Control Idle Process */
u16 tx_intr; /* TX interrupt pending */
u16 rx_intr; /* RX interrupt pending */
u16 rup_intr; /* RUP interrupt pending */
};
#endif
/*********** end of file ***********/
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : pci.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:12
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)pci.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_pci_h__
#define __rio_pci_h__
/*
** PCI stuff
*/
#define PCITpFastClock 0x80
#define PCITpSlowClock 0x00
#define PCITpFastLinks 0x40
#define PCITpSlowLinks 0x00
#define PCITpIntEnable 0x04
#define PCITpIntDisable 0x00
#define PCITpBusEnable 0x02
#define PCITpBusDisable 0x00
#define PCITpBootFromRam 0x01
#define PCITpBootFromLink 0x00
#define RIO_PCI_VENDOR 0x11CB
#define RIO_PCI_DEVICE 0x8000
#define RIO_PCI_BASE_CLASS 0x02
#define RIO_PCI_SUB_CLASS 0x80
#define RIO_PCI_PROG_IFACE 0x00
#define RIO_PCI_RID 0x0008
#define RIO_PCI_BADR0 0x0010
#define RIO_PCI_INTLN 0x003C
#define RIO_PCI_INTPIN 0x003D
#define RIO_PCI_MEM_SIZE 65536
#define RIO_PCI_TURBO_TP 0x80
#define RIO_PCI_FAST_LINKS 0x40
#define RIO_PCI_INT_ENABLE 0x04
#define RIO_PCI_TP_BUS_ENABLE 0x02
#define RIO_PCI_BOOT_FROM_RAM 0x01
#define RIO_PCI_DEFAULT_MODE 0x05
#endif /* __rio_pci_h__ */
/****************************************************************************
******* *******
******* P H B H E A D E R *******
******* *******
****************************************************************************
Author : Ian Nandhra, Jeremy Rolls
Date :
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
***************************************************************************/
#ifndef _phb_h
#define _phb_h 1
/*************************************************
* Handshake asserted. Deasserted by the LTT(s)
************************************************/
#define PHB_HANDSHAKE_SET ((ushort) 0x001) /* Set by LRT */
#define PHB_HANDSHAKE_RESET ((ushort) 0x002) /* Set by ISR / driver */
#define PHB_HANDSHAKE_FLAGS (PHB_HANDSHAKE_RESET | PHB_HANDSHAKE_SET)
/* Reset by ltt */
/*************************************************
* Maximum number of PHB's
************************************************/
#define MAX_PHB ((ushort) 128) /* range 0-127 */
/*************************************************
* Defines for the mode fields
************************************************/
#define TXPKT_INCOMPLETE 0x0001 /* Previous tx packet not completed */
#define TXINTR_ENABLED 0x0002 /* Tx interrupt is enabled */
#define TX_TAB3 0x0004 /* TAB3 mode */
#define TX_OCRNL 0x0008 /* OCRNL mode */
#define TX_ONLCR 0x0010 /* ONLCR mode */
#define TX_SENDSPACES 0x0020 /* Send n spaces command needs
completing */
#define TX_SENDNULL 0x0040 /* Escaping NULL needs completing */
#define TX_SENDLF 0x0080 /* LF -> CR LF needs completing */
#define TX_PARALLELBUG 0x0100 /* CD1400 LF -> CR LF bug on parallel
port */
#define TX_HANGOVER (TX_SENDSPACES | TX_SENDLF | TX_SENDNULL)
#define TX_DTRFLOW 0x0200 /* DTR tx flow control */
#define TX_DTRFLOWED 0x0400 /* DTR is low - don't allow more data
into the FIFO */
#define TX_DATAINFIFO 0x0800 /* There is data in the FIFO */
#define TX_BUSY 0x1000 /* Data in FIFO, shift or holding regs */
#define RX_SPARE 0x0001 /* SPARE */
#define RXINTR_ENABLED 0x0002 /* Rx interrupt enabled */
#define RX_ICRNL 0x0008 /* ICRNL mode */
#define RX_INLCR 0x0010 /* INLCR mode */
#define RX_IGNCR 0x0020 /* IGNCR mode */
#define RX_CTSFLOW 0x0040 /* CTSFLOW enabled */
#define RX_IXOFF 0x0080 /* IXOFF enabled */
#define RX_CTSFLOWED 0x0100 /* CTSFLOW and CTS dropped */
#define RX_IXOFFED 0x0200 /* IXOFF and xoff sent */
#define RX_BUFFERED 0x0400 /* Try and pass on complete packets */
#define PORT_ISOPEN 0x0001 /* Port open? */
#define PORT_HUPCL 0x0002 /* Hangup on close? */
#define PORT_MOPENPEND 0x0004 /* Modem open pending */
#define PORT_ISPARALLEL 0x0008 /* Parallel port */
#define PORT_BREAK 0x0010 /* Port on break */
#define PORT_STATUSPEND 0x0020 /* Status packet pending */
#define PORT_BREAKPEND 0x0040 /* Break packet pending */
#define PORT_MODEMPEND 0x0080 /* Modem status packet pending */
#define PORT_PARALLELBUG 0x0100 /* CD1400 LF -> CR LF bug on parallel
port */
#define PORT_FULLMODEM 0x0200 /* Full modem signals */
#define PORT_RJ45 0x0400 /* RJ45 connector - no RI signal */
#define PORT_RESTRICTED 0x0600 /* Restricted connector - no RI / DTR */
#define PORT_MODEMBITS 0x0600 /* Mask for modem fields */
#define PORT_WCLOSE 0x0800 /* Waiting for close */
#define PORT_HANDSHAKEFIX 0x1000 /* Port has H/W flow control fix */
#define PORT_WASPCLOSED 0x2000 /* Port closed with PCLOSE */
#define DUMPMODE 0x4000 /* Dump RTA mem */
#define READ_REG 0x8000 /* Read CD1400 register */
/**************************************************************************
* PHB Structure
* A few words.
*
* Normally Packets are added to the end of the list and removed from
* the start. The pointer tx_add points to a SPACE to put a Packet.
* The pointer tx_remove points to the next Packet to remove
*************************************************************************/
struct PHB {
u8 source;
u8 handshake;
u8 status;
u16 timeout; /* Maximum of 1.9 seconds */
u8 link; /* Send down this link */
u8 destination;
u16 tx_start;
u16 tx_end;
u16 tx_add;
u16 tx_remove;
u16 rx_start;
u16 rx_end;
u16 rx_add;
u16 rx_remove;
};
#endif
/*********** end of file ***********/
/****************************************************************************
******* *******
******* P A C K E T H E A D E R F I L E
******* *******
****************************************************************************
Author : Ian Nandhra / Jeremy Rolls
Date :
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
***************************************************************************/
#ifndef _pkt_h
#define _pkt_h 1
#define PKT_CMD_BIT ((ushort) 0x080)
#define PKT_CMD_DATA ((ushort) 0x080)
#define PKT_ACK ((ushort) 0x040)
#define PKT_TGL ((ushort) 0x020)
#define PKT_LEN_MASK ((ushort) 0x07f)
#define DATA_WNDW ((ushort) 0x10)
#define PKT_TTL_MASK ((ushort) 0x0f)
#define PKT_MAX_DATA_LEN 72
#define PKT_LENGTH sizeof(struct PKT)
#define SYNC_PKT_LENGTH (PKT_LENGTH + 4)
#define CONTROL_PKT_LEN_MASK PKT_LEN_MASK
#define CONTROL_PKT_CMD_BIT PKT_CMD_BIT
#define CONTROL_PKT_ACK (PKT_ACK << 8)
#define CONTROL_PKT_TGL (PKT_TGL << 8)
#define CONTROL_PKT_TTL_MASK (PKT_TTL_MASK << 8)
#define CONTROL_DATA_WNDW (DATA_WNDW << 8)
struct PKT {
u8 dest_unit; /* Destination Unit Id */
u8 dest_port; /* Destination POrt */
u8 src_unit; /* Source Unit Id */
u8 src_port; /* Source POrt */
u8 len;
u8 control;
u8 data[PKT_MAX_DATA_LEN];
/* Actual data :-) */
u16 csum; /* C-SUM */
};
#endif
/*********** end of file ***********/
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : port.h
** SID : 1.3
** Last Modified : 11/6/98 11:34:12
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)port.h 1.3
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_port_h__
#define __rio_port_h__
/*
** Port data structure
*/
struct Port {
struct gs_port gs;
int PortNum; /* RIO port no., 0-511 */
struct Host *HostP;
void __iomem *Caddr;
unsigned short HostPort; /* Port number on host card */
unsigned char RupNum; /* Number of RUP for port */
unsigned char ID2; /* Second ID of RTA for port */
unsigned long State; /* FLAGS for open & xopen */
#define RIO_LOPEN 0x00001 /* Local open */
#define RIO_MOPEN 0x00002 /* Modem open */
#define RIO_WOPEN 0x00004 /* Waiting for open */
#define RIO_CLOSING 0x00008 /* The port is being close */
#define RIO_XPBUSY 0x00010 /* Transparent printer busy */
#define RIO_BREAKING 0x00020 /* Break in progress */
#define RIO_DIRECT 0x00040 /* Doing Direct output */
#define RIO_EXCLUSIVE 0x00080 /* Stream open for exclusive use */
#define RIO_NDELAY 0x00100 /* Stream is open FNDELAY */
#define RIO_CARR_ON 0x00200 /* Stream has carrier present */
#define RIO_XPWANTR 0x00400 /* Stream wanted by Xprint */
#define RIO_RBLK 0x00800 /* Stream is read-blocked */
#define RIO_BUSY 0x01000 /* Stream is BUSY for write */
#define RIO_TIMEOUT 0x02000 /* Stream timeout in progress */
#define RIO_TXSTOP 0x04000 /* Stream output is stopped */
#define RIO_WAITFLUSH 0x08000 /* Stream waiting for flush */
#define RIO_DYNOROD 0x10000 /* Drain failed */
#define RIO_DELETED 0x20000 /* RTA has been deleted */
#define RIO_ISSCANCODE 0x40000 /* This line is in scancode mode */
#define RIO_USING_EUC 0x100000 /* Using extended Unix chars */
#define RIO_CAN_COOK 0x200000 /* This line can do cooking */
#define RIO_TRIAD_MODE 0x400000 /* Enable TRIAD special ops. */
#define RIO_TRIAD_BLOCK 0x800000 /* Next read will block */
#define RIO_TRIAD_FUNC 0x1000000 /* Seen a function key coming in */
#define RIO_THROTTLE_RX 0x2000000 /* RX needs to be throttled. */
unsigned long Config; /* FLAGS for NOREAD.... */
#define RIO_NOREAD 0x0001 /* Are not allowed to read port */
#define RIO_NOWRITE 0x0002 /* Are not allowed to write port */
#define RIO_NOXPRINT 0x0004 /* Are not allowed to xprint port */
#define RIO_NOMASK 0x0007 /* All not allowed things */
#define RIO_IXANY 0x0008 /* Port is allowed ixany */
#define RIO_MODEM 0x0010 /* Stream is a modem device */
#define RIO_IXON 0x0020 /* Port is allowed ixon */
#define RIO_WAITDRAIN 0x0040 /* Wait for port to completely drain */
#define RIO_MAP_50_TO_50 0x0080 /* Map 50 baud to 50 baud */
#define RIO_MAP_110_TO_110 0x0100 /* Map 110 baud to 110 baud */
/*
** 15.10.1998 ARG - ESIL 0761 prt fix
** As LynxOS does not appear to support Hardware Flow Control .....
** Define our own flow control flags in 'Config'.
*/
#define RIO_CTSFLOW 0x0200 /* RIO's own CTSFLOW flag */
#define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */
struct PHB __iomem *PhbP; /* pointer to PHB for port */
u16 __iomem *TxAdd; /* Add packets here */
u16 __iomem *TxStart; /* Start of add array */
u16 __iomem *TxEnd; /* End of add array */
u16 __iomem *RxRemove; /* Remove packets here */
u16 __iomem *RxStart; /* Start of remove array */
u16 __iomem *RxEnd; /* End of remove array */
unsigned int RtaUniqueNum; /* Unique number of RTA */
unsigned short PortState; /* status of port */
unsigned short ModemState; /* status of modem lines */
unsigned long ModemLines; /* Modem bits sent to RTA */
unsigned char CookMode; /* who expands CR/LF? */
unsigned char ParamSem; /* Prevent write during param */
unsigned char Mapped; /* if port mapped onto host */
unsigned char SecondBlock; /* if port belongs to 2nd block
of 16 port RTA */
unsigned char InUse; /* how many pre-emptive cmds */
unsigned char Lock; /* if params locked */
unsigned char Store; /* if params stored across closes */
unsigned char FirstOpen; /* TRUE if first time port opened */
unsigned char FlushCmdBodge; /* if doing a (non)flush */
unsigned char MagicFlags; /* require intr processing */
#define MAGIC_FLUSH 0x01 /* mirror of WflushFlag */
#define MAGIC_REBOOT 0x02 /* RTA re-booted, re-open ports */
#define MORE_OUTPUT_EYGOR 0x04 /* riotproc failed to empty clists */
unsigned char WflushFlag; /* 1 How many WFLUSHs active */
/*
** Transparent print stuff
*/
struct Xprint {
#ifndef MAX_XP_CTRL_LEN
#define MAX_XP_CTRL_LEN 16 /* ALSO IN DAEMON.H */
#endif
unsigned int XpCps;
char XpOn[MAX_XP_CTRL_LEN];
char XpOff[MAX_XP_CTRL_LEN];
unsigned short XpLen; /* strlen(XpOn)+strlen(XpOff) */
unsigned char XpActive;
unsigned char XpLastTickOk; /* TRUE if we can process */
#define XP_OPEN 00001
#define XP_RUNABLE 00002
struct ttystatics *XttyP;
} Xprint;
unsigned char RxDataStart;
unsigned char Cor2Copy; /* copy of COR2 */
char *Name; /* points to the Rta's name */
char *TxRingBuffer;
unsigned short TxBufferIn; /* New data arrives here */
unsigned short TxBufferOut; /* Intr removes data here */
unsigned short OldTxBufferOut; /* Indicates if draining */
int TimeoutId; /* Timeout ID */
unsigned int Debug;
unsigned char WaitUntilBooted; /* True if open should block */
unsigned int statsGather; /* True if gathering stats */
unsigned long txchars; /* Chars transmitted */
unsigned long rxchars; /* Chars received */
unsigned long opens; /* port open count */
unsigned long closes; /* port close count */
unsigned long ioctls; /* ioctl count */
unsigned char LastRxTgl; /* Last state of rx toggle bit */
spinlock_t portSem; /* Lock using this sem */
int MonitorTstate; /* Monitoring ? */
int timeout_id; /* For calling 100 ms delays */
int timeout_sem; /* For calling 100 ms delays */
int firstOpen; /* First time open ? */
char *p; /* save the global struc here .. */
};
struct ModuleInfo {
char *Name;
unsigned int Flags[4]; /* one per port on a module */
};
/*
** This struct is required because trying to grab an entire Port structure
** runs into problems with differing struct sizes between driver and config.
*/
struct PortParams {
unsigned int Port;
unsigned long Config;
unsigned long State;
struct ttystatics *TtyP;
};
#endif
/****************************************************************************
******* *******
******* P R O T O C O L S T A T U S S T R U C T U R E *******
******* *******
****************************************************************************
Author : Ian Nandhra / Jeremy Rolls
Date :
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
***************************************************************************/
#ifndef _protsts_h
#define _protsts_h 1
/*************************************************
* ACK bit. Last Packet received OK. Set by
* rxpkt to indicate that the Packet has been
* received OK and that the LTT must set the ACK
* bit in the next outward bound Packet
* and re-set by LTT's after xmit.
*
* Gets shoved into rx_status
************************************************/
#define PHB_RX_LAST_PKT_ACKED ((ushort) 0x080)
/*******************************************************
* The Rx TOGGLE bit.
* Stuffed into rx_status by RXPKT
******************************************************/
#define PHB_RX_DATA_WNDW ((ushort) 0x040)
/*******************************************************
* The Rx TOGGLE bit. Matches the setting in PKT.H
* Stuffed into rx_status
******************************************************/
#define PHB_RX_TGL ((ushort) 0x2000)
/*************************************************
* This bit is set by the LRT to indicate that
* an ACK (packet) must be returned.
*
* Gets shoved into tx_status
************************************************/
#define PHB_TX_SEND_PKT_ACK ((ushort) 0x08)
/*************************************************
* Set by LTT to indicate that an ACK is required
*************************************************/
#define PHB_TX_ACK_RQRD ((ushort) 0x01)
/*******************************************************
* The Tx TOGGLE bit.
* Stuffed into tx_status by RXPKT from the PKT WndW
* field. Looked by the LTT when the NEXT Packet
* is going to be sent.
******************************************************/
#define PHB_TX_DATA_WNDW ((ushort) 0x04)
/*******************************************************
* The Tx TOGGLE bit. Matches the setting in PKT.H
* Stuffed into tx_status
******************************************************/
#define PHB_TX_TGL ((ushort) 0x02)
/*******************************************************
* Request intr bit. Set when the queue has gone quiet
* and the PHB has requested an interrupt.
******************************************************/
#define PHB_TX_INTR ((ushort) 0x100)
/*******************************************************
* SET if the PHB cannot send any more data down the
* Link
******************************************************/
#define PHB_TX_HANDSHAKE ((ushort) 0x010)
#define RUP_SEND_WNDW ((ushort) 0x08) ;
#endif
/*********** end of file ***********/
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 1998 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : rio.h
** SID : 1.3
** Last Modified : 11/6/98 11:34:13
** Retrieved : 11/6/98 11:34:22
**
** ident @(#)rio.h 1.3
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_rio_h__
#define __rio_rio_h__
/*
** Maximum numbers of things
*/
#define RIO_SLOTS 4 /* number of configuration slots */
#define RIO_HOSTS 4 /* number of hosts that can be found */
#define PORTS_PER_HOST 128 /* number of ports per host */
#define LINKS_PER_UNIT 4 /* number of links from a host */
#define RIO_PORTS (PORTS_PER_HOST * RIO_HOSTS) /* max. no. of ports */
#define RTAS_PER_HOST (MAX_RUP) /* number of RTAs per host */
#define PORTS_PER_RTA (PORTS_PER_HOST/RTAS_PER_HOST) /* ports on a rta */
#define PORTS_PER_MODULE 4 /* number of ports on a plug-in module */
/* number of modules on an RTA */
#define MODULES_PER_RTA (PORTS_PER_RTA/PORTS_PER_MODULE)
#define MAX_PRODUCT 16 /* numbr of different product codes */
#define MAX_MODULE_TYPES 16 /* number of different types of module */
#define RIO_CONTROL_DEV 128 /* minor number of host/control device */
#define RIO_INVALID_MAJOR 0 /* test first host card's major no for validity */
/*
** number of RTAs that can be bound to a master
*/
#define MAX_RTA_BINDINGS (MAX_RUP * RIO_HOSTS)
/*
** Unit types
*/
#define PC_RTA16 0x90000000
#define PC_RTA8 0xe0000000
#define TYPE_HOST 0
#define TYPE_RTA8 1
#define TYPE_RTA16 2
/*
** Flag values returned by functions
*/
#define RIO_FAIL -1
/*
** SysPort value for something that hasn't any ports
*/
#define NO_PORT 0xFFFFFFFF
/*
** Unit ID Of all hosts
*/
#define HOST_ID 0
/*
** Break bytes into nybles
*/
#define LONYBLE(X) ((X) & 0xF)
#define HINYBLE(X) (((X)>>4) & 0xF)
/*
** Flag values passed into some functions
*/
#define DONT_SLEEP 0
#define OK_TO_SLEEP 1
#define DONT_PRINT 1
#define DO_PRINT 0
#define PRINT_TO_LOG_CONS 0
#define PRINT_TO_CONS 1
#define PRINT_TO_LOG 2
/*
** Timeout has trouble with times of less than 3 ticks...
*/
#define MIN_TIMEOUT 3
/*
** Generally useful constants
*/
#define HUNDRED_MS ((HZ/10)?(HZ/10):1)
#define ONE_MEG 0x100000
#define SIXTY_FOUR_K 0x10000
#define RIO_AT_MEM_SIZE SIXTY_FOUR_K
#define RIO_EISA_MEM_SIZE SIXTY_FOUR_K
#define RIO_MCA_MEM_SIZE SIXTY_FOUR_K
#define COOK_WELL 0
#define COOK_MEDIUM 1
#define COOK_RAW 2
/*
** Pointer manipulation stuff
** RIO_PTR takes hostp->Caddr and the offset into the DP RAM area
** and produces a UNIX caddr_t (pointer) to the object
** RIO_OBJ takes hostp->Caddr and a UNIX pointer to an object and
** returns the offset into the DP RAM area.
*/
#define RIO_PTR(C,O) (((unsigned char __iomem *)(C))+(0xFFFF&(O)))
#define RIO_OFF(C,O) ((unsigned char __iomem *)(O)-(unsigned char __iomem *)(C))
/*
** How to convert from various different device number formats:
** DEV is a dev number, as passed to open, close etc - NOT a minor
** number!
**/
#define RIO_MODEM_MASK 0x1FF
#define RIO_MODEM_BIT 0x200
#define RIO_UNMODEM(DEV) (MINOR(DEV) & RIO_MODEM_MASK)
#define RIO_ISMODEM(DEV) (MINOR(DEV) & RIO_MODEM_BIT)
#define RIO_PORT(DEV,FIRST_MAJ) ( (MAJOR(DEV) - FIRST_MAJ) * PORTS_PER_HOST) \
+ MINOR(DEV)
#define CSUM(pkt_ptr) (((u16 *)(pkt_ptr))[0] + ((u16 *)(pkt_ptr))[1] + \
((u16 *)(pkt_ptr))[2] + ((u16 *)(pkt_ptr))[3] + \
((u16 *)(pkt_ptr))[4] + ((u16 *)(pkt_ptr))[5] + \
((u16 *)(pkt_ptr))[6] + ((u16 *)(pkt_ptr))[7] + \
((u16 *)(pkt_ptr))[8] + ((u16 *)(pkt_ptr))[9] )
#define RIO_LINK_ENABLE 0x80FF /* FF is a hack, mainly for Mips, to */
/* prevent a really stupid race condition. */
#define NOT_INITIALISED 0
#define INITIALISED 1
#define NOT_POLLING 0
#define POLLING 1
#define NOT_CHANGED 0
#define CHANGED 1
#define NOT_INUSE 0
#define DISCONNECT 0
#define CONNECT 1
/* ------ Control Codes ------ */
#define CONTROL '^'
#define IFOAD ( CONTROL + 1 )
#define IDENTIFY ( CONTROL + 2 )
#define ZOMBIE ( CONTROL + 3 )
#define UFOAD ( CONTROL + 4 )
#define IWAIT ( CONTROL + 5 )
#define IFOAD_MAGIC 0xF0AD /* of course */
#define ZOMBIE_MAGIC (~0xDEAD) /* not dead -> zombie */
#define UFOAD_MAGIC 0xD1E /* kill-your-neighbour */
#define IWAIT_MAGIC 0xB1DE /* Bide your time */
/* ------ Error Codes ------ */
#define E_NO_ERROR ((ushort) 0)
/* ------ Free Lists ------ */
struct rio_free_list {
u16 next;
u16 prev;
};
/* NULL for card side linked lists */
#define TPNULL ((ushort)(0x8000))
/* We can add another packet to a transmit queue if the packet pointer pointed
* to by the TxAdd pointer has PKT_IN_USE clear in its address. */
#define PKT_IN_USE 0x1
/* ------ Topology ------ */
struct Top {
u8 Unit;
u8 Link;
};
#endif /* __rio_h__ */
This diff is collapsed.
/*
* rio_linux.h
*
* Copyright (C) 1998,1999,2000 R.E.Wolff@BitWizard.nl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* RIO serial driver.
*
* Version 1.0 -- July, 1999.
*
*/
#define RIO_NBOARDS 4
#define RIO_PORTSPERBOARD 128
#define RIO_NPORTS (RIO_NBOARDS * RIO_PORTSPERBOARD)
#define MODEM_SUPPORT
#ifdef __KERNEL__
#define RIO_MAGIC 0x12345678
struct vpd_prom {
unsigned short id;
char hwrev;
char hwass;
int uniqid;
char myear;
char mweek;
char hw_feature[5];
char oem_id;
char identifier[16];
};
#define RIO_DEBUG_ALL 0xffffffff
#define O_OTHER(tty) \
((O_OLCUC(tty)) ||\
(O_ONLCR(tty)) ||\
(O_OCRNL(tty)) ||\
(O_ONOCR(tty)) ||\
(O_ONLRET(tty)) ||\
(O_OFILL(tty)) ||\
(O_OFDEL(tty)) ||\
(O_NLDLY(tty)) ||\
(O_CRDLY(tty)) ||\
(O_TABDLY(tty)) ||\
(O_BSDLY(tty)) ||\
(O_VTDLY(tty)) ||\
(O_FFDLY(tty)))
/* Same for input. */
#define I_OTHER(tty) \
((I_INLCR(tty)) ||\
(I_IGNCR(tty)) ||\
(I_ICRNL(tty)) ||\
(I_IUCLC(tty)) ||\
(L_ISIG(tty)))
#endif /* __KERNEL__ */
#define RIO_BOARD_INTR_LOCK 1
#ifndef RIOCTL_MISC_MINOR
/* Allow others to gather this into "major.h" or something like that */
#define RIOCTL_MISC_MINOR 169
#endif
/* Allow us to debug "in the field" without requiring clients to
recompile.... */
#if 1
#define rio_spin_lock_irqsave(sem, flags) do { \
rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlockirqsave: %p %s:%d\n", \
sem, __FILE__, __LINE__);\
spin_lock_irqsave(sem, flags);\
} while (0)
#define rio_spin_unlock_irqrestore(sem, flags) do { \
rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlockirqrestore: %p %s:%d\n",\
sem, __FILE__, __LINE__);\
spin_unlock_irqrestore(sem, flags);\
} while (0)
#define rio_spin_lock(sem) do { \
rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlock: %p %s:%d\n",\
sem, __FILE__, __LINE__);\
spin_lock(sem);\
} while (0)
#define rio_spin_unlock(sem) do { \
rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlock: %p %s:%d\n",\
sem, __FILE__, __LINE__);\
spin_unlock(sem);\
} while (0)
#else
#define rio_spin_lock_irqsave(sem, flags) \
spin_lock_irqsave(sem, flags)
#define rio_spin_unlock_irqrestore(sem, flags) \
spin_unlock_irqrestore(sem, flags)
#define rio_spin_lock(sem) \
spin_lock(sem)
#define rio_spin_unlock(sem) \
spin_unlock(sem)
#endif
#ifdef CONFIG_RIO_OLDPCI
static inline void __iomem *rio_memcpy_toio(void __iomem *dummy, void __iomem *dest, void *source, int n)
{
char __iomem *dst = dest;
char *src = source;
while (n--) {
writeb(*src++, dst++);
(void) readb(dummy);
}
return dest;
}
static inline void __iomem *rio_copy_toio(void __iomem *dest, void *source, int n)
{
char __iomem *dst = dest;
char *src = source;
while (n--)
writeb(*src++, dst++);
return dest;
}
static inline void *rio_memcpy_fromio(void *dest, void __iomem *source, int n)
{
char *dst = dest;
char __iomem *src = source;
while (n--)
*dst++ = readb(src++);
return dest;
}
#else
#define rio_memcpy_toio(dummy,dest,source,n) memcpy_toio(dest, source, n)
#define rio_copy_toio memcpy_toio
#define rio_memcpy_fromio memcpy_fromio
#endif
#define DEBUG 1
/*
This driver can spew a whole lot of debugging output at you. If you
need maximum performance, you should disable the DEBUG define. To
aid in debugging in the field, I'm leaving the compile-time debug
features enabled, and disable them "runtime". That allows me to
instruct people with problems to enable debugging without requiring
them to recompile...
*/
#ifdef DEBUG
#define rio_dprintk(f, str...) do { if (rio_debug & f) printk (str);} while (0)
#define func_enter() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s\n", __func__)
#define func_exit() rio_dprintk (RIO_DEBUG_FLOW, "rio: exit %s\n", __func__)
#define func_enter2() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s (port %d)\n",__func__, port->line)
#else
#define rio_dprintk(f, str...) /* nothing */
#define func_enter()
#define func_exit()
#define func_enter2()
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : riodrvr.h
** SID : 1.3
** Last Modified : 11/6/98 09:22:46
** Retrieved : 11/6/98 09:22:46
**
** ident @(#)riodrvr.h 1.3
**
** -----------------------------------------------------------------------------
*/
#ifndef __riodrvr_h
#define __riodrvr_h
#include <asm/param.h> /* for HZ */
#define MEMDUMP_SIZE 32
#define MOD_DISABLE (RIO_NOREAD|RIO_NOWRITE|RIO_NOXPRINT)
struct rio_info {
int mode; /* Intr or polled, word/byte */
spinlock_t RIOIntrSem; /* Interrupt thread sem */
int current_chan; /* current channel */
int RIOFailed; /* Not initialised ? */
int RIOInstallAttempts; /* no. of rio-install() calls */
int RIOLastPCISearch; /* status of last search */
int RIONumHosts; /* Number of RIO Hosts */
struct Host *RIOHosts; /* RIO Host values */
struct Port **RIOPortp; /* RIO port values */
/*
** 02.03.1999 ARG - ESIL 0820 fix
** We no longer use RIOBootMode
**
int RIOBootMode; * RIO boot mode *
**
*/
int RIOPrintDisabled; /* RIO printing disabled ? */
int RIOPrintLogState; /* RIO printing state ? */
int RIOPolling; /* Polling ? */
/*
** 09.12.1998 ARG - ESIL 0776 part fix
** The 'RIO_QUICK_CHECK' ioctl was using RIOHalted.
** The fix for this ESIL introduces another member (RIORtaDisCons) here to be
** updated in RIOConCon() - to keep track of RTA connections/disconnections.
** 'RIO_QUICK_CHECK' now returns the value of RIORtaDisCons.
*/
int RIOHalted; /* halted ? */
int RIORtaDisCons; /* RTA connections/disconnections */
unsigned int RIOReadCheck; /* Rio read check */
unsigned int RIONoMessage; /* To display message or not */
unsigned int RIONumBootPkts; /* how many packets for an RTA */
unsigned int RIOBootCount; /* size of RTA code */
unsigned int RIOBooting; /* count of outstanding boots */
unsigned int RIOSystemUp; /* Booted ?? */
unsigned int RIOCounting; /* for counting interrupts */
unsigned int RIOIntCount; /* # of intr since last check */
unsigned int RIOTxCount; /* number of xmit intrs */
unsigned int RIORxCount; /* number of rx intrs */
unsigned int RIORupCount; /* number of rup intrs */
int RIXTimer;
int RIOBufferSize; /* Buffersize */
int RIOBufferMask; /* Buffersize */
int RIOFirstMajor; /* First host card's major no */
unsigned int RIOLastPortsMapped; /* highest port number known */
unsigned int RIOFirstPortsMapped; /* lowest port number known */
unsigned int RIOLastPortsBooted; /* highest port number running */
unsigned int RIOFirstPortsBooted; /* lowest port number running */
unsigned int RIOLastPortsOpened; /* highest port number running */
unsigned int RIOFirstPortsOpened; /* lowest port number running */
/* Flag to say that the topology information has been changed. */
unsigned int RIOQuickCheck;
unsigned int CdRegister; /* ??? */
int RIOSignalProcess; /* Signalling process */
int rio_debug; /* To debug ... */
int RIODebugWait; /* For what ??? */
int tpri; /* Thread prio */
int tid; /* Thread id */
unsigned int _RIO_Polled; /* Counter for polling */
unsigned int _RIO_Interrupted; /* Counter for interrupt */
int intr_tid; /* iointset return value */
int TxEnSem; /* TxEnable Semaphore */
struct Error RIOError; /* to Identify what went wrong */
struct Conf RIOConf; /* Configuration ??? */
struct ttystatics channel[RIO_PORTS]; /* channel information */
char RIOBootPackets[1 + (SIXTY_FOUR_K / RTA_BOOT_DATA_SIZE)]
[RTA_BOOT_DATA_SIZE];
struct Map RIOConnectTable[TOTAL_MAP_ENTRIES];
struct Map RIOSavedTable[TOTAL_MAP_ENTRIES];
/* RTA to host binding table for master/slave operation */
unsigned long RIOBindTab[MAX_RTA_BINDINGS];
/* RTA memory dump variable */
unsigned char RIOMemDump[MEMDUMP_SIZE];
struct ModuleInfo RIOModuleTypes[MAX_MODULE_TYPES];
};
#ifdef linux
#define debug(x) printk x
#else
#define debug(x) kkprintf x
#endif
#define RIO_RESET_INT 0x7d80
#endif /* __riodrvr.h */
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : rioinfo.h
** SID : 1.2
** Last Modified : 11/6/98 14:07:49
** Retrieved : 11/6/98 14:07:50
**
** ident @(#)rioinfo.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rioinfo_h
#define __rioinfo_h
/*
** Host card data structure
*/
struct RioHostInfo {
long location; /* RIO Card Base I/O address */
long vector; /* RIO Card IRQ vector */
int bus; /* ISA/EISA/MCA/PCI */
int mode; /* pointer to host mode - INTERRUPT / POLLED */
struct old_sgttyb
*Sg; /* pointer to default term characteristics */
};
/* Mode in rio device info */
#define INTERRUPTED_MODE 0x01 /* Interrupt is generated */
#define POLLED_MODE 0x02 /* No interrupt */
#define AUTO_MODE 0x03 /* Auto mode */
#define WORD_ACCESS_MODE 0x10 /* Word Access Mode */
#define BYTE_ACCESS_MODE 0x20 /* Byte Access Mode */
/* Bus type that RIO supports */
#define ISA_BUS 0x01 /* The card is ISA */
#define EISA_BUS 0x02 /* The card is EISA */
#define MCA_BUS 0x04 /* The card is MCA */
#define PCI_BUS 0x08 /* The card is PCI */
/*
** 11.11.1998 ARG - ESIL ???? part fix
** Moved definition for 'CHAN' here from rioinfo.c (it is now
** called 'DEF_TERM_CHARACTERISTICS').
*/
#define DEF_TERM_CHARACTERISTICS \
{ \
B19200, B19200, /* input and output speed */ \
'H' - '@', /* erase char */ \
-1, /* 2nd erase char */ \
'U' - '@', /* kill char */ \
ECHO | CRMOD, /* mode */ \
'C' - '@', /* interrupt character */ \
'\\' - '@', /* quit char */ \
'Q' - '@', /* start char */ \
'S' - '@', /* stop char */ \
'D' - '@', /* EOF */ \
-1, /* brk */ \
(LCRTBS | LCRTERA | LCRTKIL | LCTLECH), /* local mode word */ \
'Z' - '@', /* process stop */ \
'Y' - '@', /* delayed stop */ \
'R' - '@', /* reprint line */ \
'O' - '@', /* flush output */ \
'W' - '@', /* word erase */ \
'V' - '@' /* literal next char */ \
}
#endif /* __rioinfo_h */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment