aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/rio/board.h58
-rw-r--r--drivers/char/rio/cmdpkt.h46
-rw-r--r--drivers/char/rio/link.h106
-rw-r--r--drivers/char/rio/parmmap.h54
-rw-r--r--drivers/char/rio/phb.h37
-rw-r--r--drivers/char/rio/pkt.h24
-rw-r--r--drivers/char/rio/port.h248
-rw-r--r--drivers/char/rio/riotypes.h34
-rw-r--r--drivers/char/rio/rup.h21
-rw-r--r--drivers/char/rio/typdef.h15
10 files changed, 243 insertions, 400 deletions
diff --git a/drivers/char/rio/board.h b/drivers/char/rio/board.h
index 29c980204098..bdea633a9076 100644
--- a/drivers/char/rio/board.h
+++ b/drivers/char/rio/board.h
@@ -33,10 +33,6 @@
33#ifndef __rio_board_h__ 33#ifndef __rio_board_h__
34#define __rio_board_h__ 34#define __rio_board_h__
35 35
36#ifdef SCCS_LABELS
37static char *_board_h_sccs_ = "@(#)board.h 1.2";
38#endif
39
40/* 36/*
41** board.h contains the definitions for the *hardware* of the host cards. 37** board.h contains the definitions for the *hardware* of the host cards.
42** It describes the memory overlay for the dual port RAM area. 38** It describes the memory overlay for the dual port RAM area.
@@ -53,29 +49,29 @@ static char *_board_h_sccs_ = "@(#)board.h 1.2";
53** The shape of the Host Control area, at offset 0x7C00, Write Only 49** The shape of the Host Control area, at offset 0x7C00, Write Only
54*/ 50*/
55struct s_Ctrl { 51struct s_Ctrl {
56 BYTE DpCtl; /* 7C00 */ 52 u8 DpCtl; /* 7C00 */
57 BYTE Dp_Unused2_[127]; 53 u8 Dp_Unused2_[127];
58 BYTE DpIntSet; /* 7C80 */ 54 u8 DpIntSet; /* 7C80 */
59 BYTE Dp_Unused3_[127]; 55 u8 Dp_Unused3_[127];
60 BYTE DpTpuReset; /* 7D00 */ 56 u8 DpTpuReset; /* 7D00 */
61 BYTE Dp_Unused4_[127]; 57 u8 Dp_Unused4_[127];
62 BYTE DpIntReset; /* 7D80 */ 58 u8 DpIntReset; /* 7D80 */
63 BYTE Dp_Unused5_[127]; 59 u8 Dp_Unused5_[127];
64}; 60};
65 61
66/* 62/*
67** The PROM data area on the host (0x7C00), Read Only 63** The PROM data area on the host (0x7C00), Read Only
68*/ 64*/
69struct s_Prom { 65struct s_Prom {
70 WORD DpSlxCode[2]; 66 u16 DpSlxCode[2];
71 WORD DpRev; 67 u16 DpRev;
72 WORD Dp_Unused6_; 68 u16 Dp_Unused6_;
73 WORD DpUniq[4]; 69 u16 DpUniq[4];
74 WORD DpJahre; 70 u16 DpJahre;
75 WORD DpWoche; 71 u16 DpWoche;
76 WORD DpHwFeature[5]; 72 u16 DpHwFeature[5];
77 WORD DpOemId; 73 u16 DpOemId;
78 WORD DpSiggy[16]; 74 u16 DpSiggy[16];
79}; 75};
80 76
81/* 77/*
@@ -90,19 +86,19 @@ union u_CtrlProm { /* This is the control/PROM area (0x7C00) */
90** The top end of memory! 86** The top end of memory!
91*/ 87*/
92struct s_ParmMapS { /* Area containing Parm Map Pointer */ 88struct s_ParmMapS { /* Area containing Parm Map Pointer */
93 BYTE Dp_Unused8_[DP_PARMMAP_ADDR]; 89 u8 Dp_Unused8_[DP_PARMMAP_ADDR];
94 WORD DpParmMapAd; 90 u16 DpParmMapAd;
95}; 91};
96 92
97struct s_StartUpS { 93struct s_StartUpS {
98 BYTE Dp_Unused9_[DP_STARTUP_ADDR]; 94 u8 Dp_Unused9_[DP_STARTUP_ADDR];
99 BYTE Dp_LongJump[0x4]; 95 u8 Dp_LongJump[0x4];
100 BYTE Dp_Unused10_[2]; 96 u8 Dp_Unused10_[2];
101 BYTE Dp_ShortJump[0x2]; 97 u8 Dp_ShortJump[0x2];
102}; 98};
103 99
104union u_Sram2ParmMap { /* This is the top of memory (0x7E00-0x7FFF) */ 100union u_Sram2ParmMap { /* This is the top of memory (0x7E00-0x7FFF) */
105 BYTE DpSramMem[DP_SRAM2_SIZE]; 101 u8 DpSramMem[DP_SRAM2_SIZE];
106 struct s_ParmMapS DpParmMapS; 102 struct s_ParmMapS DpParmMapS;
107 struct s_StartUpS DpStartUpS; 103 struct s_StartUpS DpStartUpS;
108}; 104};
@@ -111,11 +107,11 @@ union u_Sram2ParmMap { /* This is the top of memory (0x7E00-0x7FFF) */
111** This is the DP RAM overlay. 107** This is the DP RAM overlay.
112*/ 108*/
113struct DpRam { 109struct DpRam {
114 BYTE DpSram1[DP_SRAM1_SIZE]; /* 0000 - 7BFF */ 110 u8 DpSram1[DP_SRAM1_SIZE]; /* 0000 - 7BFF */
115 union u_CtrlProm DpCtrlProm; /* 7C00 - 7DFF */ 111 union u_CtrlProm DpCtrlProm; /* 7C00 - 7DFF */
116 union u_Sram2ParmMap DpSram2ParmMap; /* 7E00 - 7FFF */ 112 union u_Sram2ParmMap DpSram2ParmMap; /* 7E00 - 7FFF */
117 BYTE DpScratch[DP_SCRATCH_SIZE]; /* 8000 - 8FFF */ 113 u8 DpScratch[DP_SCRATCH_SIZE]; /* 8000 - 8FFF */
118 BYTE DpSram3[DP_SRAM3_SIZE]; /* 9000 - FFFF */ 114 u8 DpSram3[DP_SRAM3_SIZE]; /* 9000 - FFFF */
119}; 115};
120 116
121#define DpControl DpCtrlProm.DpCtrl.DpCtl 117#define DpControl DpCtrlProm.DpCtrl.DpCtl
diff --git a/drivers/char/rio/cmdpkt.h b/drivers/char/rio/cmdpkt.h
index 77cee8df68ef..b6445d3f1416 100644
--- a/drivers/char/rio/cmdpkt.h
+++ b/drivers/char/rio/cmdpkt.h
@@ -55,24 +55,24 @@ static char *_cmdpkt_h_sccs_ = "@(#)cmdpkt.h 1.2";
55** at Data[2] in the actual pkt! 55** at Data[2] in the actual pkt!
56*/ 56*/
57struct BootSequence { 57struct BootSequence {
58 WORD NumPackets; 58 u16 NumPackets;
59 WORD LoadBase; 59 u16 LoadBase;
60 WORD CodeSize; 60 u16 CodeSize;
61}; 61};
62 62
63#define BOOT_SEQUENCE_LEN 8 63#define BOOT_SEQUENCE_LEN 8
64 64
65struct SamTop { 65struct SamTop {
66 BYTE Unit; 66 u8 Unit;
67 BYTE Link; 67 u8 Link;
68}; 68};
69 69
70struct CmdHdr { 70struct CmdHdr {
71 BYTE PcCommand; 71 u8 PcCommand;
72 union { 72 union {
73 BYTE PcPhbNum; 73 u8 PcPhbNum;
74 BYTE PcLinkNum; 74 u8 PcLinkNum;
75 BYTE PcIDNum; 75 u8 PcIDNum;
76 } U0; 76 } U0;
77}; 77};
78 78
@@ -84,28 +84,28 @@ struct PktCmd {
84 struct BootSequence PcBootSequence; 84 struct BootSequence PcBootSequence;
85 } S1; 85 } S1;
86 struct { 86 struct {
87 WORD PcSequence; 87 u16 PcSequence;
88 BYTE PcBootData[RTA_BOOT_DATA_SIZE]; 88 u8 PcBootData[RTA_BOOT_DATA_SIZE];
89 } S2; 89 } S2;
90 struct { 90 struct {
91 WORD __crud__; 91 u16 __crud__;
92 BYTE PcUniqNum[4]; /* this is really a uint. */ 92 u8 PcUniqNum[4]; /* this is really a uint. */
93 BYTE PcModuleTypes; /* what modules are fitted */ 93 u8 PcModuleTypes; /* what modules are fitted */
94 } S3; 94 } S3;
95 struct { 95 struct {
96 struct CmdHdr CmdHdr; 96 struct CmdHdr CmdHdr;
97 BYTE __undefined__; 97 u8 __undefined__;
98 BYTE PcModemStatus; 98 u8 PcModemStatus;
99 BYTE PcPortStatus; 99 u8 PcPortStatus;
100 BYTE PcSubCommand; /* commands like mem or register dump */ 100 u8 PcSubCommand; /* commands like mem or register dump */
101 WORD PcSubAddr; /* Address for command */ 101 u16 PcSubAddr; /* Address for command */
102 BYTE PcSubData[64]; /* Date area for command */ 102 u8 PcSubData[64]; /* Date area for command */
103 } S4; 103 } S4;
104 struct { 104 struct {
105 struct CmdHdr CmdHdr; 105 struct CmdHdr CmdHdr;
106 BYTE PcCommandText[1]; 106 u8 PcCommandText[1];
107 BYTE __crud__[20]; 107 u8 __crud__[20];
108 BYTE PcIDNum2; /* It had to go somewhere! */ 108 u8 PcIDNum2; /* It had to go somewhere! */
109 } S5; 109 } S5;
110 struct { 110 struct {
111 struct CmdHdr CmdHdr; 111 struct CmdHdr CmdHdr;
diff --git a/drivers/char/rio/link.h b/drivers/char/rio/link.h
index 48d68ca7f825..6a64b5a5b3d0 100644
--- a/drivers/char/rio/link.h
+++ b/drivers/char/rio/link.h
@@ -37,38 +37,9 @@
37#ifndef _link_h 37#ifndef _link_h
38#define _link_h 1 38#define _link_h 1
39 39
40#ifndef lint
41#ifdef SCCS_LABELS
42/* static char *_rio_link_h_sccs = "@(#)link.h 1.15"; */
43#endif
44#endif
45
46
47
48/************************************************* 40/*************************************************
49 * Define the Link Status stuff 41 * Define the Link Status stuff
50 ************************************************/ 42 ************************************************/
51#define LRT_ACTIVE ((ushort) 0x01)
52#define LRT_SPARE1 ((ushort) 0x02)
53#define INTRO_RCVD ((ushort) 0x04)
54#define FORCED_DISCONNECT ((ushort) 0x08)
55#define LRT_SPARE2 ((ushort) 0x80)
56
57#define TOP_OF_RTA_RAM ((ushort) 0x7000)
58#define HOST_SERIAL_POINTER (unsigned char **) (TOP_OF_RTA_RAM - 2 * sizeof (ushort))
59
60/* Flags for ltt_status */
61#define WAITING_ACK (ushort) 0x0001
62#define DATA_SENT (ushort) 0x0002
63#define WAITING_RUP (ushort) 0x0004
64#define WAITING_RETRY (ushort) 0x0008
65#define WAITING_TOPOLOGY (ushort) 0x0010
66#define SEND_SYNC (ushort) 0x0020
67#define FOAD_THIS_LINK (ushort) 0x0040
68#define REQUEST_SYNC (ushort) 0x0080
69#define REMOTE_DYING (ushort) 0x0100
70#define DIE_NOW (ushort) 0x0200
71
72/* Boot request stuff */ 43/* Boot request stuff */
73#define BOOT_REQUEST ((ushort) 0) /* Request for a boot */ 44#define BOOT_REQUEST ((ushort) 0) /* Request for a boot */
74#define BOOT_ABORT ((ushort) 1) /* Abort a boot */ 45#define BOOT_ABORT ((ushort) 1) /* Abort a boot */
@@ -76,56 +47,27 @@
76 and load address */ 47 and load address */
77#define BOOT_COMPLETED ((ushort) 3) /* Boot completed */ 48#define BOOT_COMPLETED ((ushort) 3) /* Boot completed */
78 49
79/* States that a link can be in */
80#define LINK_DISCONNECTED ((ushort) 0) /* Disconnected */
81#define LINK_BOOT1 ((ushort) 1) /* Trying to send 1st stage boot */
82#define LINK_BOOT2 ((ushort) 2) /* Trying to send 2nd stage boot */
83#define LINK_BOOT2WAIT ((ushort) 3) /* Waiting for selftest results */
84#define LINK_BOOT3 ((ushort) 4) /* Trying to send 3rd stage boots */
85#define LINK_SYNC ((ushort) 5) /* Syncing */
86
87#define LINK_INTRO ((ushort) 10) /* Introductory packet */
88#define LINK_SUPPLYID ((ushort) 11) /* Trying to supply an ID */
89#define LINK_TOPOLOGY ((ushort) 12) /* Send a topology update */
90#define LINK_REQUESTID ((ushort) 13) /* Waiting for an ID */
91#define LINK_CONNECTED ((ushort) 14) /* Connected */
92
93#define LINK_INTERCONNECT ((ushort) 20) /* Subnets interconnected */
94
95#define LINK_SPARE ((ushort) 40)
96
97/*
98** Set the default timeout for link communications.
99*/
100#define LINKTIMEOUT (400 * MILLISECOND)
101
102/*
103** LED stuff
104*/
105#define LED_SET_COLOUR(colour)
106#define LED_OR_COLOUR(colour)
107#define LED_TIMEOUT(time)
108 50
109struct LPB { 51struct LPB {
110 WORD link_number; /* Link Number */ 52 u16 link_number; /* Link Number */
111 Channel_ptr in_ch; /* Link In Channel */ 53 Channel_ptr in_ch; /* Link In Channel */
112 Channel_ptr out_ch; /* Link Out Channel */ 54 Channel_ptr out_ch; /* Link Out Channel */
113 BYTE attached_serial[4]; /* Attached serial number */ 55 u8 attached_serial[4]; /* Attached serial number */
114 BYTE attached_host_serial[4]; 56 u8 attached_host_serial[4];
115 /* Serial number of Host who 57 /* Serial number of Host who
116 booted the other end */ 58 booted the other end */
117 WORD descheduled; /* Currently Descheduled */ 59 u16 descheduled; /* Currently Descheduled */
118 WORD state; /* Current state */ 60 u16 state; /* Current state */
119 WORD send_poll; /* Send a Poll Packet */ 61 u16 send_poll; /* Send a Poll Packet */
120 Process_ptr ltt_p; /* Process Descriptor */ 62 Process_ptr ltt_p; /* Process Descriptor */
121 Process_ptr lrt_p; /* Process Descriptor */ 63 Process_ptr lrt_p; /* Process Descriptor */
122 WORD lrt_status; /* Current lrt status */ 64 u16 lrt_status; /* Current lrt status */
123 WORD ltt_status; /* Current ltt status */ 65 u16 ltt_status; /* Current ltt status */
124 WORD timeout; /* Timeout value */ 66 u16 timeout; /* Timeout value */
125 WORD topology; /* Topology bits */ 67 u16 topology; /* Topology bits */
126 WORD mon_ltt; 68 u16 mon_ltt;
127 WORD mon_lrt; 69 u16 mon_lrt;
128 WORD WaitNoBoot; /* Secs to hold off booting */ 70 u16 WaitNoBoot; /* Secs to hold off booting */
129 PKT_ptr add_packet_list; /* Add packets to here */ 71 PKT_ptr add_packet_list; /* Add packets to here */
130 PKT_ptr remove_packet_list; /* Send packets from here */ 72 PKT_ptr remove_packet_list; /* Send packets from here */
131 73
@@ -136,17 +78,17 @@ struct LPB {
136 struct RUP rup; 78 struct RUP rup;
137 struct RUP link_rup; /* RUP for the link (POLL, 79 struct RUP link_rup; /* RUP for the link (POLL,
138 topology etc.) */ 80 topology etc.) */
139 WORD attached_link; /* Number of attached link */ 81 u16 attached_link; /* Number of attached link */
140 WORD csum_errors; /* csum errors */ 82 u16 csum_errors; /* csum errors */
141 WORD num_disconnects; /* number of disconnects */ 83 u16 num_disconnects; /* number of disconnects */
142 WORD num_sync_rcvd; /* # sync's received */ 84 u16 num_sync_rcvd; /* # sync's received */
143 WORD num_sync_rqst; /* # sync requests */ 85 u16 num_sync_rqst; /* # sync requests */
144 WORD num_tx; /* Num pkts sent */ 86 u16 num_tx; /* Num pkts sent */
145 WORD num_rx; /* Num pkts received */ 87 u16 num_rx; /* Num pkts received */
146 WORD module_attached; /* Module tpyes of attached */ 88 u16 module_attached; /* Module tpyes of attached */
147 WORD led_timeout; /* LED timeout */ 89 u16 led_timeout; /* LED timeout */
148 WORD first_port; /* First port to service */ 90 u16 first_port; /* First port to service */
149 WORD last_port; /* Last port to service */ 91 u16 last_port; /* Last port to service */
150}; 92};
151 93
152#endif 94#endif
diff --git a/drivers/char/rio/parmmap.h b/drivers/char/rio/parmmap.h
index e24acc1d1844..c4085fbf9ec6 100644
--- a/drivers/char/rio/parmmap.h
+++ b/drivers/char/rio/parmmap.h
@@ -48,39 +48,39 @@ typedef struct PARM_MAP PARM_MAP;
48 48
49struct PARM_MAP { 49struct PARM_MAP {
50 PHB_ptr phb_ptr; /* Pointer to the PHB array */ 50 PHB_ptr phb_ptr; /* Pointer to the PHB array */
51 WORD_ptr phb_num_ptr; /* Ptr to Number of PHB's */ 51 u16 phb_num_ptr; /* Ptr to Number of PHB's */
52 FREE_LIST_ptr free_list; /* Free List pointer */ 52 FREE_LIST_ptr free_list; /* Free List pointer */
53 FREE_LIST_ptr free_list_end; /* Free List End pointer */ 53 FREE_LIST_ptr free_list_end; /* Free List End pointer */
54 Q_BUF_ptr_ptr q_free_list_ptr; /* Ptr to Q_BUF variable */ 54 Q_BUF_ptr_ptr q_free_list_ptr; /* Ptr to Q_BUF variable */
55 BYTE_ptr unit_id_ptr; /* Unit Id */ 55 u16 unit_id_ptr; /* Unit Id */
56 LPB_ptr link_str_ptr; /* Link Structure Array */ 56 LPB_ptr link_str_ptr; /* Link Structure Array */
57 BYTE_ptr bootloader_1; /* 1st Stage Boot Loader */ 57 u16 bootloader_1; /* 1st Stage Boot Loader */
58 BYTE_ptr bootloader_2; /* 2nd Stage Boot Loader */ 58 u16 bootloader_2; /* 2nd Stage Boot Loader */
59 WORD_ptr port_route_map_ptr; /* Port Route Map */ 59 u16 port_route_map_ptr; /* Port Route Map */
60 ROUTE_STR_ptr route_ptr; /* Unit Route Map */ 60 ROUTE_STR_ptr route_ptr; /* Unit Route Map */
61 NUMBER_ptr map_present; /* Route Map present */ 61 u16 map_present; /* Route Map present */
62 NUMBER pkt_num; /* Total number of packets */ 62 s16 pkt_num; /* Total number of packets */
63 NUMBER q_num; /* Total number of Q packets */ 63 s16 q_num; /* Total number of Q packets */
64 WORD buffers_per_port; /* Number of buffers per port */ 64 u16 buffers_per_port; /* Number of buffers per port */
65 WORD heap_size; /* Initial size of heap */ 65 u16 heap_size; /* Initial size of heap */
66 WORD heap_left; /* Current Heap left */ 66 u16 heap_left; /* Current Heap left */
67 WORD error; /* Error code */ 67 u16 error; /* Error code */
68 WORD tx_max; /* Max number of tx pkts per phb */ 68 u16 tx_max; /* Max number of tx pkts per phb */
69 WORD rx_max; /* Max number of rx pkts per phb */ 69 u16 rx_max; /* Max number of rx pkts per phb */
70 WORD rx_limit; /* For high / low watermarks */ 70 u16 rx_limit; /* For high / low watermarks */
71 NUMBER links; /* Links to use */ 71 s16 links; /* Links to use */
72 NUMBER timer; /* Interrupts per second */ 72 s16 timer; /* Interrupts per second */
73 RUP_ptr rups; /* Pointer to the RUPs */ 73 RUP_ptr rups; /* Pointer to the RUPs */
74 WORD max_phb; /* Mostly for debugging */ 74 u16 max_phb; /* Mostly for debugging */
75 WORD living; /* Just increments!! */ 75 u16 living; /* Just increments!! */
76 WORD init_done; /* Initialisation over */ 76 u16 init_done; /* Initialisation over */
77 WORD booting_link; 77 u16 booting_link;
78 WORD idle_count; /* Idle time counter */ 78 u16 idle_count; /* Idle time counter */
79 WORD busy_count; /* Busy counter */ 79 u16 busy_count; /* Busy counter */
80 WORD idle_control; /* Control Idle Process */ 80 u16 idle_control; /* Control Idle Process */
81 WORD tx_intr; /* TX interrupt pending */ 81 u16 tx_intr; /* TX interrupt pending */
82 WORD rx_intr; /* RX interrupt pending */ 82 u16 rx_intr; /* RX interrupt pending */
83 WORD rup_intr; /* RUP interrupt pending */ 83 u16 rup_intr; /* RUP interrupt pending */
84}; 84};
85 85
86#endif 86#endif
diff --git a/drivers/char/rio/phb.h b/drivers/char/rio/phb.h
index 2663ca0306e2..05d59f4b9fb0 100644
--- a/drivers/char/rio/phb.h
+++ b/drivers/char/rio/phb.h
@@ -37,13 +37,6 @@
37#ifndef _phb_h 37#ifndef _phb_h
38#define _phb_h 1 38#define _phb_h 1
39 39
40#ifdef SCCS_LABELS
41#ifndef lint
42/* static char *_rio_phb_h_sccs = "@(#)phb.h 1.12"; */
43#endif
44#endif
45
46
47/************************************************* 40/*************************************************
48 * Handshake asserted. Deasserted by the LTT(s) 41 * Handshake asserted. Deasserted by the LTT(s)
49 ************************************************/ 42 ************************************************/
@@ -126,21 +119,21 @@
126 *************************************************************************/ 119 *************************************************************************/
127typedef struct PHB PHB; 120typedef struct PHB PHB;
128struct PHB { 121struct PHB {
129 WORD source; 122 u8 source;
130 WORD handshake; 123 u8 handshake;
131 WORD status; 124 u8 status;
132 NUMBER timeout; /* Maximum of 1.9 seconds */ 125 u16 timeout; /* Maximum of 1.9 seconds */
133 WORD link; /* Send down this link */ 126 u8 link; /* Send down this link */
134 WORD destination; 127 u8 destination;
135 PKT_ptr_ptr tx_start; 128 u16 tx_start;
136 PKT_ptr_ptr tx_end; 129 u16 tx_end;
137 PKT_ptr_ptr tx_add; 130 u16 tx_add;
138 PKT_ptr_ptr tx_remove; 131 u16 tx_remove;
139 132
140 PKT_ptr_ptr rx_start; 133 u16 rx_start;
141 PKT_ptr_ptr rx_end; 134 u16 rx_end;
142 PKT_ptr_ptr rx_add; 135 u16 rx_add;
143 PKT_ptr_ptr rx_remove; 136 u16 rx_remove;
144 137
145}; 138};
146 139
diff --git a/drivers/char/rio/pkt.h b/drivers/char/rio/pkt.h
index 7011e52e82db..a9458164f02f 100644
--- a/drivers/char/rio/pkt.h
+++ b/drivers/char/rio/pkt.h
@@ -37,14 +37,6 @@
37#ifndef _pkt_h 37#ifndef _pkt_h
38#define _pkt_h 1 38#define _pkt_h 1
39 39
40
41#ifdef SCCS_LABELS
42#ifndef lint
43/* static char *_rio_pkt_h_sccs = "@(#)pkt.h 1.8"; */
44#endif
45#endif
46
47#define MAX_TTL 0xf
48#define PKT_CMD_BIT ((ushort) 0x080) 40#define PKT_CMD_BIT ((ushort) 0x080)
49#define PKT_CMD_DATA ((ushort) 0x080) 41#define PKT_CMD_DATA ((ushort) 0x080)
50 42
@@ -70,15 +62,15 @@
70#define CONTROL_DATA_WNDW (DATA_WNDW << 8) 62#define CONTROL_DATA_WNDW (DATA_WNDW << 8)
71 63
72struct PKT { 64struct PKT {
73 BYTE dest_unit; /* Destination Unit Id */ 65 u8 dest_unit; /* Destination Unit Id */
74 BYTE dest_port; /* Destination POrt */ 66 u8 dest_port; /* Destination POrt */
75 BYTE src_unit; /* Source Unit Id */ 67 u8 src_unit; /* Source Unit Id */
76 BYTE src_port; /* Source POrt */ 68 u8 src_port; /* Source POrt */
77 BYTE len; 69 u8 len;
78 BYTE control; 70 u8 control;
79 BYTE data[PKT_MAX_DATA_LEN]; 71 u8 data[PKT_MAX_DATA_LEN];
80 /* Actual data :-) */ 72 /* Actual data :-) */
81 WORD csum; /* C-SUM */ 73 u16 csum; /* C-SUM */
82}; 74};
83#endif 75#endif
84 76
diff --git a/drivers/char/rio/port.h b/drivers/char/rio/port.h
index c99b1e70fdc8..4f1108fe9b1a 100644
--- a/drivers/char/rio/port.h
+++ b/drivers/char/rio/port.h
@@ -33,91 +33,37 @@
33#ifndef __rio_port_h__ 33#ifndef __rio_port_h__
34#define __rio_port_h__ 34#define __rio_port_h__
35 35
36#ifdef SCCS_LABELS
37static char *_port_h_sccs_ = "@(#)port.h 1.3";
38#endif
39
40
41#undef VPIX
42
43
44/*
45** the port data structure - one per port in the system
46*/
47
48#ifdef STATS
49struct RIOStats {
50 /*
51 ** interrupt statistics
52 */
53 uint BreakIntCnt;
54 uint ModemOffCnt;
55 uint ModemOnCnt;
56 uint RxIntCnt;
57 uint TxIntCnt;
58 /*
59 ** throughput statistics
60 */
61 uint RxCharCnt;
62 uint RxPktCnt;
63 uint RxSaveCnt;
64 uint TxCharCnt;
65 uint TxPktCnt;
66 /*
67 ** driver entry statistics
68 */
69 uint CloseCnt;
70 uint IoctlCnt;
71 uint OpenCnt;
72 uint ReadCnt;
73 uint WriteCnt;
74 /*
75 ** proc statistics
76 */
77 uint BlockCnt;
78 uint OutputCnt;
79 uint ResumeCnt;
80 uint RflushCnt;
81 uint SuspendCnt;
82 uint TbreakCnt;
83 uint TimeoutCnt;
84 uint UnblockCnt;
85 uint WflushCnt;
86 uint WFBodgeCnt;
87};
88#endif
89
90/* 36/*
91** Port data structure 37** Port data structure
92*/ 38*/
93struct Port { 39struct Port {
94 struct gs_port gs; 40 struct gs_port gs;
95 int PortNum; /* RIO port no., 0-511 */ 41 int PortNum; /* RIO port no., 0-511 */
96 struct Host *HostP; 42 struct Host *HostP;
97 volatile caddr_t Caddr; 43 volatile caddr_t Caddr;
98 ushort HostPort; /* Port number on host card */ 44 unsigned short HostPort; /* Port number on host card */
99 uchar RupNum; /* Number of RUP for port */ 45 unsigned char RupNum; /* Number of RUP for port */
100 uchar ID2; /* Second ID of RTA for port */ 46 unsigned char ID2; /* Second ID of RTA for port */
101 ulong State; /* FLAGS for open & xopen */ 47 unsigned long State; /* FLAGS for open & xopen */
102#define RIO_LOPEN 0x00001 /* Local open */ 48#define RIO_LOPEN 0x00001 /* Local open */
103#define RIO_MOPEN 0x00002 /* Modem open */ 49#define RIO_MOPEN 0x00002 /* Modem open */
104#define RIO_WOPEN 0x00004 /* Waiting for open */ 50#define RIO_WOPEN 0x00004 /* Waiting for open */
105#define RIO_CLOSING 0x00008 /* The port is being close */ 51#define RIO_CLOSING 0x00008 /* The port is being close */
106#define RIO_XPBUSY 0x00010 /* Transparent printer busy */ 52#define RIO_XPBUSY 0x00010 /* Transparent printer busy */
107#define RIO_BREAKING 0x00020 /* Break in progress */ 53#define RIO_BREAKING 0x00020 /* Break in progress */
108#define RIO_DIRECT 0x00040 /* Doing Direct output */ 54#define RIO_DIRECT 0x00040 /* Doing Direct output */
109#define RIO_EXCLUSIVE 0x00080 /* Stream open for exclusive use */ 55#define RIO_EXCLUSIVE 0x00080 /* Stream open for exclusive use */
110#define RIO_NDELAY 0x00100 /* Stream is open FNDELAY */ 56#define RIO_NDELAY 0x00100 /* Stream is open FNDELAY */
111#define RIO_CARR_ON 0x00200 /* Stream has carrier present */ 57#define RIO_CARR_ON 0x00200 /* Stream has carrier present */
112#define RIO_XPWANTR 0x00400 /* Stream wanted by Xprint */ 58#define RIO_XPWANTR 0x00400 /* Stream wanted by Xprint */
113#define RIO_RBLK 0x00800 /* Stream is read-blocked */ 59#define RIO_RBLK 0x00800 /* Stream is read-blocked */
114#define RIO_BUSY 0x01000 /* Stream is BUSY for write */ 60#define RIO_BUSY 0x01000 /* Stream is BUSY for write */
115#define RIO_TIMEOUT 0x02000 /* Stream timeout in progress */ 61#define RIO_TIMEOUT 0x02000 /* Stream timeout in progress */
116#define RIO_TXSTOP 0x04000 /* Stream output is stopped */ 62#define RIO_TXSTOP 0x04000 /* Stream output is stopped */
117#define RIO_WAITFLUSH 0x08000 /* Stream waiting for flush */ 63#define RIO_WAITFLUSH 0x08000 /* Stream waiting for flush */
118#define RIO_DYNOROD 0x10000 /* Drain failed */ 64#define RIO_DYNOROD 0x10000 /* Drain failed */
119#define RIO_DELETED 0x20000 /* RTA has been deleted */ 65#define RIO_DELETED 0x20000 /* RTA has been deleted */
120#define RIO_ISSCANCODE 0x40000 /* This line is in scancode mode */ 66#define RIO_ISSCANCODE 0x40000 /* This line is in scancode mode */
121#define RIO_USING_EUC 0x100000 /* Using extended Unix chars */ 67#define RIO_USING_EUC 0x100000 /* Using extended Unix chars */
122#define RIO_CAN_COOK 0x200000 /* This line can do cooking */ 68#define RIO_CAN_COOK 0x200000 /* This line can do cooking */
123#define RIO_TRIAD_MODE 0x400000 /* Enable TRIAD special ops. */ 69#define RIO_TRIAD_MODE 0x400000 /* Enable TRIAD special ops. */
@@ -125,15 +71,15 @@ struct Port {
125#define RIO_TRIAD_FUNC 0x1000000 /* Seen a function key coming in */ 71#define RIO_TRIAD_FUNC 0x1000000 /* Seen a function key coming in */
126#define RIO_THROTTLE_RX 0x2000000 /* RX needs to be throttled. */ 72#define RIO_THROTTLE_RX 0x2000000 /* RX needs to be throttled. */
127 73
128 ulong Config; /* FLAGS for NOREAD.... */ 74 unsigned long Config; /* FLAGS for NOREAD.... */
129#define RIO_NOREAD 0x0001 /* Are not allowed to read port */ 75#define RIO_NOREAD 0x0001 /* Are not allowed to read port */
130#define RIO_NOWRITE 0x0002 /* Are not allowed to write port */ 76#define RIO_NOWRITE 0x0002 /* Are not allowed to write port */
131#define RIO_NOXPRINT 0x0004 /* Are not allowed to xprint port */ 77#define RIO_NOXPRINT 0x0004 /* Are not allowed to xprint port */
132#define RIO_NOMASK 0x0007 /* All not allowed things */ 78#define RIO_NOMASK 0x0007 /* All not allowed things */
133#define RIO_IXANY 0x0008 /* Port is allowed ixany */ 79#define RIO_IXANY 0x0008 /* Port is allowed ixany */
134#define RIO_MODEM 0x0010 /* Stream is a modem device */ 80#define RIO_MODEM 0x0010 /* Stream is a modem device */
135#define RIO_IXON 0x0020 /* Port is allowed ixon */ 81#define RIO_IXON 0x0020 /* Port is allowed ixon */
136#define RIO_WAITDRAIN 0x0040 /* Wait for port to completely drain */ 82#define RIO_WAITDRAIN 0x0040 /* Wait for port to completely drain */
137#define RIO_MAP_50_TO_50 0x0080 /* Map 50 baud to 50 baud */ 83#define RIO_MAP_50_TO_50 0x0080 /* Map 50 baud to 50 baud */
138#define RIO_MAP_110_TO_110 0x0100 /* Map 110 baud to 110 baud */ 84#define RIO_MAP_110_TO_110 0x0100 /* Map 110 baud to 110 baud */
139 85
@@ -142,36 +88,36 @@ struct Port {
142** As LynxOS does not appear to support Hardware Flow Control ..... 88** As LynxOS does not appear to support Hardware Flow Control .....
143** Define our own flow control flags in 'Config'. 89** Define our own flow control flags in 'Config'.
144*/ 90*/
145#define RIO_CTSFLOW 0x0200 /* RIO's own CTSFLOW flag */ 91#define RIO_CTSFLOW 0x0200 /* RIO's own CTSFLOW flag */
146#define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */ 92#define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */
147 93
148 94
149 struct PHB *PhbP; /* pointer to PHB for port */ 95 struct PHB *PhbP; /* pointer to PHB for port */
150 WORD *TxAdd; /* Add packets here */ 96 u16 *TxAdd; /* Add packets here */
151 WORD *TxStart; /* Start of add array */ 97 u16 *TxStart; /* Start of add array */
152 WORD *TxEnd; /* End of add array */ 98 u16 *TxEnd; /* End of add array */
153 WORD *RxRemove; /* Remove packets here */ 99 u16 *RxRemove; /* Remove packets here */
154 WORD *RxStart; /* Start of remove array */ 100 u16 *RxStart; /* Start of remove array */
155 WORD *RxEnd; /* End of remove array */ 101 u16 *RxEnd; /* End of remove array */
156 uint RtaUniqueNum; /* Unique number of RTA */ 102 unsigned int RtaUniqueNum; /* Unique number of RTA */
157 ushort PortState; /* status of port */ 103 unsigned short PortState; /* status of port */
158 ushort ModemState; /* status of modem lines */ 104 unsigned short ModemState; /* status of modem lines */
159 ulong ModemLines; /* Modem bits sent to RTA */ 105 unsigned long ModemLines; /* Modem bits sent to RTA */
160 uchar CookMode; /* who expands CR/LF? */ 106 unsigned char CookMode; /* who expands CR/LF? */
161 uchar ParamSem; /* Prevent write during param */ 107 unsigned char ParamSem; /* Prevent write during param */
162 uchar Mapped; /* if port mapped onto host */ 108 unsigned char Mapped; /* if port mapped onto host */
163 uchar SecondBlock; /* if port belongs to 2nd block 109 unsigned char SecondBlock; /* if port belongs to 2nd block
164 of 16 port RTA */ 110 of 16 port RTA */
165 uchar InUse; /* how many pre-emptive cmds */ 111 unsigned char InUse; /* how many pre-emptive cmds */
166 uchar Lock; /* if params locked */ 112 unsigned char Lock; /* if params locked */
167 uchar Store; /* if params stored across closes */ 113 unsigned char Store; /* if params stored across closes */
168 uchar FirstOpen; /* TRUE if first time port opened */ 114 unsigned char FirstOpen; /* TRUE if first time port opened */
169 uchar FlushCmdBodge; /* if doing a (non)flush */ 115 unsigned char FlushCmdBodge; /* if doing a (non)flush */
170 uchar MagicFlags; /* require intr processing */ 116 unsigned char MagicFlags; /* require intr processing */
171#define MAGIC_FLUSH 0x01 /* mirror of WflushFlag */ 117#define MAGIC_FLUSH 0x01 /* mirror of WflushFlag */
172#define MAGIC_REBOOT 0x02 /* RTA re-booted, re-open ports */ 118#define MAGIC_REBOOT 0x02 /* RTA re-booted, re-open ports */
173#define MORE_OUTPUT_EYGOR 0x04 /* riotproc failed to empty clists */ 119#define MORE_OUTPUT_EYGOR 0x04 /* riotproc failed to empty clists */
174 uchar WflushFlag; /* 1 How many WFLUSHs active */ 120 unsigned char WflushFlag; /* 1 How many WFLUSHs active */
175/* 121/*
176** Transparent print stuff 122** Transparent print stuff
177*/ 123*/
@@ -179,63 +125,55 @@ struct Port {
179#ifndef MAX_XP_CTRL_LEN 125#ifndef MAX_XP_CTRL_LEN
180#define MAX_XP_CTRL_LEN 16 /* ALSO IN DAEMON.H */ 126#define MAX_XP_CTRL_LEN 16 /* ALSO IN DAEMON.H */
181#endif 127#endif
182 uint XpCps; 128 unsigned int XpCps;
183 char XpOn[MAX_XP_CTRL_LEN]; 129 char XpOn[MAX_XP_CTRL_LEN];
184 char XpOff[MAX_XP_CTRL_LEN]; 130 char XpOff[MAX_XP_CTRL_LEN];
185 ushort XpLen; /* strlen(XpOn)+strlen(XpOff) */ 131 unsigned short XpLen; /* strlen(XpOn)+strlen(XpOff) */
186 uchar XpActive; 132 unsigned char XpActive;
187 uchar XpLastTickOk; /* TRUE if we can process */ 133 unsigned char XpLastTickOk; /* TRUE if we can process */
188#define XP_OPEN 00001 134#define XP_OPEN 00001
189#define XP_RUNABLE 00002 135#define XP_RUNABLE 00002
190 struct ttystatics *XttyP; 136 struct ttystatics *XttyP;
191 } Xprint; 137 } Xprint;
192#ifdef VPIX 138 unsigned char RxDataStart;
193 v86_t *StashP; 139 unsigned char Cor2Copy; /* copy of COR2 */
194 uint IntMask; 140 char *Name; /* points to the Rta's name */
195 struct termss VpixSs;
196 uchar ModemStatusReg; /* Modem status register */
197#endif
198 uchar RxDataStart;
199 uchar Cor2Copy; /* copy of COR2 */
200 char *Name; /* points to the Rta's name */
201#ifdef STATS
202 struct RIOStats Stat; /* ports statistics */
203#endif
204 char *TxRingBuffer; 141 char *TxRingBuffer;
205 ushort TxBufferIn; /* New data arrives here */ 142 unsigned short TxBufferIn; /* New data arrives here */
206 ushort TxBufferOut; /* Intr removes data here */ 143 unsigned short TxBufferOut; /* Intr removes data here */
207 ushort OldTxBufferOut; /* Indicates if draining */ 144 unsigned short OldTxBufferOut; /* Indicates if draining */
208 int TimeoutId; /* Timeout ID */ 145 int TimeoutId; /* Timeout ID */
209 uint Debug; 146 unsigned int Debug;
210 uchar WaitUntilBooted; /* True if open should block */ 147 unsigned char WaitUntilBooted; /* True if open should block */
211 uint statsGather; /* True if gathering stats */ 148 unsigned int statsGather; /* True if gathering stats */
212 ulong txchars; /* Chars transmitted */ 149 unsigned long txchars; /* Chars transmitted */
213 ulong rxchars; /* Chars received */ 150 unsigned long rxchars; /* Chars received */
214 ulong opens; /* port open count */ 151 unsigned long opens; /* port open count */
215 ulong closes; /* port close count */ 152 unsigned long closes; /* port close count */
216 ulong ioctls; /* ioctl count */ 153 unsigned long ioctls; /* ioctl count */
217 uchar LastRxTgl; /* Last state of rx toggle bit */ 154 unsigned char LastRxTgl; /* Last state of rx toggle bit */
218 spinlock_t portSem; /* Lock using this sem */ 155 spinlock_t portSem; /* Lock using this sem */
219 int MonitorTstate; /* Monitoring ? */ 156 int MonitorTstate; /* Monitoring ? */
220 int timeout_id; /* For calling 100 ms delays */ 157 int timeout_id; /* For calling 100 ms delays */
221 int timeout_sem; /* For calling 100 ms delays */ 158 int timeout_sem; /* For calling 100 ms delays */
222 int firstOpen; /* First time open ? */ 159 int firstOpen; /* First time open ? */
223 char *p; /* save the global struc here .. */ 160 char *p; /* save the global struc here .. */
224}; 161};
225 162
226struct ModuleInfo { 163struct ModuleInfo {
227 char *Name; 164 char *Name;
228 uint Flags[4]; /* one per port on a module */ 165 unsigned int Flags[4]; /* one per port on a module */
229}; 166};
230#endif
231 167
232/* 168/*
233** This struct is required because trying to grab an entire Port structure 169** This struct is required because trying to grab an entire Port structure
234** runs into problems with differing struct sizes between driver and config. 170** runs into problems with differing struct sizes between driver and config.
235*/ 171*/
236struct PortParams { 172struct PortParams {
237 uint Port; 173 unsigned int Port;
238 ulong Config; 174 unsigned long Config;
239 ulong State; 175 unsigned long State;
240 struct ttystatics *TtyP; 176 struct ttystatics *TtyP;
241}; 177};
178
179#endif
diff --git a/drivers/char/rio/riotypes.h b/drivers/char/rio/riotypes.h
index 46084d5c7e98..d07bd0aab5a2 100644
--- a/drivers/char/rio/riotypes.h
+++ b/drivers/char/rio/riotypes.h
@@ -43,25 +43,21 @@
43#endif 43#endif
44#endif 44#endif
45 45
46typedef unsigned short NUMBER_ptr; 46typedef u16 char_ptr;
47typedef unsigned short WORD_ptr; 47typedef u16 Channel_ptr;
48typedef unsigned short BYTE_ptr; 48typedef u16 FREE_LIST_ptr_ptr;
49typedef unsigned short char_ptr; 49typedef u16 FREE_LIST_ptr;
50typedef unsigned short Channel_ptr; 50typedef u16 LPB_ptr;
51typedef unsigned short FREE_LIST_ptr_ptr; 51typedef u16 Process_ptr;
52typedef unsigned short FREE_LIST_ptr; 52typedef u16 PHB_ptr;
53typedef unsigned short LPB_ptr; 53typedef u16 PKT_ptr;
54typedef unsigned short Process_ptr; 54typedef u16 Q_BUF_ptr;
55typedef unsigned short PHB_ptr; 55typedef u16 Q_BUF_ptr_ptr;
56typedef unsigned short PKT_ptr; 56typedef u16 ROUTE_STR_ptr;
57typedef unsigned short PKT_ptr_ptr; 57typedef u16 RUP_ptr;
58typedef unsigned short Q_BUF_ptr; 58typedef u16 short_ptr;
59typedef unsigned short Q_BUF_ptr_ptr; 59typedef u16 u_short_ptr;
60typedef unsigned short ROUTE_STR_ptr; 60typedef u16 ushort_ptr;
61typedef unsigned short RUP_ptr;
62typedef unsigned short short_ptr;
63typedef unsigned short u_short_ptr;
64typedef unsigned short ushort_ptr;
65 61
66#endif /* __riotypes__ */ 62#endif /* __riotypes__ */
67 63
diff --git a/drivers/char/rio/rup.h b/drivers/char/rio/rup.h
index f74f67c6f702..40c617436bd1 100644
--- a/drivers/char/rio/rup.h
+++ b/drivers/char/rio/rup.h
@@ -37,14 +37,7 @@
37#ifndef _rup_h 37#ifndef _rup_h
38#define _rup_h 1 38#define _rup_h 1
39 39
40#ifdef SCCS_LABELS
41#ifndef lint
42/* static char *_rio_rup_h_sccs = "@(#)rup.h 1.5"; */
43#endif
44#endif
45
46#define MAX_RUP ((short) 16) 40#define MAX_RUP ((short) 16)
47
48#define PKTS_PER_RUP ((short) 2) /* They are always used in pairs */ 41#define PKTS_PER_RUP ((short) 2) /* They are always used in pairs */
49 42
50/************************************************* 43/*************************************************
@@ -62,13 +55,13 @@
62struct RUP { 55struct RUP {
63 PKT_ptr txpkt; /* Outgoing packet */ 56 PKT_ptr txpkt; /* Outgoing packet */
64 PKT_ptr rxpkt; /* Incoming packet */ 57 PKT_ptr rxpkt; /* Incoming packet */
65 WORD link; /* Which link to send down? */ 58 u16 link; /* Which link to send down? */
66 BYTE rup_dest_unit[2]; /* Destination unit */ 59 u8 rup_dest_unit[2]; /* Destination unit */
67 WORD handshake; /* For handshaking */ 60 u16 handshake; /* For handshaking */
68 WORD timeout; /* Timeout */ 61 u16 timeout; /* Timeout */
69 WORD status; /* Status */ 62 u16 status; /* Status */
70 WORD txcontrol; /* Transmit control */ 63 u16 txcontrol; /* Transmit control */
71 WORD rxcontrol; /* Receive control */ 64 u16 rxcontrol; /* Receive control */
72}; 65};
73 66
74#endif 67#endif
diff --git a/drivers/char/rio/typdef.h b/drivers/char/rio/typdef.h
index 185b889e1510..840c2498a59d 100644
--- a/drivers/char/rio/typdef.h
+++ b/drivers/char/rio/typdef.h
@@ -33,23 +33,16 @@
33#ifndef __rio_typdef_h__ 33#ifndef __rio_typdef_h__
34#define __rio_typdef_h__ 34#define __rio_typdef_h__
35 35
36#ifdef SCCS_LABELS
37static char *_typdef_h_sccs_ = "@(#)typdef.h 1.2";
38#endif
39
40#undef VPIX
41
42/* 36/*
43** IT IS REALLY, REALLY, IMPORTANT THAT BYTES ARE UNSIGNED! 37** IT IS REALLY, REALLY, IMPORTANT THAT BYTES ARE UNSIGNED!
44** 38**
45** These types are ONLY to be used for refering to data structures 39** These types are ONLY to be used for refering to data structures
46** on the RIO Host card! 40** on the RIO Host card!
47*/ 41*/
48typedef volatile unsigned char BYTE; 42typedef volatile u8 BYTE;
49typedef volatile unsigned short WORD; 43typedef volatile u16 WORD;
50typedef volatile unsigned int DWORD; 44typedef volatile u32 DWORD;
51typedef volatile unsigned short RIOP; 45typedef volatile u16 RIOP;
52typedef volatile short NUMBER;
53 46
54 47
55/* 48/*