1 /****************************************************************************
5 ****************************************************************************
7 Author : Ian Nandhra / Jeremy Rolls
11 * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
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.
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.
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.
31 ----------------------------------------------------------------------------
33 ----------------------------------------------------------------------------
35 ***************************************************************************/
42 /* static char *_rio_link_h_sccs = "@(#)link.h 1.15"; */
48 /*************************************************
49 * Define the Link Status stuff
50 ************************************************/
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)
57 #define TOP_OF_RTA_RAM ((ushort) 0x7000)
58 #define HOST_SERIAL_POINTER (unsigned char **) (TOP_OF_RTA_RAM - 2 * sizeof (ushort))
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
72 /* Boot request stuff */
73 #define BOOT_REQUEST ((ushort) 0) /* Request for a boot */
74 #define BOOT_ABORT ((ushort) 1) /* Abort a boot */
75 #define BOOT_SEQUENCE ((ushort) 2) /* Packet with the number of packets
77 #define BOOT_COMPLETED ((ushort) 3) /* Boot completed */
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 */
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 */
93 #define LINK_INTERCONNECT ((ushort) 20) /* Subnets interconnected */
95 #define LINK_SPARE ((ushort) 40)
98 ** Set the default timeout for link communications.
100 #define LINKTIMEOUT (400 * MILLISECOND)
105 #define LED_SET_COLOUR(colour)
106 #define LED_OR_COLOUR(colour)
107 #define LED_TIMEOUT(time)
110 WORD link_number
; /* Link Number */
111 Channel_ptr in_ch
; /* Link In Channel */
112 Channel_ptr out_ch
; /* Link Out Channel */
113 BYTE attached_serial
[4]; /* Attached serial number */
114 BYTE attached_host_serial
[4];
115 /* Serial number of Host who
116 booted the other end */
117 WORD descheduled
; /* Currently Descheduled */
118 WORD state
; /* Current state */
119 WORD send_poll
; /* Send a Poll Packet */
120 Process_ptr ltt_p
; /* Process Descriptor */
121 Process_ptr lrt_p
; /* Process Descriptor */
122 WORD lrt_status
; /* Current lrt status */
123 WORD ltt_status
; /* Current ltt status */
124 WORD timeout
; /* Timeout value */
125 WORD topology
; /* Topology bits */
128 WORD WaitNoBoot
; /* Secs to hold off booting */
129 PKT_ptr add_packet_list
; /* Add packets to here */
130 PKT_ptr remove_packet_list
; /* Send packets from here */
132 Channel_ptr lrt_fail_chan
; /* Lrt's failure channel */
133 Channel_ptr ltt_fail_chan
; /* Ltt's failure channel */
135 /* RUP structure for HOST to driver communications */
137 struct RUP link_rup
; /* RUP for the link (POLL,
139 WORD attached_link
; /* Number of attached link */
140 WORD csum_errors
; /* csum errors */
141 WORD num_disconnects
; /* number of disconnects */
142 WORD num_sync_rcvd
; /* # sync's received */
143 WORD num_sync_rqst
; /* # sync requests */
144 WORD num_tx
; /* Num pkts sent */
145 WORD num_rx
; /* Num pkts received */
146 WORD module_attached
; /* Module tpyes of attached */
147 WORD led_timeout
; /* LED timeout */
148 WORD first_port
; /* First port to service */
149 WORD last_port
; /* Last port to service */
154 /*********** end of file ***********/