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