ia64/linux-2.6.18-xen.hg

annotate drivers/char/rio/port.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 - 2000 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 : port.h
ian@0 24 ** SID : 1.3
ian@0 25 ** Last Modified : 11/6/98 11:34:12
ian@0 26 ** Retrieved : 11/6/98 11:34:21
ian@0 27 **
ian@0 28 ** ident @(#)port.h 1.3
ian@0 29 **
ian@0 30 ** -----------------------------------------------------------------------------
ian@0 31 */
ian@0 32
ian@0 33 #ifndef __rio_port_h__
ian@0 34 #define __rio_port_h__
ian@0 35
ian@0 36 /*
ian@0 37 ** Port data structure
ian@0 38 */
ian@0 39 struct Port {
ian@0 40 struct gs_port gs;
ian@0 41 int PortNum; /* RIO port no., 0-511 */
ian@0 42 struct Host *HostP;
ian@0 43 void __iomem *Caddr;
ian@0 44 unsigned short HostPort; /* Port number on host card */
ian@0 45 unsigned char RupNum; /* Number of RUP for port */
ian@0 46 unsigned char ID2; /* Second ID of RTA for port */
ian@0 47 unsigned long State; /* FLAGS for open & xopen */
ian@0 48 #define RIO_LOPEN 0x00001 /* Local open */
ian@0 49 #define RIO_MOPEN 0x00002 /* Modem open */
ian@0 50 #define RIO_WOPEN 0x00004 /* Waiting for open */
ian@0 51 #define RIO_CLOSING 0x00008 /* The port is being close */
ian@0 52 #define RIO_XPBUSY 0x00010 /* Transparent printer busy */
ian@0 53 #define RIO_BREAKING 0x00020 /* Break in progress */
ian@0 54 #define RIO_DIRECT 0x00040 /* Doing Direct output */
ian@0 55 #define RIO_EXCLUSIVE 0x00080 /* Stream open for exclusive use */
ian@0 56 #define RIO_NDELAY 0x00100 /* Stream is open FNDELAY */
ian@0 57 #define RIO_CARR_ON 0x00200 /* Stream has carrier present */
ian@0 58 #define RIO_XPWANTR 0x00400 /* Stream wanted by Xprint */
ian@0 59 #define RIO_RBLK 0x00800 /* Stream is read-blocked */
ian@0 60 #define RIO_BUSY 0x01000 /* Stream is BUSY for write */
ian@0 61 #define RIO_TIMEOUT 0x02000 /* Stream timeout in progress */
ian@0 62 #define RIO_TXSTOP 0x04000 /* Stream output is stopped */
ian@0 63 #define RIO_WAITFLUSH 0x08000 /* Stream waiting for flush */
ian@0 64 #define RIO_DYNOROD 0x10000 /* Drain failed */
ian@0 65 #define RIO_DELETED 0x20000 /* RTA has been deleted */
ian@0 66 #define RIO_ISSCANCODE 0x40000 /* This line is in scancode mode */
ian@0 67 #define RIO_USING_EUC 0x100000 /* Using extended Unix chars */
ian@0 68 #define RIO_CAN_COOK 0x200000 /* This line can do cooking */
ian@0 69 #define RIO_TRIAD_MODE 0x400000 /* Enable TRIAD special ops. */
ian@0 70 #define RIO_TRIAD_BLOCK 0x800000 /* Next read will block */
ian@0 71 #define RIO_TRIAD_FUNC 0x1000000 /* Seen a function key coming in */
ian@0 72 #define RIO_THROTTLE_RX 0x2000000 /* RX needs to be throttled. */
ian@0 73
ian@0 74 unsigned long Config; /* FLAGS for NOREAD.... */
ian@0 75 #define RIO_NOREAD 0x0001 /* Are not allowed to read port */
ian@0 76 #define RIO_NOWRITE 0x0002 /* Are not allowed to write port */
ian@0 77 #define RIO_NOXPRINT 0x0004 /* Are not allowed to xprint port */
ian@0 78 #define RIO_NOMASK 0x0007 /* All not allowed things */
ian@0 79 #define RIO_IXANY 0x0008 /* Port is allowed ixany */
ian@0 80 #define RIO_MODEM 0x0010 /* Stream is a modem device */
ian@0 81 #define RIO_IXON 0x0020 /* Port is allowed ixon */
ian@0 82 #define RIO_WAITDRAIN 0x0040 /* Wait for port to completely drain */
ian@0 83 #define RIO_MAP_50_TO_50 0x0080 /* Map 50 baud to 50 baud */
ian@0 84 #define RIO_MAP_110_TO_110 0x0100 /* Map 110 baud to 110 baud */
ian@0 85
ian@0 86 /*
ian@0 87 ** 15.10.1998 ARG - ESIL 0761 prt fix
ian@0 88 ** As LynxOS does not appear to support Hardware Flow Control .....
ian@0 89 ** Define our own flow control flags in 'Config'.
ian@0 90 */
ian@0 91 #define RIO_CTSFLOW 0x0200 /* RIO's own CTSFLOW flag */
ian@0 92 #define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */
ian@0 93
ian@0 94
ian@0 95 struct PHB __iomem *PhbP; /* pointer to PHB for port */
ian@0 96 u16 __iomem *TxAdd; /* Add packets here */
ian@0 97 u16 __iomem *TxStart; /* Start of add array */
ian@0 98 u16 __iomem *TxEnd; /* End of add array */
ian@0 99 u16 __iomem *RxRemove; /* Remove packets here */
ian@0 100 u16 __iomem *RxStart; /* Start of remove array */
ian@0 101 u16 __iomem *RxEnd; /* End of remove array */
ian@0 102 unsigned int RtaUniqueNum; /* Unique number of RTA */
ian@0 103 unsigned short PortState; /* status of port */
ian@0 104 unsigned short ModemState; /* status of modem lines */
ian@0 105 unsigned long ModemLines; /* Modem bits sent to RTA */
ian@0 106 unsigned char CookMode; /* who expands CR/LF? */
ian@0 107 unsigned char ParamSem; /* Prevent write during param */
ian@0 108 unsigned char Mapped; /* if port mapped onto host */
ian@0 109 unsigned char SecondBlock; /* if port belongs to 2nd block
ian@0 110 of 16 port RTA */
ian@0 111 unsigned char InUse; /* how many pre-emptive cmds */
ian@0 112 unsigned char Lock; /* if params locked */
ian@0 113 unsigned char Store; /* if params stored across closes */
ian@0 114 unsigned char FirstOpen; /* TRUE if first time port opened */
ian@0 115 unsigned char FlushCmdBodge; /* if doing a (non)flush */
ian@0 116 unsigned char MagicFlags; /* require intr processing */
ian@0 117 #define MAGIC_FLUSH 0x01 /* mirror of WflushFlag */
ian@0 118 #define MAGIC_REBOOT 0x02 /* RTA re-booted, re-open ports */
ian@0 119 #define MORE_OUTPUT_EYGOR 0x04 /* riotproc failed to empty clists */
ian@0 120 unsigned char WflushFlag; /* 1 How many WFLUSHs active */
ian@0 121 /*
ian@0 122 ** Transparent print stuff
ian@0 123 */
ian@0 124 struct Xprint {
ian@0 125 #ifndef MAX_XP_CTRL_LEN
ian@0 126 #define MAX_XP_CTRL_LEN 16 /* ALSO IN DAEMON.H */
ian@0 127 #endif
ian@0 128 unsigned int XpCps;
ian@0 129 char XpOn[MAX_XP_CTRL_LEN];
ian@0 130 char XpOff[MAX_XP_CTRL_LEN];
ian@0 131 unsigned short XpLen; /* strlen(XpOn)+strlen(XpOff) */
ian@0 132 unsigned char XpActive;
ian@0 133 unsigned char XpLastTickOk; /* TRUE if we can process */
ian@0 134 #define XP_OPEN 00001
ian@0 135 #define XP_RUNABLE 00002
ian@0 136 struct ttystatics *XttyP;
ian@0 137 } Xprint;
ian@0 138 unsigned char RxDataStart;
ian@0 139 unsigned char Cor2Copy; /* copy of COR2 */
ian@0 140 char *Name; /* points to the Rta's name */
ian@0 141 char *TxRingBuffer;
ian@0 142 unsigned short TxBufferIn; /* New data arrives here */
ian@0 143 unsigned short TxBufferOut; /* Intr removes data here */
ian@0 144 unsigned short OldTxBufferOut; /* Indicates if draining */
ian@0 145 int TimeoutId; /* Timeout ID */
ian@0 146 unsigned int Debug;
ian@0 147 unsigned char WaitUntilBooted; /* True if open should block */
ian@0 148 unsigned int statsGather; /* True if gathering stats */
ian@0 149 unsigned long txchars; /* Chars transmitted */
ian@0 150 unsigned long rxchars; /* Chars received */
ian@0 151 unsigned long opens; /* port open count */
ian@0 152 unsigned long closes; /* port close count */
ian@0 153 unsigned long ioctls; /* ioctl count */
ian@0 154 unsigned char LastRxTgl; /* Last state of rx toggle bit */
ian@0 155 spinlock_t portSem; /* Lock using this sem */
ian@0 156 int MonitorTstate; /* Monitoring ? */
ian@0 157 int timeout_id; /* For calling 100 ms delays */
ian@0 158 int timeout_sem; /* For calling 100 ms delays */
ian@0 159 int firstOpen; /* First time open ? */
ian@0 160 char *p; /* save the global struc here .. */
ian@0 161 };
ian@0 162
ian@0 163 struct ModuleInfo {
ian@0 164 char *Name;
ian@0 165 unsigned int Flags[4]; /* one per port on a module */
ian@0 166 };
ian@0 167
ian@0 168 /*
ian@0 169 ** This struct is required because trying to grab an entire Port structure
ian@0 170 ** runs into problems with differing struct sizes between driver and config.
ian@0 171 */
ian@0 172 struct PortParams {
ian@0 173 unsigned int Port;
ian@0 174 unsigned long Config;
ian@0 175 unsigned long State;
ian@0 176 struct ttystatics *TtyP;
ian@0 177 };
ian@0 178
ian@0 179 #endif