blob: 663ee0914ed789720d4f0f17f82e3511e41e447b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2** -----------------------------------------------------------------------------
3**
4** Perle Specialix driver for Linux
5** Ported from existing RIO Driver for SCO sources.
6 *
7 * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22**
23** Module : riodrvr.h
24** SID : 1.3
25** Last Modified : 11/6/98 09:22:46
26** Retrieved : 11/6/98 09:22:46
27**
28** ident @(#)riodrvr.h 1.3
29**
30** -----------------------------------------------------------------------------
31*/
32
33#ifndef __riodrvr_h
34#define __riodrvr_h
35
Andrew Morton8d8706e2006-01-11 12:17:49 -080036#include <asm/param.h> /* for HZ */
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38#ifdef SCCS_LABELS
39static char *_riodrvr_h_sccs_ = "@(#)riodrvr.h 1.3";
40#endif
41
42#define MEMDUMP_SIZE 32
43#define MOD_DISABLE (RIO_NOREAD|RIO_NOWRITE|RIO_NOXPRINT)
44
45
46struct rio_info {
Andrew Morton8d8706e2006-01-11 12:17:49 -080047 int mode; /* Intr or polled, word/byte */
48 spinlock_t RIOIntrSem; /* Interrupt thread sem */
49 int current_chan; /* current channel */
50 int RIOFailed; /* Not initialised ? */
51 int RIOInstallAttempts; /* no. of rio-install() calls */
52 int RIOLastPCISearch; /* status of last search */
53 int RIONumHosts; /* Number of RIO Hosts */
54 struct Host *RIOHosts; /* RIO Host values */
55 struct Port **RIOPortp; /* RIO port values */
Linus Torvalds1da177e2005-04-16 15:20:36 -070056/*
57** 02.03.1999 ARG - ESIL 0820 fix
58** We no longer use RIOBootMode
59**
60 int RIOBootMode; * RIO boot mode *
61**
62*/
Andrew Morton8d8706e2006-01-11 12:17:49 -080063 int RIOPrintDisabled; /* RIO printing disabled ? */
64 int RIOPrintLogState; /* RIO printing state ? */
65 int RIOPolling; /* Polling ? */
Linus Torvalds1da177e2005-04-16 15:20:36 -070066/*
67** 09.12.1998 ARG - ESIL 0776 part fix
68** The 'RIO_QUICK_CHECK' ioctl was using RIOHalted.
69** The fix for this ESIL introduces another member (RIORtaDisCons) here to be
70** updated in RIOConCon() - to keep track of RTA connections/disconnections.
71** 'RIO_QUICK_CHECK' now returns the value of RIORtaDisCons.
72*/
Andrew Morton8d8706e2006-01-11 12:17:49 -080073 int RIOHalted; /* halted ? */
74 int RIORtaDisCons; /* RTA connections/disconnections */
75 uint RIOReadCheck; /* Rio read check */
76 uint RIONoMessage; /* To display message or not */
77 uint RIONumBootPkts; /* how many packets for an RTA */
78 uint RIOBootCount; /* size of RTA code */
79 uint RIOBooting; /* count of outstanding boots */
80 uint RIOSystemUp; /* Booted ?? */
81 uint RIOCounting; /* for counting interrupts */
82 uint RIOIntCount; /* # of intr since last check */
83 uint RIOTxCount; /* number of xmit intrs */
84 uint RIORxCount; /* number of rx intrs */
85 uint RIORupCount; /* number of rup intrs */
86 int RIXTimer;
87 int RIOBufferSize; /* Buffersize */
88 int RIOBufferMask; /* Buffersize */
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
Andrew Morton8d8706e2006-01-11 12:17:49 -080090 int RIOFirstMajor; /* First host card's major no */
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
Andrew Morton8d8706e2006-01-11 12:17:49 -080092 uint RIOLastPortsMapped; /* highest port number known */
93 uint RIOFirstPortsMapped; /* lowest port number known */
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
Andrew Morton8d8706e2006-01-11 12:17:49 -080095 uint RIOLastPortsBooted; /* highest port number running */
96 uint RIOFirstPortsBooted; /* lowest port number running */
Linus Torvalds1da177e2005-04-16 15:20:36 -070097
Andrew Morton8d8706e2006-01-11 12:17:49 -080098 uint RIOLastPortsOpened; /* highest port number running */
99 uint RIOFirstPortsOpened; /* lowest port number running */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100
101 /* Flag to say that the topology information has been changed. */
Andrew Morton8d8706e2006-01-11 12:17:49 -0800102 uint RIOQuickCheck;
103 uint CdRegister; /* ??? */
104 int RIOSignalProcess; /* Signalling process */
105 int rio_debug; /* To debug ... */
106 int RIODebugWait; /* For what ??? */
107 int tpri; /* Thread prio */
108 int tid; /* Thread id */
109 uint _RIO_Polled; /* Counter for polling */
110 uint _RIO_Interrupted; /* Counter for interrupt */
111 int intr_tid; /* iointset return value */
112 int TxEnSem; /* TxEnable Semaphore */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113
114
Andrew Morton8d8706e2006-01-11 12:17:49 -0800115 struct Error RIOError; /* to Identify what went wrong */
116 struct Conf RIOConf; /* Configuration ??? */
117 struct ttystatics channel[RIO_PORTS]; /* channel information */
118 char RIOBootPackets[1 + (SIXTY_FOUR_K / RTA_BOOT_DATA_SIZE)]
119 [RTA_BOOT_DATA_SIZE];
120 struct Map RIOConnectTable[TOTAL_MAP_ENTRIES];
121 struct Map RIOSavedTable[TOTAL_MAP_ENTRIES];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122
123 /* RTA to host binding table for master/slave operation */
Andrew Morton8d8706e2006-01-11 12:17:49 -0800124 ulong RIOBindTab[MAX_RTA_BINDINGS];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 /* RTA memory dump variable */
Andrew Morton8d8706e2006-01-11 12:17:49 -0800126 uchar RIOMemDump[MEMDUMP_SIZE];
127 struct ModuleInfo RIOModuleTypes[MAX_MODULE_TYPES];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128
129};
130
131
132#ifdef linux
133#define debug(x) printk x
134#else
135#define debug(x) kkprintf x
136#endif
137
138
139
140#define RIO_RESET_INT 0x7d80
141#define WRBYTE(x,y) *(volatile unsigned char *)((x)) = \
142 (unsigned char)(y)
143
Andrew Morton8d8706e2006-01-11 12:17:49 -0800144#endif /* __riodrvr.h */