Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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 Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 36 | #include <asm/param.h> /* for HZ */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #define MEMDUMP_SIZE 32 |
| 39 | #define MOD_DISABLE (RIO_NOREAD|RIO_NOWRITE|RIO_NOXPRINT) |
| 40 | |
| 41 | |
| 42 | struct rio_info { |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 43 | int mode; /* Intr or polled, word/byte */ |
| 44 | spinlock_t RIOIntrSem; /* Interrupt thread sem */ |
| 45 | int current_chan; /* current channel */ |
| 46 | int RIOFailed; /* Not initialised ? */ |
| 47 | int RIOInstallAttempts; /* no. of rio-install() calls */ |
| 48 | int RIOLastPCISearch; /* status of last search */ |
| 49 | int RIONumHosts; /* Number of RIO Hosts */ |
| 50 | struct Host *RIOHosts; /* RIO Host values */ |
| 51 | struct Port **RIOPortp; /* RIO port values */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | /* |
| 53 | ** 02.03.1999 ARG - ESIL 0820 fix |
| 54 | ** We no longer use RIOBootMode |
| 55 | ** |
| 56 | int RIOBootMode; * RIO boot mode * |
| 57 | ** |
| 58 | */ |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 59 | int RIOPrintDisabled; /* RIO printing disabled ? */ |
| 60 | int RIOPrintLogState; /* RIO printing state ? */ |
| 61 | int RIOPolling; /* Polling ? */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | /* |
| 63 | ** 09.12.1998 ARG - ESIL 0776 part fix |
| 64 | ** The 'RIO_QUICK_CHECK' ioctl was using RIOHalted. |
| 65 | ** The fix for this ESIL introduces another member (RIORtaDisCons) here to be |
| 66 | ** updated in RIOConCon() - to keep track of RTA connections/disconnections. |
| 67 | ** 'RIO_QUICK_CHECK' now returns the value of RIORtaDisCons. |
| 68 | */ |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 69 | int RIOHalted; /* halted ? */ |
| 70 | int RIORtaDisCons; /* RTA connections/disconnections */ |
Alan Cox | 27c6e52 | 2006-03-24 03:18:26 -0800 | [diff] [blame] | 71 | unsigned int RIOReadCheck; /* Rio read check */ |
| 72 | unsigned int RIONoMessage; /* To display message or not */ |
| 73 | unsigned int RIONumBootPkts; /* how many packets for an RTA */ |
| 74 | unsigned int RIOBootCount; /* size of RTA code */ |
| 75 | unsigned int RIOBooting; /* count of outstanding boots */ |
| 76 | unsigned int RIOSystemUp; /* Booted ?? */ |
| 77 | unsigned int RIOCounting; /* for counting interrupts */ |
| 78 | unsigned int RIOIntCount; /* # of intr since last check */ |
| 79 | unsigned int RIOTxCount; /* number of xmit intrs */ |
| 80 | unsigned int RIORxCount; /* number of rx intrs */ |
| 81 | unsigned int RIORupCount; /* number of rup intrs */ |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 82 | int RIXTimer; |
| 83 | int RIOBufferSize; /* Buffersize */ |
| 84 | int RIOBufferMask; /* Buffersize */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 86 | int RIOFirstMajor; /* First host card's major no */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
Alan Cox | 27c6e52 | 2006-03-24 03:18:26 -0800 | [diff] [blame] | 88 | unsigned int RIOLastPortsMapped; /* highest port number known */ |
| 89 | unsigned int RIOFirstPortsMapped; /* lowest port number known */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
Alan Cox | 27c6e52 | 2006-03-24 03:18:26 -0800 | [diff] [blame] | 91 | unsigned int RIOLastPortsBooted; /* highest port number running */ |
| 92 | unsigned int RIOFirstPortsBooted; /* lowest port number running */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | |
Alan Cox | 27c6e52 | 2006-03-24 03:18:26 -0800 | [diff] [blame] | 94 | unsigned int RIOLastPortsOpened; /* highest port number running */ |
| 95 | unsigned int RIOFirstPortsOpened; /* lowest port number running */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | |
| 97 | /* Flag to say that the topology information has been changed. */ |
Alan Cox | 27c6e52 | 2006-03-24 03:18:26 -0800 | [diff] [blame] | 98 | unsigned int RIOQuickCheck; |
| 99 | unsigned int CdRegister; /* ??? */ |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 100 | int RIOSignalProcess; /* Signalling process */ |
| 101 | int rio_debug; /* To debug ... */ |
| 102 | int RIODebugWait; /* For what ??? */ |
| 103 | int tpri; /* Thread prio */ |
| 104 | int tid; /* Thread id */ |
Alan Cox | 27c6e52 | 2006-03-24 03:18:26 -0800 | [diff] [blame] | 105 | unsigned int _RIO_Polled; /* Counter for polling */ |
| 106 | unsigned int _RIO_Interrupted; /* Counter for interrupt */ |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 107 | int intr_tid; /* iointset return value */ |
| 108 | int TxEnSem; /* TxEnable Semaphore */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | |
| 110 | |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 111 | struct Error RIOError; /* to Identify what went wrong */ |
| 112 | struct Conf RIOConf; /* Configuration ??? */ |
| 113 | struct ttystatics channel[RIO_PORTS]; /* channel information */ |
| 114 | char RIOBootPackets[1 + (SIXTY_FOUR_K / RTA_BOOT_DATA_SIZE)] |
| 115 | [RTA_BOOT_DATA_SIZE]; |
| 116 | struct Map RIOConnectTable[TOTAL_MAP_ENTRIES]; |
| 117 | struct Map RIOSavedTable[TOTAL_MAP_ENTRIES]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | |
| 119 | /* RTA to host binding table for master/slave operation */ |
Alan Cox | 27c6e52 | 2006-03-24 03:18:26 -0800 | [diff] [blame] | 120 | unsigned long RIOBindTab[MAX_RTA_BINDINGS]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | /* RTA memory dump variable */ |
Alan Cox | 27c6e52 | 2006-03-24 03:18:26 -0800 | [diff] [blame] | 122 | unsigned char RIOMemDump[MEMDUMP_SIZE]; |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 123 | struct ModuleInfo RIOModuleTypes[MAX_MODULE_TYPES]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | |
| 125 | }; |
| 126 | |
| 127 | |
| 128 | #ifdef linux |
| 129 | #define debug(x) printk x |
| 130 | #else |
| 131 | #define debug(x) kkprintf x |
| 132 | #endif |
| 133 | |
| 134 | |
| 135 | |
| 136 | #define RIO_RESET_INT 0x7d80 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | |
Andrew Morton | 8d8706e | 2006-01-11 12:17:49 -0800 | [diff] [blame] | 138 | #endif /* __riodrvr.h */ |