aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rio
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2006-02-09 00:59:34 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-02-09 00:59:34 -0500
commit725b2805fd5d729b0db59fe8fc992e97523782c7 (patch)
tree04ca7c7ed6e918029898a6c5301488e60d0564d4 /drivers/char/rio
parent9ac341ae799413708e674bc65c8a72c90dae8d34 (diff)
parentcac0e8e8bb2e7a086643bdd00c41d900a79bb4fa (diff)
Merge branch 'upstream-fixes'
Diffstat (limited to 'drivers/char/rio')
-rw-r--r--drivers/char/rio/cirrus.h142
-rw-r--r--drivers/char/rio/defaults.h7
-rw-r--r--drivers/char/rio/link.h34
-rw-r--r--drivers/char/rio/list.h140
-rw-r--r--drivers/char/rio/parmmap.h5
-rw-r--r--drivers/char/rio/phb.h133
-rw-r--r--drivers/char/rio/pkt.h27
-rw-r--r--drivers/char/rio/qbuf.h4
-rw-r--r--drivers/char/rio/riotypes.h66
-rw-r--r--drivers/char/rio/rup.h5
-rw-r--r--drivers/char/rio/sam.h4
11 files changed, 0 insertions, 567 deletions
diff --git a/drivers/char/rio/cirrus.h b/drivers/char/rio/cirrus.h
index 217ff09f2fa1..89bd94eb45be 100644
--- a/drivers/char/rio/cirrus.h
+++ b/drivers/char/rio/cirrus.h
@@ -40,148 +40,6 @@
40#endif 40#endif
41#define _cirrus_h 1 41#define _cirrus_h 1
42 42
43#ifdef RTA
44#define TO_UART RX
45#define TO_DRIVER TX
46#endif
47
48#ifdef HOST
49#define TO_UART TX
50#define TO_DRIVER RX
51#endif
52#ifdef RTA
53/* Miscellaneous defines for CIRRUS addresses and related logic for
54 interrupts etc.
55*/
56#define MAP(a) ((short *)(cirrus_base + (a)))
57#define outp(a,b) (*MAP (a) =(b))
58#define inp(a) ((*MAP (a)) & 0xff)
59#define CIRRUS_FIRST (short*)0x7300
60#define CIRRUS_SECOND (short*)0x7200
61#define CIRRUS_THIRD (short*)0x7100
62#define CIRRUS_FOURTH (short*)0x7000
63#define PORTS_ON_CIRRUS 4
64#define CIRRUS_FIFO_SIZE 12
65#define SPACE 0x20
66#define TAB 0x09
67#define LINE_FEED 0x0a
68#define CARRIAGE_RETURN 0x0d
69#define BACKSPACE 0x08
70#define SPACES_IN_TABS 8
71#define SEND_ESCAPE 0x00
72#define START_BREAK 0x81
73#define TIMER_TICK 0x82
74#define STOP_BREAK 0x83
75#define BASE(a) ((a) < 4 ? (short*)CIRRUS_FIRST : ((a) < 8 ? (short *)CIRRUS_SECOND : ((a) < 12 ? (short*)CIRRUS_THIRD : (short *)CIRRUS_FOURTH)))
76#define txack1 ((short *)0x7104)
77#define rxack1 ((short *)0x7102)
78#define mdack1 ((short *)0x7106)
79#define txack2 ((short *)0x7006)
80#define rxack2 ((short *)0x7004)
81#define mdack2 ((short *)0x7100)
82#define int_latch ((short *) 0x7800)
83#define int_status ((short *) 0x7c00)
84#define tx1_pending 0x20
85#define rx1_pending 0x10
86#define md1_pending 0x40
87#define tx2_pending 0x02
88#define rx2_pending 0x01
89#define md2_pending 0x40
90#define module1_bits 0x07
91#define module1_modern 0x08
92#define module2_bits 0x70
93#define module2_modern 0x80
94#define module_blank 0xf
95#define rs232_d25 0x0
96#define rs232_rj45 0x1
97#define rs422_d25 0x3
98#define parallel 0x5
99
100#define CLK0 0x00
101#define CLK1 0x01
102#define CLK2 0x02
103#define CLK3 0x03
104#define CLK4 0x04
105
106#define CIRRUS_REVC 0x42
107#define CIRRUS_REVE 0x44
108
109#define TURNON 1
110#define TURNOFF 0
111
112/* The list of CIRRUS registers.
113 NB. These registers are relative values on 8 bit boundaries whereas
114 on the RTA's the CIRRUS registers are on word boundaries. Use pointer
115 arithmetic (short *) to obtain the real addresses required */
116#define ccr 0x05 /* Channel Command Register */
117#define ier 0x06 /* Interrupt Enable Register */
118#define cor1 0x08 /* Channel Option Register 1 */
119#define cor2 0x09 /* Channel Option Register 2 */
120#define cor3 0x0a /* Channel Option Register 3 */
121#define cor4 0x1e /* Channel Option Register 4 */
122#define cor5 0x1f /* Channel Option Register 5 */
123
124#define ccsr 0x0b /* Channel Control Status Register */
125#define rdcr 0x0e /* Receive Data Count Register */
126#define tdcr 0x12 /* Transmit Data Count Register */
127#define mcor1 0x15 /* Modem Change Option Register 1 */
128#define mcor2 0x16 /* Modem Change Option Regsiter 2 */
129
130#define livr 0x18 /* Local Interrupt Vector Register */
131#define schr1 0x1a /* Special Character Register 1 */
132#define schr2 0x1b /* Special Character Register 2 */
133#define schr3 0x1c /* Special Character Register 3 */
134#define schr4 0x1d /* Special Character Register 4 */
135
136#define rtr 0x20 /* Receive Timer Register */
137#define rtpr 0x21 /* Receive Timeout Period Register */
138#define lnc 0x24 /* Lnext character */
139
140#define rivr 0x43 /* Receive Interrupt Vector Register */
141#define tivr 0x42 /* Transmit Interrupt Vector Register */
142#define mivr 0x41 /* Modem Interrupt Vector Register */
143#define gfrcr 0x40 /* Global Firmware Revision code Reg */
144#define ricr 0x44 /* Receive Interrupting Channel Reg */
145#define ticr 0x45 /* Transmit Interrupting Channel Reg */
146#define micr 0x46 /* Modem Interrupting Channel Register */
147
148#define gcr 0x4b /* Global configuration register */
149#define misr 0x4c /* Modem interrupt status register */
150
151#define rbusr 0x59
152#define tbusr 0x5a
153#define mbusr 0x5b
154
155#define eoir 0x60 /* End Of Interrupt Register */
156#define rdsr 0x62 /* Receive Data / Status Register */
157#define tdr 0x63 /* Transmit Data Register */
158#define svrr 0x67 /* Service Request Register */
159
160#define car 0x68 /* Channel Access Register */
161#define mir 0x69 /* Modem Interrupt Register */
162#define tir 0x6a /* Transmit Interrupt Register */
163#define rir 0x6b /* Receive Interrupt Register */
164#define msvr1 0x6c /* Modem Signal Value Register 1 */
165#define msvr2 0x6d /* Modem Signal Value Register 2 */
166#define psvr 0x6f /* Printer Signal Value Register */
167
168#define tbpr 0x72 /* Transmit Baud Rate Period Register */
169#define tcor 0x76 /* Transmit Clock Option Register */
170
171#define rbpr 0x78 /* Receive Baud Rate Period Register */
172#define rber 0x7a /* Receive Baud Rate Extension Register */
173#define rcor 0x7c /* Receive Clock Option Register */
174#define ppr 0x7e /* Prescalar Period Register */
175
176/* Misc registers used for forcing the 1400 out of its reset woes */
177#define airl 0x6d
178#define airm 0x6e
179#define airh 0x6f
180#define btcr 0x66
181#define mtcr 0x6c
182#define tber 0x74
183
184#endif /* #ifdef RTA */
185 43
186 44
187/* Bit fields for particular registers */ 45/* Bit fields for particular registers */
diff --git a/drivers/char/rio/defaults.h b/drivers/char/rio/defaults.h
index 5b600c32ac02..d55c2f6a9877 100644
--- a/drivers/char/rio/defaults.h
+++ b/drivers/char/rio/defaults.h
@@ -45,13 +45,6 @@ static char *_rio_defaults_h_sccs = "@(#)defaults.h 1.1";
45#define MILLISECOND (int) (1000/64) /* 15.625 low ticks */ 45#define MILLISECOND (int) (1000/64) /* 15.625 low ticks */
46#define SECOND (int) 15625 /* Low priority ticks */ 46#define SECOND (int) 15625 /* Low priority ticks */
47 47
48#ifdef RTA
49#define RX_LIMIT (ushort) 3
50#endif
51#ifdef HOST
52#define RX_LIMIT (ushort) 1
53#endif
54
55#define LINK_TIMEOUT (int) (POLL_PERIOD / 2) 48#define LINK_TIMEOUT (int) (POLL_PERIOD / 2)
56 49
57 50
diff --git a/drivers/char/rio/link.h b/drivers/char/rio/link.h
index bfba5b0c033e..48d68ca7f825 100644
--- a/drivers/char/rio/link.h
+++ b/drivers/char/rio/link.h
@@ -102,30 +102,14 @@
102/* 102/*
103** LED stuff 103** LED stuff
104*/ 104*/
105#if defined(RTA)
106#define LED_OFF ((ushort) 0) /* LED off */
107#define LED_RED ((ushort) 1) /* LED Red */
108#define LED_GREEN ((ushort) 2) /* LED Green */
109#define LED_ORANGE ((ushort) 4) /* LED Orange */
110#define LED_1TO8_OPEN ((ushort) 1) /* Port 1->8 LED on */
111#define LED_9TO16_OPEN ((ushort) 2) /* Port 9->16 LED on */
112#define LED_SET_COLOUR(colour) (link->led = (colour))
113#define LED_OR_COLOUR(colour) (link->led |= (colour))
114#define LED_TIMEOUT(time) (link->led_timeout = RioTimePlus(RioTime(),(time)))
115#else
116#define LED_SET_COLOUR(colour) 105#define LED_SET_COLOUR(colour)
117#define LED_OR_COLOUR(colour) 106#define LED_OR_COLOUR(colour)
118#define LED_TIMEOUT(time) 107#define LED_TIMEOUT(time)
119#endif /* RTA */
120 108
121struct LPB { 109struct LPB {
122 WORD link_number; /* Link Number */ 110 WORD link_number; /* Link Number */
123 Channel_ptr in_ch; /* Link In Channel */ 111 Channel_ptr in_ch; /* Link In Channel */
124 Channel_ptr out_ch; /* Link Out Channel */ 112 Channel_ptr out_ch; /* Link Out Channel */
125#ifdef RTA
126 uchar stat_led; /* Port open leds */
127 uchar led; /* True, light led! */
128#endif
129 BYTE attached_serial[4]; /* Attached serial number */ 113 BYTE attached_serial[4]; /* Attached serial number */
130 BYTE attached_host_serial[4]; 114 BYTE attached_host_serial[4];
131 /* Serial number of Host who 115 /* Serial number of Host who
@@ -144,30 +128,12 @@ struct LPB {
144 WORD WaitNoBoot; /* Secs to hold off booting */ 128 WORD WaitNoBoot; /* Secs to hold off booting */
145 PKT_ptr add_packet_list; /* Add packets to here */ 129 PKT_ptr add_packet_list; /* Add packets to here */
146 PKT_ptr remove_packet_list; /* Send packets from here */ 130 PKT_ptr remove_packet_list; /* Send packets from here */
147#ifdef RTA
148#ifdef DCIRRUS
149#define QBUFS_PER_REDIRECT (4 / PKTS_PER_BUFFER + 1)
150#else
151#define QBUFS_PER_REDIRECT (8 / PKTS_PER_BUFFER + 1)
152#endif
153 PKT_ptr_ptr rd_add; /* Add a new Packet here */
154 Q_BUF_ptr rd_add_qb; /* Pointer to the add Q buf */
155 PKT_ptr_ptr rd_add_st_qbb; /* Pointer to start of the Q's buf */
156 PKT_ptr_ptr rd_add_end_qbb; /* Pointer to the end of the Q's buf */
157 PKT_ptr_ptr rd_remove; /* Remove a Packet here */
158 Q_BUF_ptr rd_remove_qb; /* Pointer to the remove Q buf */
159 PKT_ptr_ptr rd_remove_st_qbb; /* Pointer to the start of the Q buf */
160 PKT_ptr_ptr rd_remove_end_qbb; /* Pointer to the end of the Q buf */
161 ushort pkts_in_q; /* Packets in queue */
162#endif
163 131
164 Channel_ptr lrt_fail_chan; /* Lrt's failure channel */ 132 Channel_ptr lrt_fail_chan; /* Lrt's failure channel */
165 Channel_ptr ltt_fail_chan; /* Ltt's failure channel */ 133 Channel_ptr ltt_fail_chan; /* Ltt's failure channel */
166 134
167#if defined (HOST) || defined (INKERNEL)
168 /* RUP structure for HOST to driver communications */ 135 /* RUP structure for HOST to driver communications */
169 struct RUP rup; 136 struct RUP rup;
170#endif
171 struct RUP link_rup; /* RUP for the link (POLL, 137 struct RUP link_rup; /* RUP for the link (POLL,
172 topology etc.) */ 138 topology etc.) */
173 WORD attached_link; /* Number of attached link */ 139 WORD attached_link; /* Number of attached link */
diff --git a/drivers/char/rio/list.h b/drivers/char/rio/list.h
index 36aad4c9cb3a..79b853140ae5 100644
--- a/drivers/char/rio/list.h
+++ b/drivers/char/rio/list.h
@@ -44,8 +44,6 @@ static char *_rio_list_h_sccs = "@(#)list.h 1.9";
44 44
45#define PKT_IN_USE 0x1 45#define PKT_IN_USE 0x1
46 46
47#ifdef INKERNEL
48
49#define ZERO_PTR (ushort) 0x8000 47#define ZERO_PTR (ushort) 0x8000
50#define CaD PortP->Caddr 48#define CaD PortP->Caddr
51 49
@@ -54,143 +52,5 @@ static char *_rio_list_h_sccs = "@(#)list.h 1.9";
54** to by the TxAdd pointer has PKT_IN_USE clear in its address. 52** to by the TxAdd pointer has PKT_IN_USE clear in its address.
55*/ 53*/
56 54
57#ifndef linux
58#if defined( MIPS ) && !defined( MIPSEISA )
59/* May the shoes of the Devil dance on your grave for creating this */
60#define can_add_transmit(PacketP,PortP) \
61 (!((uint)(PacketP = (struct PKT *)RIO_PTR(CaD,RINDW(PortP->TxAdd))) \
62 & (PKT_IN_USE<<2)))
63
64#elif defined(MIPSEISA) || defined(nx6000) || \
65 defined(drs6000) || defined(UWsparc)
66
67#define can_add_transmit(PacketP,PortP) \
68 (!((uint)(PacketP = (struct PKT *)RIO_PTR(CaD,RINDW(PortP->TxAdd))) \
69 & PKT_IN_USE))
70
71#else
72#define can_add_transmit(PacketP,PortP) \
73 (!((uint)(PacketP = (struct PKT *)RIO_PTR(CaD,*PortP->TxAdd)) \
74 & PKT_IN_USE))
75#endif
76
77/*
78** To add a packet to the queue, you set the PKT_IN_USE bit in the address,
79** and then move the TxAdd pointer along one position to point to the next
80** packet pointer. You must wrap the pointer from the end back to the start.
81*/
82#if defined(MIPS) || defined(nx6000) || defined(drs6000) || defined(UWsparc)
83# define add_transmit(PortP) \
84 WINDW(PortP->TxAdd,RINDW(PortP->TxAdd) | PKT_IN_USE);\
85 if (PortP->TxAdd == PortP->TxEnd)\
86 PortP->TxAdd = PortP->TxStart;\
87 else\
88 PortP->TxAdd++;\
89 WWORD(PortP->PhbP->tx_add , RIO_OFF(CaD,PortP->TxAdd));
90#elif defined(AIX)
91# define add_transmit(PortP) \
92 {\
93 register ushort *TxAddP = (ushort *)RIO_PTR(Cad,PortP->TxAddO);\
94 WINDW( TxAddP, RINDW( TxAddP ) | PKT_IN_USE );\
95 if (PortP->TxAddO == PortP->TxEndO )\
96 PortP->TxAddO = PortP->TxStartO;\
97 else\
98 PortP->TxAddO += sizeof(ushort);\
99 WWORD(((PHB *)RIO_PTR(Cad,PortP->PhbO))->tx_add , PortP->TxAddO );\
100 }
101#else
102# define add_transmit(PortP) \
103 *PortP->TxAdd |= PKT_IN_USE;\
104 if (PortP->TxAdd == PortP->TxEnd)\
105 PortP->TxAdd = PortP->TxStart;\
106 else\
107 PortP->TxAdd++;\
108 PortP->PhbP->tx_add = RIO_OFF(CaD,PortP->TxAdd);
109#endif
110
111/*
112** can_remove_receive( PacketP, PortP ) returns non-zero if PKT_IN_USE is set
113** for the next packet on the queue. It will also set PacketP to point to the
114** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear,
115** then can_remove_receive() returns 0.
116*/
117#if defined(MIPS) || defined(nx6000) || defined(drs6000) || defined(UWsparc)
118# define can_remove_receive(PacketP,PortP) \
119 ((RINDW(PortP->RxRemove) & PKT_IN_USE) ? \
120 (PacketP=(struct PKT *)RIO_PTR(CaD,(RINDW(PortP->RxRemove) & ~PKT_IN_USE))):0)
121#elif defined(AIX)
122# define can_remove_receive(PacketP,PortP) \
123 ((RINDW((ushort *)RIO_PTR(Cad,PortP->RxRemoveO)) & PKT_IN_USE) ? \
124 (PacketP=(struct PKT *)RIO_PTR(Cad,RINDW((ushort *)RIO_PTR(Cad,PortP->RxRemoveO)) & ~PKT_IN_USE)):0)
125#else
126# define can_remove_receive(PacketP,PortP) \
127 ((*PortP->RxRemove & PKT_IN_USE) ? \
128 (PacketP=(struct PKT *)RIO_PTR(CaD,(*PortP->RxRemove & ~PKT_IN_USE))):0)
129#endif
130
131
132/*
133** Will God see it within his heart to forgive us for this thing that
134** we have created? To remove a packet from the receive queue you clear
135** its PKT_IN_USE bit, and then bump the pointers. Once the pointers
136** get to the end, they must be wrapped back to the start.
137*/
138#if defined(MIPS) || defined(nx6000) || defined(drs6000) || defined(UWsparc)
139# define remove_receive(PortP) \
140 WINDW(PortP->RxRemove, (RINDW(PortP->RxRemove) & ~PKT_IN_USE));\
141 if (PortP->RxRemove == PortP->RxEnd)\
142 PortP->RxRemove = PortP->RxStart;\
143 else\
144 PortP->RxRemove++;\
145 WWORD(PortP->PhbP->rx_remove , RIO_OFF(CaD,PortP->RxRemove));
146#elif defined(AIX)
147# define remove_receive(PortP) \
148 {\
149 register ushort *RxRemoveP = (ushort *)RIO_PTR(Cad,PortP->RxRemoveO);\
150 WINDW( RxRemoveP, RINDW( RxRemoveP ) & ~PKT_IN_USE );\
151 if (PortP->RxRemoveO == PortP->RxEndO)\
152 PortP->RxRemoveO = PortP->RxStartO;\
153 else\
154 PortP->RxRemoveO += sizeof(ushort);\
155 WWORD(((PHB *)RIO_PTR(Cad,PortP->PhbO))->rx_remove, PortP->RxRemoveO );\
156 }
157#else
158# define remove_receive(PortP) \
159 *PortP->RxRemove &= ~PKT_IN_USE;\
160 if (PortP->RxRemove == PortP->RxEnd)\
161 PortP->RxRemove = PortP->RxStart;\
162 else\
163 PortP->RxRemove++;\
164 PortP->PhbP->rx_remove = RIO_OFF(CaD,PortP->RxRemove);
165#endif
166#endif
167
168
169#else /* !IN_KERNEL */
170
171#define ZERO_PTR NULL
172
173
174#ifdef HOST
175/* #define can_remove_transmit(pkt,phb) ((((char*)pkt = (*(char**)(phb->tx_remove))-1) || 1)) && (*phb->u3.s2.tx_remove_ptr & PKT_IN_USE)) */
176#define remove_transmit(phb) *phb->u3.s2.tx_remove_ptr &= ~(ushort)PKT_IN_USE;\
177 if (phb->tx_remove == phb->tx_end)\
178 phb->tx_remove = phb->tx_start;\
179 else\
180 phb->tx_remove++;
181#define can_add_receive(phb) !(*phb->u4.s2.rx_add_ptr & PKT_IN_USE)
182#define add_receive(pkt,phb) *phb->rx_add = pkt;\
183 *phb->u4.s2.rx_add_ptr |= PKT_IN_USE;\
184 if (phb->rx_add == phb->rx_end)\
185 phb->rx_add = phb->rx_start;\
186 else\
187 phb->rx_add++;
188#endif
189#endif
190
191#ifdef RTA
192#define splx(oldspl) if ((oldspl) == 0) spl0()
193#endif
194
195#endif /* ifndef _list.h */ 55#endif /* ifndef _list.h */
196/*********** end of file ***********/ 56/*********** end of file ***********/
diff --git a/drivers/char/rio/parmmap.h b/drivers/char/rio/parmmap.h
index fe4e00567065..e24acc1d1844 100644
--- a/drivers/char/rio/parmmap.h
+++ b/drivers/char/rio/parmmap.h
@@ -78,14 +78,9 @@ struct PARM_MAP {
78 WORD idle_count; /* Idle time counter */ 78 WORD idle_count; /* Idle time counter */
79 WORD busy_count; /* Busy counter */ 79 WORD busy_count; /* Busy counter */
80 WORD idle_control; /* Control Idle Process */ 80 WORD idle_control; /* Control Idle Process */
81#if defined(HOST) || defined(INKERNEL)
82 WORD tx_intr; /* TX interrupt pending */ 81 WORD tx_intr; /* TX interrupt pending */
83 WORD rx_intr; /* RX interrupt pending */ 82 WORD rx_intr; /* RX interrupt pending */
84 WORD rup_intr; /* RUP interrupt pending */ 83 WORD rup_intr; /* RUP interrupt pending */
85#endif
86#if defined(RTA)
87 WORD dying_count; /* Count of processes dead */
88#endif
89}; 84};
90 85
91#endif 86#endif
diff --git a/drivers/char/rio/phb.h b/drivers/char/rio/phb.h
index 3baebf8513af..2663ca0306e2 100644
--- a/drivers/char/rio/phb.h
+++ b/drivers/char/rio/phb.h
@@ -44,17 +44,6 @@
44#endif 44#endif
45 45
46 46
47 /*************************************************
48 * Set the LIMIT values.
49 ************************************************/
50#ifdef RTA
51#define RX_LIMIT (ushort) 3
52#endif
53#ifdef HOST
54#define RX_LIMIT (ushort) 1
55#endif
56
57
58/************************************************* 47/*************************************************
59 * Handshake asserted. Deasserted by the LTT(s) 48 * Handshake asserted. Deasserted by the LTT(s)
60 ************************************************/ 49 ************************************************/
@@ -69,11 +58,7 @@
69/************************************************* 58/*************************************************
70 * Maximum number of PHB's 59 * Maximum number of PHB's
71 ************************************************/ 60 ************************************************/
72#if defined (HOST) || defined (INKERNEL)
73#define MAX_PHB ((ushort) 128) /* range 0-127 */ 61#define MAX_PHB ((ushort) 128) /* range 0-127 */
74#else
75#define MAX_PHB ((ushort) 8) /* range 0-7 */
76#endif
77 62
78/************************************************* 63/*************************************************
79 * Defines for the mode fields 64 * Defines for the mode fields
@@ -139,141 +124,23 @@
139 * the start. The pointer tx_add points to a SPACE to put a Packet. 124 * the start. The pointer tx_add points to a SPACE to put a Packet.
140 * The pointer tx_remove points to the next Packet to remove 125 * The pointer tx_remove points to the next Packet to remove
141 *************************************************************************/ 126 *************************************************************************/
142#ifndef INKERNEL
143#define src_unit u2.s2.unit
144#define src_port u2.s2.port
145#define dest_unit u1.s1.unit
146#define dest_port u1.s1.port
147#endif
148#ifdef HOST
149#define tx_start u3.s1.tx_start_ptr_ptr
150#define tx_add u3.s1.tx_add_ptr_ptr
151#define tx_end u3.s1.tx_end_ptr_ptr
152#define tx_remove u3.s1.tx_remove_ptr_ptr
153#define rx_start u4.s1.rx_start_ptr_ptr
154#define rx_add u4.s1.rx_add_ptr_ptr
155#define rx_end u4.s1.rx_end_ptr_ptr
156#define rx_remove u4.s1.rx_remove_ptr_ptr
157#endif
158typedef struct PHB PHB; 127typedef struct PHB PHB;
159struct PHB { 128struct PHB {
160#ifdef RTA
161 ushort port;
162#endif
163#ifdef INKERNEL
164 WORD source; 129 WORD source;
165#else
166 union {
167 ushort source; /* Complete source */
168 struct {
169 unsigned char unit; /* Source unit */
170 unsigned char port; /* Source port */
171 } s2;
172 } u2;
173#endif
174 WORD handshake; 130 WORD handshake;
175 WORD status; 131 WORD status;
176 NUMBER timeout; /* Maximum of 1.9 seconds */ 132 NUMBER timeout; /* Maximum of 1.9 seconds */
177 WORD link; /* Send down this link */ 133 WORD link; /* Send down this link */
178#ifdef INKERNEL
179 WORD destination; 134 WORD destination;
180#else
181 union {
182 ushort destination; /* Complete destination */
183 struct {
184 unsigned char unit; /* Destination unit */
185 unsigned char port; /* Destination port */
186 } s1;
187 } u1;
188#endif
189#ifdef RTA
190 ushort tx_pkts_added;
191 ushort tx_pkts_removed;
192 Q_BUF_ptr tx_q_start; /* Start of the Q list chain */
193 short num_tx_q_bufs; /* Number of Q buffers in the chain */
194 PKT_ptr_ptr tx_add; /* Add a new Packet here */
195 Q_BUF_ptr tx_add_qb; /* Pointer to the add Q buf */
196 PKT_ptr_ptr tx_add_st_qbb; /* Pointer to start of the Q's buf */
197 PKT_ptr_ptr tx_add_end_qbb; /* Pointer to the end of the Q's buf */
198 PKT_ptr_ptr tx_remove; /* Remove a Packet here */
199 Q_BUF_ptr tx_remove_qb; /* Pointer to the remove Q buf */
200 PKT_ptr_ptr tx_remove_st_qbb; /* Pointer to the start of the Q buf */
201 PKT_ptr_ptr tx_remove_end_qbb; /* Pointer to the end of the Q buf */
202#endif
203#ifdef INKERNEL
204 PKT_ptr_ptr tx_start; 135 PKT_ptr_ptr tx_start;
205 PKT_ptr_ptr tx_end; 136 PKT_ptr_ptr tx_end;
206 PKT_ptr_ptr tx_add; 137 PKT_ptr_ptr tx_add;
207 PKT_ptr_ptr tx_remove; 138 PKT_ptr_ptr tx_remove;
208#endif
209#ifdef HOST
210 union {
211 struct {
212 PKT_ptr_ptr tx_start_ptr_ptr;
213 PKT_ptr_ptr tx_end_ptr_ptr;
214 PKT_ptr_ptr tx_add_ptr_ptr;
215 PKT_ptr_ptr tx_remove_ptr_ptr;
216 } s1;
217 struct {
218 ushort *tx_start_ptr;
219 ushort *tx_end_ptr;
220 ushort *tx_add_ptr;
221 ushort *tx_remove_ptr;
222 } s2;
223 } u3;
224#endif
225 139
226#ifdef RTA
227 ushort rx_pkts_added;
228 ushort rx_pkts_removed;
229 Q_BUF_ptr rx_q_start; /* Start of the Q list chain */
230 short num_rx_q_bufs; /* Number of Q buffers in the chain */
231 PKT_ptr_ptr rx_add; /* Add a new Packet here */
232 Q_BUF_ptr rx_add_qb; /* Pointer to the add Q buf */
233 PKT_ptr_ptr rx_add_st_qbb; /* Pointer to start of the Q's buf */
234 PKT_ptr_ptr rx_add_end_qbb; /* Pointer to the end of the Q's buf */
235 PKT_ptr_ptr rx_remove; /* Remove a Packet here */
236 Q_BUF_ptr rx_remove_qb; /* Pointer to the remove Q buf */
237 PKT_ptr_ptr rx_remove_st_qbb; /* Pointer to the start of the Q buf */
238 PKT_ptr_ptr rx_remove_end_qbb; /* Pointer to the end of the Q buf */
239#endif
240#ifdef INKERNEL
241 PKT_ptr_ptr rx_start; 140 PKT_ptr_ptr rx_start;
242 PKT_ptr_ptr rx_end; 141 PKT_ptr_ptr rx_end;
243 PKT_ptr_ptr rx_add; 142 PKT_ptr_ptr rx_add;
244 PKT_ptr_ptr rx_remove; 143 PKT_ptr_ptr rx_remove;
245#endif
246#ifdef HOST
247 union {
248 struct {
249 PKT_ptr_ptr rx_start_ptr_ptr;
250 PKT_ptr_ptr rx_end_ptr_ptr;
251 PKT_ptr_ptr rx_add_ptr_ptr;
252 PKT_ptr_ptr rx_remove_ptr_ptr;
253 } s1;
254 struct {
255 ushort *rx_start_ptr;
256 ushort *rx_end_ptr;
257 ushort *rx_add_ptr;
258 ushort *rx_remove_ptr;
259 } s2;
260 } u4;
261#endif
262
263#ifdef RTA /* some fields for the remotes */
264 ushort flush_count; /* Count of write flushes */
265 ushort txmode; /* Modes for tx */
266 ushort rxmode; /* Modes for rx */
267 ushort portmode; /* Generic modes */
268 ushort column; /* TAB3 column count */
269 ushort tx_subscript; /* (TX) Subscript into data field */
270 ushort rx_subscript; /* (RX) Subscript into data field */
271 PKT_ptr rx_incomplete; /* Hold an incomplete packet here */
272 ushort modem_bits; /* Modem bits to mask */
273 ushort lastModem; /* Modem control lines. */
274 ushort addr; /* Address for sub commands */
275 ushort MonitorTstate; /* TRUE if monitoring tstop */
276#endif
277 144
278}; 145};
279 146
diff --git a/drivers/char/rio/pkt.h b/drivers/char/rio/pkt.h
index 882fd429ac2e..7011e52e82db 100644
--- a/drivers/char/rio/pkt.h
+++ b/drivers/char/rio/pkt.h
@@ -70,39 +70,12 @@
70#define CONTROL_DATA_WNDW (DATA_WNDW << 8) 70#define CONTROL_DATA_WNDW (DATA_WNDW << 8)
71 71
72struct PKT { 72struct PKT {
73#ifdef INKERNEL
74 BYTE dest_unit; /* Destination Unit Id */ 73 BYTE dest_unit; /* Destination Unit Id */
75 BYTE dest_port; /* Destination POrt */ 74 BYTE dest_port; /* Destination POrt */
76 BYTE src_unit; /* Source Unit Id */ 75 BYTE src_unit; /* Source Unit Id */
77 BYTE src_port; /* Source POrt */ 76 BYTE src_port; /* Source POrt */
78#else
79 union {
80 ushort destination; /* Complete destination */
81 struct {
82 unsigned char unit; /* Destination unit */
83 unsigned char port; /* Destination port */
84 } s1;
85 } u1;
86 union {
87 ushort source; /* Complete source */
88 struct {
89 unsigned char unit; /* Source unit */
90 unsigned char port; /* Source port */
91 } s2;
92 } u2;
93#endif
94#ifdef INKERNEL
95 BYTE len; 77 BYTE len;
96 BYTE control; 78 BYTE control;
97#else
98 union {
99 ushort control;
100 struct {
101 unsigned char len;
102 unsigned char control;
103 } s3;
104 } u3;
105#endif
106 BYTE data[PKT_MAX_DATA_LEN]; 79 BYTE data[PKT_MAX_DATA_LEN];
107 /* Actual data :-) */ 80 /* Actual data :-) */
108 WORD csum; /* C-SUM */ 81 WORD csum; /* C-SUM */
diff --git a/drivers/char/rio/qbuf.h b/drivers/char/rio/qbuf.h
index acd9e8e5307d..391ffc335535 100644
--- a/drivers/char/rio/qbuf.h
+++ b/drivers/char/rio/qbuf.h
@@ -46,11 +46,7 @@ static char *_rio_qbuf_h_sccs = "@(#)qbuf.h 1.1";
46 46
47 47
48 48
49#ifdef HOST
50#define PKTS_PER_BUFFER 1
51#else
52#define PKTS_PER_BUFFER (220 / PKT_LENGTH) 49#define PKTS_PER_BUFFER (220 / PKT_LENGTH)
53#endif
54 50
55typedef struct Q_BUF Q_BUF; 51typedef struct Q_BUF Q_BUF;
56struct Q_BUF { 52struct Q_BUF {
diff --git a/drivers/char/rio/riotypes.h b/drivers/char/rio/riotypes.h
index 9b67e2468bec..46084d5c7e98 100644
--- a/drivers/char/rio/riotypes.h
+++ b/drivers/char/rio/riotypes.h
@@ -43,9 +43,6 @@
43#endif 43#endif
44#endif 44#endif
45 45
46#ifdef INKERNEL
47
48#if !defined(MIPSAT)
49typedef unsigned short NUMBER_ptr; 46typedef unsigned short NUMBER_ptr;
50typedef unsigned short WORD_ptr; 47typedef unsigned short WORD_ptr;
51typedef unsigned short BYTE_ptr; 48typedef unsigned short BYTE_ptr;
@@ -65,69 +62,6 @@ typedef unsigned short RUP_ptr;
65typedef unsigned short short_ptr; 62typedef unsigned short short_ptr;
66typedef unsigned short u_short_ptr; 63typedef unsigned short u_short_ptr;
67typedef unsigned short ushort_ptr; 64typedef unsigned short ushort_ptr;
68#else
69/* MIPSAT types */
70typedef char RIO_POINTER[8];
71typedef RIO_POINTER NUMBER_ptr;
72typedef RIO_POINTER WORD_ptr;
73typedef RIO_POINTER BYTE_ptr;
74typedef RIO_POINTER char_ptr;
75typedef RIO_POINTER Channel_ptr;
76typedef RIO_POINTER FREE_LIST_ptr_ptr;
77typedef RIO_POINTER FREE_LIST_ptr;
78typedef RIO_POINTER LPB_ptr;
79typedef RIO_POINTER Process_ptr;
80typedef RIO_POINTER PHB_ptr;
81typedef RIO_POINTER PKT_ptr;
82typedef RIO_POINTER PKT_ptr_ptr;
83typedef RIO_POINTER Q_BUF_ptr;
84typedef RIO_POINTER Q_BUF_ptr_ptr;
85typedef RIO_POINTER ROUTE_STR_ptr;
86typedef RIO_POINTER RUP_ptr;
87typedef RIO_POINTER short_ptr;
88typedef RIO_POINTER u_short_ptr;
89typedef RIO_POINTER ushort_ptr;
90#endif
91
92#else /* not INKERNEL */
93typedef unsigned char BYTE;
94typedef unsigned short WORD;
95typedef unsigned long DWORD;
96typedef short NUMBER;
97typedef short *NUMBER_ptr;
98typedef unsigned short *WORD_ptr;
99typedef unsigned char *BYTE_ptr;
100typedef unsigned char uchar;
101typedef unsigned short ushort;
102typedef unsigned int uint;
103typedef unsigned long ulong;
104typedef unsigned char u_char;
105typedef unsigned short u_short;
106typedef unsigned int u_int;
107typedef unsigned long u_long;
108typedef unsigned short ERROR;
109typedef unsigned long ID;
110typedef char *char_ptr;
111typedef Channel *Channel_ptr;
112typedef struct FREE_LIST *FREE_LIST_ptr;
113typedef struct FREE_LIST **FREE_LIST_ptr_ptr;
114typedef struct LPB *LPB_ptr;
115typedef struct Process *Process_ptr;
116typedef struct PHB *PHB_ptr;
117typedef struct PKT *PKT_ptr;
118typedef struct PKT **PKT_ptr_ptr;
119typedef struct Q_BUF *Q_BUF_ptr;
120typedef struct Q_BUF **Q_BUF_ptr_ptr;
121typedef struct ROUTE_STR *ROUTE_STR_ptr;
122typedef struct RUP *RUP_ptr;
123typedef short *short_ptr;
124typedef u_short *u_short_ptr;
125typedef ushort *ushort_ptr;
126typedef struct PKT PKT;
127typedef struct LPB LPB;
128typedef struct RUP RUP;
129#endif
130
131 65
132#endif /* __riotypes__ */ 66#endif /* __riotypes__ */
133 67
diff --git a/drivers/char/rio/rup.h b/drivers/char/rio/rup.h
index 8d44fec91dd5..f74f67c6f702 100644
--- a/drivers/char/rio/rup.h
+++ b/drivers/char/rio/rup.h
@@ -43,12 +43,7 @@
43#endif 43#endif
44#endif 44#endif
45 45
46#if defined( HOST ) || defined( INKERNEL )
47#define MAX_RUP ((short) 16) 46#define MAX_RUP ((short) 16)
48#endif
49#ifdef RTA
50#define MAX_RUP ((short) 1)
51#endif
52 47
53#define PKTS_PER_RUP ((short) 2) /* They are always used in pairs */ 48#define PKTS_PER_RUP ((short) 2) /* They are always used in pairs */
54 49
diff --git a/drivers/char/rio/sam.h b/drivers/char/rio/sam.h
index 31494054b213..6f754e19015d 100644
--- a/drivers/char/rio/sam.h
+++ b/drivers/char/rio/sam.h
@@ -43,10 +43,6 @@
43#endif 43#endif
44 44
45 45
46#if !defined( HOST ) && !defined( INKERNEL )
47#define RTA 1
48#endif
49
50#define NUM_FREE_LIST_UNITS 500 46#define NUM_FREE_LIST_UNITS 500
51 47
52#ifndef FALSE 48#ifndef FALSE