aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/rio/rio.h169
-rw-r--r--drivers/char/rio/rio_linux.c70
-rw-r--r--drivers/char/rio/rioboot.c78
-rw-r--r--drivers/char/rio/riocmd.c52
-rw-r--r--drivers/char/rio/rioctrl.c33
-rw-r--r--drivers/char/rio/rioinit.c23
-rw-r--r--drivers/char/rio/riointr.c9
-rw-r--r--drivers/char/rio/rioparam.c39
-rw-r--r--drivers/char/rio/rioroute.c110
-rw-r--r--drivers/char/rio/riotable.c49
-rw-r--r--drivers/char/rio/riotty.c179
-rw-r--r--drivers/char/rio/riotypes.h64
-rw-r--r--drivers/char/rio/rom.h62
-rw-r--r--drivers/char/rio/sam.h67
-rw-r--r--drivers/char/rio/space.h45
-rw-r--r--drivers/char/rio/top.h48
-rw-r--r--drivers/char/rio/typdef.h74
-rw-r--r--drivers/char/rio/unixrup.h6
18 files changed, 265 insertions, 912 deletions
diff --git a/drivers/char/rio/rio.h b/drivers/char/rio/rio.h
index 2d466ffe112d..b4c91871ba28 100644
--- a/drivers/char/rio/rio.h
+++ b/drivers/char/rio/rio.h
@@ -33,38 +33,6 @@
33#ifndef __rio_rio_h__ 33#ifndef __rio_rio_h__
34#define __rio_rio_h__ 34#define __rio_rio_h__
35 35
36#ifdef SCCS_LABELS
37static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
38#endif
39
40/*
41** 30.09.1998 ARG -
42** Introduced driver version and host card type strings
43*/
44#define RIO_DRV_STR "Specialix RIO Driver"
45#define RIO_AT_HOST_STR "ISA"
46#define RIO_PCI_HOST_STR "PCI"
47
48
49/*
50** rio_info_store() commands (arbitary values) :
51*/
52#define RIO_INFO_PUT 0xA4B3C2D1
53#define RIO_INFO_GET 0xF1E2D3C4
54
55
56/*
57** anything that I couldn't cram in somewhere else
58*/
59/*
60#ifndef RIODEBUG
61#define debug
62#else
63#define debug rioprint
64#endif
65*/
66
67
68/* 36/*
69** Maximum numbers of things 37** Maximum numbers of things
70*/ 38*/
@@ -101,9 +69,8 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
101/* 69/*
102** Flag values returned by functions 70** Flag values returned by functions
103*/ 71*/
72
104#define RIO_FAIL -1 73#define RIO_FAIL -1
105#define RIO_SUCCESS 0
106#define COPYFAIL -1 /* copy[in|out] failed */
107 74
108/* 75/*
109** SysPort value for something that hasn't any ports 76** SysPort value for something that hasn't any ports
@@ -142,30 +109,8 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
142/* 109/*
143** Generally useful constants 110** Generally useful constants
144*/ 111*/
145#define HALF_A_SECOND ((HZ)>>1) 112
146#define A_SECOND (HZ) 113#define HUNDRED_MS ((HZ/10)?(HZ/10):1)
147#define HUNDRED_HZ ((HZ/100)?(HZ/100):1)
148#define FIFTY_HZ ((HZ/50)?(HZ/50):1)
149#define TWENTY_HZ ((HZ/20)?(HZ/20):1)
150#define TEN_HZ ((HZ/10)?(HZ/10):1)
151#define FIVE_HZ ((HZ/5)?(HZ/5):1)
152#define HUNDRED_MS TEN_HZ
153#define FIFTY_MS TWENTY_HZ
154#define TWENTY_MS FIFTY_HZ
155#define TEN_MS HUNDRED_HZ
156#define TWO_SECONDS ((A_SECOND)*2)
157#define FIVE_SECONDS ((A_SECOND)*5)
158#define TEN_SECONDS ((A_SECOND)*10)
159#define FIFTEEN_SECONDS ((A_SECOND)*15)
160#define TWENTY_SECONDS ((A_SECOND)*20)
161#define HALF_A_MINUTE (A_MINUTE>>1)
162#define A_MINUTE (A_SECOND*60)
163#define FIVE_MINUTES (A_MINUTE*5)
164#define QUARTER_HOUR (A_MINUTE*15)
165#define HALF_HOUR (A_MINUTE*30)
166#define HOUR (A_MINUTE*60)
167
168#define SIXTEEN_MEG 0x1000000
169#define ONE_MEG 0x100000 114#define ONE_MEG 0x100000
170#define SIXTY_FOUR_K 0x10000 115#define SIXTY_FOUR_K 0x10000
171 116
@@ -173,8 +118,6 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
173#define RIO_EISA_MEM_SIZE SIXTY_FOUR_K 118#define RIO_EISA_MEM_SIZE SIXTY_FOUR_K
174#define RIO_MCA_MEM_SIZE SIXTY_FOUR_K 119#define RIO_MCA_MEM_SIZE SIXTY_FOUR_K
175 120
176#define POLL_VECTOR 0x100
177
178#define COOK_WELL 0 121#define COOK_WELL 0
179#define COOK_MEDIUM 1 122#define COOK_MEDIUM 1
180#define COOK_RAW 2 123#define COOK_RAW 2
@@ -193,62 +136,19 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
193** How to convert from various different device number formats: 136** How to convert from various different device number formats:
194** DEV is a dev number, as passed to open, close etc - NOT a minor 137** DEV is a dev number, as passed to open, close etc - NOT a minor
195** number! 138** number!
196** 139**/
197** Note: LynxOS only gives us 8 bits for the device minor number, 140
198** so all this crap here to deal with 'modem' bits etc. is
199** just a load of irrelevant old bunkum!
200** This however does not stop us needing to define a value
201** for RIO_MODEMOFFSET which is required by the 'riomkdev'
202** utility in the New Config Utilities suite.
203*/
204/* 0-511: direct 512-1023: modem */
205#define RIO_MODEMOFFSET 0x200 /* doesn't mean anything */
206#define RIO_MODEM_MASK 0x1FF 141#define RIO_MODEM_MASK 0x1FF
207#define RIO_MODEM_BIT 0x200 142#define RIO_MODEM_BIT 0x200
208#define RIO_UNMODEM(DEV) (MINOR(DEV) & RIO_MODEM_MASK) 143#define RIO_UNMODEM(DEV) (MINOR(DEV) & RIO_MODEM_MASK)
209#define RIO_ISMODEM(DEV) (MINOR(DEV) & RIO_MODEM_BIT) 144#define RIO_ISMODEM(DEV) (MINOR(DEV) & RIO_MODEM_BIT)
210#define RIO_PORT(DEV,FIRST_MAJ) ( (MAJOR(DEV) - FIRST_MAJ) * PORTS_PER_HOST) \ 145#define RIO_PORT(DEV,FIRST_MAJ) ( (MAJOR(DEV) - FIRST_MAJ) * PORTS_PER_HOST) \
211 + MINOR(DEV) 146 + MINOR(DEV)
212 147#define CSUM(pkt_ptr) (((u16 *)(pkt_ptr))[0] + ((u16 *)(pkt_ptr))[1] + \
213#define splrio spltty 148 ((u16 *)(pkt_ptr))[2] + ((u16 *)(pkt_ptr))[3] + \
214 149 ((u16 *)(pkt_ptr))[4] + ((u16 *)(pkt_ptr))[5] + \
215#define RIO_IPL 5 150 ((u16 *)(pkt_ptr))[6] + ((u16 *)(pkt_ptr))[7] + \
216#define RIO_PRI (PZERO+10) 151 ((u16 *)(pkt_ptr))[8] + ((u16 *)(pkt_ptr))[9] )
217#define RIO_CLOSE_PRI PZERO-1 /* uninterruptible sleeps for close */
218
219typedef struct DbInf {
220 uint Flag;
221 char Name[8];
222} DbInf;
223
224#ifndef TRUE
225#define TRUE (1==1)
226#endif
227#ifndef FALSE
228#define FALSE (!TRUE)
229#endif
230
231#define CSUM(pkt_ptr) (((ushort *)(pkt_ptr))[0] + ((ushort *)(pkt_ptr))[1] + \
232 ((ushort *)(pkt_ptr))[2] + ((ushort *)(pkt_ptr))[3] + \
233 ((ushort *)(pkt_ptr))[4] + ((ushort *)(pkt_ptr))[5] + \
234 ((ushort *)(pkt_ptr))[6] + ((ushort *)(pkt_ptr))[7] + \
235 ((ushort *)(pkt_ptr))[8] + ((ushort *)(pkt_ptr))[9] )
236
237/*
238** This happy little macro copies SIZE bytes of data from FROM to TO
239** quite well. SIZE must be a constant.
240*/
241#define CCOPY( FROM, TO, SIZE ) { *(struct s { char data[SIZE]; } *)(TO) = *(struct s *)(FROM); }
242
243/*
244** increment a buffer pointer modulo the size of the buffer...
245*/
246#define BUMP( P, I ) ((P) = (((P)+(I)) & RIOBufferMask))
247
248#define INIT_PACKET( PK, PP ) \
249{ \
250 *((uint *)PK) = PP->PacketInfo; \
251}
252 152
253#define RIO_LINK_ENABLE 0x80FF /* FF is a hack, mainly for Mips, to */ 153#define RIO_LINK_ENABLE 0x80FF /* FF is a hack, mainly for Mips, to */
254 /* prevent a really stupid race condition. */ 154 /* prevent a really stupid race condition. */
@@ -267,27 +167,42 @@ typedef struct DbInf {
267#define DISCONNECT 0 167#define DISCONNECT 0
268#define CONNECT 1 168#define CONNECT 1
269 169
170/* ------ Control Codes ------ */
270 171
271/* 172#define CONTROL '^'
272** Machine types - these must NOT overlap with product codes 0-15 173#define IFOAD ( CONTROL + 1 )
273*/ 174#define IDENTIFY ( CONTROL + 2 )
274#define RIO_MIPS_R3230 31 175#define ZOMBIE ( CONTROL + 3 )
275#define RIO_MIPS_R4030 32 176#define UFOAD ( CONTROL + 4 )
177#define IWAIT ( CONTROL + 5 )
178
179#define IFOAD_MAGIC 0xF0AD /* of course */
180#define ZOMBIE_MAGIC (~0xDEAD) /* not dead -> zombie */
181#define UFOAD_MAGIC 0xD1E /* kill-your-neighbour */
182#define IWAIT_MAGIC 0xB1DE /* Bide your time */
183
184/* ------ Error Codes ------ */
185
186#define E_NO_ERROR ((ushort) 0)
187
188/* ------ Free Lists ------ */
276 189
277#define RIO_IO_UNKNOWN -2 190struct rio_free_list {
191 u16 next;
192 u16 prev;
193};
278 194
279#undef MODERN 195/* NULL for card side linked lists */
280#define ERROR( E ) do { u.u_error = E; return OPENFAIL } while ( 0 ) 196#define TPNULL ((ushort)(0x8000))
197/* We can add another packet to a transmit queue if the packet pointer pointed
198 * to by the TxAdd pointer has PKT_IN_USE clear in its address. */
199#define PKT_IN_USE 0x1
281 200
282/* Defines for MPX line discipline routines */ 201/* ------ Topology ------ */
283 202
284#define DIST_LINESW_OPEN 0x01 203struct Top {
285#define DIST_LINESW_CLOSE 0x02 204 u8 Unit;
286#define DIST_LINESW_READ 0x04 205 u8 Link;
287#define DIST_LINESW_WRITE 0x08 206};
288#define DIST_LINESW_IOCTL 0x10
289#define DIST_LINESW_INPUT 0x20
290#define DIST_LINESW_OUTPUT 0x40
291#define DIST_LINESW_MDMINT 0x80
292 207
293#endif /* __rio_h__ */ 208#endif /* __rio_h__ */
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index f1e9e9a20c85..78dd856534ce 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -57,15 +57,12 @@
57#include <asm/uaccess.h> 57#include <asm/uaccess.h>
58 58
59#include "linux_compat.h" 59#include "linux_compat.h"
60#include "typdef.h"
61#include "pkt.h" 60#include "pkt.h"
62#include "daemon.h" 61#include "daemon.h"
63#include "rio.h" 62#include "rio.h"
64#include "riospace.h" 63#include "riospace.h"
65#include "top.h"
66#include "cmdpkt.h" 64#include "cmdpkt.h"
67#include "map.h" 65#include "map.h"
68#include "riotypes.h"
69#include "rup.h" 66#include "rup.h"
70#include "port.h" 67#include "port.h"
71#include "riodrvr.h" 68#include "riodrvr.h"
@@ -78,17 +75,13 @@
78#include "unixrup.h" 75#include "unixrup.h"
79#include "board.h" 76#include "board.h"
80#include "host.h" 77#include "host.h"
81#include "error.h"
82#include "phb.h" 78#include "phb.h"
83#include "link.h" 79#include "link.h"
84#include "cmdblk.h" 80#include "cmdblk.h"
85#include "route.h" 81#include "route.h"
86#include "control.h"
87#include "cirrus.h" 82#include "cirrus.h"
88#include "rioioctl.h" 83#include "rioioctl.h"
89#include "param.h" 84#include "param.h"
90#include "list.h"
91#include "sam.h"
92#include "protsts.h" 85#include "protsts.h"
93#include "rioboard.h" 86#include "rioboard.h"
94 87
@@ -350,27 +343,9 @@ int rio_minor(struct tty_struct *tty)
350 return tty->index + (tty->driver == rio_driver) ? 0 : 256; 343 return tty->index + (tty->driver == rio_driver) ? 0 : 256;
351} 344}
352 345
353int rio_ismodem(struct tty_struct *tty)
354{
355 return 1;
356}
357
358
359static int rio_set_real_termios(void *ptr) 346static int rio_set_real_termios(void *ptr)
360{ 347{
361 int rv, modem; 348 return RIOParam((struct Port *) ptr, CONFIG, 1, 1);
362 struct tty_struct *tty;
363 func_enter();
364
365 tty = ((struct Port *) ptr)->gs.tty;
366
367 modem = rio_ismodem(tty);
368
369 rv = RIOParam((struct Port *) ptr, CONFIG, modem, 1);
370
371 func_exit();
372
373 return rv;
374} 349}
375 350
376 351
@@ -973,7 +948,6 @@ static int __init rio_init(void)
973 948
974#ifdef CONFIG_PCI 949#ifdef CONFIG_PCI
975 struct pci_dev *pdev = NULL; 950 struct pci_dev *pdev = NULL;
976 unsigned int tint;
977 unsigned short tshort; 951 unsigned short tshort;
978#endif 952#endif
979 953
@@ -998,6 +972,8 @@ static int __init rio_init(void)
998#ifdef CONFIG_PCI 972#ifdef CONFIG_PCI
999 /* First look for the JET devices: */ 973 /* First look for the JET devices: */
1000 while ((pdev = pci_get_device(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, pdev))) { 974 while ((pdev = pci_get_device(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, pdev))) {
975 u32 tint;
976
1001 if (pci_enable_device(pdev)) 977 if (pci_enable_device(pdev))
1002 continue; 978 continue;
1003 979
@@ -1008,7 +984,6 @@ static int __init rio_init(void)
1008 Also, reading a non-aligned dword doesn't work. So we read the 984 Also, reading a non-aligned dword doesn't work. So we read the
1009 whole dword at 0x2c and extract the word at 0x2e (SUBSYSTEM_ID) 985 whole dword at 0x2c and extract the word at 0x2e (SUBSYSTEM_ID)
1010 ourselves */ 986 ourselves */
1011 /* I don't know why the define doesn't work, constant 0x2c does --REW */
1012 pci_read_config_dword(pdev, 0x2c, &tint); 987 pci_read_config_dword(pdev, 0x2c, &tint);
1013 tshort = (tint >> 16) & 0xffff; 988 tshort = (tint >> 16) & 0xffff;
1014 rio_dprintk(RIO_DEBUG_PROBE, "Got a specialix card: %x.\n", tint); 989 rio_dprintk(RIO_DEBUG_PROBE, "Got a specialix card: %x.\n", tint);
@@ -1018,10 +993,8 @@ static int __init rio_init(void)
1018 } 993 }
1019 rio_dprintk(RIO_DEBUG_PROBE, "cp1\n"); 994 rio_dprintk(RIO_DEBUG_PROBE, "cp1\n");
1020 995
1021 pci_read_config_dword(pdev, PCI_BASE_ADDRESS_2, &tint);
1022
1023 hp = &p->RIOHosts[p->RIONumHosts]; 996 hp = &p->RIOHosts[p->RIONumHosts];
1024 hp->PaddrP = tint & PCI_BASE_ADDRESS_MEM_MASK; 997 hp->PaddrP = pci_resource_start(pdev, 2);
1025 hp->Ivec = pdev->irq; 998 hp->Ivec = pdev->irq;
1026 if (((1 << hp->Ivec) & rio_irqmask) == 0) 999 if (((1 << hp->Ivec) & rio_irqmask) == 0)
1027 hp->Ivec = 0; 1000 hp->Ivec = 0;
@@ -1035,7 +1008,7 @@ static int __init rio_init(void)
1035 rio_start_card_running(hp); 1008 rio_start_card_running(hp);
1036 1009
1037 rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr); 1010 rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr);
1038 if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == RIO_SUCCESS) { 1011 if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == 0) {
1039 rio_dprintk(RIO_DEBUG_INIT, "Done RIOBoardTest\n"); 1012 rio_dprintk(RIO_DEBUG_INIT, "Done RIOBoardTest\n");
1040 writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); 1013 writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt);
1041 p->RIOHosts[p->RIONumHosts].UniqueNum = 1014 p->RIOHosts[p->RIONumHosts].UniqueNum =
@@ -1044,7 +1017,7 @@ static int __init rio_init(void)
1044 rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); 1017 rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
1045 1018
1046 fix_rio_pci(pdev); 1019 fix_rio_pci(pdev);
1047 p->RIOLastPCISearch = RIO_SUCCESS; 1020 p->RIOLastPCISearch = 0;
1048 p->RIONumHosts++; 1021 p->RIONumHosts++;
1049 found++; 1022 found++;
1050 } else { 1023 } else {
@@ -1067,10 +1040,8 @@ static int __init rio_init(void)
1067 continue; 1040 continue;
1068 1041
1069#ifdef CONFIG_RIO_OLDPCI 1042#ifdef CONFIG_RIO_OLDPCI
1070 pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &tint);
1071
1072 hp = &p->RIOHosts[p->RIONumHosts]; 1043 hp = &p->RIOHosts[p->RIONumHosts];
1073 hp->PaddrP = tint & PCI_BASE_ADDRESS_MEM_MASK; 1044 hp->PaddrP = pci_resource_start(pdev, 0);
1074 hp->Ivec = pdev->irq; 1045 hp->Ivec = pdev->irq;
1075 if (((1 << hp->Ivec) & rio_irqmask) == 0) 1046 if (((1 << hp->Ivec) & rio_irqmask) == 0)
1076 hp->Ivec = 0; 1047 hp->Ivec = 0;
@@ -1088,14 +1059,14 @@ static int __init rio_init(void)
1088 rio_reset_interrupt(hp); 1059 rio_reset_interrupt(hp);
1089 rio_start_card_running(hp); 1060 rio_start_card_running(hp);
1090 rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr); 1061 rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr);
1091 if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == RIO_SUCCESS) { 1062 if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == 0) {
1092 writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); 1063 writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt);
1093 p->RIOHosts[p->RIONumHosts].UniqueNum = 1064 p->RIOHosts[p->RIONumHosts].UniqueNum =
1094 ((readb(&p->RIOHosts[p->RIONumHosts].Unique[0]) & 0xFF) << 0) | 1065 ((readb(&p->RIOHosts[p->RIONumHosts].Unique[0]) & 0xFF) << 0) |
1095 ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24); 1066 ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24);
1096 rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); 1067 rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
1097 1068
1098 p->RIOLastPCISearch = RIO_SUCCESS; 1069 p->RIOLastPCISearch = 0;
1099 p->RIONumHosts++; 1070 p->RIONumHosts++;
1100 found++; 1071 found++;
1101 } else { 1072 } else {
@@ -1129,7 +1100,7 @@ static int __init rio_init(void)
1129 okboard = 0; 1100 okboard = 0;
1130 if ((strncmp(vpdp->identifier, RIO_ISA_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA2_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA3_IDENT, 16) == 0)) { 1101 if ((strncmp(vpdp->identifier, RIO_ISA_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA2_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA3_IDENT, 16) == 0)) {
1131 /* Board is present... */ 1102 /* Board is present... */
1132 if (RIOBoardTest(hp->PaddrP, hp->Caddr, RIO_AT, 0) == RIO_SUCCESS) { 1103 if (RIOBoardTest(hp->PaddrP, hp->Caddr, RIO_AT, 0) == 0) {
1133 /* ... and feeling fine!!!! */ 1104 /* ... and feeling fine!!!! */
1134 rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); 1105 rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
1135 if (RIOAssignAT(p, hp->PaddrP, hp->Caddr, 0)) { 1106 if (RIOAssignAT(p, hp->PaddrP, hp->Caddr, 0)) {
@@ -1231,24 +1202,3 @@ static void __exit rio_exit(void)
1231 1202
1232module_init(rio_init); 1203module_init(rio_init);
1233module_exit(rio_exit); 1204module_exit(rio_exit);
1234
1235/*
1236 * Anybody who knows why this doesn't work for me, please tell me -- REW.
1237 * Snatched from scsi.c (fixed one spelling error):
1238 * Overrides for Emacs so that we follow Linus' tabbing style.
1239 * Emacs will notice this stuff at the end of the file and automatically
1240 * adjust the settings for this buffer only. This must remain at the end
1241 * of the file.
1242 * ---------------------------------------------------------------------------
1243 * Local Variables:
1244 * c-indent-level: 4
1245 * c-brace-imaginary-offset: 0
1246 * c-brace-offset: -4
1247 * c-argdecl-indent: 4
1248 * c-label-offset: -4
1249 * c-continued-statement-offset: 4
1250 * c-continued-brace-offset: 0
1251 * indent-tabs-mode: nil
1252 * tab-width: 8
1253 * End:
1254 */
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c
index e1542e8dfb43..acda9326c2ef 100644
--- a/drivers/char/rio/rioboot.c
+++ b/drivers/char/rio/rioboot.c
@@ -47,15 +47,12 @@
47 47
48#include "linux_compat.h" 48#include "linux_compat.h"
49#include "rio_linux.h" 49#include "rio_linux.h"
50#include "typdef.h"
51#include "pkt.h" 50#include "pkt.h"
52#include "daemon.h" 51#include "daemon.h"
53#include "rio.h" 52#include "rio.h"
54#include "riospace.h" 53#include "riospace.h"
55#include "top.h"
56#include "cmdpkt.h" 54#include "cmdpkt.h"
57#include "map.h" 55#include "map.h"
58#include "riotypes.h"
59#include "rup.h" 56#include "rup.h"
60#include "port.h" 57#include "port.h"
61#include "riodrvr.h" 58#include "riodrvr.h"
@@ -68,7 +65,6 @@
68#include "unixrup.h" 65#include "unixrup.h"
69#include "board.h" 66#include "board.h"
70#include "host.h" 67#include "host.h"
71#include "error.h"
72#include "phb.h" 68#include "phb.h"
73#include "link.h" 69#include "link.h"
74#include "cmdblk.h" 70#include "cmdblk.h"
@@ -386,7 +382,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
386 */ 382 */
387 offset = (p->RIOConf.HostLoadBase - 2) - 0x7FFC; 383 offset = (p->RIOConf.HostLoadBase - 2) - 0x7FFC;
388 384
389 writeb(NFIX(((ushort) (~offset) >> (ushort) 12) & 0xF), DestP); 385 writeb(NFIX(((unsigned short) (~offset) >> (unsigned short) 12) & 0xF), DestP);
390 writeb(PFIX((offset >> 8) & 0xF), DestP + 1); 386 writeb(PFIX((offset >> 8) & 0xF), DestP + 1);
391 writeb(PFIX((offset >> 4) & 0xF), DestP + 2); 387 writeb(PFIX((offset >> 4) & 0xF), DestP + 2);
392 writeb(JUMP(offset & 0xF), DestP + 3); 388 writeb(JUMP(offset & 0xF), DestP + 3);
@@ -515,10 +511,10 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
515 ** 32 bit pointers for the driver in ioremap space. 511 ** 32 bit pointers for the driver in ioremap space.
516 */ 512 */
517 HostP->ParmMapP = ParmMapP; 513 HostP->ParmMapP = ParmMapP;
518 HostP->PhbP = (PHB *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr)); 514 HostP->PhbP = (struct PHB *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr));
519 HostP->RupP = (RUP *) RIO_PTR(Cad, readw(&ParmMapP->rups)); 515 HostP->RupP = (struct RUP *) RIO_PTR(Cad, readw(&ParmMapP->rups));
520 HostP->PhbNumP = (ushort *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr)); 516 HostP->PhbNumP = (unsigned short *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr));
521 HostP->LinkStrP = (LPB *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr)); 517 HostP->LinkStrP = (struct LPB *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr));
522 518
523 /* 519 /*
524 ** point the UnixRups at the real Rups 520 ** point the UnixRups at the real Rups
@@ -639,7 +635,7 @@ int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
639 /* 635 /*
640 ** Fill in the default info on the command block 636 ** Fill in the default info on the command block
641 */ 637 */
642 CmdBlkP->Packet.dest_unit = Rup < (ushort) MAX_RUP ? Rup : 0; 638 CmdBlkP->Packet.dest_unit = Rup < (unsigned short) MAX_RUP ? Rup : 0;
643 CmdBlkP->Packet.dest_port = BOOT_RUP; 639 CmdBlkP->Packet.dest_port = BOOT_RUP;
644 CmdBlkP->Packet.src_unit = 0; 640 CmdBlkP->Packet.src_unit = 0;
645 CmdBlkP->Packet.src_port = BOOT_RUP; 641 CmdBlkP->Packet.src_port = BOOT_RUP;
@@ -748,7 +744,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
748 */ 744 */
749 745
750 RtaType = GetUnitType(RtaUniq); 746 RtaType = GetUnitType(RtaUniq);
751 if (Rup >= (ushort) MAX_RUP) 747 if (Rup >= (unsigned short) MAX_RUP)
752 rio_dprintk(RIO_DEBUG_BOOT, "RIO: Host %s has booted an RTA(%d) on link %c\n", HostP->Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A'); 748 rio_dprintk(RIO_DEBUG_BOOT, "RIO: Host %s has booted an RTA(%d) on link %c\n", HostP->Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A');
753 else 749 else
754 rio_dprintk(RIO_DEBUG_BOOT, "RIO: RTA %s has booted an RTA(%d) on link %c\n", HostP->Mapping[Rup].Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A'); 750 rio_dprintk(RIO_DEBUG_BOOT, "RIO: RTA %s has booted an RTA(%d) on link %c\n", HostP->Mapping[Rup].Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A');
@@ -757,7 +753,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
757 753
758 if (RtaUniq == 0x00000000 || RtaUniq == 0xffffffff) { 754 if (RtaUniq == 0x00000000 || RtaUniq == 0xffffffff) {
759 rio_dprintk(RIO_DEBUG_BOOT, "Illegal RTA Uniq Number\n"); 755 rio_dprintk(RIO_DEBUG_BOOT, "Illegal RTA Uniq Number\n");
760 return TRUE; 756 return 1;
761 } 757 }
762 758
763 /* 759 /*
@@ -785,7 +781,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
785 */ 781 */
786 writew(30, &HostP->LinkStrP[MyLink].WaitNoBoot); 782 writew(30, &HostP->LinkStrP[MyLink].WaitNoBoot);
787 rio_dprintk(RIO_DEBUG_BOOT, "RTA %x not owned - suspend booting down link %c on unit %x\n", RtaUniq, 'A' + MyLink, HostP->Mapping[Rup].RtaUniqueNum); 783 rio_dprintk(RIO_DEBUG_BOOT, "RTA %x not owned - suspend booting down link %c on unit %x\n", RtaUniq, 'A' + MyLink, HostP->Mapping[Rup].RtaUniqueNum);
788 return TRUE; 784 return 1;
789 } 785 }
790 786
791 /* 787 /*
@@ -826,7 +822,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
826 rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given IDs %d+%d\n", entry + 1, entry2 + 1); 822 rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given IDs %d+%d\n", entry + 1, entry2 + 1);
827 else 823 else
828 rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given ID %d\n", entry + 1); 824 rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given ID %d\n", entry + 1);
829 return TRUE; 825 return 1;
830 } 826 }
831 } 827 }
832 828
@@ -868,7 +864,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
868 rio_dprintk(RIO_DEBUG_BOOT, "Found previous tentative slot (%d)\n", entry); 864 rio_dprintk(RIO_DEBUG_BOOT, "Found previous tentative slot (%d)\n", entry);
869 if (!p->RIONoMessage) 865 if (!p->RIONoMessage)
870 printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A'); 866 printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A');
871 return TRUE; 867 return 1;
872 } 868 }
873 } 869 }
874 870
@@ -961,13 +957,13 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
961 if (RtaType == TYPE_RTA16) { 957 if (RtaType == TYPE_RTA16) {
962 if (RIOFindFreeID(p, HostP, &entry, &entry2) == 0) { 958 if (RIOFindFreeID(p, HostP, &entry, &entry2) == 0) {
963 RIODefaultName(p, HostP, entry); 959 RIODefaultName(p, HostP, entry);
964 FillSlot(entry, entry2, RtaUniq, HostP); 960 rio_fill_host_slot(entry, entry2, RtaUniq, HostP);
965 EmptySlot = 0; 961 EmptySlot = 0;
966 } 962 }
967 } else { 963 } else {
968 if (RIOFindFreeID(p, HostP, &entry, NULL) == 0) { 964 if (RIOFindFreeID(p, HostP, &entry, NULL) == 0) {
969 RIODefaultName(p, HostP, entry); 965 RIODefaultName(p, HostP, entry);
970 FillSlot(entry, 0, RtaUniq, HostP); 966 rio_fill_host_slot(entry, 0, RtaUniq, HostP);
971 EmptySlot = 0; 967 EmptySlot = 0;
972 } 968 }
973 } 969 }
@@ -1023,7 +1019,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
1023 } else if (!p->RIONoMessage) 1019 } else if (!p->RIONoMessage)
1024 printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A'); 1020 printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A');
1025 RIOSetChange(p); 1021 RIOSetChange(p);
1026 return TRUE; 1022 return 1;
1027 } 1023 }
1028 1024
1029 /* 1025 /*
@@ -1038,7 +1034,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
1038 /* 1034 /*
1039 ** already got it! 1035 ** already got it!
1040 */ 1036 */
1041 return TRUE; 1037 return 1;
1042 } 1038 }
1043 } 1039 }
1044 /* 1040 /*
@@ -1046,13 +1042,13 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
1046 */ 1042 */
1047 if (HostP->NumExtraBooted < MAX_EXTRA_UNITS) 1043 if (HostP->NumExtraBooted < MAX_EXTRA_UNITS)
1048 HostP->ExtraUnits[HostP->NumExtraBooted++] = RtaUniq; 1044 HostP->ExtraUnits[HostP->NumExtraBooted++] = RtaUniq;
1049 return TRUE; 1045 return 1;
1050} 1046}
1051 1047
1052 1048
1053/* 1049/*
1054** If the RTA or its host appears in the RIOBindTab[] structure then 1050** If the RTA or its host appears in the RIOBindTab[] structure then
1055** we mustn't boot the RTA and should return FALSE. 1051** we mustn't boot the RTA and should return 0.
1056** This operation is slightly different from the other drivers for RIO 1052** This operation is slightly different from the other drivers for RIO
1057** in that this is designed to work with the new utilities 1053** in that this is designed to work with the new utilities
1058** not config.rio and is FAR SIMPLER. 1054** not config.rio and is FAR SIMPLER.
@@ -1080,38 +1076,38 @@ int RIOBootOk(struct rio_info *p, struct Host *HostP, unsigned long RtaUniq)
1080** slots tentative, and the second one RTA_SECOND_SLOT as well. 1076** slots tentative, and the second one RTA_SECOND_SLOT as well.
1081*/ 1077*/
1082 1078
1083void FillSlot(int entry, int entry2, unsigned int RtaUniq, struct Host *HostP) 1079void rio_fill_host_slot(int entry, int entry2, unsigned int rta_uniq, struct Host *host)
1084{ 1080{
1085 int link; 1081 int link;
1086 1082
1087 rio_dprintk(RIO_DEBUG_BOOT, "FillSlot(%d, %d, 0x%x...)\n", entry, entry2, RtaUniq); 1083 rio_dprintk(RIO_DEBUG_BOOT, "rio_fill_host_slot(%d, %d, 0x%x...)\n", entry, entry2, rta_uniq);
1088 1084
1089 HostP->Mapping[entry].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE); 1085 host->Mapping[entry].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE);
1090 HostP->Mapping[entry].SysPort = NO_PORT; 1086 host->Mapping[entry].SysPort = NO_PORT;
1091 HostP->Mapping[entry].RtaUniqueNum = RtaUniq; 1087 host->Mapping[entry].RtaUniqueNum = rta_uniq;
1092 HostP->Mapping[entry].HostUniqueNum = HostP->UniqueNum; 1088 host->Mapping[entry].HostUniqueNum = host->UniqueNum;
1093 HostP->Mapping[entry].ID = entry + 1; 1089 host->Mapping[entry].ID = entry + 1;
1094 HostP->Mapping[entry].ID2 = 0; 1090 host->Mapping[entry].ID2 = 0;
1095 if (entry2) { 1091 if (entry2) {
1096 HostP->Mapping[entry2].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE | RTA16_SECOND_SLOT); 1092 host->Mapping[entry2].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE | RTA16_SECOND_SLOT);
1097 HostP->Mapping[entry2].SysPort = NO_PORT; 1093 host->Mapping[entry2].SysPort = NO_PORT;
1098 HostP->Mapping[entry2].RtaUniqueNum = RtaUniq; 1094 host->Mapping[entry2].RtaUniqueNum = rta_uniq;
1099 HostP->Mapping[entry2].HostUniqueNum = HostP->UniqueNum; 1095 host->Mapping[entry2].HostUniqueNum = host->UniqueNum;
1100 HostP->Mapping[entry2].Name[0] = '\0'; 1096 host->Mapping[entry2].Name[0] = '\0';
1101 HostP->Mapping[entry2].ID = entry2 + 1; 1097 host->Mapping[entry2].ID = entry2 + 1;
1102 HostP->Mapping[entry2].ID2 = entry + 1; 1098 host->Mapping[entry2].ID2 = entry + 1;
1103 HostP->Mapping[entry].ID2 = entry2 + 1; 1099 host->Mapping[entry].ID2 = entry2 + 1;
1104 } 1100 }
1105 /* 1101 /*
1106 ** Must set these up, so that utilities show 1102 ** Must set these up, so that utilities show
1107 ** topology of 16 port RTAs correctly 1103 ** topology of 16 port RTAs correctly
1108 */ 1104 */
1109 for (link = 0; link < LINKS_PER_UNIT; link++) { 1105 for (link = 0; link < LINKS_PER_UNIT; link++) {
1110 HostP->Mapping[entry].Topology[link].Unit = ROUTE_DISCONNECT; 1106 host->Mapping[entry].Topology[link].Unit = ROUTE_DISCONNECT;
1111 HostP->Mapping[entry].Topology[link].Link = NO_LINK; 1107 host->Mapping[entry].Topology[link].Link = NO_LINK;
1112 if (entry2) { 1108 if (entry2) {
1113 HostP->Mapping[entry2].Topology[link].Unit = ROUTE_DISCONNECT; 1109 host->Mapping[entry2].Topology[link].Unit = ROUTE_DISCONNECT;
1114 HostP->Mapping[entry2].Topology[link].Link = NO_LINK; 1110 host->Mapping[entry2].Topology[link].Link = NO_LINK;
1115 } 1111 }
1116 } 1112 }
1117} 1113}
diff --git a/drivers/char/rio/riocmd.c b/drivers/char/rio/riocmd.c
index 08fcac1f12de..e6d2b14b5e65 100644
--- a/drivers/char/rio/riocmd.c
+++ b/drivers/char/rio/riocmd.c
@@ -51,15 +51,12 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2";
51 51
52#include "linux_compat.h" 52#include "linux_compat.h"
53#include "rio_linux.h" 53#include "rio_linux.h"
54#include "typdef.h"
55#include "pkt.h" 54#include "pkt.h"
56#include "daemon.h" 55#include "daemon.h"
57#include "rio.h" 56#include "rio.h"
58#include "riospace.h" 57#include "riospace.h"
59#include "top.h"
60#include "cmdpkt.h" 58#include "cmdpkt.h"
61#include "map.h" 59#include "map.h"
62#include "riotypes.h"
63#include "rup.h" 60#include "rup.h"
64#include "port.h" 61#include "port.h"
65#include "riodrvr.h" 62#include "riodrvr.h"
@@ -72,12 +69,10 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2";
72#include "unixrup.h" 69#include "unixrup.h"
73#include "board.h" 70#include "board.h"
74#include "host.h" 71#include "host.h"
75#include "error.h"
76#include "phb.h" 72#include "phb.h"
77#include "link.h" 73#include "link.h"
78#include "cmdblk.h" 74#include "cmdblk.h"
79#include "route.h" 75#include "route.h"
80#include "control.h"
81#include "cirrus.h" 76#include "cirrus.h"
82 77
83 78
@@ -148,7 +143,7 @@ int RIOCommandRta(struct rio_info *p, unsigned long RtaUnique, int (*func) (stru
148{ 143{
149 unsigned int Host; 144 unsigned int Host;
150 145
151 rio_dprintk(RIO_DEBUG_CMD, "Command RTA 0x%lx func 0x%p\n", RtaUnique, func); 146 rio_dprintk(RIO_DEBUG_CMD, "Command RTA 0x%lx func %p\n", RtaUnique, func);
152 147
153 if (!RtaUnique) 148 if (!RtaUnique)
154 return (0); 149 return (0);
@@ -375,7 +370,7 @@ int RIOFoadWakeup(struct rio_info *p)
375/* 370/*
376** Incoming command on the COMMAND_RUP to be processed. 371** Incoming command on the COMMAND_RUP to be processed.
377*/ 372*/
378static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) 373static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struct PKT * PacketP)
379{ 374{
380 struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; 375 struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data;
381 struct Port *PortP; 376 struct Port *PortP;
@@ -418,7 +413,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *
418 rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", PacketP->control, PacketP->control); 413 rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", PacketP->control, PacketP->control);
419 rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Check 0x%x (%d)\n", PacketP->csum, PacketP->csum); 414 rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Check 0x%x (%d)\n", PacketP->csum, PacketP->csum);
420 rio_dprintk(RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, " "Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command); 415 rio_dprintk(RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, " "Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command);
421 return TRUE; 416 return 1;
422 } 417 }
423 PortP = p->RIOPortp[SysPort]; 418 PortP = p->RIOPortp[SysPort];
424 rio_spin_lock_irqsave(&PortP->portSem, flags); 419 rio_spin_lock_irqsave(&PortP->portSem, flags);
@@ -427,7 +422,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *
427 rio_dprintk(RIO_DEBUG_CMD, "Received a break!\n"); 422 rio_dprintk(RIO_DEBUG_CMD, "Received a break!\n");
428 /* If the current line disc. is not multi-threading and 423 /* If the current line disc. is not multi-threading and
429 the current processor is not the default, reset rup_intr 424 the current processor is not the default, reset rup_intr
430 and return FALSE to ensure that the command packet is 425 and return 0 to ensure that the command packet is
431 not freed. */ 426 not freed. */
432 /* Call tmgr HANGUP HERE */ 427 /* Call tmgr HANGUP HERE */
433 /* Fix this later when every thing works !!!! RAMRAJ */ 428 /* Fix this later when every thing works !!!! RAMRAJ */
@@ -541,7 +536,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *
541 536
542 func_exit(); 537 func_exit();
543 538
544 return TRUE; 539 return 1;
545} 540}
546 541
547/* 542/*
@@ -600,13 +595,13 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
600 ** straight on the RUP.... 595 ** straight on the RUP....
601 */ 596 */
602 if ((UnixRupP->CmdsWaitingP == NULL) && (UnixRupP->CmdPendingP == NULL) && (readw(&UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE) && (CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) 597 if ((UnixRupP->CmdsWaitingP == NULL) && (UnixRupP->CmdPendingP == NULL) && (readw(&UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE) && (CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP)
603 : TRUE)) { 598 : 1)) {
604 rio_dprintk(RIO_DEBUG_CMD, "RUP inactive-placing command straight on. Cmd byte is 0x%x\n", CmdBlkP->Packet.data[0]); 599 rio_dprintk(RIO_DEBUG_CMD, "RUP inactive-placing command straight on. Cmd byte is 0x%x\n", CmdBlkP->Packet.data[0]);
605 600
606 /* 601 /*
607 ** Whammy! blat that pack! 602 ** Whammy! blat that pack!
608 */ 603 */
609 HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT)); 604 HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT));
610 605
611 /* 606 /*
612 ** place command packet on the pending position. 607 ** place command packet on the pending position.
@@ -620,7 +615,7 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
620 615
621 rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags); 616 rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
622 617
623 return RIO_SUCCESS; 618 return 0;
624 } 619 }
625 rio_dprintk(RIO_DEBUG_CMD, "RUP active - en-queing\n"); 620 rio_dprintk(RIO_DEBUG_CMD, "RUP active - en-queing\n");
626 621
@@ -633,15 +628,15 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
633 628
634 Base = &UnixRupP->CmdsWaitingP; 629 Base = &UnixRupP->CmdsWaitingP;
635 630
636 rio_dprintk(RIO_DEBUG_CMD, "First try to queue cmdblk 0x%p at 0x%p\n", CmdBlkP, Base); 631 rio_dprintk(RIO_DEBUG_CMD, "First try to queue cmdblk %p at %p\n", CmdBlkP, Base);
637 632
638 while (*Base) { 633 while (*Base) {
639 rio_dprintk(RIO_DEBUG_CMD, "Command cmdblk 0x%p here\n", *Base); 634 rio_dprintk(RIO_DEBUG_CMD, "Command cmdblk %p here\n", *Base);
640 Base = &((*Base)->NextP); 635 Base = &((*Base)->NextP);
641 rio_dprintk(RIO_DEBUG_CMD, "Now try to queue cmd cmdblk 0x%p at 0x%p\n", CmdBlkP, Base); 636 rio_dprintk(RIO_DEBUG_CMD, "Now try to queue cmd cmdblk %p at %p\n", CmdBlkP, Base);
642 } 637 }
643 638
644 rio_dprintk(RIO_DEBUG_CMD, "Will queue cmdblk 0x%p at 0x%p\n", CmdBlkP, Base); 639 rio_dprintk(RIO_DEBUG_CMD, "Will queue cmdblk %p at %p\n", CmdBlkP, Base);
645 640
646 *Base = CmdBlkP; 641 *Base = CmdBlkP;
647 642
@@ -649,7 +644,7 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
649 644
650 rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags); 645 rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
651 646
652 return RIO_SUCCESS; 647 return 0;
653} 648}
654 649
655/* 650/*
@@ -681,9 +676,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
681 if (readw(&UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE) { 676 if (readw(&UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE) {
682 int FreeMe; 677 int FreeMe;
683 678
684 PacketP = (PKT *) RIO_PTR(HostP->Caddr, readw(&UnixRupP->RupP->rxpkt)); 679 PacketP = (struct PKT *) RIO_PTR(HostP->Caddr, readw(&UnixRupP->RupP->rxpkt));
685
686 ShowPacket(DBG_CMD, PacketP);
687 680
688 switch (readb(&PacketP->dest_port)) { 681 switch (readb(&PacketP->dest_port)) {
689 case BOOT_RUP: 682 case BOOT_RUP:
@@ -749,7 +742,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
749 if (CmdBlkP->Packet.dest_port == BOOT_RUP) 742 if (CmdBlkP->Packet.dest_port == BOOT_RUP)
750 rio_dprintk(RIO_DEBUG_CMD, "Free Boot %s Command Block '%x'\n", CmdBlkP->Packet.len & 0x80 ? "Command" : "Data", CmdBlkP->Packet.data[0]); 743 rio_dprintk(RIO_DEBUG_CMD, "Free Boot %s Command Block '%x'\n", CmdBlkP->Packet.len & 0x80 ? "Command" : "Data", CmdBlkP->Packet.data[0]);
751 744
752 rio_dprintk(RIO_DEBUG_CMD, "Command 0x%p completed\n", CmdBlkP); 745 rio_dprintk(RIO_DEBUG_CMD, "Command %p completed\n", CmdBlkP);
753 746
754 /* 747 /*
755 ** Clear the Rup lock to prevent mutual exclusion. 748 ** Clear the Rup lock to prevent mutual exclusion.
@@ -782,14 +775,14 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
782 ** If it returns RIO_FAIL then don't 775 ** If it returns RIO_FAIL then don't
783 ** send this command yet! 776 ** send this command yet!
784 */ 777 */
785 if (!(CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) : TRUE)) { 778 if (!(CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) : 1)) {
786 rio_dprintk(RIO_DEBUG_CMD, "Not ready to start command 0x%p\n", CmdBlkP); 779 rio_dprintk(RIO_DEBUG_CMD, "Not ready to start command %p\n", CmdBlkP);
787 } else { 780 } else {
788 rio_dprintk(RIO_DEBUG_CMD, "Start new command 0x%p Cmd byte is 0x%x\n", CmdBlkP, CmdBlkP->Packet.data[0]); 781 rio_dprintk(RIO_DEBUG_CMD, "Start new command %p Cmd byte is 0x%x\n", CmdBlkP, CmdBlkP->Packet.data[0]);
789 /* 782 /*
790 ** Whammy! blat that pack! 783 ** Whammy! blat that pack!
791 */ 784 */
792 HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT)); 785 HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT));
793 786
794 /* 787 /*
795 ** remove the command from the rup command queue... 788 ** remove the command from the rup command queue...
@@ -831,14 +824,13 @@ int RIOWFlushMark(unsigned long iPortP, struct CmdBlk *CmdBlkP)
831int RIORFlushEnable(unsigned long iPortP, struct CmdBlk *CmdBlkP) 824int RIORFlushEnable(unsigned long iPortP, struct CmdBlk *CmdBlkP)
832{ 825{
833 struct Port *PortP = (struct Port *) iPortP; 826 struct Port *PortP = (struct Port *) iPortP;
834 PKT *PacketP; 827 struct PKT *PacketP;
835 unsigned long flags; 828 unsigned long flags;
836 829
837 rio_spin_lock_irqsave(&PortP->portSem, flags); 830 rio_spin_lock_irqsave(&PortP->portSem, flags);
838 831
839 while (can_remove_receive(&PacketP, PortP)) { 832 while (can_remove_receive(&PacketP, PortP)) {
840 remove_receive(PortP); 833 remove_receive(PortP);
841 ShowPacket(DBG_PROC, PacketP);
842 put_free_end(PortP->HostP, PacketP); 834 put_free_end(PortP->HostP, PacketP);
843 } 835 }
844 836
@@ -892,10 +884,6 @@ int RIOUnUse(unsigned long iPortP, struct CmdBlk *CmdBlkP)
892 return 0; 884 return 0;
893} 885}
894 886
895void ShowPacket(uint Flags, struct PKT *PacketP)
896{
897}
898
899/* 887/*
900** 888**
901** How to use this file: 889** How to use this file:
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index f6a19aae1044..d31aba62bb7f 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/char/rio/rioctrl.c
@@ -51,15 +51,12 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3";
51 51
52#include "linux_compat.h" 52#include "linux_compat.h"
53#include "rio_linux.h" 53#include "rio_linux.h"
54#include "typdef.h"
55#include "pkt.h" 54#include "pkt.h"
56#include "daemon.h" 55#include "daemon.h"
57#include "rio.h" 56#include "rio.h"
58#include "riospace.h" 57#include "riospace.h"
59#include "top.h"
60#include "cmdpkt.h" 58#include "cmdpkt.h"
61#include "map.h" 59#include "map.h"
62#include "riotypes.h"
63#include "rup.h" 60#include "rup.h"
64#include "port.h" 61#include "port.h"
65#include "riodrvr.h" 62#include "riodrvr.h"
@@ -72,12 +69,10 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3";
72#include "unixrup.h" 69#include "unixrup.h"
73#include "board.h" 70#include "board.h"
74#include "host.h" 71#include "host.h"
75#include "error.h"
76#include "phb.h" 72#include "phb.h"
77#include "link.h" 73#include "link.h"
78#include "cmdblk.h" 74#include "cmdblk.h"
79#include "route.h" 75#include "route.h"
80#include "control.h"
81#include "cirrus.h" 76#include "cirrus.h"
82#include "rioioctl.h" 77#include "rioioctl.h"
83 78
@@ -144,7 +139,7 @@ int su;
144 ushort loop; 139 ushort loop;
145 int Entry; 140 int Entry;
146 struct Port *PortP; 141 struct Port *PortP;
147 PKT *PacketP; 142 struct PKT *PacketP;
148 int retval = 0; 143 int retval = 0;
149 unsigned long flags; 144 unsigned long flags;
150 145
@@ -154,7 +149,7 @@ int su;
154 Host = 0; 149 Host = 0;
155 PortP = NULL; 150 PortP = NULL;
156 151
157 rio_dprintk(RIO_DEBUG_CTRL, "control ioctl cmd: 0x%x arg: 0x%p\n", cmd, arg); 152 rio_dprintk(RIO_DEBUG_CTRL, "control ioctl cmd: 0x%x arg: %p\n", cmd, arg);
158 153
159 switch (cmd) { 154 switch (cmd) {
160 /* 155 /*
@@ -572,8 +567,8 @@ int su;
572 PortSetup.Store = p->RIOPortp[port]->Store; 567 PortSetup.Store = p->RIOPortp[port]->Store;
573 PortSetup.Lock = p->RIOPortp[port]->Lock; 568 PortSetup.Lock = p->RIOPortp[port]->Lock;
574 PortSetup.XpCps = p->RIOPortp[port]->Xprint.XpCps; 569 PortSetup.XpCps = p->RIOPortp[port]->Xprint.XpCps;
575 bcopy(p->RIOPortp[port]->Xprint.XpOn, PortSetup.XpOn, MAX_XP_CTRL_LEN); 570 memcpy(PortSetup.XpOn, p->RIOPortp[port]->Xprint.XpOn, MAX_XP_CTRL_LEN);
576 bcopy(p->RIOPortp[port]->Xprint.XpOff, PortSetup.XpOff, MAX_XP_CTRL_LEN); 571 memcpy(PortSetup.XpOff, p->RIOPortp[port]->Xprint.XpOff, MAX_XP_CTRL_LEN);
577 PortSetup.XpOn[MAX_XP_CTRL_LEN - 1] = '\0'; 572 PortSetup.XpOn[MAX_XP_CTRL_LEN - 1] = '\0';
578 PortSetup.XpOff[MAX_XP_CTRL_LEN - 1] = '\0'; 573 PortSetup.XpOff[MAX_XP_CTRL_LEN - 1] = '\0';
579 574
@@ -1404,7 +1399,7 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1404 return RIO_FAIL; 1399 return RIO_FAIL;
1405 } 1400 }
1406 1401
1407 rio_dprintk(RIO_DEBUG_CTRL, "Command blk 0x%p - InUse now %d\n", CmdBlkP, PortP->InUse); 1402 rio_dprintk(RIO_DEBUG_CTRL, "Command blk %p - InUse now %d\n", CmdBlkP, PortP->InUse);
1408 1403
1409 PktCmdP = (struct PktCmd_M *) &CmdBlkP->Packet.data[0]; 1404 PktCmdP = (struct PktCmd_M *) &CmdBlkP->Packet.data[0];
1410 1405
@@ -1430,38 +1425,38 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1430 1425
1431 switch (Cmd) { 1426 switch (Cmd) {
1432 case MEMDUMP: 1427 case MEMDUMP:
1433 rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk 0x%p (addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr); 1428 rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p (addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr);
1434 PktCmdP->SubCommand = MEMDUMP; 1429 PktCmdP->SubCommand = MEMDUMP;
1435 PktCmdP->SubAddr = SubCmd.Addr; 1430 PktCmdP->SubAddr = SubCmd.Addr;
1436 break; 1431 break;
1437 case FCLOSE: 1432 case FCLOSE:
1438 rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk 0x%p\n", CmdBlkP); 1433 rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n", CmdBlkP);
1439 break; 1434 break;
1440 case READ_REGISTER: 1435 case READ_REGISTER:
1441 rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) command blk 0x%p\n", (int) SubCmd.Addr, CmdBlkP); 1436 rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) command blk %p\n", (int) SubCmd.Addr, CmdBlkP);
1442 PktCmdP->SubCommand = READ_REGISTER; 1437 PktCmdP->SubCommand = READ_REGISTER;
1443 PktCmdP->SubAddr = SubCmd.Addr; 1438 PktCmdP->SubAddr = SubCmd.Addr;
1444 break; 1439 break;
1445 case RESUME: 1440 case RESUME:
1446 rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk 0x%p\n", CmdBlkP); 1441 rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n", CmdBlkP);
1447 break; 1442 break;
1448 case RFLUSH: 1443 case RFLUSH:
1449 rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk 0x%p\n", CmdBlkP); 1444 rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n", CmdBlkP);
1450 CmdBlkP->PostFuncP = RIORFlushEnable; 1445 CmdBlkP->PostFuncP = RIORFlushEnable;
1451 break; 1446 break;
1452 case SUSPEND: 1447 case SUSPEND:
1453 rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk 0x%p\n", CmdBlkP); 1448 rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n", CmdBlkP);
1454 break; 1449 break;
1455 1450
1456 case MGET: 1451 case MGET:
1457 rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk 0x%p\n", CmdBlkP); 1452 rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n", CmdBlkP);
1458 break; 1453 break;
1459 1454
1460 case MSET: 1455 case MSET:
1461 case MBIC: 1456 case MBIC:
1462 case MBIS: 1457 case MBIS:
1463 CmdBlkP->Packet.data[4] = (char) PortP->ModemLines; 1458 CmdBlkP->Packet.data[4] = (char) PortP->ModemLines;
1464 rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command blk 0x%p\n", CmdBlkP); 1459 rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command blk %p\n", CmdBlkP);
1465 break; 1460 break;
1466 1461
1467 case WFLUSH: 1462 case WFLUSH:
@@ -1475,7 +1470,7 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1475 RIOFreeCmdBlk(CmdBlkP); 1470 RIOFreeCmdBlk(CmdBlkP);
1476 return (RIO_FAIL); 1471 return (RIO_FAIL);
1477 } else { 1472 } else {
1478 rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command blk 0x%p\n", CmdBlkP); 1473 rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command blk %p\n", CmdBlkP);
1479 CmdBlkP->PostFuncP = RIOWFlushMark; 1474 CmdBlkP->PostFuncP = RIOWFlushMark;
1480 } 1475 }
1481 break; 1476 break;
diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c
index 1d73c4646bbd..24d2992154cc 100644
--- a/drivers/char/rio/rioinit.c
+++ b/drivers/char/rio/rioinit.c
@@ -51,15 +51,12 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
51 51
52 52
53#include "linux_compat.h" 53#include "linux_compat.h"
54#include "typdef.h"
55#include "pkt.h" 54#include "pkt.h"
56#include "daemon.h" 55#include "daemon.h"
57#include "rio.h" 56#include "rio.h"
58#include "riospace.h" 57#include "riospace.h"
59#include "top.h"
60#include "cmdpkt.h" 58#include "cmdpkt.h"
61#include "map.h" 59#include "map.h"
62#include "riotypes.h"
63#include "rup.h" 60#include "rup.h"
64#include "port.h" 61#include "port.h"
65#include "riodrvr.h" 62#include "riodrvr.h"
@@ -72,19 +69,17 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
72#include "unixrup.h" 69#include "unixrup.h"
73#include "board.h" 70#include "board.h"
74#include "host.h" 71#include "host.h"
75#include "error.h"
76#include "phb.h" 72#include "phb.h"
77#include "link.h" 73#include "link.h"
78#include "cmdblk.h" 74#include "cmdblk.h"
79#include "route.h" 75#include "route.h"
80#include "control.h"
81#include "cirrus.h" 76#include "cirrus.h"
82#include "rioioctl.h" 77#include "rioioctl.h"
83#include "rio_linux.h" 78#include "rio_linux.h"
84 79
85int RIOPCIinit(struct rio_info *p, int Mode); 80int RIOPCIinit(struct rio_info *p, int Mode);
86 81
87static int RIOScrub(int, BYTE *, int); 82static int RIOScrub(int, u8 *, int);
88 83
89 84
90/** 85/**
@@ -156,7 +151,7 @@ static u8 val[] = {
156** RAM test a board. 151** RAM test a board.
157** Nothing too complicated, just enough to check it out. 152** Nothing too complicated, just enough to check it out.
158*/ 153*/
159int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot) 154int RIOBoardTest(unsigned long paddr, caddr_t caddr, unsigned char type, int slot)
160{ 155{
161 struct DpRam *DpRam = (struct DpRam *)caddr; 156 struct DpRam *DpRam = (struct DpRam *)caddr;
162 char *ram[4]; 157 char *ram[4];
@@ -164,7 +159,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
164 int op, bank; 159 int op, bank;
165 int nbanks; 160 int nbanks;
166 161
167 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Reset host type=%d, DpRam=0x%p, slot=%d\n", 162 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Reset host type=%d, DpRam=%p, slot=%d\n",
168 type, DpRam, slot); 163 type, DpRam, slot);
169 164
170 RIOHostReset(type, DpRam, slot); 165 RIOHostReset(type, DpRam, slot);
@@ -193,10 +188,10 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
193 188
194 189
195 if (nbanks == 3) { 190 if (nbanks == 3) {
196 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Memory: 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x)\n", 191 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Memory: %p(0x%x), %p(0x%x), %p(0x%x)\n",
197 ram[0], size[0], ram[1], size[1], ram[2], size[2]); 192 ram[0], size[0], ram[1], size[1], ram[2], size[2]);
198 } else { 193 } else {
199 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x)\n", 194 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: %p(0x%x), %p(0x%x), %p(0x%x), %p(0x%x)\n",
200 ram[0], size[0], ram[1], size[1], ram[2], size[2], ram[3], size[3]); 195 ram[0], size[0], ram[1], size[1], ram[2], size[2], ram[3], size[3]);
201 } 196 }
202 197
@@ -207,7 +202,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
207 */ 202 */
208 for (op=0; op<TEST_END; op++) { 203 for (op=0; op<TEST_END; op++) {
209 for (bank=0; bank<nbanks; bank++) { 204 for (bank=0; bank<nbanks; bank++) {
210 if (RIOScrub(op, (BYTE *)ram[bank], size[bank]) == RIO_FAIL) { 205 if (RIOScrub(op, (u8 *)ram[bank], size[bank]) == RIO_FAIL) {
211 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: RIOScrub band %d, op %d failed\n", 206 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: RIOScrub band %d, op %d failed\n",
212 bank, op); 207 bank, op);
213 return RIO_FAIL; 208 return RIO_FAIL;
@@ -216,7 +211,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
216 } 211 }
217 212
218 rio_dprintk (RIO_DEBUG_INIT, "Test completed\n"); 213 rio_dprintk (RIO_DEBUG_INIT, "Test completed\n");
219 return RIO_SUCCESS; 214 return 0;
220} 215}
221 216
222 217
@@ -232,7 +227,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
232** to check that the data from the previous phase was retained. 227** to check that the data from the previous phase was retained.
233*/ 228*/
234 229
235static int RIOScrub(int op, BYTE *ram, int size) 230static int RIOScrub(int op, u8 *ram, int size)
236{ 231{
237 int off; 232 int off;
238 unsigned char oldbyte; 233 unsigned char oldbyte;
@@ -364,7 +359,7 @@ static int RIOScrub(int op, BYTE *ram, int size)
364 } 359 }
365 writew(newword, ram + off); 360 writew(newword, ram + off);
366 } 361 }
367 return RIO_SUCCESS; 362 return 0;
368} 363}
369 364
370 365
diff --git a/drivers/char/rio/riointr.c b/drivers/char/rio/riointr.c
index ec415ccbc4f0..97f0fa550652 100644
--- a/drivers/char/rio/riointr.c
+++ b/drivers/char/rio/riointr.c
@@ -54,15 +54,12 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2";
54 54
55#include "linux_compat.h" 55#include "linux_compat.h"
56#include "rio_linux.h" 56#include "rio_linux.h"
57#include "typdef.h"
58#include "pkt.h" 57#include "pkt.h"
59#include "daemon.h" 58#include "daemon.h"
60#include "rio.h" 59#include "rio.h"
61#include "riospace.h" 60#include "riospace.h"
62#include "top.h"
63#include "cmdpkt.h" 61#include "cmdpkt.h"
64#include "map.h" 62#include "map.h"
65#include "riotypes.h"
66#include "rup.h" 63#include "rup.h"
67#include "port.h" 64#include "port.h"
68#include "riodrvr.h" 65#include "riodrvr.h"
@@ -75,12 +72,10 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2";
75#include "unixrup.h" 72#include "unixrup.h"
76#include "board.h" 73#include "board.h"
77#include "host.h" 74#include "host.h"
78#include "error.h"
79#include "phb.h" 75#include "phb.h"
80#include "link.h" 76#include "link.h"
81#include "cmdblk.h" 77#include "cmdblk.h"
82#include "route.h" 78#include "route.h"
83#include "control.h"
84#include "cirrus.h" 79#include "cirrus.h"
85#include "rioioctl.h" 80#include "rioioctl.h"
86 81
@@ -396,7 +391,6 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From)
396 /* For now don't handle RTA reboots. -- REW. 391 /* For now don't handle RTA reboots. -- REW.
397 Reenabled. Otherwise RTA reboots didn't work. Duh. -- REW */ 392 Reenabled. Otherwise RTA reboots didn't work. Duh. -- REW */
398 if (PortP->MagicFlags) { 393 if (PortP->MagicFlags) {
399#if 1
400 if (PortP->MagicFlags & MAGIC_REBOOT) { 394 if (PortP->MagicFlags & MAGIC_REBOOT) {
401 /* 395 /*
402 ** well, the RTA has been rebooted, and there is room 396 ** well, the RTA has been rebooted, and there is room
@@ -413,13 +407,12 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From)
413 PortP->InUse = NOT_INUSE; 407 PortP->InUse = NOT_INUSE;
414 408
415 rio_spin_unlock(&PortP->portSem); 409 rio_spin_unlock(&PortP->portSem);
416 if (RIOParam(PortP, OPEN, ((PortP->Cor2Copy & (COR2_RTSFLOW | COR2_CTSFLOW)) == (COR2_RTSFLOW | COR2_CTSFLOW)) ? TRUE : FALSE, DONT_SLEEP) == RIO_FAIL) { 410 if (RIOParam(PortP, OPEN, ((PortP->Cor2Copy & (COR2_RTSFLOW | COR2_CTSFLOW)) == (COR2_RTSFLOW | COR2_CTSFLOW)) ? 1 : 0, DONT_SLEEP) == RIO_FAIL) {
417 continue; /* with next port */ 411 continue; /* with next port */
418 } 412 }
419 rio_spin_lock(&PortP->portSem); 413 rio_spin_lock(&PortP->portSem);
420 PortP->MagicFlags &= ~MAGIC_REBOOT; 414 PortP->MagicFlags &= ~MAGIC_REBOOT;
421 } 415 }
422#endif
423 416
424 /* 417 /*
425 ** As mentioned above, this is a tacky hack to cope 418 ** As mentioned above, this is a tacky hack to cope
diff --git a/drivers/char/rio/rioparam.c b/drivers/char/rio/rioparam.c
index af25d2084f47..d2e8092cdb29 100644
--- a/drivers/char/rio/rioparam.c
+++ b/drivers/char/rio/rioparam.c
@@ -52,15 +52,12 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
52 52
53#include "linux_compat.h" 53#include "linux_compat.h"
54#include "rio_linux.h" 54#include "rio_linux.h"
55#include "typdef.h"
56#include "pkt.h" 55#include "pkt.h"
57#include "daemon.h" 56#include "daemon.h"
58#include "rio.h" 57#include "rio.h"
59#include "riospace.h" 58#include "riospace.h"
60#include "top.h"
61#include "cmdpkt.h" 59#include "cmdpkt.h"
62#include "map.h" 60#include "map.h"
63#include "riotypes.h"
64#include "rup.h" 61#include "rup.h"
65#include "port.h" 62#include "port.h"
66#include "riodrvr.h" 63#include "riodrvr.h"
@@ -73,17 +70,13 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
73#include "unixrup.h" 70#include "unixrup.h"
74#include "board.h" 71#include "board.h"
75#include "host.h" 72#include "host.h"
76#include "error.h"
77#include "phb.h" 73#include "phb.h"
78#include "link.h" 74#include "link.h"
79#include "cmdblk.h" 75#include "cmdblk.h"
80#include "route.h" 76#include "route.h"
81#include "control.h"
82#include "cirrus.h" 77#include "cirrus.h"
83#include "rioioctl.h" 78#include "rioioctl.h"
84#include "param.h" 79#include "param.h"
85#include "list.h"
86#include "sam.h"
87 80
88 81
89 82
@@ -162,7 +155,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
162 struct tty_struct *TtyP; 155 struct tty_struct *TtyP;
163 int retval; 156 int retval;
164 struct phb_param *phb_param_ptr; 157 struct phb_param *phb_param_ptr;
165 PKT *PacketP; 158 struct PKT *PacketP;
166 int res; 159 int res;
167 u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0; 160 u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0;
168 u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0; 161 u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0;
@@ -228,7 +221,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
228 if (PortP->State & RIO_DELETED) { 221 if (PortP->State & RIO_DELETED) {
229 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 222 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
230 func_exit(); 223 func_exit();
231 return RIO_SUCCESS; 224 return 0;
232 } 225 }
233 } 226 }
234 227
@@ -240,7 +233,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
240 } 233 }
241 234
242 rio_dprintk(RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n", res); 235 rio_dprintk(RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n", res);
243 rio_dprintk(RIO_DEBUG_PARAM, "Packet is 0x%p\n", PacketP); 236 rio_dprintk(RIO_DEBUG_PARAM, "Packet is %p\n", PacketP);
244 237
245 phb_param_ptr = (struct phb_param *) PacketP->data; 238 phb_param_ptr = (struct phb_param *) PacketP->data;
246 239
@@ -579,7 +572,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
579 */ 572 */
580 func_exit(); 573 func_exit();
581 574
582 return RIO_SUCCESS; 575 return 0;
583} 576}
584 577
585 578
@@ -587,11 +580,11 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
587** We can add another packet to a transmit queue if the packet pointer pointed 580** We can add another packet to a transmit queue if the packet pointer pointed
588** to by the TxAdd pointer has PKT_IN_USE clear in its address. 581** to by the TxAdd pointer has PKT_IN_USE clear in its address.
589*/ 582*/
590int can_add_transmit(PKT **PktP, struct Port *PortP) 583int can_add_transmit(struct PKT **PktP, struct Port *PortP)
591{ 584{
592 PKT *tp; 585 struct PKT *tp;
593 586
594 *PktP = tp = (PKT *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd)); 587 *PktP = tp = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd));
595 588
596 return !((unsigned long) tp & PKT_IN_USE); 589 return !((unsigned long) tp & PKT_IN_USE);
597} 590}
@@ -615,10 +608,10 @@ void add_transmit(struct Port *PortP)
615 * Put a packet onto the end of the 608 * Put a packet onto the end of the
616 * free list 609 * free list
617 ****************************************/ 610 ****************************************/
618void put_free_end(struct Host *HostP, PKT *PktP) 611void put_free_end(struct Host *HostP, struct PKT *PktP)
619{ 612{
620 FREE_LIST *tmp_pointer; 613 struct rio_free_list *tmp_pointer;
621 ushort old_end, new_end; 614 unsigned short old_end, new_end;
622 unsigned long flags; 615 unsigned long flags;
623 616
624 rio_spin_lock_irqsave(&HostP->HostLock, flags); 617 rio_spin_lock_irqsave(&HostP->HostLock, flags);
@@ -632,15 +625,15 @@ void put_free_end(struct Host *HostP, PKT *PktP)
632 625
633 if ((old_end = readw(&HostP->ParmMapP->free_list_end)) != TPNULL) { 626 if ((old_end = readw(&HostP->ParmMapP->free_list_end)) != TPNULL) {
634 new_end = RIO_OFF(HostP->Caddr, PktP); 627 new_end = RIO_OFF(HostP->Caddr, PktP);
635 tmp_pointer = (FREE_LIST *) RIO_PTR(HostP->Caddr, old_end); 628 tmp_pointer = (struct rio_free_list *) RIO_PTR(HostP->Caddr, old_end);
636 writew(new_end, &tmp_pointer->next); 629 writew(new_end, &tmp_pointer->next);
637 writew(old_end, &((FREE_LIST *) PktP)->prev); 630 writew(old_end, &((struct rio_free_list *) PktP)->prev);
638 writew(TPNULL, &((FREE_LIST *) PktP)->next); 631 writew(TPNULL, &((struct rio_free_list *) PktP)->next);
639 writew(new_end, &HostP->ParmMapP->free_list_end); 632 writew(new_end, &HostP->ParmMapP->free_list_end);
640 } else { /* First packet on the free list this should never happen! */ 633 } else { /* First packet on the free list this should never happen! */
641 rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n"); 634 rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n");
642 writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end); 635 writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end);
643 tmp_pointer = (FREE_LIST *) PktP; 636 tmp_pointer = (struct rio_free_list *) PktP;
644 writew(TPNULL, &tmp_pointer->prev); 637 writew(TPNULL, &tmp_pointer->prev);
645 writew(TPNULL, &tmp_pointer->next); 638 writew(TPNULL, &tmp_pointer->next);
646 } 639 }
@@ -654,10 +647,10 @@ void put_free_end(struct Host *HostP, PKT *PktP)
654** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear, 647** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear,
655** then can_remove_receive() returns 0. 648** then can_remove_receive() returns 0.
656*/ 649*/
657int can_remove_receive(PKT **PktP, struct Port *PortP) 650int can_remove_receive(struct PKT **PktP, struct Port *PortP)
658{ 651{
659 if (readw(PortP->RxRemove) & PKT_IN_USE) { 652 if (readw(PortP->RxRemove) & PKT_IN_USE) {
660 *PktP = (PKT *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE); 653 *PktP = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE);
661 return 1; 654 return 1;
662 } 655 }
663 return 0; 656 return 0;
diff --git a/drivers/char/rio/rioroute.c b/drivers/char/rio/rioroute.c
index 874ac7462388..357085337942 100644
--- a/drivers/char/rio/rioroute.c
+++ b/drivers/char/rio/rioroute.c
@@ -50,15 +50,12 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3";
50 50
51#include "linux_compat.h" 51#include "linux_compat.h"
52#include "rio_linux.h" 52#include "rio_linux.h"
53#include "typdef.h"
54#include "pkt.h" 53#include "pkt.h"
55#include "daemon.h" 54#include "daemon.h"
56#include "rio.h" 55#include "rio.h"
57#include "riospace.h" 56#include "riospace.h"
58#include "top.h"
59#include "cmdpkt.h" 57#include "cmdpkt.h"
60#include "map.h" 58#include "map.h"
61#include "riotypes.h"
62#include "rup.h" 59#include "rup.h"
63#include "port.h" 60#include "port.h"
64#include "riodrvr.h" 61#include "riodrvr.h"
@@ -71,29 +68,25 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3";
71#include "unixrup.h" 68#include "unixrup.h"
72#include "board.h" 69#include "board.h"
73#include "host.h" 70#include "host.h"
74#include "error.h"
75#include "phb.h" 71#include "phb.h"
76#include "link.h" 72#include "link.h"
77#include "cmdblk.h" 73#include "cmdblk.h"
78#include "route.h" 74#include "route.h"
79#include "control.h"
80#include "cirrus.h" 75#include "cirrus.h"
81#include "rioioctl.h" 76#include "rioioctl.h"
82#include "param.h" 77#include "param.h"
83#include "list.h"
84#include "sam.h"
85 78
86static int RIOCheckIsolated(struct rio_info *, struct Host *, uint); 79static int RIOCheckIsolated(struct rio_info *, struct Host *, unsigned int);
87static int RIOIsolate(struct rio_info *, struct Host *, uint); 80static int RIOIsolate(struct rio_info *, struct Host *, unsigned int);
88static int RIOCheck(struct Host *, uint); 81static int RIOCheck(struct Host *, unsigned int);
89static void RIOConCon(struct rio_info *, struct Host *, uint, uint, uint, uint, int); 82static void RIOConCon(struct rio_info *, struct Host *, unsigned int, unsigned int, unsigned int, unsigned int, int);
90 83
91 84
92/* 85/*
93** Incoming on the ROUTE_RUP 86** Incoming on the ROUTE_RUP
94** I wrote this while I was tired. Forgive me. 87** I wrote this while I was tired. Forgive me.
95*/ 88*/
96int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) 89int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT * PacketP)
97{ 90{
98 struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; 91 struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data;
99 struct PktCmd_M *PktReplyP; 92 struct PktCmd_M *PktReplyP;
@@ -104,10 +97,10 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
104 int ThisLink, ThisLinkMin, ThisLinkMax; 97 int ThisLink, ThisLinkMin, ThisLinkMax;
105 int port; 98 int port;
106 int Mod, Mod1, Mod2; 99 int Mod, Mod1, Mod2;
107 ushort RtaType; 100 unsigned short RtaType;
108 uint RtaUniq; 101 unsigned int RtaUniq;
109 uint ThisUnit, ThisUnit2; /* 2 ids to accommodate 16 port RTA */ 102 unsigned int ThisUnit, ThisUnit2; /* 2 ids to accommodate 16 port RTA */
110 uint OldUnit, NewUnit, OldLink, NewLink; 103 unsigned int OldUnit, NewUnit, OldLink, NewLink;
111 char *MyType, *MyName; 104 char *MyType, *MyName;
112 int Lies; 105 int Lies;
113 unsigned long flags; 106 unsigned long flags;
@@ -125,7 +118,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
125 ** from an RTA then we need to fill in the Mapping structure's 118 ** from an RTA then we need to fill in the Mapping structure's
126 ** Topology array for the unit. 119 ** Topology array for the unit.
127 */ 120 */
128 if (Rup >= (ushort) MAX_RUP) { 121 if (Rup >= (unsigned short) MAX_RUP) {
129 ThisUnit = HOST_ID; 122 ThisUnit = HOST_ID;
130 TopP = HostP->Topology; 123 TopP = HostP->Topology;
131 MyType = "Host"; 124 MyType = "Host";
@@ -151,7 +144,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
151 ** it won't lie about network interconnect, total disconnects 144 ** it won't lie about network interconnect, total disconnects
152 ** and no-IDs. (or at least, it doesn't *matter* if it does) 145 ** and no-IDs. (or at least, it doesn't *matter* if it does)
153 */ 146 */
154 if (readb(&PktCmdP->RouteTopology[ThisLink].Unit) > (ushort) MAX_RUP) 147 if (readb(&PktCmdP->RouteTopology[ThisLink].Unit) > (unsigned short) MAX_RUP)
155 continue; 148 continue;
156 149
157 for (NewLink = ThisLinkMin; NewLink < ThisLink; NewLink++) { 150 for (NewLink = ThisLinkMin; NewLink < ThisLink; NewLink++) {
@@ -168,7 +161,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
168 'A' + readb(&PktCmdP->RouteTopology[0].Link), 161 'A' + readb(&PktCmdP->RouteTopology[0].Link),
169 readb(&PktCmdP->RouteTopology[1].Unit), 162 readb(&PktCmdP->RouteTopology[1].Unit),
170 'A' + readb(&PktCmdP->RouteTopology[1].Link), readb(&PktCmdP->RouteTopology[2].Unit), 'A' + readb(&PktCmdP->RouteTopology[2].Link), readb(&PktCmdP->RouteTopology[3].Unit), 'A' + readb(&PktCmdP->RouteTopology[3].Link)); 163 'A' + readb(&PktCmdP->RouteTopology[1].Link), readb(&PktCmdP->RouteTopology[2].Unit), 'A' + readb(&PktCmdP->RouteTopology[2].Link), readb(&PktCmdP->RouteTopology[3].Unit), 'A' + readb(&PktCmdP->RouteTopology[3].Link));
171 return TRUE; 164 return 1;
172 } 165 }
173 166
174 /* 167 /*
@@ -258,7 +251,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
258 RIOCheckIsolated(p, HostP, OldUnit); 251 RIOCheckIsolated(p, HostP, OldUnit);
259 } 252 }
260 } 253 }
261 return TRUE; 254 return 1;
262 } 255 }
263 256
264 /* 257 /*
@@ -266,7 +259,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
266 */ 259 */
267 if (readb(&PktCmdP->Command) != ROUTE_REQUEST) { 260 if (readb(&PktCmdP->Command) != ROUTE_REQUEST) {
268 rio_dprintk(RIO_DEBUG_ROUTE, "Unknown command %d received on rup %d host %p ROUTE_RUP\n", readb(&PktCmdP->Command), Rup, HostP); 261 rio_dprintk(RIO_DEBUG_ROUTE, "Unknown command %d received on rup %d host %p ROUTE_RUP\n", readb(&PktCmdP->Command), Rup, HostP);
269 return TRUE; 262 return 1;
270 } 263 }
271 264
272 RtaUniq = (readb(&PktCmdP->UniqNum[0])) + (readb(&PktCmdP->UniqNum[1]) << 8) + (readb(&PktCmdP->UniqNum[2]) << 16) + (readb(&PktCmdP->UniqNum[3]) << 24); 265 RtaUniq = (readb(&PktCmdP->UniqNum[0])) + (readb(&PktCmdP->UniqNum[1]) << 8) + (readb(&PktCmdP->UniqNum[2]) << 16) + (readb(&PktCmdP->UniqNum[3]) << 24);
@@ -292,10 +285,6 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
292 rio_dprintk(RIO_DEBUG_ROUTE, "Module types are %s (ports 0-3) and %s (ports 4-7)\n", p->RIOModuleTypes[Mod1].Name, p->RIOModuleTypes[Mod2].Name); 285 rio_dprintk(RIO_DEBUG_ROUTE, "Module types are %s (ports 0-3) and %s (ports 4-7)\n", p->RIOModuleTypes[Mod1].Name, p->RIOModuleTypes[Mod2].Name);
293 } 286 }
294 287
295 if (RtaUniq == 0xffffffff) {
296 ShowPacket(DBG_SPECIAL, PacketP);
297 }
298
299 /* 288 /*
300 ** try to unhook a command block from the command free list. 289 ** try to unhook a command block from the command free list.
301 */ 290 */
@@ -320,7 +309,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
320 PktReplyP->Command = ROUTE_FOAD; 309 PktReplyP->Command = ROUTE_FOAD;
321 HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7); 310 HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7);
322 RIOQueueCmdBlk(HostP, Rup, CmdBlkP); 311 RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
323 return TRUE; 312 return 1;
324 } 313 }
325 314
326 /* 315 /*
@@ -354,7 +343,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
354 PktReplyP->Command = ROUTE_FOAD; 343 PktReplyP->Command = ROUTE_FOAD;
355 HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7); 344 HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7);
356 RIOQueueCmdBlk(HostP, Rup, CmdBlkP); 345 RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
357 return TRUE; 346 return 1;
358 } 347 }
359 348
360 /* 349 /*
@@ -447,7 +436,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
447 /* 436 /*
448 ** Job done, get on with the interrupts! 437 ** Job done, get on with the interrupts!
449 */ 438 */
450 return TRUE; 439 return 1;
451 } 440 }
452 } 441 }
453 /* 442 /*
@@ -491,28 +480,25 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
491 if (RtaType == TYPE_RTA16) { 480 if (RtaType == TYPE_RTA16) {
492 if (RIOFindFreeID(p, HostP, &ThisUnit, &ThisUnit2) == 0) { 481 if (RIOFindFreeID(p, HostP, &ThisUnit, &ThisUnit2) == 0) {
493 RIODefaultName(p, HostP, ThisUnit); 482 RIODefaultName(p, HostP, ThisUnit);
494 FillSlot(ThisUnit, ThisUnit2, RtaUniq, HostP); 483 rio_fill_host_slot(ThisUnit, ThisUnit2, RtaUniq, HostP);
495 } 484 }
496 } else { 485 } else {
497 if (RIOFindFreeID(p, HostP, &ThisUnit, NULL) == 0) { 486 if (RIOFindFreeID(p, HostP, &ThisUnit, NULL) == 0) {
498 RIODefaultName(p, HostP, ThisUnit); 487 RIODefaultName(p, HostP, ThisUnit);
499 FillSlot(ThisUnit, 0, RtaUniq, HostP); 488 rio_fill_host_slot(ThisUnit, 0, RtaUniq, HostP);
500 } 489 }
501 } 490 }
502 PktReplyP->Command = ROUTE_USED; 491 PktReplyP->Command = ROUTE_USED;
503 HostP->Copy("RT_USED", PktReplyP->CommandText, 7); 492 HostP->Copy("RT_USED", PktReplyP->CommandText, 7);
504 } 493 }
505 RIOQueueCmdBlk(HostP, Rup, CmdBlkP); 494 RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
506 return TRUE; 495 return 1;
507} 496}
508 497
509 498
510void RIOFixPhbs(p, HostP, unit) 499void RIOFixPhbs(struct rio_info *p, struct Host *HostP, unsigned int unit)
511struct rio_info *p;
512struct Host *HostP;
513uint unit;
514{ 500{
515 ushort link, port; 501 unsigned short link, port;
516 struct Port *PortP; 502 struct Port *PortP;
517 unsigned long flags; 503 unsigned long flags;
518 int PortN = HostP->Mapping[unit].SysPort; 504 int PortN = HostP->Mapping[unit].SysPort;
@@ -520,7 +506,7 @@ uint unit;
520 rio_dprintk(RIO_DEBUG_ROUTE, "RIOFixPhbs unit %d sysport %d\n", unit, PortN); 506 rio_dprintk(RIO_DEBUG_ROUTE, "RIOFixPhbs unit %d sysport %d\n", unit, PortN);
521 507
522 if (PortN != -1) { 508 if (PortN != -1) {
523 ushort dest_unit = HostP->Mapping[unit].ID2; 509 unsigned short dest_unit = HostP->Mapping[unit].ID2;
524 510
525 /* 511 /*
526 ** Get the link number used for the 1st 8 phbs on this unit. 512 ** Get the link number used for the 1st 8 phbs on this unit.
@@ -530,9 +516,9 @@ uint unit;
530 link = readw(&PortP->PhbP->link); 516 link = readw(&PortP->PhbP->link);
531 517
532 for (port = 0; port < PORTS_PER_RTA; port++, PortN++) { 518 for (port = 0; port < PORTS_PER_RTA; port++, PortN++) {
533 ushort dest_port = port + 8; 519 unsigned short dest_port = port + 8;
534 WORD *TxPktP; 520 u16 *TxPktP;
535 PKT *Pkt; 521 struct PKT *Pkt;
536 522
537 PortP = p->RIOPortp[PortN]; 523 PortP = p->RIOPortp[PortN];
538 524
@@ -569,12 +555,12 @@ uint unit;
569 ** card. This needs to be translated into a 32 bit pointer 555 ** card. This needs to be translated into a 32 bit pointer
570 ** so it can be accessed from the driver. 556 ** so it can be accessed from the driver.
571 */ 557 */
572 Pkt = (PKT *) RIO_PTR(HostP->Caddr, readw(TxPktP)); 558 Pkt = (struct PKT *) RIO_PTR(HostP->Caddr, readw(TxPktP));
573 559
574 /* 560 /*
575 ** If the packet is used, reset it. 561 ** If the packet is used, reset it.
576 */ 562 */
577 Pkt = (PKT *) ((unsigned long) Pkt & ~PKT_IN_USE); 563 Pkt = (struct PKT *) ((unsigned long) Pkt & ~PKT_IN_USE);
578 writeb(dest_unit, &Pkt->dest_unit); 564 writeb(dest_unit, &Pkt->dest_unit);
579 writeb(dest_port, &Pkt->dest_port); 565 writeb(dest_port, &Pkt->dest_port);
580 } 566 }
@@ -603,10 +589,7 @@ uint unit;
603** the world about it. This is done to ensure that the configurator 589** the world about it. This is done to ensure that the configurator
604** only gets up-to-date information about what is going on. 590** only gets up-to-date information about what is going on.
605*/ 591*/
606static int RIOCheckIsolated(p, HostP, UnitId) 592static int RIOCheckIsolated(struct rio_info *p, struct Host *HostP, unsigned int UnitId)
607struct rio_info *p;
608struct Host *HostP;
609uint UnitId;
610{ 593{
611 unsigned long flags; 594 unsigned long flags;
612 rio_spin_lock_irqsave(&HostP->HostLock, flags); 595 rio_spin_lock_irqsave(&HostP->HostLock, flags);
@@ -628,12 +611,9 @@ uint UnitId;
628** all the units attached to it. This will mean that the entire 611** all the units attached to it. This will mean that the entire
629** subnet will re-introduce itself. 612** subnet will re-introduce itself.
630*/ 613*/
631static int RIOIsolate(p, HostP, UnitId) 614static int RIOIsolate(struct rio_info *p, struct Host *HostP, unsigned int UnitId)
632struct rio_info *p;
633struct Host *HostP;
634uint UnitId;
635{ 615{
636 uint link, unit; 616 unsigned int link, unit;
637 617
638 UnitId--; /* this trick relies on the Unit Id being UNSIGNED! */ 618 UnitId--; /* this trick relies on the Unit Id being UNSIGNED! */
639 619
@@ -658,9 +638,7 @@ uint UnitId;
658 return 1; 638 return 1;
659} 639}
660 640
661static int RIOCheck(HostP, UnitId) 641static int RIOCheck(struct Host *HostP, unsigned int UnitId)
662struct Host *HostP;
663uint UnitId;
664{ 642{
665 unsigned char link; 643 unsigned char link;
666 644
@@ -714,8 +692,7 @@ uint UnitId;
714** Returns the type of unit (host, 16/8 port RTA) 692** Returns the type of unit (host, 16/8 port RTA)
715*/ 693*/
716 694
717uint GetUnitType(Uniq) 695unsigned int GetUnitType(unsigned int Uniq)
718uint Uniq;
719{ 696{
720 switch ((Uniq >> 28) & 0xf) { 697 switch ((Uniq >> 28) & 0xf) {
721 case RIO_AT: 698 case RIO_AT:
@@ -736,8 +713,7 @@ uint Uniq;
736 } 713 }
737} 714}
738 715
739int RIOSetChange(p) 716int RIOSetChange(struct rio_info *p)
740struct rio_info *p;
741{ 717{
742 if (p->RIOQuickCheck != NOT_CHANGED) 718 if (p->RIOQuickCheck != NOT_CHANGED)
743 return (0); 719 return (0);
@@ -751,14 +727,13 @@ struct rio_info *p;
751 return (0); 727 return (0);
752} 728}
753 729
754static void RIOConCon(p, HostP, FromId, FromLink, ToId, ToLink, Change) 730static void RIOConCon(struct rio_info *p,
755struct rio_info *p; 731 struct Host *HostP,
756struct Host *HostP; 732 unsigned int FromId,
757uint FromId; 733 unsigned int FromLink,
758uint FromLink; 734 unsigned int ToId,
759uint ToId; 735 unsigned int ToLink,
760uint ToLink; 736 int Change)
761int Change;
762{ 737{
763 char *FromName; 738 char *FromName;
764 char *FromType; 739 char *FromType;
@@ -912,7 +887,8 @@ static int RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit)
912** This function scans the given host table for either one 887** This function scans the given host table for either one
913** or two free unit ID's. 888** or two free unit ID's.
914*/ 889*/
915int RIOFindFreeID(struct rio_info *p, struct Host *HostP, uint * pID1, uint * pID2) 890
891int RIOFindFreeID(struct rio_info *p, struct Host *HostP, unsigned int * pID1, unsigned int * pID2)
916{ 892{
917 int unit, tempID; 893 int unit, tempID;
918 894
diff --git a/drivers/char/rio/riotable.c b/drivers/char/rio/riotable.c
index f1d50142b91d..d3abe0d37d64 100644
--- a/drivers/char/rio/riotable.c
+++ b/drivers/char/rio/riotable.c
@@ -53,15 +53,12 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2";
53 53
54#include "linux_compat.h" 54#include "linux_compat.h"
55#include "rio_linux.h" 55#include "rio_linux.h"
56#include "typdef.h"
57#include "pkt.h" 56#include "pkt.h"
58#include "daemon.h" 57#include "daemon.h"
59#include "rio.h" 58#include "rio.h"
60#include "riospace.h" 59#include "riospace.h"
61#include "top.h"
62#include "cmdpkt.h" 60#include "cmdpkt.h"
63#include "map.h" 61#include "map.h"
64#include "riotypes.h"
65#include "rup.h" 62#include "rup.h"
66#include "port.h" 63#include "port.h"
67#include "riodrvr.h" 64#include "riodrvr.h"
@@ -74,17 +71,13 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2";
74#include "unixrup.h" 71#include "unixrup.h"
75#include "board.h" 72#include "board.h"
76#include "host.h" 73#include "host.h"
77#include "error.h"
78#include "phb.h" 74#include "phb.h"
79#include "link.h" 75#include "link.h"
80#include "cmdblk.h" 76#include "cmdblk.h"
81#include "route.h" 77#include "route.h"
82#include "control.h"
83#include "cirrus.h" 78#include "cirrus.h"
84#include "rioioctl.h" 79#include "rioioctl.h"
85#include "param.h" 80#include "param.h"
86#include "list.h"
87#include "sam.h"
88#include "protsts.h" 81#include "protsts.h"
89 82
90/* 83/*
@@ -136,7 +129,7 @@ int RIONewTable(struct rio_info *p)
136 cptr = MapP->Name; /* (2) */ 129 cptr = MapP->Name; /* (2) */
137 cptr[MAX_NAME_LEN - 1] = '\0'; 130 cptr[MAX_NAME_LEN - 1] = '\0';
138 if (cptr[0] == '\0') { 131 if (cptr[0] == '\0') {
139 bcopy(MapP->RtaUniqueNum ? "RTA NN" : "HOST NN", MapP->Name, 8); 132 memcpy(MapP->Name, MapP->RtaUniqueNum ? "RTA NN" : "HOST NN", 8);
140 MapP->Name[5] = '0' + Entry / 10; 133 MapP->Name[5] = '0' + Entry / 10;
141 MapP->Name[6] = '0' + Entry % 10; 134 MapP->Name[6] = '0' + Entry % 10;
142 } 135 }
@@ -325,7 +318,7 @@ int RIONewTable(struct rio_info *p)
325 */ 318 */
326 if (MapP->ID == 0) { 319 if (MapP->ID == 0) {
327 rio_dprintk(RIO_DEBUG_TABLE, "Host entry found. Name %s\n", MapP->Name); 320 rio_dprintk(RIO_DEBUG_TABLE, "Host entry found. Name %s\n", MapP->Name);
328 bcopy(MapP->Name, HostP->Name, MAX_NAME_LEN); 321 memcpy(HostP->Name, MapP->Name, MAX_NAME_LEN);
329 continue; 322 continue;
330 } 323 }
331 324
@@ -369,7 +362,7 @@ int RIONewTable(struct rio_info *p)
369 } 362 }
370 } 363 }
371 if (!p->RIOHosts[Host].Name[0]) { 364 if (!p->RIOHosts[Host].Name[0]) {
372 bcopy("HOST 1", p->RIOHosts[Host].Name, 7); 365 memcpy(p->RIOHosts[Host].Name, "HOST 1", 7);
373 p->RIOHosts[Host].Name[5] += Host; 366 p->RIOHosts[Host].Name[5] += Host;
374 } 367 }
375 /* 368 /*
@@ -397,7 +390,7 @@ int RIONewTable(struct rio_info *p)
397 */ 390 */
398 if (Host1 != Host) { 391 if (Host1 != Host) {
399 rio_dprintk(RIO_DEBUG_TABLE, "Default name %s already used\n", p->RIOHosts[Host].Name); 392 rio_dprintk(RIO_DEBUG_TABLE, "Default name %s already used\n", p->RIOHosts[Host].Name);
400 bcopy("HOST 1", p->RIOHosts[Host].Name, 7); 393 memcpy(p->RIOHosts[Host].Name, "HOST 1", 7);
401 p->RIOHosts[Host].Name[5] += Host1; 394 p->RIOHosts[Host].Name[5] += Host1;
402 } 395 }
403 rio_dprintk(RIO_DEBUG_TABLE, "Assigning default name %s\n", p->RIOHosts[Host].Name); 396 rio_dprintk(RIO_DEBUG_TABLE, "Assigning default name %s\n", p->RIOHosts[Host].Name);
@@ -440,7 +433,7 @@ int RIOApel(struct rio_info *p)
440 MapP->SysPort = NO_PORT; 433 MapP->SysPort = NO_PORT;
441 for (link = 0; link < LINKS_PER_UNIT; link++) 434 for (link = 0; link < LINKS_PER_UNIT; link++)
442 MapP->Topology[link] = HostP->Topology[link]; 435 MapP->Topology[link] = HostP->Topology[link];
443 bcopy(HostP->Name, MapP->Name, MAX_NAME_LEN); 436 memcpy(MapP->Name, HostP->Name, MAX_NAME_LEN);
444 for (Rup = 0; Rup < MAX_RUP; Rup++) { 437 for (Rup = 0; Rup < MAX_RUP; Rup++) {
445 if (HostP->Mapping[Rup].Flags & (SLOT_IN_USE | SLOT_TENTATIVE)) { 438 if (HostP->Mapping[Rup].Flags & (SLOT_IN_USE | SLOT_TENTATIVE)) {
446 p->RIOConnectTable[Next] = HostP->Mapping[Rup]; 439 p->RIOConnectTable[Next] = HostP->Mapping[Rup];
@@ -539,10 +532,10 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP)
539 ** the phb to port mappings in RIORouteRup. 532 ** the phb to port mappings in RIORouteRup.
540 */ 533 */
541 if (PortP->SecondBlock) { 534 if (PortP->SecondBlock) {
542 ushort dest_unit = HostMapP->ID; 535 u16 dest_unit = HostMapP->ID;
543 ushort dest_port = port - SysPort; 536 u16 dest_port = port - SysPort;
544 u16 *TxPktP; 537 u16 *TxPktP;
545 PKT *Pkt; 538 struct PKT *Pkt;
546 539
547 for (TxPktP = PortP->TxStart; TxPktP <= PortP->TxEnd; TxPktP++) { 540 for (TxPktP = PortP->TxStart; TxPktP <= PortP->TxEnd; TxPktP++) {
548 /* 541 /*
@@ -552,7 +545,7 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP)
552 ** a 32 bit pointer so it can be 545 ** a 32 bit pointer so it can be
553 ** accessed from the driver. 546 ** accessed from the driver.
554 */ 547 */
555 Pkt = (PKT *) RIO_PTR(HostP->Caddr, readw(&*TxPktP)); 548 Pkt = (struct PKT *) RIO_PTR(HostP->Caddr, readw(&*TxPktP));
556 rio_dprintk(RIO_DEBUG_TABLE, "Tx packet (%x) destination: Old %x:%x New %x:%x\n", *TxPktP, Pkt->dest_unit, Pkt->dest_port, dest_unit, dest_port); 549 rio_dprintk(RIO_DEBUG_TABLE, "Tx packet (%x) destination: Old %x:%x New %x:%x\n", *TxPktP, Pkt->dest_unit, Pkt->dest_port, dest_unit, dest_port);
557 writew(dest_unit, &Pkt->dest_unit); 550 writew(dest_unit, &Pkt->dest_unit);
558 writew(dest_port, &Pkt->dest_port); 551 writew(dest_port, &Pkt->dest_port);
@@ -600,7 +593,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
600 593
601 rio_dprintk(RIO_DEBUG_TABLE, "Assign entry on host %x, rta %x, ID %d, Sysport %d\n", MapP->HostUniqueNum, MapP->RtaUniqueNum, MapP->ID, (int) MapP->SysPort); 594 rio_dprintk(RIO_DEBUG_TABLE, "Assign entry on host %x, rta %x, ID %d, Sysport %d\n", MapP->HostUniqueNum, MapP->RtaUniqueNum, MapP->ID, (int) MapP->SysPort);
602 595
603 if ((MapP->ID != (ushort) - 1) && ((int) MapP->ID < (int) 1 || (int) MapP->ID > MAX_RUP)) { 596 if ((MapP->ID != (u16) - 1) && ((int) MapP->ID < (int) 1 || (int) MapP->ID > MAX_RUP)) {
604 rio_dprintk(RIO_DEBUG_TABLE, "Bad ID in map entry!\n"); 597 rio_dprintk(RIO_DEBUG_TABLE, "Bad ID in map entry!\n");
605 p->RIOError.Error = ID_NUMBER_OUT_OF_RANGE; 598 p->RIOError.Error = ID_NUMBER_OUT_OF_RANGE;
606 return -EINVAL; 599 return -EINVAL;
@@ -646,7 +639,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
646 ** Now we have a host we need to allocate an ID 639 ** Now we have a host we need to allocate an ID
647 ** if the entry does not already have one. 640 ** if the entry does not already have one.
648 */ 641 */
649 if (MapP->ID == (ushort) - 1) { 642 if (MapP->ID == (u16) - 1) {
650 int nNewID; 643 int nNewID;
651 644
652 rio_dprintk(RIO_DEBUG_TABLE, "Attempting to get a new ID for rta \"%s\"\n", MapP->Name); 645 rio_dprintk(RIO_DEBUG_TABLE, "Attempting to get a new ID for rta \"%s\"\n", MapP->Name);
@@ -665,7 +658,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
665 p->RIOError.Error = COULDNT_FIND_ENTRY; 658 p->RIOError.Error = COULDNT_FIND_ENTRY;
666 return -EBUSY; 659 return -EBUSY;
667 } 660 }
668 MapP->ID = (ushort) nNewID + 1; 661 MapP->ID = (u16) nNewID + 1;
669 rio_dprintk(RIO_DEBUG_TABLE, "Allocated ID %d for this new RTA.\n", MapP->ID); 662 rio_dprintk(RIO_DEBUG_TABLE, "Allocated ID %d for this new RTA.\n", MapP->ID);
670 HostMapP = &p->RIOHosts[host].Mapping[nNewID]; 663 HostMapP = &p->RIOHosts[host].Mapping[nNewID];
671 HostMapP->RtaUniqueNum = MapP->RtaUniqueNum; 664 HostMapP->RtaUniqueNum = MapP->RtaUniqueNum;
@@ -706,7 +699,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
706 */ 699 */
707 HostMapP->SysPort = MapP->SysPort; 700 HostMapP->SysPort = MapP->SysPort;
708 if ((MapP->Flags & RTA16_SECOND_SLOT) == 0) 701 if ((MapP->Flags & RTA16_SECOND_SLOT) == 0)
709 CCOPY(MapP->Name, HostMapP->Name, MAX_NAME_LEN); 702 memcpy(HostMapP->Name, MapP->Name, MAX_NAME_LEN);
710 HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED; 703 HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED;
711#ifdef NEED_TO_FIX 704#ifdef NEED_TO_FIX
712 RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID - 1]); 705 RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID - 1]);
@@ -743,10 +736,10 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
743int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP) 736int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP)
744{ 737{
745 struct Port *PortP; 738 struct Port *PortP;
746 uint SubEnt; 739 unsigned int SubEnt;
747 uint HostPort; 740 unsigned int HostPort;
748 uint SysPort; 741 unsigned int SysPort;
749 ushort RtaType; 742 u16 RtaType;
750 unsigned long flags; 743 unsigned long flags;
751 744
752 rio_dprintk(RIO_DEBUG_TABLE, "Mapping sysport %d to id %d\n", (int) HostMapP->SysPort, HostMapP->ID); 745 rio_dprintk(RIO_DEBUG_TABLE, "Mapping sysport %d to id %d\n", (int) HostMapP->SysPort, HostMapP->ID);
@@ -808,10 +801,10 @@ int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP)
808 PortP->RupNum = HostMapP->ID - 1; 801 PortP->RupNum = HostMapP->ID - 1;
809 if (HostMapP->Flags & RTA16_SECOND_SLOT) { 802 if (HostMapP->Flags & RTA16_SECOND_SLOT) {
810 PortP->ID2 = HostMapP->ID2 - 1; 803 PortP->ID2 = HostMapP->ID2 - 1;
811 PortP->SecondBlock = TRUE; 804 PortP->SecondBlock = 1;
812 } else { 805 } else {
813 PortP->ID2 = 0; 806 PortP->ID2 = 0;
814 PortP->SecondBlock = FALSE; 807 PortP->SecondBlock = 0;
815 } 808 }
816 PortP->RtaUniqueNum = HostMapP->RtaUniqueNum; 809 PortP->RtaUniqueNum = HostMapP->RtaUniqueNum;
817 810
@@ -931,7 +924,7 @@ int RIOChangeName(struct rio_info *p, struct Map *MapP)
931 return -ENXIO; 924 return -ENXIO;
932 } 925 }
933 if (MapP->ID == 0) { 926 if (MapP->ID == 0) {
934 CCOPY(MapP->Name, p->RIOHosts[host].Name, MAX_NAME_LEN); 927 memcpy(p->RIOHosts[host].Name, MapP->Name, MAX_NAME_LEN);
935 return 0; 928 return 0;
936 } 929 }
937 930
@@ -941,7 +934,7 @@ int RIOChangeName(struct rio_info *p, struct Map *MapP)
941 p->RIOError.Error = RTA_NUMBER_WRONG; 934 p->RIOError.Error = RTA_NUMBER_WRONG;
942 return -ENXIO; 935 return -ENXIO;
943 } 936 }
944 CCOPY(MapP->Name, HostMapP->Name, MAX_NAME_LEN); 937 memcpy(HostMapP->Name, MapP->Name, MAX_NAME_LEN);
945 return 0; 938 return 0;
946 } 939 }
947 } 940 }
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c
index 0ca431b4c474..204267613c9c 100644
--- a/drivers/char/rio/riotty.c
+++ b/drivers/char/rio/riotty.c
@@ -56,15 +56,12 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3";
56 56
57#include "linux_compat.h" 57#include "linux_compat.h"
58#include "rio_linux.h" 58#include "rio_linux.h"
59#include "typdef.h"
60#include "pkt.h" 59#include "pkt.h"
61#include "daemon.h" 60#include "daemon.h"
62#include "rio.h" 61#include "rio.h"
63#include "riospace.h" 62#include "riospace.h"
64#include "top.h"
65#include "cmdpkt.h" 63#include "cmdpkt.h"
66#include "map.h" 64#include "map.h"
67#include "riotypes.h"
68#include "rup.h" 65#include "rup.h"
69#include "port.h" 66#include "port.h"
70#include "riodrvr.h" 67#include "riodrvr.h"
@@ -77,58 +74,18 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3";
77#include "unixrup.h" 74#include "unixrup.h"
78#include "board.h" 75#include "board.h"
79#include "host.h" 76#include "host.h"
80#include "error.h"
81#include "phb.h" 77#include "phb.h"
82#include "link.h" 78#include "link.h"
83#include "cmdblk.h" 79#include "cmdblk.h"
84#include "route.h" 80#include "route.h"
85#include "control.h"
86#include "cirrus.h" 81#include "cirrus.h"
87#include "rioioctl.h" 82#include "rioioctl.h"
88#include "param.h" 83#include "param.h"
89#include "list.h"
90#include "sam.h"
91 84
92static void RIOClearUp(struct Port *PortP); 85static void RIOClearUp(struct Port *PortP);
93int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg);
94
95
96extern int conv_vb[]; /* now defined in ttymgr.c */
97extern int conv_bv[]; /* now defined in ttymgr.c */
98
99/*
100** 16.09.1998 ARG - Fix to build riotty.k.o for Modular Kernel Support
101**
102** ep.def.h is necessary for Modular Kernel Support
103** DO NOT place any kernel 'extern's after this line
104** or this source file will not build riotty.k.o
105*/
106#ifdef uLYNX
107#include <ep.def.h>
108#endif
109 86
110#ifdef NEED_THIS2 87/* Below belongs in func.h */
111static struct old_sgttyb default_sg = { 88int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg);
112 B19200, B19200, /* input and output speed */
113 'H' - '@', /* erase char */
114 -1, /* 2nd erase char */
115 'U' - '@', /* kill char */
116 ECHO | CRMOD, /* mode */
117 'C' - '@', /* interrupt character */
118 '\\' - '@', /* quit char */
119 'Q' - '@', /* start char */
120 'S' - '@', /* stop char */
121 'D' - '@', /* EOF */
122 -1, /* brk */
123 (LCRTBS | LCRTERA | LCRTKIL | LCTLECH), /* local mode word */
124 'Z' - '@', /* process stop */
125 'Y' - '@', /* delayed stop */
126 'R' - '@', /* reprint line */
127 'O' - '@', /* flush output */
128 'W' - '@', /* word erase */
129 'V' - '@' /* literal next char */
130};
131#endif
132 89
133 90
134extern struct rio_info *p; 91extern struct rio_info *p;
@@ -137,7 +94,6 @@ extern struct rio_info *p;
137int riotopen(struct tty_struct *tty, struct file *filp) 94int riotopen(struct tty_struct *tty, struct file *filp)
138{ 95{
139 unsigned int SysPort; 96 unsigned int SysPort;
140 int Modem;
141 int repeat_this = 250; 97 int repeat_this = 250;
142 struct Port *PortP; /* pointer to the port structure */ 98 struct Port *PortP; /* pointer to the port structure */
143 unsigned long flags; 99 unsigned long flags;
@@ -151,7 +107,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
151 tty->driver_data = NULL; 107 tty->driver_data = NULL;
152 108
153 SysPort = rio_minor(tty); 109 SysPort = rio_minor(tty);
154 Modem = rio_ismodem(tty);
155 110
156 if (p->RIOFailed) { 111 if (p->RIOFailed) {
157 rio_dprintk(RIO_DEBUG_TTY, "System initialisation failed\n"); 112 rio_dprintk(RIO_DEBUG_TTY, "System initialisation failed\n");
@@ -159,7 +114,7 @@ int riotopen(struct tty_struct *tty, struct file *filp)
159 return -ENXIO; 114 return -ENXIO;
160 } 115 }
161 116
162 rio_dprintk(RIO_DEBUG_TTY, "port open SysPort %d (%s) (mapped:%d)\n", SysPort, Modem ? "Modem" : "tty", p->RIOPortp[SysPort]->Mapped); 117 rio_dprintk(RIO_DEBUG_TTY, "port open SysPort %d (mapped:%d)\n", SysPort, p->RIOPortp[SysPort]->Mapped);
163 118
164 /* 119 /*
165 ** Validate that we have received a legitimate request. 120 ** Validate that we have received a legitimate request.
@@ -305,15 +260,12 @@ int riotopen(struct tty_struct *tty, struct file *filp)
305 /* PortP->gs.xmit_cnt = 0; */ 260 /* PortP->gs.xmit_cnt = 0; */
306 261
307 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 262 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
308#ifdef NEED_THIS
309 ttyseth(PortP, tp, (struct old_sgttyb *) &default_sg);
310#endif
311 263
312 /* Someone explain to me why this delay/config is 264 /* Someone explain to me why this delay/config is
313 here. If I read the docs correctly the "open" 265 here. If I read the docs correctly the "open"
314 command piggybacks the parameters immediately. 266 command piggybacks the parameters immediately.
315 -- REW */ 267 -- REW */
316 RIOParam(PortP, OPEN, Modem, OK_TO_SLEEP); /* Open the port */ 268 RIOParam(PortP, OPEN, 1, OK_TO_SLEEP); /* Open the port */
317 rio_spin_lock_irqsave(&PortP->portSem, flags); 269 rio_spin_lock_irqsave(&PortP->portSem, flags);
318 270
319 /* 271 /*
@@ -321,20 +273,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
321 */ 273 */
322 while (!(PortP->PortState & PORT_ISOPEN) && !p->RIOHalted) { 274 while (!(PortP->PortState & PORT_ISOPEN) && !p->RIOHalted) {
323 rio_dprintk(RIO_DEBUG_TTY, "Waiting for PORT_ISOPEN-currently %x\n", PortP->PortState); 275 rio_dprintk(RIO_DEBUG_TTY, "Waiting for PORT_ISOPEN-currently %x\n", PortP->PortState);
324/*
325** 15.10.1998 ARG - ESIL 0759
326** (Part) fix for port being trashed when opened whilst RTA "disconnected"
327** Take out the limited wait - now wait for ever or until user
328** bangs us out.
329**
330 if (repeat_this -- <= 0) {
331 rio_dprint(RIO_DEBUG_TTY, ("Waiting for open to finish timed out.\n"));
332 RIOPreemptiveCmd(p, PortP, FCLOSE );
333 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
334 return -EINTR;
335 }
336**
337*/
338 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 276 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
339 if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) { 277 if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {
340 rio_dprintk(RIO_DEBUG_TTY, "Waiting for open to finish broken by signal\n"); 278 rio_dprintk(RIO_DEBUG_TTY, "Waiting for open to finish broken by signal\n");
@@ -354,74 +292,58 @@ int riotopen(struct tty_struct *tty, struct file *filp)
354 } 292 }
355 rio_dprintk(RIO_DEBUG_TTY, "PORT_ISOPEN found\n"); 293 rio_dprintk(RIO_DEBUG_TTY, "PORT_ISOPEN found\n");
356 } 294 }
357#ifdef MODEM_SUPPORT 295 rio_dprintk(RIO_DEBUG_TTY, "Modem - test for carrier\n");
358 if (Modem) { 296 /*
359 rio_dprintk(RIO_DEBUG_TTY, "Modem - test for carrier\n"); 297 ** ACTION
298 ** insert test for carrier here. -- ???
299 ** I already see that test here. What's the deal? -- REW
300 */
301 if ((PortP->gs.tty->termios->c_cflag & CLOCAL) || (PortP->ModemState & MSVR1_CD)) {
302 rio_dprintk(RIO_DEBUG_TTY, "open(%d) Modem carr on\n", SysPort);
360 /* 303 /*
361 ** ACTION 304 tp->tm.c_state |= CARR_ON;
362 ** insert test for carrier here. -- ??? 305 wakeup((caddr_t) &tp->tm.c_canq);
363 ** I already see that test here. What's the deal? -- REW
364 */ 306 */
365 if ((PortP->gs.tty->termios->c_cflag & CLOCAL) || (PortP->ModemState & MSVR1_CD)) { 307 PortP->State |= RIO_CARR_ON;
366 rio_dprintk(RIO_DEBUG_TTY, "open(%d) Modem carr on\n", SysPort); 308 wake_up_interruptible(&PortP->gs.open_wait);
309 } else { /* no carrier - wait for DCD */
367 /* 310 /*
368 tp->tm.c_state |= CARR_ON; 311 while (!(PortP->gs.tty->termios->c_state & CARR_ON) &&
369 wakeup((caddr_t) &tp->tm.c_canq); 312 !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted )
370 */ 313 */
371 PortP->State |= RIO_CARR_ON; 314 while (!(PortP->State & RIO_CARR_ON) && !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted) {
372 wake_up_interruptible(&PortP->gs.open_wait); 315 rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr on\n", SysPort);
373 } else { /* no carrier - wait for DCD */
374
375 /* 316 /*
376 while (!(PortP->gs.tty->termios->c_state & CARR_ON) && 317 PortP->gs.tty->termios->c_state |= WOPEN;
377 !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted )
378 */ 318 */
379 while (!(PortP->State & RIO_CARR_ON) && !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted) { 319 PortP->State |= RIO_WOPEN;
380 320 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
381 rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr on\n", SysPort); 321 if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {
322 /*
323 ** ACTION: verify that this is a good thing
324 ** to do here. -- ???
325 ** I think it's OK. -- REW
326 */
327 rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr broken by signal\n", SysPort);
328 RIOPreemptiveCmd(p, PortP, FCLOSE);
382 /* 329 /*
383 PortP->gs.tty->termios->c_state |= WOPEN; 330 tp->tm.c_state &= ~WOPEN;
384 */ 331 */
385 PortP->State |= RIO_WOPEN; 332 PortP->State &= ~RIO_WOPEN;
386 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 333 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
387 if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) 334 func_exit();
388 { 335 return -EINTR;
389 /*
390 ** ACTION: verify that this is a good thing
391 ** to do here. -- ???
392 ** I think it's OK. -- REW
393 */
394 rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr broken by signal\n", SysPort);
395 RIOPreemptiveCmd(p, PortP, FCLOSE);
396 /*
397 tp->tm.c_state &= ~WOPEN;
398 */
399 PortP->State &= ~RIO_WOPEN;
400 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
401 func_exit();
402 return -EINTR;
403 }
404 } 336 }
405 PortP->State &= ~RIO_WOPEN;
406 } 337 }
407 if (p->RIOHalted) 338 PortP->State &= ~RIO_WOPEN;
408 goto bombout;
409 rio_dprintk(RIO_DEBUG_TTY, "Setting RIO_MOPEN\n");
410 PortP->State |= RIO_MOPEN;
411 } else
412#endif
413 {
414 /*
415 ** ACTION
416 ** Direct line open - force carrier (will probably mean
417 ** that sleeping Modem line fubar)
418 */
419 PortP->State |= RIO_LOPEN;
420 } 339 }
340 if (p->RIOHalted)
341 goto bombout;
342 rio_dprintk(RIO_DEBUG_TTY, "Setting RIO_MOPEN\n");
343 PortP->State |= RIO_MOPEN;
421 344
422 if (p->RIOHalted) { 345 if (p->RIOHalted)
423 goto bombout; 346 goto bombout;
424 }
425 347
426 rio_dprintk(RIO_DEBUG_TTY, "high level open done\n"); 348 rio_dprintk(RIO_DEBUG_TTY, "high level open done\n");
427 349
@@ -453,23 +375,21 @@ int riotclose(void *ptr)
453 unsigned long end_time; 375 unsigned long end_time;
454 struct tty_struct *tty; 376 struct tty_struct *tty;
455 unsigned long flags; 377 unsigned long flags;
456 int Modem;
457 int rv = 0; 378 int rv = 0;
458 379
459 rio_dprintk(RIO_DEBUG_TTY, "port close SysPort %d\n", PortP->PortNum); 380 rio_dprintk(RIO_DEBUG_TTY, "port close SysPort %d\n", PortP->PortNum);
460 381
461 /* PortP = p->RIOPortp[SysPort]; */ 382 /* PortP = p->RIOPortp[SysPort]; */
462 rio_dprintk(RIO_DEBUG_TTY, "Port is at address 0x%p\n", PortP); 383 rio_dprintk(RIO_DEBUG_TTY, "Port is at address %p\n", PortP);
463 /* tp = PortP->TtyP; *//* Get tty */ 384 /* tp = PortP->TtyP; *//* Get tty */
464 tty = PortP->gs.tty; 385 tty = PortP->gs.tty;
465 rio_dprintk(RIO_DEBUG_TTY, "TTY is at address 0x%p\n", tty); 386 rio_dprintk(RIO_DEBUG_TTY, "TTY is at address %p\n", tty);
466 387
467 if (PortP->gs.closing_wait) 388 if (PortP->gs.closing_wait)
468 end_time = jiffies + PortP->gs.closing_wait; 389 end_time = jiffies + PortP->gs.closing_wait;
469 else 390 else
470 end_time = jiffies + MAX_SCHEDULE_TIMEOUT; 391 end_time = jiffies + MAX_SCHEDULE_TIMEOUT;
471 392
472 Modem = rio_ismodem(tty);
473 rio_spin_lock_irqsave(&PortP->portSem, flags); 393 rio_spin_lock_irqsave(&PortP->portSem, flags);
474 394
475 /* 395 /*
@@ -493,7 +413,7 @@ int riotclose(void *ptr)
493 /* 413 /*
494 ** clear the open bits for this device 414 ** clear the open bits for this device
495 */ 415 */
496 PortP->State &= (Modem ? ~RIO_MOPEN : ~RIO_LOPEN); 416 PortP->State &= ~RIO_MOPEN;
497 PortP->State &= ~RIO_CARR_ON; 417 PortP->State &= ~RIO_CARR_ON;
498 PortP->ModemState &= ~MSVR1_CD; 418 PortP->ModemState &= ~MSVR1_CD;
499 /* 419 /*
@@ -613,7 +533,7 @@ int riotclose(void *ptr)
613 if (PortP->statsGather) 533 if (PortP->statsGather)
614 PortP->closes++; 534 PortP->closes++;
615 535
616 close_end: 536close_end:
617 /* XXX: Why would a "DELETED" flag be reset here? I'd have 537 /* XXX: Why would a "DELETED" flag be reset here? I'd have
618 thought that a "deleted" flag means that the port was 538 thought that a "deleted" flag means that the port was
619 permanently gone, but here we can make it reappear by it 539 permanently gone, but here we can make it reappear by it
@@ -629,8 +549,7 @@ int riotclose(void *ptr)
629 549
630 550
631 551
632static void RIOClearUp(PortP) 552static void RIOClearUp(struct Port *PortP)
633struct Port *PortP;
634{ 553{
635 rio_dprintk(RIO_DEBUG_TTY, "RIOHalted set\n"); 554 rio_dprintk(RIO_DEBUG_TTY, "RIOHalted set\n");
636 PortP->Config = 0; /* Direct semaphore */ 555 PortP->Config = 0; /* Direct semaphore */
@@ -657,7 +576,7 @@ struct Port *PortP;
657*/ 576*/
658int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg) 577int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg)
659{ 578{
660 PKT *PacketP; 579 struct PKT *PacketP;
661 int retries = 20; /* at 10 per second -> 2 seconds */ 580 int retries = 20; /* at 10 per second -> 2 seconds */
662 unsigned long flags; 581 unsigned long flags;
663 582
diff --git a/drivers/char/rio/riotypes.h b/drivers/char/rio/riotypes.h
deleted file mode 100644
index d07bd0aab5a2..000000000000
--- a/drivers/char/rio/riotypes.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/****************************************************************************
2 ******* *******
3 ******* R I O T Y P E S
4 ******* *******
5 ****************************************************************************
6
7 Author : Jon Brawn
8 Date :
9
10 *
11 * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27 Version : 0.01
28
29
30 Mods
31 ----------------------------------------------------------------------------
32 Date By Description
33 ----------------------------------------------------------------------------
34
35 ***************************************************************************/
36
37#ifndef _riotypes_h
38#define _riotypes_h 1
39
40#ifdef SCCS_LABELS
41#ifndef lint
42/* static char *_rio_riotypes_h_sccs = "@(#)riotypes.h 1.10"; */
43#endif
44#endif
45
46typedef u16 char_ptr;
47typedef u16 Channel_ptr;
48typedef u16 FREE_LIST_ptr_ptr;
49typedef u16 FREE_LIST_ptr;
50typedef u16 LPB_ptr;
51typedef u16 Process_ptr;
52typedef u16 PHB_ptr;
53typedef u16 PKT_ptr;
54typedef u16 Q_BUF_ptr;
55typedef u16 Q_BUF_ptr_ptr;
56typedef u16 ROUTE_STR_ptr;
57typedef u16 RUP_ptr;
58typedef u16 short_ptr;
59typedef u16 u_short_ptr;
60typedef u16 ushort_ptr;
61
62#endif /* __riotypes__ */
63
64/*********** end of file ***********/
diff --git a/drivers/char/rio/rom.h b/drivers/char/rio/rom.h
deleted file mode 100644
index 58a7843625ff..000000000000
--- a/drivers/char/rio/rom.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/****************************************************************************
2 ******* *******
3 ******* R O M
4 ******* *******
5 ****************************************************************************
6
7 Author : Ian Nandhra
8 Date :
9
10 *
11 * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27 Version : 0.01
28
29
30 Mods
31 ----------------------------------------------------------------------------
32 Date By Description
33 ----------------------------------------------------------------------------
34
35 ***************************************************************************/
36
37#ifndef _rom_h
38#define _rom_h 1
39
40#ifndef lint
41#ifdef SCCS
42static char *_rio_rom_h_sccs = "@(#)rom.h 1.1";
43#endif
44#endif
45
46typedef struct ROM ROM;
47struct ROM {
48 u_short slx;
49 char pcb_letter_rev;
50 char pcb_number_rev;
51 char serial[4];
52 char year;
53 char week;
54};
55
56#endif
57
58#define HOST_ROM (ROM *) 0x7c00
59#define RTA_ROM (ROM *) 0x7801
60#define ROM_LENGTH 0x20
61
62/*********** end of file ***********/
diff --git a/drivers/char/rio/sam.h b/drivers/char/rio/sam.h
deleted file mode 100644
index 6f754e19015d..000000000000
--- a/drivers/char/rio/sam.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/****************************************************************************
2 ******* *******
3 ******* S A M . H
4 ******* *******
5 ****************************************************************************
6
7 Author : Ian Nandhra
8 Date :
9
10 *
11 * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27 Version : 0.01
28
29
30 Mods
31 ----------------------------------------------------------------------------
32 Date By Description
33 ----------------------------------------------------------------------------
34
35 ***************************************************************************/
36#ifndef _sam_h
37#define _sam_h 1
38
39#ifdef SCCS_LABELS
40#ifndef lint
41/* static char *_rio_sam_h_sccs = "@(#)sam.h 1.3"; */
42#endif
43#endif
44
45
46#define NUM_FREE_LIST_UNITS 500
47
48#ifndef FALSE
49#define FALSE (short) 0x00
50#endif
51#ifndef TRUE
52#define TRUE (short) !FALSE
53#endif
54
55#define TX TRUE
56#define RX FALSE
57
58
59typedef struct FREE_LIST FREE_LIST;
60struct FREE_LIST {
61 FREE_LIST_ptr next;
62 FREE_LIST_ptr prev;
63};
64
65
66#endif
67/*********** end of file ***********/
diff --git a/drivers/char/rio/space.h b/drivers/char/rio/space.h
deleted file mode 100644
index 1f12690f9d1f..000000000000
--- a/drivers/char/rio/space.h
+++ /dev/null
@@ -1,45 +0,0 @@
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 : space.h
24** SID : 1.2
25** Last Modified : 11/6/98 11:34:19
26** Retrieved : 11/6/98 11:34:22
27**
28** ident @(#)space.h 1.2
29**
30** -----------------------------------------------------------------------------
31*/
32
33#ifndef __rio_space_h__
34#define __rio_space_h__
35
36#ifdef SCCS_LABELS
37static char *_space_h_sccs_ = "@(#)space.h 1.2";
38#endif
39
40extern int rio_cntls;
41extern int rio_bases[];
42extern int rio_limits[];
43extern int rio_vects[];
44
45#endif /* __rio_space_h__ */
diff --git a/drivers/char/rio/top.h b/drivers/char/rio/top.h
deleted file mode 100644
index fe60430cf099..000000000000
--- a/drivers/char/rio/top.h
+++ /dev/null
@@ -1,48 +0,0 @@
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 : top.h
24** SID : 1.2
25** Last Modified : 11/6/98 11:34:19
26** Retrieved : 11/6/98 11:34:22
27**
28** ident @(#)top.h 1.2
29**
30** -----------------------------------------------------------------------------
31*/
32
33#ifndef __rio_top_h__
34#define __rio_top_h__
35
36#ifdef SCCS_LABELS
37static char *_top_h_sccs_ = "@(#)top.h 1.2";
38#endif
39
40/*
41** Topology information
42*/
43struct Top {
44 u8 Unit;
45 u8 Link;
46};
47
48#endif /* __rio_top_h__ */
diff --git a/drivers/char/rio/typdef.h b/drivers/char/rio/typdef.h
deleted file mode 100644
index f40c1df7db1f..000000000000
--- a/drivers/char/rio/typdef.h
+++ /dev/null
@@ -1,74 +0,0 @@
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 : typdef.h
24** SID : 1.2
25** Last Modified : 11/6/98 11:34:20
26** Retrieved : 11/6/98 11:34:22
27**
28** ident @(#)typdef.h 1.2
29**
30** -----------------------------------------------------------------------------
31*/
32
33#ifndef __rio_typdef_h__
34#define __rio_typdef_h__
35
36/*
37** IT IS REALLY, REALLY, IMPORTANT THAT BYTES ARE UNSIGNED!
38**
39** These types are ONLY to be used for refering to data structures
40** on the RIO Host card!
41*/
42typedef u8 BYTE;
43typedef u16 WORD;
44typedef u32 DWORD;
45typedef u16 RIOP;
46
47
48/*
49** 27.01.199 ARG - mods to compile 'newutils' on LyxnOS -
50** These #defines are for the benefit of the 'libfuncs' library
51** only. They are not necessarily correct type mappings and
52** are here only to make the source compile.
53*/
54/* typedef unsigned int uint; */
55typedef unsigned long ulong_t;
56typedef unsigned short ushort_t;
57typedef unsigned char uchar_t;
58typedef unsigned char queue_t;
59typedef unsigned char mblk_t;
60typedef unsigned long paddr_t;
61
62#define TPNULL ((ushort)(0x8000))
63
64
65/*
66** RIO structures defined in other include files.
67*/
68typedef struct PKT PKT;
69typedef struct LPB LPB;
70typedef struct RUP RUP;
71typedef struct Port Port;
72typedef struct DpRam DpRam;
73
74#endif /* __rio_typdef_h__ */
diff --git a/drivers/char/rio/unixrup.h b/drivers/char/rio/unixrup.h
index a126c7cabac6..4306e01dbf01 100644
--- a/drivers/char/rio/unixrup.h
+++ b/drivers/char/rio/unixrup.h
@@ -45,9 +45,9 @@ struct UnixRup {
45 struct CmdBlk *CmdsWaitingP; /* Commands waiting to be done */ 45 struct CmdBlk *CmdsWaitingP; /* Commands waiting to be done */
46 struct CmdBlk *CmdPendingP; /* The command currently being sent */ 46 struct CmdBlk *CmdPendingP; /* The command currently being sent */
47 struct RUP *RupP; /* the Rup to send it to */ 47 struct RUP *RupP; /* the Rup to send it to */
48 uint Id; /* Id number */ 48 unsigned int Id; /* Id number */
49 uint BaseSysPort; /* SysPort of first tty on this RTA */ 49 unsigned int BaseSysPort; /* SysPort of first tty on this RTA */
50 uint ModTypes; /* Modules on this RTA */ 50 unsigned int ModTypes; /* Modules on this RTA */
51 spinlock_t RupLock; /* Lock structure for MPX */ 51 spinlock_t RupLock; /* Lock structure for MPX */
52 /* struct lockb RupLock; *//* Lock structure for MPX */ 52 /* struct lockb RupLock; *//* Lock structure for MPX */
53}; 53};