Commit 0f0078de authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.99pre7-9

parent 32fe99e4
......@@ -30,7 +30,8 @@ Driver OSS Behavior
--------------------
This OSS driver exports /dev/mixer and /dev/dsp to applications, which
mostly adhere to the OSS spec.
mostly adhere to the OSS spec. This driver doesn't register itself
with /dev/sndstat, so don't expect information to appear there.
The /dev/dsp device exported behaves almost as expected. Playback is
supported in all the various lovely formats. 8/16bit stereo/mono from
......
......@@ -185,24 +185,28 @@ programs could use a more reasonable interface, for example evdev.c
crw-r--r-- 1 root root 13, 33 Mar 29 00:41 mouse1
crw-r--r-- 1 root root 13, 34 Mar 29 00:41 mouse2
crw-r--r-- 1 root root 13, 35 Apr 1 10:50 mouse3
...
...
crw-r--r-- 1 root root 13, 62 Apr 1 10:50 mouse30
crw-r--r-- 1 root root 13, 63 Apr 1 10:50 mice
and so on, up to mouse31. Each is assigned to a single mouse or digitizer,
unless CONFIG_INPUT_MOUSEDEV_MIX is set. In that case all mice and
digitizers share a single character device, mouse0, and even when none are
connected, mouse0 is present. This is useful for hotplugging USB mice, so
that programs can open the device even when no mice are present.
Each 'mouse' device is assigned to a single mouse or digitizer, except the last
one - 'mice'. This single character device is shared by all mice and
digitizers, and even if none are connected, the device is present. This is
useful for hotplugging USB mice, so that programs can open the device even when
no mice are present.
CONFIG_INPUT_MOUSEDEV_SCREEN_[XY] in the kernel configuration are the size
of your screen (in pixels) in XFree86. This is needed if you want to use
your digitizer in X, because it's movement is sent to X via a virtual PS/2
mouse.
mouse. These values won't be used if you use a mouse only.
Mousedev.c will generate either PS/2, ImPS/2 (microsoft intellimouse) or
GenPS/2 (genius netmouse/netscroll) protocols, depending on what the program
wishes. You can set GPM and X to any of these. You'll need ImPS/2 if you
want to make use of a wheel on a USB mouse and GenPS/2 if you want to use
extra (up to 5) buttons. I'm not sure how much is GenPS/2 supported in X,
though.
reading the data wishes. You can set GPM and X to any of these. You'll need
ImPS/2 if you want to make use of a wheel on a USB mouse and GenPS/2 if you
want to use extra (up to 5) buttons. I'm not sure how much is GenPS/2 supported
in X, though.
3.2.3 joydev.c
~~~~~~~~~~~~~~
......@@ -216,6 +220,7 @@ though. As soon as any USB joystick is connected, it can be accessed in
crw-r--r-- 1 root root 13, 1 Apr 1 10:50 js1
crw-r--r-- 1 root root 13, 2 Apr 1 10:50 js2
crw-r--r-- 1 root root 13, 3 Apr 1 10:50 js3
...
And so on up to js31.
......@@ -236,6 +241,7 @@ independent.
crw-r--r-- 1 root root 13, 65 Apr 1 10:50 event1
crw-r--r-- 1 root root 13, 66 Apr 1 10:50 event2
crw-r--r-- 1 root root 13, 67 Apr 1 10:50 event3
...
3. Contacts
~~~~~~~~~~~
......
......@@ -1344,7 +1344,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
/* Names for the Pentium II/Celeron processors
detectable only by also checking the cache size.
Dixon is NOT a Celeron. */
if (cpu_models[i].x86 == 6) {
if (c->x86 == 6) {
switch (c->x86_model) {
case 5:
if (c->x86_cache_size == 0)
......
......@@ -204,6 +204,9 @@ if [ "$CONFIG_VIDEO_DEV" != "n" ]; then
dep_tristate ' BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_I2C_ALGOBIT
fi
dep_tristate ' Mediavision Pro Movie Studio Video For Linux' CONFIG_VIDEO_PMS $CONFIG_VIDEO_DEV
if [ "$CONFIG_ALL_PPC" = "y" ]; then
dep_tristate ' PlanB Video-In on PowerMac' CONFIG_VIDEO_PLANB $CONFIG_VIDEO_DEV
fi
if [ "$CONFIG_PARPORT" != "n" ]; then
dep_tristate ' Quickcam BW Video For Linux' CONFIG_VIDEO_BWQCAM $CONFIG_VIDEO_DEV $CONFIG_PARPORT
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
......
......@@ -23,7 +23,7 @@ obj- :=
SUB_DIRS :=
MOD_SUB_DIRS := $(SUB_DIRS)
ALL_SUB_DIRS := $(SUB_DIRS) ftape joystick pcmcia
ALL_SUB_DIRS := $(SUB_DIRS) ftape joystick pcmcia rio
#
# This file contains the font map for the default (hardware) font
......@@ -45,6 +45,13 @@ KEYBD =pc_keyb.o
CONSOLE =console.o
SERIAL =serial.o
ifeq ($(ARCH),s390)
KEYMAP =
KEYBD =
CONSOLE =
SERIAL =
endif
ifeq ($(ARCH),m68k)
ifdef CONFIG_AMIGA
KEYBD = amikeyb.o
......@@ -127,11 +134,41 @@ obj-$(CONFIG_SYNCLINK) += synclink.o
obj-$(CONFIG_N_HDLC) += n_hdlc.o
obj-$(CONFIG_SPECIALIX) += specialix.o
obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
obj-$(CONFIG_SX) += sx.o
# If either is in the kernel, generic_serial goes in the kernel, and
# the module is no longer required. The "in kernel" case is last to be
# able to override the module case.... This is an example of the new
# "makefile automatically figures out the dependencies".... -- REW
GS = n
ifeq ($(CONFIG_SX),m)
GS = m
endif
ifeq ($(CONFIG_RIO),m)
GS = m
endif
ifeq ($(CONFIG_SX),y)
obj-y += sx.o generic_serial.o
GS = y
endif
ifeq ($(CONFIG_RIO),y)
GS = y
endif
obj-$(GS) += generic_serial.o
ifeq ($(CONFIG_RIO),y)
obj-y += rio/rio.o generic_serial.o
SUB_DIRS += rio
MOD_SUB_DIRS += rio
else
obj-$(CONFIG_SX) += sx.o
ifeq ($(CONFIG_RIO),m)
obj-m += generic_serial.o
MOD_SUB_DIRS += rio
endif
endif
obj-$(CONFIG_ATIXL_BUSMOUSE) += atixlmouse.o
......
......@@ -98,7 +98,7 @@ static DECLARE_MUTEX(tmp_buf_sem);
/* baud index mappings from linux defns to isi */
static char linuxb_to_isib[] = {
static signed char linuxb_to_isib[] = {
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 16, 17,
18, 19
};
......
#
# 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.
#
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := rio.o
O_OBJS := rio_linux.o rioinit.o rioboot.o riocmd.o rioctrl.o riointr.o \
rioparam.o riopcicopy.o rioroute.o riotable.o riotty.o
M_OBJS := $(O_TARGET)
include $(TOPDIR)/Rules.make
rio.o: $(O_OBJS)
\ No newline at 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 : 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__
#ifdef SCCS_LABELS
static char *_board_h_sccs_ = "@(#)board.h 1.2";
#endif
/*
** 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
{
BYTE DpCtl; /* 7C00 */
BYTE Dp_Unused2_[127];
BYTE DpIntSet; /* 7C80 */
BYTE Dp_Unused3_[127];
BYTE DpTpuReset; /* 7D00 */
BYTE Dp_Unused4_[127];
BYTE DpIntReset; /* 7D80 */
BYTE Dp_Unused5_[127];
};
/*
** The PROM data area on the host (0x7C00), Read Only
*/
struct s_Prom
{
WORD DpSlxCode[2];
WORD DpRev;
WORD Dp_Unused6_;
WORD DpUniq[4];
WORD DpJahre;
WORD DpWoche;
WORD DpHwFeature[5];
WORD DpOemId;
WORD 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 */
{
BYTE Dp_Unused8_[DP_PARMMAP_ADDR];
WORD DpParmMapAd;
};
struct s_StartUpS
{
BYTE Dp_Unused9_[DP_STARTUP_ADDR];
BYTE Dp_LongJump[0x4];
BYTE Dp_Unused10_[2];
BYTE Dp_ShortJump[0x2];
};
union u_Sram2ParmMap /* This is the top of memory (0x7E00-0x7FFF) */
{
BYTE DpSramMem[DP_SRAM2_SIZE];
struct s_ParmMapS DpParmMapS;
struct s_StartUpS DpStartUpS;
};
/*
** This is the DP RAM overlay.
*/
struct DpRam
{
BYTE DpSram1[DP_SRAM1_SIZE]; /* 0000 - 7BFF */
union u_CtrlProm DpCtrlProm; /* 7C00 - 7DFF */
union u_Sram2ParmMap DpSram2ParmMap; /* 7E00 - 7FFF */
BYTE DpScratch[DP_SCRATCH_SIZE]; /* 8000 - 8FFF */
BYTE 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
/****************************************************************************
******* *******
******* B O O T P A C K E T H E A D E R F I L E
******* *******
****************************************************************************
Author : Ian Nandhra
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
#ifndef lint
#ifdef SCCS
static char *_rio_bootpkt_h_sccs = "@(#)bootpkt.h 1.1" ;
#endif
#endif
/*************************************************
* Overlayed onto the Data fields of a regular
* Packet
************************************************/
typedef struct BOOT_PKT BOOT_PKT ;
struct BOOT_PKT {
short seq_num ;
char data[10] ;
} ;
#endif
/*********** end of file ***********/
/****************************************************************************
******* *******
******* BRATES.H *******
******* *******
****************************************************************************
Author : Jeremy Rolls
Date : 1 Nov 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 _brates_h
#ifndef lint
/* static char * _brates_h_sccs = "@(#)brates.h 1.4"; */
#endif
#define _brates_h 1
/* List of baud rate defines. Most are borrowed from /usr/include/sys/termio.h
*/
#ifndef INKERNEL
#define B0 0x00
#define B50 0x01
#define B75 0x02
#define B110 0x03
#define B134 0x04
#define B150 0x05
#define B200 0x06
#define B300 0x07
#define B600 0x08
#define B1200 0x09
#define B1800 0x0a
#define B2400 0x0b
#define B4800 0x0c
#define B9600 0x0d
#define B19200 0x0e
#define B38400 0x0f
#endif
/*
** The following baudrates may or may not be defined
** on various UNIX systems.
** If they are not then we define them.
** If they are then we do not define them ;-)
**
** This is appalling that we use same definitions as UNIX
** for our own download code as there is no garuntee that
** B57600 will be defined as 0x11 by a UNIX system....
** Arghhhhh!!!!!!!!!!!!!!
*/
#if !defined(B56000)
#define B56000 0x10
#endif
#if !defined(B57600)
#define B57600 0x11
#endif
#if !defined(B64000)
#define B64000 0x12
#endif
#if !defined(B115200)
#define B115200 0x13
#endif
#if !defined(B2000)
#define B2000 0x14
#endif
#define MAX_RATE B2000
struct baud_rate /* Tag for baud rates */
{
/* short host_rate,*/ /* As passed by the driver */
short divisor, /* The divisor */
prescaler; /* The pre-scaler */
};
#endif
/*
*
* (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.
*/
#ifndef _cirrusprots_h
#define _cirrusprots_h
#ifdef RTA
extern void cd1400_reset ( int uart) ;
extern void cd1400_init ( int uart ) ;
extern void ccr_wait ( int priority, int port) ;
extern void cd1400_txstart( int port) ;
extern void cd1400_rxstart ( int port) ;
extern void command_acknowledge ( PHB *port_header ) ;
extern int close_port ( ushort port, PHB *port_header, ushort preemptive, int pseudo) ;
extern void command_preemptive ( PKT *packet) ;
extern void rup_service ( void ) ;
extern ushort GetModemLines(struct PHB *, register short *);
extern void cd1400_intr (Process *cirrus_p, ushort *RtaType) ;
extern void cd1400_mdint ( short port) ;
extern void cd1400_rxint ( short port) ;
extern void cd1400_rxexcept ( short port) ;
extern void cd1400_txdata ( short port, PHB *port_header, PKT *packet) ;
extern void cd1400_fast_clock(void);
extern void cd1400_map_baud ( ushort host_rate, ushort *prescaler, ushort *divisor) ;
extern void cd1400_modem ( ushort port, ushort way) ;
extern void cd1400_txcommand ( short port, PHB *port_header, PKT *packet) ;
extern void cd1400_txint ( int port) ;
void Rprintf( char *RIOPrBuf, char *Str, ... );
#if defined(DCIRRUS)
void debug_packet(PKT *pkt, int option, char *string, int channel);
#endif /* defined(DCIRRUS) */
#endif
#ifdef HOST
extern void wflush (PHB *);
extern void command_preemptive (PKT *);
#endif
#endif /* _cirrusprots_h */
/*
*
* (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.
*/
#ifndef _chan_h
#define _chan_h
#ifndef lint
#ifdef SCCS
static char *_rio_chan_h_sccs = "@(#)chan.h 1.1" ;
#endif
#endif
#define Link0 0
#define Link1 1
#define Link2 2
#define Link3 3
#endif
This diff is collapsed.
/****************************************************************************
******* *******
******* C O M M A N D P A C K E T H E A D E R S
******* *******
****************************************************************************
Author : Ian Nandhra
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 _cmd_h
#define _cmd_h
#ifndef lint
#ifdef SCCS
static char *_rio_cmd_h_sccs = "@(#)cmd.h 1.1" ;
#endif
#endif
#define PRE_EMPTIVE_CMD 0x80
#define INLINE_CMD ~PRE_EMPTIVE_CMD
#define CMD_IGNORE_PKT ( (ushort) 0)
#define CMD_STATUS_REQ ( (ushort) 1)
#define CMD_UNIT_STATUS_REQ ( (ushort) 2) /* Is this needed ??? */
#define CMD_CONF_PORT ( (ushort) 3)
#define CMD_CONF_UNIT ( (ushort) 4)
#define CMD_ROUTE_MAP_REQ ( (ushort) 5)
#define CMD_FLUSH_TX ( (ushort) 6)
#define CMD_FLUSH_RX ( (ushort) 7)
#define CMD_PARTION_PORT ( (ushort) 8)
#define CMD_RESET_PORT ( (ushort) 0x0a)
#define CMD_BOOT_UNIT ( (ushort) 0x0b)
#define CMD_FOUND_UNIT ( (ushort) 0x0c)
#define CMD_ATTACHED_RTA_2 ( (ushort) 0x0d)
#define CMD_PROVIDE_BOOT ( (ushort) 0x0e)
#define CMD_CIRRUS ( (ushort) 0x0f)
#define FORM_STATUS_PKT ( (ushort) 1 )
#define FORM_POLL_PKT ( (ushort) 2 )
#define FORM_LINK_STATUS_PKT ( (ushort) 3 )
#define CMD_DATA_PORT ( (ushort) 1 )
#define CMD_DATA ( (ushort) 2 )
#define CMD_TX_PART ( (ushort) 2 )
#define CMD_RX_PART ( (ushort) 3 )
#define CMD_RX_LIMIT ( (ushort) 4 )
#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 : 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__
#ifdef SCCS_LABELS
#ifndef lint
static char *_cmdblk_h_sccs_ = "@(#)cmdblk.h 1.2";
#endif
#endif
/*
** 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)(int, struct CmdBlk *);
int PreArg; /* The arg for the func */
/* The func to call when completed */
int (*PostFuncP)(int, 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__
#ifdef SCCS_LABELS
#ifndef lint
static char *_cmdpkt_h_sccs_ = "@(#)cmdpkt.h 1.2";
#endif
#endif
/*
** 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 seperate
** 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
{
WORD NumPackets;
WORD LoadBase;
WORD CodeSize;
};
#define BOOT_SEQUENCE_LEN 8
struct SamTop
{
BYTE Unit;
BYTE Link;
};
struct CmdHdr
{
BYTE PcCommand;
union
{
BYTE PcPhbNum;
BYTE PcLinkNum;
BYTE PcIDNum;
} U0;
};
struct PktCmd
{
union
{
struct
{
struct CmdHdr CmdHdr;
struct BootSequence PcBootSequence;
} S1;
struct
{
WORD PcSequence;
BYTE PcBootData[RTA_BOOT_DATA_SIZE];
} S2;
struct
{
WORD __crud__;
BYTE PcUniqNum[4]; /* this is really a uint. */
BYTE PcModuleTypes; /* what modules are fitted */
} S3;
struct
{
struct CmdHdr CmdHdr;
BYTE __undefined__;
BYTE PcModemStatus;
BYTE PcPortStatus;
BYTE PcSubCommand; /* commands like mem or register dump */
WORD PcSubAddr; /* Address for command */
BYTE PcSubData[64]; /* Date area for command */
} S4;
struct
{
struct CmdHdr CmdHdr;
BYTE PcCommandText[1];
BYTE __crud__[20];
BYTE 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
{
uchar PcCommand;
union
{
uchar PcPhbNum;
uchar PcLinkNum;
uchar PcIDNum;
} U0;
} CmdHdr;
struct
{
ushort NumPackets;
ushort LoadBase;
ushort CodeSize;
} PcBootSequence;
} S1;
struct
{
ushort PcSequence;
uchar PcBootData[RTA_BOOT_DATA_SIZE];
} S2;
struct
{
ushort __crud__;
uchar PcUniqNum[4]; /* this is really a uint. */
uchar PcModuleTypes; /* what modules are fitted */
} S3;
struct
{
ushort __cmd_hdr__;
uchar __undefined__;
uchar PcModemStatus;
uchar PcPortStatus;
uchar PcSubCommand;
ushort PcSubAddr;
uchar PcSubData[64];
} S4;
struct
{
ushort __cmd_hdr__;
uchar PcCommandText[1];
uchar __crud__[20];
uchar PcIDNum2; /* Tacked on end */
} S5;
struct
{
ushort __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
/****************************************************************************
******* *******
******* C O N T R O L P A C K E T H E A D E R S
******* *******
****************************************************************************
Author : Jon Brawn
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 _control_h
#define _control_h
#ifndef lint
/* static char *_rio_control_h_sccs = "@(#)control.h 1.4"; */
#endif
#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 */
#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 : 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__
#ifdef SCCS_LABELS
#ifndef lint
static char *_daemon_h_sccs_ = "@(#)daemon.h 1.3";
#endif
#endif
/*
** structures used on /dev/rio
*/
struct Error
{
uint Error;
uint Entry;
uint Other;
};
struct DownLoad
{
char *DataP;
uint Count;
uint 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
{
uint From; /* Set/Clear XP & IXANY Control from this port.... */
uint To; /* .... to this port */
uint 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 */
uchar IxAny; /* enable/disable IXANY */
uchar IxOn; /* enable/disable IXON */
uchar Lock; /* lock port params */
uchar Store; /* store params across closes */
uchar Drain; /* close only when drained */
};
struct LpbReq
{
uint Host;
uint Link;
struct LPB *LpbP;
};
struct RupReq
{
uint HostNum;
uint RupNum;
struct RUP *RupP;
};
struct PortReq
{
uint SysPort;
struct Port *PortP;
};
struct StreamInfo
{
uint SysPort;
#if 0
queue_t RQueue;
queue_t WQueue;
#else
int RQueue;
int WQueue;
#endif
};
struct HostReq
{
uint HostNum;
struct Host *HostP;
};
struct HostDpRam
{
uint HostNum;
struct DpRam *DpRamP;
};
struct DebugCtrl
{
uint SysPort;
uint Debug;
uint Wait;
};
struct MapInfo
{
uint FirstPort; /* 8 ports, starting from this (tty) number */
uint RtaUnique; /* reside on this RTA (unique number) */
};
struct MapIn
{
uint 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
{
ulong RtaUnique;
uchar ID;
};
struct KillNeighbour
{
ulong UniqueNum;
uchar 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 : data.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:09
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)data.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_datadex__
#define __rio_datadex__
#ifndef lint
static char *_data_h_sccs_ = "@(#)data.h 1.2";
#endif
#endif
/*
** File: debug.h
**
** Author: David Dix
**
** Created: 12th March 1993
**
** Last modified: 93/04/27
**
*
* (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.
*/
#ifndef _debug_h_
#define _debug_h_
#if defined(DCIRRUS)
#define DBPACKET(pkt, opt, str, chn) debug_packet((pkt), (opt), (str), (chn))
#else
#define DBPACKET(pkt, opt, str, c)
#endif /* DCIRRUS */
#endif /* _debug_h_ */
/****************************************************************************
******* *******
******* D E F A U L T S
******* *******
****************************************************************************
Author : Ian Nandhra
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 lint
#ifdef SCCS
static char *_rio_defaults_h_sccs = "@(#)defaults.h 1.1" ;
#endif
#endif
#define MILLISECOND (int) (1000/64) /* 15.625 low ticks */
#define SECOND (int) 15625 /* Low priority ticks */
#ifdef RTA
#define RX_LIMIT (ushort) 3
#endif
#ifdef HOST
#define RX_LIMIT (ushort) 1
#endif
#define LINK_TIMEOUT (int) (POLL_PERIOD / 2)
/*********** 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 : eisa.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:10
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)eisa.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_eisa_h__
#define __rio_eisa_h__
#ifdef SCCS_LABELS
#ifndef lint
static char *_eisa_h_sccs_ = "@(#)eisa.h 1.2";
#endif
#endif
/*
** things to do with the EISA bus
*/
#define RIO_EISA_STRING_ADDRESS 0xfffd9 /* where EISA is stored */
#define RIO_MAX_EISA_SLOTS 16 /* how many EISA slots? */
#define RIO_EISA_IDENT 0x984D /* Specialix */
#define RIO_EISA_PRODUCT_CODE 0x14 /* Code 14 */
#define RIO_EISA_ENABLE_BIT 0x01 /* To enable card */
#define EISA_MEMORY_BASE_LO 0xC00 /* A16-A23 */
#define EISA_MEMORY_BASE_HI 0xC01 /* A24-A31 */
#define EISA_INTERRUPT_VEC 0xC02 /* see below */
#define EISA_CONTROL_PORT 0xC02 /* see below */
#define EISA_INTERRUPT_RESET 0xC03 /* read to clear IRQ */
#define EISA_PRODUCT_IDENT_LO 0xC80 /* where RIO_EISA_IDENT is */
#define EISA_PRODUCT_IDENT_HI 0xC81
#define EISA_PRODUCT_NUMBER 0xC82 /* where PROD_CODE is */
#define EISA_REVISION_NUMBER 0xC83 /* revision (1dp) */
#define EISA_ENABLE 0xC84 /* set LSB to enable card */
#define EISA_UNIQUE_NUM_0 0xC88 /* vomit */
#define EISA_UNIQUE_NUM_1 0xC8A
#define EISA_UNIQUE_NUM_2 0xC90 /* bit strangely arranged */
#define EISA_UNIQUE_NUM_3 0xC92
#define EISA_MANUF_YEAR 0xC98 /* when */
#define EISA_MANUF_WEEK 0xC9A /* more when */
#define EISA_TP_BOOT_FROM_RAM 0x01
#define EISA_TP_BOOT_FROM_LINK 0x00
#define EISA_TP_FAST_LINKS 0x02
#define EISA_TP_SLOW_LINKS 0x00
#define EISA_TP_BUS_ENABLE 0x04
#define EISA_TP_BUS_DISABLE 0x00
#define EISA_TP_RUN 0x08
#define EISA_TP_RESET 0x00
#define EISA_POLLED 0x00
#define EISA_IRQ_3 0x30
#define EISA_IRQ_4 0x40
#define EISA_IRQ_5 0x50
#define EISA_IRQ_6 0x60
#define EISA_IRQ_7 0x70
#define EISA_IRQ_9 0x90
#define EISA_IRQ_10 0xA0
#define EISA_IRQ_11 0xB0
#define EISA_IRQ_12 0xC0
#define EISA_IRQ_14 0xE0
#define EISA_IRQ_15 0xF0
#define EISA_INTERRUPT_MASK 0xF0
#define EISA_CONTROL_MASK 0x0F
#define RIO_EISA_DEFAULT_MODE EISA_TP_SLOW_LINKS
#define RIOEisaToIvec(X) (uchar )((uchar)((X) & EISA_INTERRUPT_MASK)>>4)
#define INBZ(z,x) inb(((z)<<12) | (x))
#define OUTBZ(z,x,y) outb((((z)<<12) | (x)), y)
#endif /* __rio_eisa_h__ */
/****************************************************************************
******* *******
******* E N A B L E H E A D E R S
******* *******
****************************************************************************
Author : Ian Nandhra
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 lint
#ifdef SCCS
static char *_rio_enable_h_sccs = "@(#)enable.h 1.1" ;
#endif
#endif
#define ENABLE_LTT TRUE
#define ENABLE_LRT TRUE
/*********** end of file ***********/
/****************************************************************************
******* *******
******* E R R O R H E A D E R F I L E
******* *******
****************************************************************************
Author : Ian Nandhra
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 lint
/* static char *_rio_error_h_sccs = "@(#)error.h 1.3"; */
#endif
#define E_NO_ERROR ((ushort) 0)
#define E_PROCESS_NOT_INIT ((ushort) 1)
#define E_LINK_TIMEOUT ((ushort) 2)
#define E_NO_ROUTE ((ushort) 3)
#define E_CONFUSED ((ushort) 4)
#define E_HOME ((ushort) 5)
#define E_CSUM_FAIL ((ushort) 6)
#define E_DISCONNECTED ((ushort) 7)
#define E_BAD_RUP ((ushort) 8)
#define E_NO_VIRGIN ((ushort) 9)
#define E_BOOT_RUP_BUSY ((ushort) 10)
/*************************************************
* Parsed to mem_halt()
************************************************/
#define E_CHANALLOC ((ushort) 0x80)
#define E_POLL_ALLOC ((ushort) 0x81)
#define E_LTTWAKE ((ushort) 0x82)
#define E_LTT_ALLOC ((ushort) 0x83)
#define E_LRT_ALLOC ((ushort) 0x84)
#define E_CIRRUS ((ushort) 0x85)
#define E_MONITOR ((ushort) 0x86)
#define E_PHB_ALLOC ((ushort) 0x87)
#define E_ARRAY_ALLOC ((ushort) 0x88)
#define E_QBUF_ALLOC ((ushort) 0x89)
#define E_PKT_ALLOC ((ushort) 0x8a)
#define E_GET_TX_Q_BUF ((ushort) 0x8b)
#define E_GET_RX_Q_BUF ((ushort) 0x8c)
#define E_MEM_OUT ((ushort) 0x8d)
#define E_MMU_INIT ((ushort) 0x8e)
#define E_LTT_INIT ((ushort) 0x8f)
#define E_LRT_INIT ((ushort) 0x90)
#define E_LINK_RUN ((ushort) 0x91)
#define E_MONITOR_ALLOC ((ushort) 0x92)
#define E_MONITOR_INIT ((ushort) 0x93)
#define E_POLL_INIT ((ushort) 0x94)
/*********** 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 : 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__
#ifdef SCCS_LABELS
#ifndef lint
static char *_errors_h_sccs_ = "@(#)errors.h 1.2";
#endif
#endif
/*
** 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__ */
/****************************************************************************
******* *******
******* F O R M P A C K E T H E A D E R F I L E
******* *******
****************************************************************************
Author : Ian Nandhra
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 _formpkt_h
#define _formpkt_h 1
#ifndef lint
#ifdef SCCS
static char *_rio_formpkt_h_sccs = "@(#)formpkt.h 1.1" ;
#endif
#endif
typedef struct FORM_BOOT_PKT_1 FORM_BOOT_PKT_1 ;
struct FORM_BOOT_PKT_1 {
ushort pkt_number ;
ushort pkt_total ;
ushort boot_top ;
} ;
typedef struct FORM_BOOT_PKT_2 FORM_BOOT_PKT_2 ;
struct FORM_BOOT_PKT_2 {
ushort pkt_number ;
char boot_data[10] ;
} ;
typedef struct FORM_ATTACH_RTA FORM_ATTACH_RTA ;
struct FORM_ATTACH_RTA {
char cmd_code ;
char booter_serial[4] ;
char booter_link ;
char bootee_serial[4] ;
char bootee_link ;
} ;
typedef struct FORM_BOOT_ID FORM_BOOT_ID ;
struct FORM_BOOT_ID {
char cmd_code ;
char bootee_serial[4] ;
char bootee_prod_id ;
char bootee_link ;
} ;
typedef struct FORM_ROUTE_1 FORM_ROUTE_1 ;
struct FORM_ROUTE_1 {
char cmd_code ;
char pkt_number ;
char total_in_sequence ;
char unit_id ;
char host_unit_id ;
} ;
typedef struct FORM_ROUTE_2 FORM_ROUTE_2 ;
struct FORM_ROUTE_2 {
char cmd_code ;
char pkt_number ;
char total_in_sequence ;
char route_data[9] ;
} ;
typedef struct FORM_ROUTE_REQ FORM_ROUTE_REQ ;
struct FORM_ROUTE_REQ {
char cmd_code ;
char pkt_number ;
char total_in_sequence ;
char route_data[10] ;
} ;
typedef struct FORM_ERROR FORM_ERROR ;
struct FORM_ERROR {
char cmd_code ;
char error_code ;
} ;
typedef struct FORM_STATUS FORM_STATUS ;
struct FORM_STATUS {
char cmd_code ;
char status_code ;
char last_packet_valid ;
char tx_buffer ;
char rx_buffer ;
char port_status ;
char phb_status ;
} ;
typedef struct FORM_LINK_STATUS FORM_LINK_STATUS ;
struct FORM_LINK_STATUS {
char cmd_code ;
char status_code ;
char link_number ;
ushort rx_errors ;
ushort tx_errors ;
ushort csum_errors ;
ushort disconnects ;
} ;
typedef struct FORM_PARTITION FORM_PARTITION ;
struct FORM_PARTITION {
char cmd_code ;
char status_code ;
char port_number ;
char tx_max ;
char rx_max ;
char rx_limit ;
} ;
#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 : 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
#ifdef SCCS_LABELS
#ifndef lint
static char *_func_h_sccs_ = "@(#)func.h 1.3";
#endif
#endif
/* rioboot.c */
int RIOBootCodeRTA(struct rio_info *, struct DownLoad *);
int RIOBootCodeHOST(struct rio_info *, register struct DownLoad *);
int RIOBootCodeUNKNOWN(struct rio_info *, struct DownLoad *);
void msec_timeout(struct Host *);
int RIOBootRup(struct rio_info *, uint, struct Host *, struct PKT *);
int RIOBootComplete(struct rio_info *, struct Host *, uint, struct PktCmd *);
int RIOBootOk(struct rio_info *,struct Host *, ulong);
int RIORtaBound(struct rio_info *, uint);
void FillSlot(int, int, uint, struct Host *);
/* riocmd.c */
int RIOFoadRta(struct Host *, struct Map *);
int RIOZombieRta(struct Host *, struct Map *);
int RIOCommandRta(struct rio_info *, uint, int (* func)( struct Host *,
struct Map *));
int RIOIdentifyRta(struct rio_info *, caddr_t);
int RIOKillNeighbour(struct rio_info *, caddr_t);
int RIOSuspendBootRta(struct Host *, int, int);
int RIOFoadWakeup(struct rio_info *);
int RIOCommandRup(struct rio_info *, uint, struct Host *, struct PKT *);
struct CmdBlk * RIOGetCmdBlk(void);
void RIOFreeCmdBlk(struct CmdBlk *);
int RIOQueueCmdBlk(struct Host *, uint, struct CmdBlk *);
void RIOPollHostCommands(struct rio_info *, struct Host *);
int RIOStrlen(register char *);
int RIOStrCmp(register char *, register char *);
int RIOStrnCmp(register char *, register char *, int);
void RIOStrNCpy(char *, char *, int);
int RIOWFlushMark(int, struct CmdBlk *);
int RIORFlushEnable(int, struct CmdBlk *);
int RIOUnUse(int, struct CmdBlk *);
void ShowPacket(uint, struct PKT *);
/* rioctrl.c */
int copyin(int, caddr_t, int);
int copyout(caddr_t, int, int);
int riocontrol(struct rio_info *, dev_t,int,caddr_t,int);
int RIOPreemptiveCmd(struct rio_info *,struct Port *,uchar);
/* 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, caddr_t, int);
int RIOBoardTest(paddr_t, caddr_t, uchar, int);
int RIOScrub(int, BYTE *, int);
void RIOAllocateInterrupts(struct rio_info *);
void RIOStopInterrupts(struct rio_info *, int, int);
void RIOAllocDataStructs(struct rio_info *);
void RIOSetupDataStructs(struct rio_info *);
int RIODefaultName(struct rio_info *, struct Host *, uint);
int RIOReport(struct rio_info *);
struct rioVersion * RIOVersid(void);
int RIOMapin(paddr_t, int, caddr_t *);
void RIOMapout(paddr_t, long, caddr_t);
void RIOHostReset(uint, volatile struct DpRam *, uint);
/* riointr.c */
void riopoll(struct rio_info *);
void riointr(struct rio_info *);
void RIOTxEnable(char *);
void RIOServiceHost(struct rio_info *, struct Host *, int);
void RIOReceive(struct rio_info *, struct Port *);
int riotproc(struct rio_info *, register 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 **, struct Port *);
void add_transmit(struct Port *);
void put_free_end(struct Host *, struct PKT *);
int can_remove_receive(struct PKT **, struct Port *);
void remove_receive(struct Port *);
/* rioroute.c */
int RIORouteRup(struct rio_info *, uint, struct Host *, struct PKT *);
void RIOFixPhbs(struct rio_info *, struct Host *, uint);
int RIOCheckIsolated(struct rio_info *, struct Host *, uint);
int RIOIsolate(struct rio_info *, struct Host *, uint);
int RIOCheck(struct Host *, uint);
uint GetUnitType(uint);
int RIOSetChange(struct rio_info *);
void RIOConCon(struct rio_info *, struct Host *, uint, uint, uint, uint, int);
int RIOFindFreeID(struct rio_info *, struct Host *, uint *, uint *);
int RIOFreeDisconnected(struct rio_info *, struct Host *, int );
int RIORemoveFromSavedTable(struct rio_info *, struct Map *);
/* riotty.c */
int riotopen(struct tty_struct * tty, struct file * filp);
int riotclose(void *ptr);
int RIOCookMode(struct ttystatics *);
int riotioctl(struct rio_info *, dev_t, register int, register 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(register 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 int rio_pcicopy(char *src, char *dst, int n);
extern int rio_minor (kdev_t device);
extern int rio_ismodem (kdev_t device);
extern void rio_udelay (int usecs);
#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__
#ifdef SCCS_LABELS
#ifndef lint
static char *_host_h_sccs_ = "@(#)host.h 1.2";
#endif
#endif
/*
** 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
{
uchar Type; /* RIO_EISA, RIO_MCA, ... */
uchar Ivec; /* POLLED or ivec number */
uchar Mode; /* Control stuff */
uchar Slot; /* Slot */
volatile caddr_t Caddr; /* KV address of DPRAM */
volatile struct DpRam *CardP; /* KV address of DPRAM, with overlay */
paddr_t PaddrP; /* Phys. address of DPRAM */
char Name[MAX_NAME_LEN]; /* The name of the host */
uint UniqueNum; /* host unique number */
spinlock_t HostLock; /* Lock structure for MPX */
/*struct pci_devinfo PciDevInfo; *//* PCI Bus/Device/Function stuff */
/*struct lockb HostLock; *//* Lock structure for MPX */
uint WorkToBeDone; /* set to true each interrupt */
uint InIntr; /* Being serviced? */
uint IntSrvDone; /* host's interrupt has been serviced */
int (*Copy)( caddr_t, caddr_t, 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.
*/
ulong Flags; /* Whats going down */
#define RC_WAITING 0
#define RC_STARTUP 1
#define RC_RUNNING 2
#define RC_STUFFED 3
#define RC_SOMETHING 4
#define RC_SOMETHING_NEW 5
#define RC_SOMETHING_ELSE 6
#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 *PhbP; /* Pointer to the PHB array */
ushort *PhbNumP; /* Ptr to Number of PHB's */
struct LPB *LinkStrP ; /* Link Structure Array */
struct RUP *RupP; /* Sixteen real rups here */
struct PARM_MAP *ParmMapP; /* points to the parmmap */
uint ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */
uint 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 */
int locks;
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
/****************************************************************************
******* *******
******* H O S T H A R D W A 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 lint
#ifdef SCCS_LABELS
static char *_rio_hosthw_h_sccs = "@(#)hosthw.h 1.2" ;
#endif
#endif
#define SET_OTHER_INTERRUPT ( (volatile u_short *) 0x7c80 )
#define SET_EISA_INTERRUPT ( (volatile u_short *) 0x7ef0 )
#define EISA_HOST 0x30
#define AT_HOST 0xa0
#define MCA_HOST 0xb0
#define PCI_HOST 0xd0
#define PRODUCT_MASK 0xf0
/*********** end of file ***********/
/****************************************************************************
******* *******
******* 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
#ifndef lint
#ifdef SCCS_LABELS
/* static char *_rio_link_h_sccs = "@(#)link.h 1.15"; */
#endif
#endif
/*************************************************
* Define the Link Status stuff
************************************************/
#define LRT_ACTIVE ((ushort) 0x01)
#define LRT_SPARE1 ((ushort) 0x02)
#define INTRO_RCVD ((ushort) 0x04)
#define FORCED_DISCONNECT ((ushort) 0x08)
#define LRT_SPARE2 ((ushort) 0x80)
#define TOP_OF_RTA_RAM ((ushort) 0x7000)
#define HOST_SERIAL_POINTER (unsigned char **) (TOP_OF_RTA_RAM - 2 * sizeof (ushort))
/* Flags for ltt_status */
#define WAITING_ACK (ushort) 0x0001
#define DATA_SENT (ushort) 0x0002
#define WAITING_RUP (ushort) 0x0004
#define WAITING_RETRY (ushort) 0x0008
#define WAITING_TOPOLOGY (ushort) 0x0010
#define SEND_SYNC (ushort) 0x0020
#define FOAD_THIS_LINK (ushort) 0x0040
#define REQUEST_SYNC (ushort) 0x0080
#define REMOTE_DYING (ushort) 0x0100
#define DIE_NOW (ushort) 0x0200
/* 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 */
/* States that a link can be in */
#define LINK_DISCONNECTED ((ushort) 0) /* Disconnected */
#define LINK_BOOT1 ((ushort) 1) /* Trying to send 1st stage boot */
#define LINK_BOOT2 ((ushort) 2) /* Trying to send 2nd stage boot */
#define LINK_BOOT2WAIT ((ushort) 3) /* Waiting for selftest results */
#define LINK_BOOT3 ((ushort) 4) /* Trying to send 3rd stage boots */
#define LINK_SYNC ((ushort) 5) /* Syncing */
#define LINK_INTRO ((ushort) 10) /* Introductory packet */
#define LINK_SUPPLYID ((ushort) 11) /* Trying to supply an ID */
#define LINK_TOPOLOGY ((ushort) 12) /* Send a topology update */
#define LINK_REQUESTID ((ushort) 13) /* Waiting for an ID */
#define LINK_CONNECTED ((ushort) 14) /* Connected */
#define LINK_INTERCONNECT ((ushort) 20) /* Subnets interconnected */
#define LINK_SPARE ((ushort) 40)
/*
** Set the default timeout for link communications.
*/
#define LINKTIMEOUT (400 * MILLISECOND)
/*
** LED stuff
*/
#if defined(RTA)
#define LED_OFF ((ushort) 0) /* LED off */
#define LED_RED ((ushort) 1) /* LED Red */
#define LED_GREEN ((ushort) 2) /* LED Green */
#define LED_ORANGE ((ushort) 4) /* LED Orange */
#define LED_1TO8_OPEN ((ushort) 1) /* Port 1->8 LED on */
#define LED_9TO16_OPEN ((ushort) 2) /* Port 9->16 LED on */
#define LED_SET_COLOUR(colour) (link->led = (colour))
#define LED_OR_COLOUR(colour) (link->led |= (colour))
#define LED_TIMEOUT(time) (link->led_timeout = RioTimePlus(RioTime(),(time)))
#else
#define LED_SET_COLOUR(colour)
#define LED_OR_COLOUR(colour)
#define LED_TIMEOUT(time)
#endif /* RTA */
struct LPB {
WORD link_number ; /* Link Number */
Channel_ptr in_ch ; /* Link In Channel */
Channel_ptr out_ch ; /* Link Out Channel */
#ifdef RTA
uchar stat_led ; /* Port open leds */
uchar led ; /* True, light led! */
#endif
BYTE attached_serial[4]; /* Attached serial number */
BYTE attached_host_serial[4];
/* Serial number of Host who
booted the other end */
WORD descheduled ; /* Currently Descheduled */
WORD state; /* Current state */
WORD send_poll ; /* Send a Poll Packet */
Process_ptr ltt_p ; /* Process Descriptor */
Process_ptr lrt_p ; /* Process Descriptor */
WORD lrt_status ; /* Current lrt status */
WORD ltt_status ; /* Current ltt status */
WORD timeout ; /* Timeout value */
WORD topology; /* Topology bits */
WORD mon_ltt ;
WORD mon_lrt ;
WORD WaitNoBoot ; /* Secs to hold off booting */
PKT_ptr add_packet_list; /* Add packets to here */
PKT_ptr remove_packet_list; /* Send packets from here */
#ifdef RTA
#ifdef DCIRRUS
#define QBUFS_PER_REDIRECT (4 / PKTS_PER_BUFFER + 1)
#else
#define QBUFS_PER_REDIRECT (8 / PKTS_PER_BUFFER + 1)
#endif
PKT_ptr_ptr rd_add ; /* Add a new Packet here */
Q_BUF_ptr rd_add_qb; /* Pointer to the add Q buf */
PKT_ptr_ptr rd_add_st_qbb ; /* Pointer to start of the Q's buf */
PKT_ptr_ptr rd_add_end_qbb ; /* Pointer to the end of the Q's buf */
PKT_ptr_ptr rd_remove ; /* Remove a Packet here */
Q_BUF_ptr rd_remove_qb ; /* Pointer to the remove Q buf */
PKT_ptr_ptr rd_remove_st_qbb ; /* Pointer to the start of the Q buf */
PKT_ptr_ptr rd_remove_end_qbb ; /* Pointer to the end of the Q buf */
ushort pkts_in_q ; /* Packets in queue */
#endif
Channel_ptr lrt_fail_chan ; /* Lrt's failure channel */
Channel_ptr ltt_fail_chan ; /* Ltt's failure channel */
#if defined (HOST) || defined (INKERNEL)
/* RUP structure for HOST to driver communications */
struct RUP rup ;
#endif
struct RUP link_rup; /* RUP for the link (POLL,
topology etc.) */
WORD attached_link ; /* Number of attached link */
WORD csum_errors ; /* csum errors */
WORD num_disconnects ; /* number of disconnects */
WORD num_sync_rcvd ; /* # sync's received */
WORD num_sync_rqst ; /* # sync requests */
WORD num_tx ; /* Num pkts sent */
WORD num_rx ; /* Num pkts received */
WORD module_attached; /* Module tpyes of attached */
WORD led_timeout; /* LED timeout */
WORD first_port; /* First port to service */
WORD 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.
*/
#define disable(oldspl) save_flags (oldspl)
#define restore(oldspl) restore_flags (oldspl)
#define sysbrk(x) kmalloc ((x), GFP_KERNEL)
#define sysfree(p,size) kfree ((p))
#define WBYTE(p,v) writeb(v, &p)
#define RBYTE(p) readb (&p)
#define WWORD(p,v) writew(v, &p)
#define RWORD(p) readw(&p)
#define WINDW(p,v) writew(v, p)
#define RINDW(p) readw(p)
#define DEBUG_ALL
#define cprintf printk
#ifdef __KERNEL__
#define INKERNEL
#endif
struct ttystatics {
struct termios tm;
};
#define bzero(d, n) memset((d), 0, (n))
#define bcopy(src, dest, n) memcpy ((dest), (src), (n))
#define SEM_SIGIGNORE 0x1234
#ifdef DEBUG_SEM
#define swait(a,b) printk ("waiting: " __FILE__ " line %d\n", __LINE__)
#define ssignal(sem) printk ("signalling: " __FILE__ " line %d\n", __LINE__)
#define sreset(sem) printk ("sreset: " __FILE__ "\n")
#define sem_init(sem,v) printk ("sreset: " __FILE__ "\n")
#endif
#define getpid() (current->pid)
#define major(dev) MAJOR(dev)
#define minor(dev) MINOR(dev)
#define QSIZE SERIAL_XMIT_SIZE
#define pseterr(errno) return (- errno)
#define V_CBAUD CBAUD
/* For one reason or another rioboot.c uses delay instead of RIODelay. */
#define delay(x,y) RIODelay(NULL, y)
extern int rio_debug;
#define rio_dprint(f, p) do {if (rio_debug & f) printk p;} while (0)
#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
/* 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 */
/****************************************************************************
******* *******
******* L I S T *******
******* *******
****************************************************************************
Author : Jeremy Rolls.
Date : 04-Nov-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 _list_h
#define _list_h 1
#ifdef SCCS_LABELS
#ifndef lint
static char *_rio_list_h_sccs = "@(#)list.h 1.9" ;
#endif
#endif
#define PKT_IN_USE 0x1
#ifdef INKERNEL
#define ZERO_PTR (ushort) 0x8000
#define CaD PortP->Caddr
/*
** 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.
*/
#ifndef linux
#if defined( MIPS ) && !defined( MIPSEISA )
/* May the shoes of the Devil dance on your grave for creating this */
#define can_add_transmit(PacketP,PortP) \
(!((uint)(PacketP = (struct PKT *)RIO_PTR(CaD,RINDW(PortP->TxAdd))) \
& (PKT_IN_USE<<2)))
#elif defined(MIPSEISA) || defined(nx6000) || \
defined(drs6000) || defined(UWsparc)
#define can_add_transmit(PacketP,PortP) \
(!((uint)(PacketP = (struct PKT *)RIO_PTR(CaD,RINDW(PortP->TxAdd))) \
& PKT_IN_USE))
#else
#define can_add_transmit(PacketP,PortP) \
(!((uint)(PacketP = (struct PKT *)RIO_PTR(CaD,*PortP->TxAdd)) \
& PKT_IN_USE))
#endif
/*
** To add a packet to the queue, you set the PKT_IN_USE bit in the address,
** and then move the TxAdd pointer along one position to point to the next
** packet pointer. You must wrap the pointer from the end back to the start.
*/
#if defined(MIPS) || defined(nx6000) || defined(drs6000) || defined(UWsparc)
# define add_transmit(PortP) \
WINDW(PortP->TxAdd,RINDW(PortP->TxAdd) | PKT_IN_USE);\
if (PortP->TxAdd == PortP->TxEnd)\
PortP->TxAdd = PortP->TxStart;\
else\
PortP->TxAdd++;\
WWORD(PortP->PhbP->tx_add , RIO_OFF(CaD,PortP->TxAdd));
#elif defined(AIX)
# define add_transmit(PortP) \
{\
register ushort *TxAddP = (ushort *)RIO_PTR(Cad,PortP->TxAddO);\
WINDW( TxAddP, RINDW( TxAddP ) | PKT_IN_USE );\
if (PortP->TxAddO == PortP->TxEndO )\
PortP->TxAddO = PortP->TxStartO;\
else\
PortP->TxAddO += sizeof(ushort);\
WWORD(((PHB *)RIO_PTR(Cad,PortP->PhbO))->tx_add , PortP->TxAddO );\
}
#else
# define add_transmit(PortP) \
*PortP->TxAdd |= PKT_IN_USE;\
if (PortP->TxAdd == PortP->TxEnd)\
PortP->TxAdd = PortP->TxStart;\
else\
PortP->TxAdd++;\
PortP->PhbP->tx_add = RIO_OFF(CaD,PortP->TxAdd);
#endif
/*
** can_remove_receive( PacketP, PortP ) returns non-zero if PKT_IN_USE is set
** for the next packet on the queue. It will also set PacketP to point to the
** relevent packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear,
** then can_remove_receive() returns 0.
*/
#if defined(MIPS) || defined(nx6000) || defined(drs6000) || defined(UWsparc)
# define can_remove_receive(PacketP,PortP) \
((RINDW(PortP->RxRemove) & PKT_IN_USE) ? \
(PacketP=(struct PKT *)RIO_PTR(CaD,(RINDW(PortP->RxRemove) & ~PKT_IN_USE))):0)
#elif defined(AIX)
# define can_remove_receive(PacketP,PortP) \
((RINDW((ushort *)RIO_PTR(Cad,PortP->RxRemoveO)) & PKT_IN_USE) ? \
(PacketP=(struct PKT *)RIO_PTR(Cad,RINDW((ushort *)RIO_PTR(Cad,PortP->RxRemoveO)) & ~PKT_IN_USE)):0)
#else
# define can_remove_receive(PacketP,PortP) \
((*PortP->RxRemove & PKT_IN_USE) ? \
(PacketP=(struct PKT *)RIO_PTR(CaD,(*PortP->RxRemove & ~PKT_IN_USE))):0)
#endif
/*
** Will God see it within his heart to forgive us for this thing that
** we have created? To remove a packet from the receive queue you clear
** its PKT_IN_USE bit, and then bump the pointers. Once the pointers
** get to the end, they must be wrapped back to the start.
*/
#if defined(MIPS) || defined(nx6000) || defined(drs6000) || defined(UWsparc)
# define remove_receive(PortP) \
WINDW(PortP->RxRemove, (RINDW(PortP->RxRemove) & ~PKT_IN_USE));\
if (PortP->RxRemove == PortP->RxEnd)\
PortP->RxRemove = PortP->RxStart;\
else\
PortP->RxRemove++;\
WWORD(PortP->PhbP->rx_remove , RIO_OFF(CaD,PortP->RxRemove));
#elif defined(AIX)
# define remove_receive(PortP) \
{\
register ushort *RxRemoveP = (ushort *)RIO_PTR(Cad,PortP->RxRemoveO);\
WINDW( RxRemoveP, RINDW( RxRemoveP ) & ~PKT_IN_USE );\
if (PortP->RxRemoveO == PortP->RxEndO)\
PortP->RxRemoveO = PortP->RxStartO;\
else\
PortP->RxRemoveO += sizeof(ushort);\
WWORD(((PHB *)RIO_PTR(Cad,PortP->PhbO))->rx_remove, PortP->RxRemoveO );\
}
#else
# define remove_receive(PortP) \
*PortP->RxRemove &= ~PKT_IN_USE;\
if (PortP->RxRemove == PortP->RxEnd)\
PortP->RxRemove = PortP->RxStart;\
else\
PortP->RxRemove++;\
PortP->PhbP->rx_remove = RIO_OFF(CaD,PortP->RxRemove);
#endif
#endif
#else /* !IN_KERNEL */
#define ZERO_PTR NULL
#ifdef HOST
/* #define can_remove_transmit(pkt,phb) ((((char*)pkt = (*(char**)(phb->tx_remove))-1) || 1)) && (*phb->u3.s2.tx_remove_ptr & PKT_IN_USE)) */
#define remove_transmit(phb) *phb->u3.s2.tx_remove_ptr &= ~(ushort)PKT_IN_USE;\
if (phb->tx_remove == phb->tx_end)\
phb->tx_remove = phb->tx_start;\
else\
phb->tx_remove++;
#define can_add_receive(phb) !(*phb->u4.s2.rx_add_ptr & PKT_IN_USE)
#define add_receive(pkt,phb) *phb->rx_add = pkt;\
*phb->u4.s2.rx_add_ptr |= PKT_IN_USE;\
if (phb->rx_add == phb->rx_end)\
phb->rx_add = phb->rx_start;\
else\
phb->rx_add++;
#endif
#endif
#ifdef RTA
#define splx(oldspl) if ((oldspl) == 0) spl0()
#endif
#endif /* ifndef _list.h */
/*********** end of file ***********/
/****************************************************************************
******* *******
******* L R T
******* *******
****************************************************************************
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 lint
#ifdef SCCS_LABELS
static char *_rio_lrt_h_sccs = "@(#)lrt.h 1.1" ;
#endif
#endif
#ifdef DCIRRUS
#define LRT_STACK (unsigned short) 600
#else
#define LRT_STACK (ushort) 200
#endif
/*********** end of file ***********/
/****************************************************************************
******* *******
******* L T T
******* *******
****************************************************************************
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 lint
#ifdef SCCS_LABELS
static char *_rio_ltt_h_sccs = "@(#)ltt.h 1.1" ;
#endif
#endif
#ifdef DCIRRUS
#define LTT_STACK (unsigned short) 600
#else
#define LTT_STACK (ushort) 200
#endif
/*********** end of file ***********/
/****************************************************************************
******* *******
******* L T T W A K E U P H E A D E R
******* *******
****************************************************************************
Author : Ian Nandhra
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 lint
#ifdef SCCS_LABELS
static char *_rio_lttwake_h_sccs = "@(#)lttwake.h 1.1" ;
#endif
#endif
#define LTT_WAKEUP_STACK 500
#define LTT_WAKEUP_INTERVAL (int) (500 * MILLISECOND)
/*********** 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 : 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__
#ifdef SCCS_LABELS
static char *_map_h_sccs_ = "@(#)map.h 1.2";
#endif
/*
** 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
{
uint HostUniqueNum; /* Supporting hosts unique number */
uint 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).
*/
ushort ID; /* ID used in the subnet */
ushort ID2; /* ID of 2nd block of 8 for 16 port */
ulong Flags; /* Booted, ID Given, Disconnected */
ulong 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, upto 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 : mca.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:11
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)mca.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_mca_h__
#define __rio_mca_h__
#ifdef SCCS_LABELS
static char *_mca_h_sccs_ = "@(#)mca.h 1.2";
#endif
/*
** Micro Channel stuff
*/
#define McaMaxSlots 8
#define McaSlotSelect 0x96
#define McaSlotEnable 0x08
#define McaIdLow 0x100
#define McaIdHigh 0x101
#define McaIrqEnable 0x102
#define McaMemory 0x103
#define McaRIOId 0x6a5c
#define McaIrq9 0x00
#define McaIrq3 0x02
#define McaIrq4 0x04
#define McaIrq7 0x06
#define McaIrq10 0x08
#define McaIrq11 0x0A
#define McaIrq12 0x0C
#define McaIrq15 0x0E
#define McaIrqMask 0x0E
#define McaCardEnable 0x01
#define McaAddress(X) (((X)&0xFF)<<16)
#define McaTpFastLinks 0x40
#define McaTpSlowLinks 0x00
#define McaTpBootFromRam 0x01
#define McaTpBootFromLink 0x00
#define McaTpBusEnable 0x02
#define McaTpBusDisable 0x00
#define RIO_MCA_DEFAULT_MODE SLOW_LINKS
#endif /* __rio_mca_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 : mesg.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:12
** Retrieved : 11/6/98 11:34:21
**
** ident @(#)mesg.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_mesg_h__
#define __rio_mesg_h__
#ifdef SCCS_LABELS
static char *_mesg_h_sccs_ = "@(#)mesg.h 1.2";
#endif
#endif /* __rio_mesg_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 : 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__
#ifdef SCCS_LABELS
static char *_param_h_sccs_ = "@(#)param.h 1.2";
#endif
/*
** the param command block, as used in OPEN and PARAM calls.
*/
struct phb_param
{
BYTE Cmd; /* It is very important that these line up */
BYTE Cor1; /* with what is expected at the other end. */
BYTE Cor2; /* to confirm that you've got it right, */
BYTE Cor4; /* check with cirrus/cirrus.h */
BYTE Cor5;
BYTE TxXon; /* Transmit X-On character */
BYTE TxXoff; /* Transmit X-Off character */
BYTE RxXon; /* Receive X-On character */
BYTE RxXoff; /* Receive X-Off character */
BYTE LNext; /* Literal-next character */
BYTE TxBaud; /* Transmit baudrate */
BYTE 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 accomodate Mips R3230 bus
***************************************************************************/
#ifndef _parmap_h
#define _parmap_h
#ifdef SCCS_LABELS
#ifndef lint
/* static char *_rio_parmmap_h_sccs = "@(#)parmmap.h 1.4"; */
#endif
#endif
typedef struct PARM_MAP PARM_MAP ;
struct PARM_MAP
{
PHB_ptr phb_ptr ; /* Pointer to the PHB array */
WORD_ptr phb_num_ptr ; /* Ptr to Number of PHB's */
FREE_LIST_ptr free_list; /* Free List pointer */
FREE_LIST_ptr free_list_end; /* Free List End pointer */
Q_BUF_ptr_ptr q_free_list_ptr ; /* Ptr to Q_BUF variable */
BYTE_ptr unit_id_ptr ; /* Unit Id */
LPB_ptr link_str_ptr ; /* Link Structure Array */
BYTE_ptr bootloader_1 ; /* 1st Stage Boot Loader */
BYTE_ptr bootloader_2 ; /* 2nd Stage Boot Loader */
WORD_ptr port_route_map_ptr ; /* Port Route Map */
ROUTE_STR_ptr route_ptr ; /* Unit Route Map */
NUMBER_ptr map_present ; /* Route Map present */
NUMBER pkt_num ; /* Total number of packets */
NUMBER q_num ; /* Total number of Q packets */
WORD buffers_per_port ; /* Number of buffers per port */
WORD heap_size ; /* Initial size of heap */
WORD heap_left ; /* Current Heap left */
WORD error ; /* Error code */
WORD tx_max; /* Max number of tx pkts per phb */
WORD rx_max; /* Max number of rx pkts per phb */
WORD rx_limit; /* For high / low watermarks */
NUMBER links ; /* Links to use */
NUMBER timer ; /* Interrupts per second */
RUP_ptr rups ; /* Pointer to the RUPs */
WORD max_phb ; /* Mostly for debugging */
WORD living ; /* Just increments!! */
WORD init_done ; /* Initialisation over */
WORD booting_link ;
WORD idle_count ; /* Idle time counter */
WORD busy_count ; /* Busy counter */
WORD idle_control ; /* Control Idle Process */
#if defined(HOST) || defined(INKERNEL)
WORD tx_intr; /* TX interrupt pending */
WORD rx_intr; /* RX interrupt pending */
WORD rup_intr; /* RUP interrupt pending */
#endif
#if defined(RTA)
WORD dying_count; /* Count of processes dead */
#endif
} ;
#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__
#ifdef SCCS_LABELS
static char *_pci_h_sccs_ = "@(#)pci.h 1.2";
#endif
/*
** 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__ */
This diff is collapsed.
/****************************************************************************
******* *******
******* 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
#ifdef SCCS_LABELS
#ifndef lint
/* static char *_rio_pkt_h_sccs = "@(#)pkt.h 1.8"; */
#endif
#endif
#define MAX_TTL 0xf
#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 {
#ifdef INKERNEL
BYTE dest_unit ; /* Destination Unit Id */
BYTE dest_port ; /* Destination POrt */
BYTE src_unit ; /* Source Unit Id */
BYTE src_port ; /* Source POrt */
#else
union
{
ushort destination; /* Complete destination */
struct
{
unsigned char unit; /* Destination unit */
unsigned char port; /* Destination port */
} s1;
} u1;
union
{
ushort source; /* Complete source */
struct
{
unsigned char unit; /* Source unit */
unsigned char port; /* Source port */
} s2;
} u2;
#endif
#ifdef INKERNEL
BYTE len ;
BYTE control;
#else
union
{
ushort control;
struct
{
unsigned char len;
unsigned char control;
} s3;
} u3;
#endif
BYTE data[PKT_MAX_DATA_LEN] ;
/* Actual data :-) */
WORD csum ; /* C-SUM */
} ;
#endif
/*********** end of file ***********/
/****************************************************************************
******* *******
******* P O L L
******* *******
****************************************************************************
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 _poll_h
#define _poll_h
#ifndef lint
#ifdef SCCS_LABELS
static char *_rio_poll_h_sccs = "@(#)poll.h 1.2" ;
#endif
#endif
#ifdef HOST
#define POLL_STACK 100
#endif
#ifdef RTA
#define POLL_STACK 200
#endif
#define POLL_PERIOD (int) SECOND
/* The various poll commands */
#define POLL_POLL 0 /* We are connected and happy.. */
#define POLL_INTRO 1 /* Introduction packet */
#define POLL_TOPOLOGY 2 /* Topology update */
#define POLL_ASSIGN 3 /* ID assign */
#define POLL_FOAD 4 /* F*** Off And Die */
#define POLL_LMD 5 /* Let Me Die */
#define POLL_DYB 6 /* Die You Ba***** */
/* The way data fields are split up for POLL packets */
#define POLL_HOST_SERIAL 2 /* Host who booted me */
#define POLL_MY_SERIAL 6 /* My serial number */
#define POLL_YOUR_ID 1 /* Your ID number */
#define POLL_TOPOLOGY_FIELDS 2 /* Topology maps */
#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__
#ifdef SCCS_LABELS
static char *_port_h_sccs_ = "@(#)port.h 1.3";
#endif
#undef VPIX
/*
** the port data structure - one per port in the system
*/
#ifdef STATS
struct RIOStats
{
/*
** interrupt statistics
*/
uint BreakIntCnt;
uint ModemOffCnt;
uint ModemOnCnt;
uint RxIntCnt;
uint TxIntCnt;
/*
** throughput statistics
*/
uint RxCharCnt;
uint RxPktCnt;
uint RxSaveCnt;
uint TxCharCnt;
uint TxPktCnt;
/*
** driver entry statistics
*/
uint CloseCnt;
uint IoctlCnt;
uint OpenCnt;
uint ReadCnt;
uint WriteCnt;
/*
** proc statistics
*/
uint BlockCnt;
uint OutputCnt;
uint ResumeCnt;
uint RflushCnt;
uint SuspendCnt;
uint TbreakCnt;
uint TimeoutCnt;
uint UnblockCnt;
uint WflushCnt;
uint WFBodgeCnt;
};
#endif
/*
** Port data structure
*/
struct Port
{
struct gs_port gs;
int PortNum; /* RIO port no., 0-511 */
struct Host *HostP;
volatile caddr_t Caddr;
ushort HostPort; /* Port number on host card */
uchar RupNum; /* Number of RUP for port */
uchar ID2; /* Second ID of RTA for port */
ulong 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. */
ulong 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 *PhbP; /* pointer to PHB for port */
WORD *TxAdd; /* Add packets here */
WORD *TxStart; /* Start of add array */
WORD *TxEnd; /* End of add array */
WORD *RxRemove; /* Remove packets here */
WORD *RxStart; /* Start of remove array */
WORD *RxEnd; /* End of remove array */
uint RtaUniqueNum; /* Unique number of RTA */
ushort PortState; /* status of port */
ushort ModemState; /* status of modem lines */
ulong ModemLines; /* Modem bits sent to RTA */
uchar CookMode; /* who expands CR/LF? */
uchar ParamSem; /* Prevent write during param */
uchar Mapped; /* if port mapped onto host */
uchar SecondBlock; /* if port belongs to 2nd block
of 16 port RTA */
uchar InUse; /* how many pre-emptive cmds */
uchar Lock; /* if params locked */
uchar Store; /* if params stored across closes */
uchar FirstOpen; /* TRUE if first time port opened */
uchar FlushCmdBodge; /* if doing a (non)flush */
uchar 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 */
uchar 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
uint XpCps;
char XpOn[MAX_XP_CTRL_LEN];
char XpOff[MAX_XP_CTRL_LEN];
ushort XpLen; /* strlen(XpOn)+strlen(XpOff) */
uchar XpActive;
uchar XpLastTickOk; /* TRUE if we can process */
#define XP_OPEN 00001
#define XP_RUNABLE 00002
struct ttystatics *XttyP;
} Xprint;
#ifdef VPIX
v86_t *StashP;
uint IntMask;
struct termss VpixSs;
uchar ModemStatusReg; /* Modem status register */
#endif
uchar RxDataStart;
uchar Cor2Copy; /* copy of COR2 */
char *Name; /* points to the Rta's name */
#ifdef STATS
struct RIOStats Stat; /* ports statistics */
#endif
char *TxRingBuffer;
ushort TxBufferIn; /* New data arrives here */
ushort TxBufferOut; /* Intr removes data here */
ushort OldTxBufferOut; /* Indicates if draining */
int TimeoutId; /* Timeout ID */
uint Debug;
uchar WaitUntilBooted; /* True if open should block */
uint statsGather; /* True if gathering stats */
ulong txchars; /* Chars transmitted */
ulong rxchars; /* Chars received */
ulong opens; /* port open count */
ulong closes; /* port close count */
ulong ioctls; /* ioctl count */
uchar 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;
uint Flags[4]; /* one per port on a module */
};
#endif
/*
** 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 {
uint Port;
ulong Config;
ulong State;
struct ttystatics *TtyP;
};
/*
*
* (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.
*/
#ifndef _prototypes_h
#define _prototypes_h
/*
** boot.c
*/
void init_boot( char *p, short stage);
/*
** disconct.c
*/
void kill_boot ( LPB *link );
void disconnected( LPB *link );
short boot_3( LPB *link, PKT *pkt );
short send_3_pkt( LPB *link, PKT *pkt);
/*
** error.c
*/
void du_error(void);
/*
** formpkt.c
*/
ushort sum_it( PKT *pkt ) ;
void form_rup_pkt( RUP *form_rup, PKT *pkt );
void form_poll_pkt ( int type, LPB *link, int node );
void form_route_pkt ( int type, PKT *pkt, LPB *link );
/*
** idle.c
*/
void idle( Process *idle_p );
/*
** init.c
*/
void general_init(void);
void mem_halt( int error);
/*
** linkinit.c
*/
void initlink( u_short number, LPB *link);
void runlink( LPB *link);
/*
** list.c
*/
PKT *get_free_start(void);
void put_free_start( PKT *pkt);
#ifdef HOST
int can_remove_transmit ( PKT **pkt, PKT *pointer );
#endif
#ifdef RTA
int spl7 ( void );
int spl0 ( void );
Q_BUF *get_free_q( void );
PKT *get_free_end(void);
int add_end( PKT *pkt, PHB *phb, int type);
unsigned short free_packets( PHB *phb, int type);
int can_remove_start( PKT **pkt, PHB *phb, int type);
int can_add_start( PHB *phb, int type);
int can_add_end( PHB *phb, int type);
void put_free_end( PKT *pkt);
int remove_start( PKT **pkt, PHB *phb, int type);
#endif
/*
** Lrt.c
*/
void lrt( Process *lrt_p, LPB *link );
#ifdef RTA
void set_led_red ( LPB *link );
#endif
/*
** ltt.c
*/
void ltt( Process *ltt_p, LPB *link, PHB *phb_ptr[] );
void send_poll ( LPB *link );
void request_id ( LPB *link );
void send_topology_update ( LPB *link );
void send_topology ( LPB *link );
void supply_id ( LPB *link );
#ifdef RTA
void redirect_queue ( LPB *link, ushort flush );
int obtain_rup ( int rup_number, PKT **pkt_address, LPB *link );
#endif
#ifdef TESTING_PERF
int consume_cpu( void );
#endif
/*
** lttwake.c
*/
#ifdef HOST
void ltt_wakeup( Process *ltt_wakeup_p );
#endif
/*
** mapgen.c
*/
void generate_id_map( short mapping, ROUTE_STR route[] );
void gen_map( int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl );
void adjust_ttl( int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl);
void init_sys_map(void);
/*
** mmu.c
*/
char *rio_malloc( unsigned int amount);
char *rio_calloc( unsigned int num, unsigned int size);
ERROR rio_mmu_init( uint total_mem );
/*
** partn.c
*/
void partition_tx( struct PHB *phb, u_short tx_size, u_short rx_size, u_short rx_limit);
/*
** poll.c
*/
void tx_poll( Process *tx_poll_p);
/*
** process.c
*/
int get_proc_space( Process **pd, int **pws, int wssize);
/*
** readrom.c
*/
void read_serial_number(char *buf);
/*
** rio.c
*/
int main( void );
/*
** route.c
*/
void route_update ( PKT *pkt, LPB *link);
/*
** rtainit.c
*/
#if defined(RTA)
void rta_init(ushort RtaType);
#endif /* defined(RTA) */
/*
** rupboot.c
*/
void rup_boot( PKT *pkt, RUP *this_rup, LPB *link);
#ifdef RTA
void kill_your_neighbour( int link_to_kill );
#endif
/*
** rupcmd.c
*/
void rup_command( PKT *pkt, struct RUP *this_rup, LPB *link);
/*
** ruperr.c
*/
void rup_error( PKT *pkt, RUP *this_rup, LPB *link );
void illegal_cmd( PKT *src_pkt );
/*
** ruppoll.c
*/
void rup_poll( PKT *pkt, RUP *this_rup, LPB *link );
/*
** ruppower.c
*/
void rup_power( PKT *pkt, RUP *this_rup, LPB *link );
/*
** ruprm.c
*/
void rup_route_map( PKT *pkt, RUP *this_rup, LPB *link);
/*
** rupstat.c
*/
void rup_status( PKT *pkt, RUP *this_rup, LPB *link);
/*
** rupsync.c
*/
void rup_sync( PKT *pkt);
/*
** rxpkt.c
*/
ERROR rx_pkt( PKT_ptr_ptr pkt_address, LPB *link);
/*
** sendsts.c
*/
void send_status( PKT *requesting_pkt, RUP *this_rup);
/*
** serial.c
*/
void assign_serial ( char *ser_in, char *ser_out);
int cmp_serial ( char *ser_1, char *ser_2);
/*
** txpkt.c
*/
ERROR tx_pkt( PKT *pkt, LPB *link);
short send_sync( LPB *link);
#endif /* _prototypes_h */
/****************************************************************************
******* *******
******* 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
#ifdef SCCS_LABELS
#ifndef lint
/* static char *_rio_protsts_h_sccs = "@(#)protsts.h 1.4"; */
#endif
#endif
/*************************************************
* 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 ***********/
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.
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.
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.
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