ia64/linux-2.6.18-xen.hg

annotate drivers/char/rio/rio.h @ 893:f994bfe9b93b

linux/blktap2: reduce TLB flush scope

c/s 885 added very coarse TLB flushing. Since these flushes always
follow single page updates, single page flushes (when available) are
sufficient.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 04 10:32:57 2009 +0100 (2009-06-04)
parents 831230e53067
children
rev   line source
ian@0 1 /*
ian@0 2 ** -----------------------------------------------------------------------------
ian@0 3 **
ian@0 4 ** Perle Specialix driver for Linux
ian@0 5 ** Ported from existing RIO Driver for SCO sources.
ian@0 6 *
ian@0 7 * (C) 1990 - 1998 Specialix International Ltd., Byfleet, Surrey, UK.
ian@0 8 *
ian@0 9 * This program is free software; you can redistribute it and/or modify
ian@0 10 * it under the terms of the GNU General Public License as published by
ian@0 11 * the Free Software Foundation; either version 2 of the License, or
ian@0 12 * (at your option) any later version.
ian@0 13 *
ian@0 14 * This program is distributed in the hope that it will be useful,
ian@0 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ian@0 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ian@0 17 * GNU General Public License for more details.
ian@0 18 *
ian@0 19 * You should have received a copy of the GNU General Public License
ian@0 20 * along with this program; if not, write to the Free Software
ian@0 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
ian@0 22 **
ian@0 23 ** Module : rio.h
ian@0 24 ** SID : 1.3
ian@0 25 ** Last Modified : 11/6/98 11:34:13
ian@0 26 ** Retrieved : 11/6/98 11:34:22
ian@0 27 **
ian@0 28 ** ident @(#)rio.h 1.3
ian@0 29 **
ian@0 30 ** -----------------------------------------------------------------------------
ian@0 31 */
ian@0 32
ian@0 33 #ifndef __rio_rio_h__
ian@0 34 #define __rio_rio_h__
ian@0 35
ian@0 36 /*
ian@0 37 ** Maximum numbers of things
ian@0 38 */
ian@0 39 #define RIO_SLOTS 4 /* number of configuration slots */
ian@0 40 #define RIO_HOSTS 4 /* number of hosts that can be found */
ian@0 41 #define PORTS_PER_HOST 128 /* number of ports per host */
ian@0 42 #define LINKS_PER_UNIT 4 /* number of links from a host */
ian@0 43 #define RIO_PORTS (PORTS_PER_HOST * RIO_HOSTS) /* max. no. of ports */
ian@0 44 #define RTAS_PER_HOST (MAX_RUP) /* number of RTAs per host */
ian@0 45 #define PORTS_PER_RTA (PORTS_PER_HOST/RTAS_PER_HOST) /* ports on a rta */
ian@0 46 #define PORTS_PER_MODULE 4 /* number of ports on a plug-in module */
ian@0 47 /* number of modules on an RTA */
ian@0 48 #define MODULES_PER_RTA (PORTS_PER_RTA/PORTS_PER_MODULE)
ian@0 49 #define MAX_PRODUCT 16 /* numbr of different product codes */
ian@0 50 #define MAX_MODULE_TYPES 16 /* number of different types of module */
ian@0 51
ian@0 52 #define RIO_CONTROL_DEV 128 /* minor number of host/control device */
ian@0 53 #define RIO_INVALID_MAJOR 0 /* test first host card's major no for validity */
ian@0 54
ian@0 55 /*
ian@0 56 ** number of RTAs that can be bound to a master
ian@0 57 */
ian@0 58 #define MAX_RTA_BINDINGS (MAX_RUP * RIO_HOSTS)
ian@0 59
ian@0 60 /*
ian@0 61 ** Unit types
ian@0 62 */
ian@0 63 #define PC_RTA16 0x90000000
ian@0 64 #define PC_RTA8 0xe0000000
ian@0 65 #define TYPE_HOST 0
ian@0 66 #define TYPE_RTA8 1
ian@0 67 #define TYPE_RTA16 2
ian@0 68
ian@0 69 /*
ian@0 70 ** Flag values returned by functions
ian@0 71 */
ian@0 72
ian@0 73 #define RIO_FAIL -1
ian@0 74
ian@0 75 /*
ian@0 76 ** SysPort value for something that hasn't any ports
ian@0 77 */
ian@0 78 #define NO_PORT 0xFFFFFFFF
ian@0 79
ian@0 80 /*
ian@0 81 ** Unit ID Of all hosts
ian@0 82 */
ian@0 83 #define HOST_ID 0
ian@0 84
ian@0 85 /*
ian@0 86 ** Break bytes into nybles
ian@0 87 */
ian@0 88 #define LONYBLE(X) ((X) & 0xF)
ian@0 89 #define HINYBLE(X) (((X)>>4) & 0xF)
ian@0 90
ian@0 91 /*
ian@0 92 ** Flag values passed into some functions
ian@0 93 */
ian@0 94 #define DONT_SLEEP 0
ian@0 95 #define OK_TO_SLEEP 1
ian@0 96
ian@0 97 #define DONT_PRINT 1
ian@0 98 #define DO_PRINT 0
ian@0 99
ian@0 100 #define PRINT_TO_LOG_CONS 0
ian@0 101 #define PRINT_TO_CONS 1
ian@0 102 #define PRINT_TO_LOG 2
ian@0 103
ian@0 104 /*
ian@0 105 ** Timeout has trouble with times of less than 3 ticks...
ian@0 106 */
ian@0 107 #define MIN_TIMEOUT 3
ian@0 108
ian@0 109 /*
ian@0 110 ** Generally useful constants
ian@0 111 */
ian@0 112
ian@0 113 #define HUNDRED_MS ((HZ/10)?(HZ/10):1)
ian@0 114 #define ONE_MEG 0x100000
ian@0 115 #define SIXTY_FOUR_K 0x10000
ian@0 116
ian@0 117 #define RIO_AT_MEM_SIZE SIXTY_FOUR_K
ian@0 118 #define RIO_EISA_MEM_SIZE SIXTY_FOUR_K
ian@0 119 #define RIO_MCA_MEM_SIZE SIXTY_FOUR_K
ian@0 120
ian@0 121 #define COOK_WELL 0
ian@0 122 #define COOK_MEDIUM 1
ian@0 123 #define COOK_RAW 2
ian@0 124
ian@0 125 /*
ian@0 126 ** Pointer manipulation stuff
ian@0 127 ** RIO_PTR takes hostp->Caddr and the offset into the DP RAM area
ian@0 128 ** and produces a UNIX caddr_t (pointer) to the object
ian@0 129 ** RIO_OBJ takes hostp->Caddr and a UNIX pointer to an object and
ian@0 130 ** returns the offset into the DP RAM area.
ian@0 131 */
ian@0 132 #define RIO_PTR(C,O) (((unsigned char __iomem *)(C))+(0xFFFF&(O)))
ian@0 133 #define RIO_OFF(C,O) ((unsigned char __iomem *)(O)-(unsigned char __iomem *)(C))
ian@0 134
ian@0 135 /*
ian@0 136 ** How to convert from various different device number formats:
ian@0 137 ** DEV is a dev number, as passed to open, close etc - NOT a minor
ian@0 138 ** number!
ian@0 139 **/
ian@0 140
ian@0 141 #define RIO_MODEM_MASK 0x1FF
ian@0 142 #define RIO_MODEM_BIT 0x200
ian@0 143 #define RIO_UNMODEM(DEV) (MINOR(DEV) & RIO_MODEM_MASK)
ian@0 144 #define RIO_ISMODEM(DEV) (MINOR(DEV) & RIO_MODEM_BIT)
ian@0 145 #define RIO_PORT(DEV,FIRST_MAJ) ( (MAJOR(DEV) - FIRST_MAJ) * PORTS_PER_HOST) \
ian@0 146 + MINOR(DEV)
ian@0 147 #define CSUM(pkt_ptr) (((u16 *)(pkt_ptr))[0] + ((u16 *)(pkt_ptr))[1] + \
ian@0 148 ((u16 *)(pkt_ptr))[2] + ((u16 *)(pkt_ptr))[3] + \
ian@0 149 ((u16 *)(pkt_ptr))[4] + ((u16 *)(pkt_ptr))[5] + \
ian@0 150 ((u16 *)(pkt_ptr))[6] + ((u16 *)(pkt_ptr))[7] + \
ian@0 151 ((u16 *)(pkt_ptr))[8] + ((u16 *)(pkt_ptr))[9] )
ian@0 152
ian@0 153 #define RIO_LINK_ENABLE 0x80FF /* FF is a hack, mainly for Mips, to */
ian@0 154 /* prevent a really stupid race condition. */
ian@0 155
ian@0 156 #define NOT_INITIALISED 0
ian@0 157 #define INITIALISED 1
ian@0 158
ian@0 159 #define NOT_POLLING 0
ian@0 160 #define POLLING 1
ian@0 161
ian@0 162 #define NOT_CHANGED 0
ian@0 163 #define CHANGED 1
ian@0 164
ian@0 165 #define NOT_INUSE 0
ian@0 166
ian@0 167 #define DISCONNECT 0
ian@0 168 #define CONNECT 1
ian@0 169
ian@0 170 /* ------ Control Codes ------ */
ian@0 171
ian@0 172 #define CONTROL '^'
ian@0 173 #define IFOAD ( CONTROL + 1 )
ian@0 174 #define IDENTIFY ( CONTROL + 2 )
ian@0 175 #define ZOMBIE ( CONTROL + 3 )
ian@0 176 #define UFOAD ( CONTROL + 4 )
ian@0 177 #define IWAIT ( CONTROL + 5 )
ian@0 178
ian@0 179 #define IFOAD_MAGIC 0xF0AD /* of course */
ian@0 180 #define ZOMBIE_MAGIC (~0xDEAD) /* not dead -> zombie */
ian@0 181 #define UFOAD_MAGIC 0xD1E /* kill-your-neighbour */
ian@0 182 #define IWAIT_MAGIC 0xB1DE /* Bide your time */
ian@0 183
ian@0 184 /* ------ Error Codes ------ */
ian@0 185
ian@0 186 #define E_NO_ERROR ((ushort) 0)
ian@0 187
ian@0 188 /* ------ Free Lists ------ */
ian@0 189
ian@0 190 struct rio_free_list {
ian@0 191 u16 next;
ian@0 192 u16 prev;
ian@0 193 };
ian@0 194
ian@0 195 /* NULL for card side linked lists */
ian@0 196 #define TPNULL ((ushort)(0x8000))
ian@0 197 /* We can add another packet to a transmit queue if the packet pointer pointed
ian@0 198 * to by the TxAdd pointer has PKT_IN_USE clear in its address. */
ian@0 199 #define PKT_IN_USE 0x1
ian@0 200
ian@0 201 /* ------ Topology ------ */
ian@0 202
ian@0 203 struct Top {
ian@0 204 u8 Unit;
ian@0 205 u8 Link;
ian@0 206 };
ian@0 207
ian@0 208 #endif /* __rio_h__ */