aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rio/port.h
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-03-24 06:18:24 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:28 -0500
commit74769abfcb430b839914f3fe91e23a4f628d9553 (patch)
treeaf7443e43f236d4d9e6c87ef777989989f1079ec /drivers/char/rio/port.h
parent10e705f83c3e796893a70fb872895ba604901166 (diff)
[PATCH] rio: more header cleanup
Strip some of the typedef mess out Remove a small subset of unused defines and the like. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/rio/port.h')
-rw-r--r--drivers/char/rio/port.h248
1 files changed, 93 insertions, 155 deletions
diff --git a/drivers/char/rio/port.h b/drivers/char/rio/port.h
index c99b1e70fdc8..4f1108fe9b1a 100644
--- a/drivers/char/rio/port.h
+++ b/drivers/char/rio/port.h
@@ -33,91 +33,37 @@
33#ifndef __rio_port_h__ 33#ifndef __rio_port_h__
34#define __rio_port_h__ 34#define __rio_port_h__
35 35
36#ifdef SCCS_LABELS
37static char *_port_h_sccs_ = "@(#)port.h 1.3";
38#endif
39
40
41#undef VPIX
42
43
44/*
45** the port data structure - one per port in the system
46*/
47
48#ifdef STATS
49struct RIOStats {
50 /*
51 ** interrupt statistics
52 */
53 uint BreakIntCnt;
54 uint ModemOffCnt;
55 uint ModemOnCnt;
56 uint RxIntCnt;
57 uint TxIntCnt;
58 /*
59 ** throughput statistics
60 */
61 uint RxCharCnt;
62 uint RxPktCnt;
63 uint RxSaveCnt;
64 uint TxCharCnt;
65 uint TxPktCnt;
66 /*
67 ** driver entry statistics
68 */
69 uint CloseCnt;
70 uint IoctlCnt;
71 uint OpenCnt;
72 uint ReadCnt;
73 uint WriteCnt;
74 /*
75 ** proc statistics
76 */
77 uint BlockCnt;
78 uint OutputCnt;
79 uint ResumeCnt;
80 uint RflushCnt;
81 uint SuspendCnt;
82 uint TbreakCnt;
83 uint TimeoutCnt;
84 uint UnblockCnt;
85 uint WflushCnt;
86 uint WFBodgeCnt;
87};
88#endif
89
90/* 36/*
91** Port data structure 37** Port data structure
92*/ 38*/
93struct Port { 39struct Port {
94 struct gs_port gs; 40 struct gs_port gs;
95 int PortNum; /* RIO port no., 0-511 */ 41 int PortNum; /* RIO port no., 0-511 */
96 struct Host *HostP; 42 struct Host *HostP;
97 volatile caddr_t Caddr; 43 volatile caddr_t Caddr;
98 ushort HostPort; /* Port number on host card */ 44 unsigned short HostPort; /* Port number on host card */
99 uchar RupNum; /* Number of RUP for port */ 45 unsigned char RupNum; /* Number of RUP for port */
100 uchar ID2; /* Second ID of RTA for port */ 46 unsigned char ID2; /* Second ID of RTA for port */
101 ulong State; /* FLAGS for open & xopen */ 47 unsigned long State; /* FLAGS for open & xopen */
102#define RIO_LOPEN 0x00001 /* Local open */ 48#define RIO_LOPEN 0x00001 /* Local open */
103#define RIO_MOPEN 0x00002 /* Modem open */ 49#define RIO_MOPEN 0x00002 /* Modem open */
104#define RIO_WOPEN 0x00004 /* Waiting for open */ 50#define RIO_WOPEN 0x00004 /* Waiting for open */
105#define RIO_CLOSING 0x00008 /* The port is being close */ 51#define RIO_CLOSING 0x00008 /* The port is being close */
106#define RIO_XPBUSY 0x00010 /* Transparent printer busy */ 52#define RIO_XPBUSY 0x00010 /* Transparent printer busy */
107#define RIO_BREAKING 0x00020 /* Break in progress */ 53#define RIO_BREAKING 0x00020 /* Break in progress */
108#define RIO_DIRECT 0x00040 /* Doing Direct output */ 54#define RIO_DIRECT 0x00040 /* Doing Direct output */
109#define RIO_EXCLUSIVE 0x00080 /* Stream open for exclusive use */ 55#define RIO_EXCLUSIVE 0x00080 /* Stream open for exclusive use */
110#define RIO_NDELAY 0x00100 /* Stream is open FNDELAY */ 56#define RIO_NDELAY 0x00100 /* Stream is open FNDELAY */
111#define RIO_CARR_ON 0x00200 /* Stream has carrier present */ 57#define RIO_CARR_ON 0x00200 /* Stream has carrier present */
112#define RIO_XPWANTR 0x00400 /* Stream wanted by Xprint */ 58#define RIO_XPWANTR 0x00400 /* Stream wanted by Xprint */
113#define RIO_RBLK 0x00800 /* Stream is read-blocked */ 59#define RIO_RBLK 0x00800 /* Stream is read-blocked */
114#define RIO_BUSY 0x01000 /* Stream is BUSY for write */ 60#define RIO_BUSY 0x01000 /* Stream is BUSY for write */
115#define RIO_TIMEOUT 0x02000 /* Stream timeout in progress */ 61#define RIO_TIMEOUT 0x02000 /* Stream timeout in progress */
116#define RIO_TXSTOP 0x04000 /* Stream output is stopped */ 62#define RIO_TXSTOP 0x04000 /* Stream output is stopped */
117#define RIO_WAITFLUSH 0x08000 /* Stream waiting for flush */ 63#define RIO_WAITFLUSH 0x08000 /* Stream waiting for flush */
118#define RIO_DYNOROD 0x10000 /* Drain failed */ 64#define RIO_DYNOROD 0x10000 /* Drain failed */
119#define RIO_DELETED 0x20000 /* RTA has been deleted */ 65#define RIO_DELETED 0x20000 /* RTA has been deleted */
120#define RIO_ISSCANCODE 0x40000 /* This line is in scancode mode */ 66#define RIO_ISSCANCODE 0x40000 /* This line is in scancode mode */
121#define RIO_USING_EUC 0x100000 /* Using extended Unix chars */ 67#define RIO_USING_EUC 0x100000 /* Using extended Unix chars */
122#define RIO_CAN_COOK 0x200000 /* This line can do cooking */ 68#define RIO_CAN_COOK 0x200000 /* This line can do cooking */
123#define RIO_TRIAD_MODE 0x400000 /* Enable TRIAD special ops. */ 69#define RIO_TRIAD_MODE 0x400000 /* Enable TRIAD special ops. */
@@ -125,15 +71,15 @@ struct Port {
125#define RIO_TRIAD_FUNC 0x1000000 /* Seen a function key coming in */ 71#define RIO_TRIAD_FUNC 0x1000000 /* Seen a function key coming in */
126#define RIO_THROTTLE_RX 0x2000000 /* RX needs to be throttled. */ 72#define RIO_THROTTLE_RX 0x2000000 /* RX needs to be throttled. */
127 73
128 ulong Config; /* FLAGS for NOREAD.... */ 74 unsigned long Config; /* FLAGS for NOREAD.... */
129#define RIO_NOREAD 0x0001 /* Are not allowed to read port */ 75#define RIO_NOREAD 0x0001 /* Are not allowed to read port */
130#define RIO_NOWRITE 0x0002 /* Are not allowed to write port */ 76#define RIO_NOWRITE 0x0002 /* Are not allowed to write port */
131#define RIO_NOXPRINT 0x0004 /* Are not allowed to xprint port */ 77#define RIO_NOXPRINT 0x0004 /* Are not allowed to xprint port */
132#define RIO_NOMASK 0x0007 /* All not allowed things */ 78#define RIO_NOMASK 0x0007 /* All not allowed things */
133#define RIO_IXANY 0x0008 /* Port is allowed ixany */ 79#define RIO_IXANY 0x0008 /* Port is allowed ixany */
134#define RIO_MODEM 0x0010 /* Stream is a modem device */ 80#define RIO_MODEM 0x0010 /* Stream is a modem device */
135#define RIO_IXON 0x0020 /* Port is allowed ixon */ 81#define RIO_IXON 0x0020 /* Port is allowed ixon */
136#define RIO_WAITDRAIN 0x0040 /* Wait for port to completely drain */ 82#define RIO_WAITDRAIN 0x0040 /* Wait for port to completely drain */
137#define RIO_MAP_50_TO_50 0x0080 /* Map 50 baud to 50 baud */ 83#define RIO_MAP_50_TO_50 0x0080 /* Map 50 baud to 50 baud */
138#define RIO_MAP_110_TO_110 0x0100 /* Map 110 baud to 110 baud */ 84#define RIO_MAP_110_TO_110 0x0100 /* Map 110 baud to 110 baud */
139 85
@@ -142,36 +88,36 @@ struct Port {
142** As LynxOS does not appear to support Hardware Flow Control ..... 88** As LynxOS does not appear to support Hardware Flow Control .....
143** Define our own flow control flags in 'Config'. 89** Define our own flow control flags in 'Config'.
144*/ 90*/
145#define RIO_CTSFLOW 0x0200 /* RIO's own CTSFLOW flag */ 91#define RIO_CTSFLOW 0x0200 /* RIO's own CTSFLOW flag */
146#define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */ 92#define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */
147 93
148 94
149 struct PHB *PhbP; /* pointer to PHB for port */ 95 struct PHB *PhbP; /* pointer to PHB for port */
150 WORD *TxAdd; /* Add packets here */ 96 u16 *TxAdd; /* Add packets here */
151 WORD *TxStart; /* Start of add array */ 97 u16 *TxStart; /* Start of add array */
152 WORD *TxEnd; /* End of add array */ 98 u16 *TxEnd; /* End of add array */
153 WORD *RxRemove; /* Remove packets here */ 99 u16 *RxRemove; /* Remove packets here */
154 WORD *RxStart; /* Start of remove array */ 100 u16 *RxStart; /* Start of remove array */
155 WORD *RxEnd; /* End of remove array */ 101 u16 *RxEnd; /* End of remove array */
156 uint RtaUniqueNum; /* Unique number of RTA */ 102 unsigned int RtaUniqueNum; /* Unique number of RTA */
157 ushort PortState; /* status of port */ 103 unsigned short PortState; /* status of port */
158 ushort ModemState; /* status of modem lines */ 104 unsigned short ModemState; /* status of modem lines */
159 ulong ModemLines; /* Modem bits sent to RTA */ 105 unsigned long ModemLines; /* Modem bits sent to RTA */
160 uchar CookMode; /* who expands CR/LF? */ 106 unsigned char CookMode; /* who expands CR/LF? */
161 uchar ParamSem; /* Prevent write during param */ 107 unsigned char ParamSem; /* Prevent write during param */
162 uchar Mapped; /* if port mapped onto host */ 108 unsigned char Mapped; /* if port mapped onto host */
163 uchar SecondBlock; /* if port belongs to 2nd block 109 unsigned char SecondBlock; /* if port belongs to 2nd block
164 of 16 port RTA */ 110 of 16 port RTA */
165 uchar InUse; /* how many pre-emptive cmds */ 111 unsigned char InUse; /* how many pre-emptive cmds */
166 uchar Lock; /* if params locked */ 112 unsigned char Lock; /* if params locked */
167 uchar Store; /* if params stored across closes */ 113 unsigned char Store; /* if params stored across closes */
168 uchar FirstOpen; /* TRUE if first time port opened */ 114 unsigned char FirstOpen; /* TRUE if first time port opened */
169 uchar FlushCmdBodge; /* if doing a (non)flush */ 115 unsigned char FlushCmdBodge; /* if doing a (non)flush */
170 uchar MagicFlags; /* require intr processing */ 116 unsigned char MagicFlags; /* require intr processing */
171#define MAGIC_FLUSH 0x01 /* mirror of WflushFlag */ 117#define MAGIC_FLUSH 0x01 /* mirror of WflushFlag */
172#define MAGIC_REBOOT 0x02 /* RTA re-booted, re-open ports */ 118#define MAGIC_REBOOT 0x02 /* RTA re-booted, re-open ports */
173#define MORE_OUTPUT_EYGOR 0x04 /* riotproc failed to empty clists */ 119#define MORE_OUTPUT_EYGOR 0x04 /* riotproc failed to empty clists */
174 uchar WflushFlag; /* 1 How many WFLUSHs active */ 120 unsigned char WflushFlag; /* 1 How many WFLUSHs active */
175/* 121/*
176** Transparent print stuff 122** Transparent print stuff
177*/ 123*/
@@ -179,63 +125,55 @@ struct Port {
179#ifndef MAX_XP_CTRL_LEN 125#ifndef MAX_XP_CTRL_LEN
180#define MAX_XP_CTRL_LEN 16 /* ALSO IN DAEMON.H */ 126#define MAX_XP_CTRL_LEN 16 /* ALSO IN DAEMON.H */
181#endif 127#endif
182 uint XpCps; 128 unsigned int XpCps;
183 char XpOn[MAX_XP_CTRL_LEN]; 129 char XpOn[MAX_XP_CTRL_LEN];
184 char XpOff[MAX_XP_CTRL_LEN]; 130 char XpOff[MAX_XP_CTRL_LEN];
185 ushort XpLen; /* strlen(XpOn)+strlen(XpOff) */ 131 unsigned short XpLen; /* strlen(XpOn)+strlen(XpOff) */
186 uchar XpActive; 132 unsigned char XpActive;
187 uchar XpLastTickOk; /* TRUE if we can process */ 133 unsigned char XpLastTickOk; /* TRUE if we can process */
188#define XP_OPEN 00001 134#define XP_OPEN 00001
189#define XP_RUNABLE 00002 135#define XP_RUNABLE 00002
190 struct ttystatics *XttyP; 136 struct ttystatics *XttyP;
191 } Xprint; 137 } Xprint;
192#ifdef VPIX 138 unsigned char RxDataStart;
193 v86_t *StashP; 139 unsigned char Cor2Copy; /* copy of COR2 */
194 uint IntMask; 140 char *Name; /* points to the Rta's name */
195 struct termss VpixSs;
196 uchar ModemStatusReg; /* Modem status register */
197#endif
198 uchar RxDataStart;
199 uchar Cor2Copy; /* copy of COR2 */
200 char *Name; /* points to the Rta's name */
201#ifdef STATS
202 struct RIOStats Stat; /* ports statistics */
203#endif
204 char *TxRingBuffer; 141 char *TxRingBuffer;
205 ushort TxBufferIn; /* New data arrives here */ 142 unsigned short TxBufferIn; /* New data arrives here */
206 ushort TxBufferOut; /* Intr removes data here */ 143 unsigned short TxBufferOut; /* Intr removes data here */
207 ushort OldTxBufferOut; /* Indicates if draining */ 144 unsigned short OldTxBufferOut; /* Indicates if draining */
208 int TimeoutId; /* Timeout ID */ 145 int TimeoutId; /* Timeout ID */
209 uint Debug; 146 unsigned int Debug;
210 uchar WaitUntilBooted; /* True if open should block */ 147 unsigned char WaitUntilBooted; /* True if open should block */
211 uint statsGather; /* True if gathering stats */ 148 unsigned int statsGather; /* True if gathering stats */
212 ulong txchars; /* Chars transmitted */ 149 unsigned long txchars; /* Chars transmitted */
213 ulong rxchars; /* Chars received */ 150 unsigned long rxchars; /* Chars received */
214 ulong opens; /* port open count */ 151 unsigned long opens; /* port open count */
215 ulong closes; /* port close count */ 152 unsigned long closes; /* port close count */
216 ulong ioctls; /* ioctl count */ 153 unsigned long ioctls; /* ioctl count */
217 uchar LastRxTgl; /* Last state of rx toggle bit */ 154 unsigned char LastRxTgl; /* Last state of rx toggle bit */
218 spinlock_t portSem; /* Lock using this sem */ 155 spinlock_t portSem; /* Lock using this sem */
219 int MonitorTstate; /* Monitoring ? */ 156 int MonitorTstate; /* Monitoring ? */
220 int timeout_id; /* For calling 100 ms delays */ 157 int timeout_id; /* For calling 100 ms delays */
221 int timeout_sem; /* For calling 100 ms delays */ 158 int timeout_sem; /* For calling 100 ms delays */
222 int firstOpen; /* First time open ? */ 159 int firstOpen; /* First time open ? */
223 char *p; /* save the global struc here .. */ 160 char *p; /* save the global struc here .. */
224}; 161};
225 162
226struct ModuleInfo { 163struct ModuleInfo {
227 char *Name; 164 char *Name;
228 uint Flags[4]; /* one per port on a module */ 165 unsigned int Flags[4]; /* one per port on a module */
229}; 166};
230#endif
231 167
232/* 168/*
233** This struct is required because trying to grab an entire Port structure 169** This struct is required because trying to grab an entire Port structure
234** runs into problems with differing struct sizes between driver and config. 170** runs into problems with differing struct sizes between driver and config.
235*/ 171*/
236struct PortParams { 172struct PortParams {
237 uint Port; 173 unsigned int Port;
238 ulong Config; 174 unsigned long Config;
239 ulong State; 175 unsigned long State;
240 struct ttystatics *TtyP; 176 struct ttystatics *TtyP;
241}; 177};
178
179#endif