[PATCH] Remove mesg.h from rio driver (unused file)
[safe/jmp/linux-2.6] / drivers / char / rio / riowinif.h
1 /************************************************************************/
2 /*                                                                      */
3 /*      Title           :       RIO Shared Memory Window Inteface       */
4 /*                                                                      */
5 /*      Author          :       N.P.Vassallo                            */
6 /*                                                                      */
7 /*      Creation        :       7th June 1999                           */
8 /*                                                                      */
9 /*      Version         :       1.0.0                                   */
10 /*                                                                      */
11 /*      Copyright       :       (c) Specialix International Ltd. 1999   *
12  *      This program is free software; you can redistribute it and/or modify
13  *      it under the terms of the GNU General Public License as published by
14  *      the Free Software Foundation; either version 2 of the License, or
15  *      (at your option) any later version.
16  *
17  *      This program is distributed in the hope that it will be useful,
18  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *      GNU General Public License for more details.
21  *
22  *      You should have received a copy of the GNU General Public License
23  *      along with this program; if not, write to the Free Software
24  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  *                                                                      */
26 /*      Description     :       Prototypes, structures and definitions  */
27 /*                              describing RIO host card shared memory  */
28 /*                              window interface structures:            */
29 /*                                      PARMMAP                         */
30 /*                                      RUP                             */
31 /*                                      PHB                             */
32 /*                                      LPB                             */
33 /*                                      PKT                             */
34 /*                                                                      */
35 /************************************************************************/
36
37 /* History...
38
39 1.0.0   07/06/99 NPV    Creation. (based on PARMMAP.H)
40
41 */
42
43 #ifndef _riowinif_h             /* If RIOWINDIF.H not already defined */
44 #define _riowinif_h    1
45
46 /*****************************************************************************
47 ********************************             *********************************
48 ********************************   General   *********************************
49 ********************************             *********************************
50 *****************************************************************************/
51
52 #define TPNULL          ((_u16)(0x8000))
53
54 /*****************************************************************************
55 ********************************              ********************************
56 ********************************   PARM_MAP   ********************************
57 ********************************              ********************************
58 *****************************************************************************/
59
60 /* The PARM_MAP structure defines global values relating to the Host Card / RTA
61    and is the main structure from which all other structures are referenced. */
62
63 typedef struct _PARM_MAP {
64         _u16 phb_ptr;           /* 0x00 Pointer to the PHB array */
65         _u16 phb_num_ptr;       /* 0x02 Ptr to Number of PHB's */
66         _u16 free_list;         /* 0x04 Free List pointer */
67         _u16 free_list_end;     /* 0x06 Free List End pointer */
68         _u16 q_free_list_ptr;   /* 0x08 Ptr to Q_BUF variable */
69         _u16 unit_id_ptr;       /* 0x0A Unit Id */
70         _u16 link_str_ptr;      /* 0x0C Link Structure Array */
71         _u16 bootloader_1;      /* 0x0E 1st Stage Boot Loader */
72         _u16 bootloader_2;      /* 0x10 2nd Stage Boot Loader */
73         _u16 port_route_map_ptr;        /* 0x12 Port Route Map */
74         _u16 route_ptr;         /* 0x14 Route Map */
75         _u16 map_present;       /* 0x16 Route Map present */
76         _u16 pkt_num;           /* 0x18 Total number of packets */
77         _u16 q_num;             /* 0x1A Total number of Q packets */
78         _u16 buffers_per_port;  /* 0x1C Number of buffers per port */
79         _u16 heap_size;         /* 0x1E Initial size of heap */
80         _u16 heap_left;         /* 0x20 Current Heap left */
81         _u16 error;             /* 0x22 Error code */
82         _u16 tx_max;            /* 0x24 Max number of tx pkts per phb */
83         _u16 rx_max;            /* 0x26 Max number of rx pkts per phb */
84         _u16 rx_limit;          /* 0x28 For high / low watermarks */
85         _u16 links;             /* 0x2A Links to use */
86         _u16 timer;             /* 0x2C Interrupts per second */
87         _u16 rups;              /* 0x2E Pointer to the RUPs */
88         _u16 max_phb;           /* 0x30 Mostly for debugging */
89         _u16 living;            /* 0x32 Just increments!! */
90         _u16 init_done;         /* 0x34 Initialisation over */
91         _u16 booting_link;      /* 0x36 */
92         _u16 idle_count;        /* 0x38 Idle time counter */
93         _u16 busy_count;        /* 0x3A Busy counter */
94         _u16 idle_control;      /* 0x3C Control Idle Process */
95         _u16 tx_intr;           /* 0x3E TX interrupt pending */
96         _u16 rx_intr;           /* 0x40 RX interrupt pending */
97         _u16 rup_intr;          /* 0x42 RUP interrupt pending */
98
99 } PARM_MAP;
100
101 /* Same thing again, but defined as offsets... */
102
103 #define PM_phb_ptr              0x00    /* 0x00 Pointer to the PHB array */
104 #define PM_phb_num_ptr          0x02    /* 0x02 Ptr to Number of PHB's */
105 #define PM_free_list            0x04    /* 0x04 Free List pointer */
106 #define PM_free_list_end        0x06    /* 0x06 Free List End pointer */
107 #define PM_q_free_list_ptr      0x08    /* 0x08 Ptr to Q_BUF variable */
108 #define PM_unit_id_ptr          0x0A    /* 0x0A Unit Id */
109 #define PM_link_str_ptr         0x0C    /* 0x0C Link Structure Array */
110 #define PM_bootloader_1         0x0E    /* 0x0E 1st Stage Boot Loader */
111 #define PM_bootloader_2         0x10    /* 0x10 2nd Stage Boot Loader */
112 #define PM_port_route_map_ptr   0x12    /* 0x12 Port Route Map */
113 #define PM_route_ptr            0x14    /* 0x14 Route Map */
114 #define PM_map_present          0x16    /* 0x16 Route Map present */
115 #define PM_pkt_num              0x18    /* 0x18 Total number of packets */
116 #define PM_q_num                0x1A    /* 0x1A Total number of Q packets */
117 #define PM_buffers_per_port     0x1C    /* 0x1C Number of buffers per port */
118 #define PM_heap_size            0x1E    /* 0x1E Initial size of heap */
119 #define PM_heap_left            0x20    /* 0x20 Current Heap left */
120 #define PM_error                0x22    /* 0x22 Error code */
121 #define PM_tx_max               0x24    /* 0x24 Max number of tx pkts per phb */
122 #define PM_rx_max               0x26    /* 0x26 Max number of rx pkts per phb */
123 #define PM_rx_limit             0x28    /* 0x28 For high / low watermarks */
124 #define PM_links                0x2A    /* 0x2A Links to use */
125 #define PM_timer                0x2C    /* 0x2C Interrupts per second */
126 #define PM_rups                 0x2E    /* 0x2E Pointer to the RUPs */
127 #define PM_max_phb              0x30    /* 0x30 Mostly for debugging */
128 #define PM_living               0x32    /* 0x32 Just increments!! */
129 #define PM_init_done            0x34    /* 0x34 Initialisation over */
130 #define PM_booting_link         0x36    /* 0x36 */
131 #define PM_idle_count           0x38    /* 0x38 Idle time counter */
132 #define PM_busy_count           0x3A    /* 0x3A Busy counter */
133 #define PM_idle_control         0x3C    /* 0x3C Control Idle Process */
134 #define PM_tx_intr              0x3E    /* 0x4E TX interrupt pending */
135 #define PM_rx_intr              0x40    /* 0x40 RX interrupt pending */
136 #define PM_rup_intr             0x42    /* 0x42 RUP interrupt pending */
137 #define sizeof_PARM_MAP         0x44    /* structure size = 0x44 */
138
139 /* PARM_MAP.error definitions... */
140 #define E_NO_ERROR              0x00
141 #define E_PROCESS_NOT_INIT      0x01
142 #define E_LINK_TIMEOUT          0x02
143 #define E_NO_ROUTE              0x03
144 #define E_CONFUSED              0x04
145 #define E_HOME                  0x05
146 #define E_CSUM_FAIL             0x06
147 #define E_DISCONNECTED          0x07
148 #define E_BAD_RUP               0x08
149 #define E_NO_VIRGIN             0x09
150 #define E_BOOT_RUP_BUSY         0x10
151 #define E_CHANALLOC             0x80
152 #define E_POLL_ALLOC            0x81
153 #define E_LTTWAKE               0x82
154 #define E_LTT_ALLOC             0x83
155 #define E_LRT_ALLOC             0x84
156 #define E_CIRRUS                0x85
157 #define E_MONITOR               0x86
158 #define E_PHB_ALLOC             0x87
159 #define E_ARRAY_ALLOC           0x88
160 #define E_QBUF_ALLOC            0x89
161 #define E_PKT_ALLOC             0x8a
162 #define E_GET_TX_Q_BUF          0x8b
163 #define E_GET_RX_Q_BUF          0x8c
164 #define E_MEM_OUT               0x8d
165 #define E_MMU_INIT              0x8e
166 #define E_LTT_INIT              0x8f
167 #define E_LRT_INIT              0x90
168 #define E_LINK_RUN              0x91
169 #define E_MONITOR_ALLOC         0x92
170 #define E_MONITOR_INIT          0x93
171 #define E_POLL_INIT             0x94
172
173 /* PARM_MAP.links definitions... */
174 #define RIO_LINK_ENABLE 0x80FF
175
176 /*****************************************************************************
177 **********************************         ***********************************
178 **********************************   RUP   ***********************************
179 **********************************         ***********************************
180 *****************************************************************************/
181
182 /* The RUP (Remote Unit Port) structure relates to the Remote Terminal Adapters
183    attached to the system and there is normally an array of MAX_RUPS (=16) structures
184    in a host card, defined by PARM_MAP->rup. */
185
186 typedef struct _RUP {
187         _u16 txpkt;             /* 0x00 Outgoing packet */
188         _u16 rxpkt;             /* 0x02 ncoming packet */
189         _u16 link;              /* 0x04 Which link to send packet down ? */
190         _u8 rup_dest_unit[2];   /* 0x06 Destination Unit */
191         _u16 handshake;         /* 0x08 Handshaking */
192         _u16 timeout;           /* 0x0A Timeout */
193         _u16 status;            /* 0x0C Status */
194         _u16 txcontrol;         /* 0x0E Transmit control */
195         _u16 rxcontrol;         /* 0x10 Receive control */
196
197 } RUP;
198
199 /* Same thing again, but defined as offsets... */
200
201 #define RUP_txpkt               0x00    /* 0x00 Outgoing packet */
202 #define RUP_rxpkt               0x02    /* 0x02 Incoming packet */
203 #define RUP_link                0x04    /* 0x04 Which link to send packet down ? */
204 #define RUP_rup_dest_unit       0x06    /* 0x06 Destination Unit */
205 #define RUP_handshake           0x08    /* 0x08 Handshaking */
206 #define RUP_timeout             0x0A    /* 0x0A Timeout */
207 #define RUP_status              0x0C    /* 0x0C Status */
208 #define RUP_txcontrol           0x0E    /* 0x0E Transmit control */
209 #define RUP_rxcontrol           0x10    /* 0x10 Receive control */
210 #define sizeof_RUP              0x12    /* structure size = 0x12 */
211
212 #define MAX_RUP                 16
213
214 /* RUP.txcontrol definitions... */
215 #define TX_RUP_INACTIVE         0       /* Nothing to transmit */
216 #define TX_PACKET_READY         1       /* Transmit packet ready */
217 #define TX_LOCK_RUP             2       /* Transmit side locked */
218
219 /* RUP.txcontrol definitions... */
220 #define RX_RUP_INACTIVE         0       /* Nothing received */
221 #define RX_PACKET_READY         1       /* Packet received */
222
223 #define RUP_NO_OWNER            0xFF    /* RUP not owned by any process */
224
225 /*****************************************************************************
226 **********************************         ***********************************
227 **********************************   PHB   ***********************************
228 **********************************         ***********************************
229 *****************************************************************************/
230
231 /* The PHB (Port Header Block) structure relates to the serial ports attached
232    to the system and there is normally an array of MAX_PHBS (=128) structures
233    in a host card, defined by PARM_MAP->phb_ptr and PARM_MAP->phb_num_ptr. */
234
235 typedef struct _PHB {
236         _u16 source;            /* 0x00 Location of the PHB in the host card */
237         _u16 handshake;         /* 0x02 Used to manage receive packet flow control */
238         _u16 status;            /* 0x04 Internal port transmit/receive status */
239         _u16 timeout;           /* 0x06 Time period to wait for an ACK */
240         _u16 link;              /* 0x08 The host link associated with the PHB */
241         _u16 destination;       /* 0x0A Location of the remote port on the network */
242
243         _u16 tx_start;          /* 0x0C first entry in the packet array for transmit packets */
244         _u16 tx_end;            /* 0x0E last entry in the packet array for transmit packets */
245         _u16 tx_add;            /* 0x10 position in the packet array for new transmit packets */
246         _u16 tx_remove;         /* 0x12 current position in the packet pointer array */
247
248         _u16 rx_start;          /* 0x14 first entry in the packet array for receive packets */
249         _u16 rx_end;            /* 0x16 last entry in the packet array for receive packets */
250         _u16 rx_add;            /* 0x18 position in the packet array for new receive packets */
251         _u16 rx_remove;         /* 0x1A current position in the packet pointer array */
252
253 } PHB;
254
255 /* Same thing again, but defined as offsets... */
256
257 #define PHB_source              0x00    /* 0x00 Location of the PHB in the host card */
258 #define PHB_handshake           0x02    /* 0x02 Used to manage receive packet flow control */
259 #define PHB_status              0x04    /* 0x04 Internal port transmit/receive status */
260 #define PHB_timeout             0x06    /* 0x06 Time period to wait for an ACK */
261 #define PHB_link                0x08    /* 0x08 The host link associated with the PHB */
262 #define PHB_destination         0x0A    /* 0x0A Location of the remote port on the network */
263 #define PHB_tx_start            0x0C    /* 0x0C first entry in the packet array for transmit packets */
264 #define PHB_tx_end              0x0E    /* 0x0E last entry in the packet array for transmit packets */
265 #define PHB_tx_add              0x10    /* 0x10 position in the packet array for new transmit packets */
266 #define PHB_tx_remove           0x12    /* 0x12 current position in the packet pointer array */
267 #define PHB_rx_start            0x14    /* 0x14 first entry in the packet array for receive packets */
268 #define PHB_rx_end              0x16    /* 0x16 last entry in the packet array for receive packets */
269 #define PHB_rx_add              0x18    /* 0x18 position in the packet array for new receive packets */
270 #define PHB_rx_remove           0x1A    /* 0x1A current position in the packet pointer array */
271 #define sizeof_PHB              0x1C    /* structure size = 0x1C */
272
273 /* PHB.handshake definitions... */
274 #define PHB_HANDSHAKE_SET       0x0001  /* Set by LRT */
275 #define PHB_HANDSHAKE_RESET     0x0002  /* Set by ISR / driver */
276 #define PHB_HANDSHAKE_FLAGS     (PHB_HANDSHAKE_RESET|PHB_HANDSHAKE_SET)
277                                                 /* Reset by ltt */
278
279 #define MAX_PHB                 128     /* range 0-127 */
280
281 /*****************************************************************************
282 **********************************         ***********************************
283 **********************************   LPB   ***********************************
284 **********************************         ***********************************
285 *****************************************************************************/
286
287 /* The LPB (Link Parameter Block) structure relates to a RIO Network Link
288    and there is normally an array of MAX_LINKS (=4) structures in a host card,
289    defined by PARM_MAP->link_str_ptr. */
290
291 typedef struct _LPB {
292         _u16 link_number;       /* 0x00 Link Number */
293         _u16 in_ch;             /* 0x02 Link In Channel */
294         _u16 out_ch;            /* 0x04 Link Out Channel */
295         _u8 attached_serial[4]; /* 0x06 Attached serial number */
296         _u8 attached_host_serial[4];    /* 0x0A Serial number of Host who booted other end */
297         _u16 descheduled;       /* 0x0E Currently Descheduled */
298         _u16 state;             /* 0x10 Current state */
299         _u16 send_poll;         /* 0x12 Send a Poll Packet */
300         _u16 ltt_p;             /* 0x14 Process Descriptor */
301         _u16 lrt_p;             /* 0x16 Process Descriptor */
302         _u16 lrt_status;        /* 0x18 Current lrt status */
303         _u16 ltt_status;        /* 0x1A Current ltt status */
304         _u16 timeout;           /* 0x1C Timeout value */
305         _u16 topology;          /* 0x1E Topology bits */
306         _u16 mon_ltt;           /* 0x20 */
307         _u16 mon_lrt;           /* 0x22 */
308         _u16 num_pkts;          /* 0x24 */
309         _u16 add_packet_list;   /* 0x26 Add packets to here */
310         _u16 remove_packet_list;        /* 0x28 Send packets from here */
311
312         _u16 lrt_fail_chan;     /* 0x2A Lrt's failure channel */
313         _u16 ltt_fail_chan;     /* 0x2C Ltt's failure channel */
314
315         RUP rup;                /* 0x2E RUP structure for HOST to driver comms */
316         RUP link_rup;           /* 0x40 RUP for the link (POLL, topology etc.) */
317         _u16 attached_link;     /* 0x52 Number of attached link */
318         _u16 csum_errors;       /* 0x54 csum errors */
319         _u16 num_disconnects;   /* 0x56 number of disconnects */
320         _u16 num_sync_rcvd;     /* 0x58 # sync's received */
321         _u16 num_sync_rqst;     /* 0x5A # sync requests */
322         _u16 num_tx;            /* 0x5C Num pkts sent */
323         _u16 num_rx;            /* 0x5E Num pkts received */
324         _u16 module_attached;   /* 0x60 Module tpyes of attached */
325         _u16 led_timeout;       /* 0x62 LED timeout */
326         _u16 first_port;        /* 0x64 First port to service */
327         _u16 last_port;         /* 0x66 Last port to service */
328
329 } LPB;
330
331 /* Same thing again, but defined as offsets... */
332
333 #define LPB_link_number         0x00    /* 0x00 Link Number */
334 #define LPB_in_ch               0x02    /* 0x02 Link In Channel */
335 #define LPB_out_ch              0x04    /* 0x04 Link Out Channel */
336 #define LPB_attached_serial     0x06    /* 0x06 Attached serial number */
337 #define LPB_attached_host_serial 0x0A   /* 0x0A Serial number of Host who booted other end */
338 #define LPB_descheduled         0x0E    /* 0x0E Currently Descheduled */
339 #define LPB_state               0x10    /* 0x10 Current state */
340 #define LPB_send_poll           0x12    /* 0x12 Send a Poll Packet */
341 #define LPB_ltt_p               0x14    /* 0x14 Process Descriptor */
342 #define LPB_lrt_p               0x16    /* 0x16 Process Descriptor */
343 #define LPB_lrt_status          0x18    /* 0x18 Current lrt status */
344 #define LPB_ltt_status          0x1A    /* 0x1A Current ltt status */
345 #define LPB_timeout             0x1C    /* 0x1C Timeout value */
346 #define LPB_topology            0x1E    /* 0x1E Topology bits */
347 #define LPB_mon_ltt             0x20    /* 0x20 */
348 #define LPB_mon_lrt             0x22    /* 0x22 */
349 #define LPB_num_pkts            0x24    /* 0x24 */
350 #define LPB_add_packet_list     0x26    /* 0x26 Add packets to here */
351 #define LPB_remove_packet_list  0x28    /* 0x28 Send packets from here */
352 #define LPB_lrt_fail_chan       0x2A    /* 0x2A Lrt's failure channel */
353 #define LPB_ltt_fail_chan       0x2C    /* 0x2C Ltt's failure channel */
354 #define LPB_rup                 0x2E    /* 0x2E RUP structure for HOST to driver comms */
355 #define LPB_link_rup            0x40    /* 0x40 RUP for the link (POLL, topology etc.) */
356 #define LPB_attached_link       0x52    /* 0x52 Number of attached link */
357 #define LPB_csum_errors         0x54    /* 0x54 csum errors */
358 #define LPB_num_disconnects     0x56    /* 0x56 number of disconnects */
359 #define LPB_num_sync_rcvd       0x58    /* 0x58 # sync's received */
360 #define LPB_num_sync_rqst       0x5A    /* 0x5A # sync requests */
361 #define LPB_num_tx              0x5C    /* 0x5C Num pkts sent */
362 #define LPB_num_rx              0x5E    /* 0x5E Num pkts received */
363 #define LPB_module_attached     0x60    /* 0x60 Module tpyes of attached */
364 #define LPB_led_timeout         0x62    /* 0x62 LED timeout */
365 #define LPB_first_port          0x64    /* 0x64 First port to service */
366 #define LPB_last_port           0x66    /* 0x66 Last port to service */
367 #define sizeof_LPB              0x68    /* structure size = 0x68 */
368
369 #define LINKS_PER_UNIT          4       /* number of links from a host */
370
371 /*****************************************************************************
372 ********************************               *******************************
373 ********************************   FREE_LIST   *******************************
374 ********************************               *******************************
375 *****************************************************************************/
376
377 /* Used to overlay packet headers when allocating/freeing packets from the free list */
378
379 typedef struct _FREE_LIST {
380         _u16 next;              /* 0x00 offset of next list item */
381         _u16 prev;              /* 0x02 offset of previous list item */
382
383 } FREE_LIST;
384
385 /* Same thing again, but defined as offsets... */
386
387 #define FL_next                 0x00    /* 0x00 offset of next list item */
388 #define FL_prev                 0x02    /* 0x02 offset of previous list item */
389
390 /*****************************************************************************
391 **********************************         ***********************************
392 **********************************   PKT   ***********************************
393 **********************************         ***********************************
394 *****************************************************************************/
395
396 /* The PKT is the main unit of communication between Host Cards and RTAs across
397    the RIO network.  */
398
399 #define PKT_MAX_DATA_LEN   72   /* Size of packet data */
400
401 typedef struct _PKT {
402         _u8 dest_unit;          /* 0x00 Destination Unit Id */
403         _u8 dest_port;          /* 0x01 Destination Port */
404         _u8 src_unit;           /* 0x02 Source Unit Id */
405         _u8 src_port;           /* 0x03 Source Port */
406         _u8 len;                /* 0x04 Length (in bytes) of data field */
407         _u8 control;            /* 0x05 */
408         _u8 data[PKT_MAX_DATA_LEN];     /* 0x06 Actual data */
409         _u16 csum;              /* 0x4E C-SUM */
410
411 } PKT;
412
413 /* Same thing again, but defined as offsets... */
414
415 #define PKT_dest_unit           0x00    /* 0x00 Destination Unit Id */
416 #define PKT_dest_port           0x01    /* 0x01 Destination Port */
417 #define PKT_src_unit            0x02    /* 0x02 Source Unit Id */
418 #define PKT_src_port            0x03    /* 0x03 Source Port */
419 #define PKT_len                 0x04    /* 0x04 Length (in bytes) of data field */
420 #define PKT_control             0x05    /* 0x05 */
421 #define PKT_data                0x06    /* 0x06 Actual data */
422 #define PKT_csum                0x4E    /* 0x4E C-SUM */
423 #define sizeof_PKT              0x50    /* structure size = 0x50 */
424
425 /* PKT.len definitions... */
426 #define PKT_CMD_BIT             0x80
427 #define PKT_CMD_DATA            0x80
428 #define PKT_LEN_MASK            0x7F
429
430 /* PKT.control definitions... */
431 #define PKT_ACK                 0x40
432 #define PKT_TGL                 0x20
433 #define DATA_WNDW               0x10
434 #define PKT_TTL_MASK            0x0F
435 #define MAX_TTL                 0x0F
436
437 /*****************************************************************************
438 *****************************                     ****************************
439 *****************************   Control Packets   ****************************
440 *****************************                     ****************************
441 *****************************************************************************/
442
443 /* The following definitions and structures define the control packets sent
444    between the driver and RIO Ports, RTAs and Host Cards. */
445
446 #define PRE_EMPTIVE             0x80    /* Pre-emptive command (sent via port's RUP) */
447
448 /* "in-band" and "pre-emptive" port commands... */
449 #define OPEN                    0x00    /* Driver->RIO Open a port */
450 #define CONFIG                  0x01    /* Driver->RIO Configure a port */
451 #define MOPEN                   0x02    /* Driver->RIO Modem open (wait for DCD) */
452 #define CLOSE                   0x03    /* Driver->RIO Close a port */
453 #define WFLUSH                  (0x04|PRE_EMPTIVE)      /* Driver->RIO Write flush */
454 #define RFLUSH                  (0x05|PRE_EMPTIVE)      /* Driver->RIO Read flush */
455 #define RESUME                  (0x06|PRE_EMPTIVE)      /* Driver->RIO Behave as if XON received */
456 #define SBREAK                  0x07    /* Driver->RIO Start break */
457 #define EBREAK                  0x08    /* Driver->RIO End break */
458 #define SUSPEND                 (0x09|PRE_EMPTIVE)      /* Driver->RIO Behave as if XOFF received */
459 #define FCLOSE                  (0x0A|PRE_EMPTIVE)      /* Driver->RIO Force close */
460 #define XPRINT                  0x0B    /* Driver->RIO Xprint packet */
461 #define MBIS                    (0x0C|PRE_EMPTIVE)      /* Driver->RIO Set modem lines */
462 #define MBIC                    (0x0D|PRE_EMPTIVE)      /* Driver->RIO Clear modem lines */
463 #define MSET                    (0x0E|PRE_EMPTIVE)      /* Driver->RIO Set modem lines */
464 #define PCLOSE                  0x0F    /* Driver->RIO Pseudo close */
465 #define MGET                    (0x10|PRE_EMPTIVE)      /* Driver->RIO Force update of modem status */
466 #define MEMDUMP                 (0x11|PRE_EMPTIVE)      /* Driver->RIO DEBUG request for RTA memory */
467 #define READ_REGISTER           (0x12|PRE_EMPTIVE)      /* Driver->RIO DEBUG read CD1400 register */
468
469 /* Remote Unit Port (RUP) packet definitions... (specified in PKT.dest_unit and PKT.src_unit) */
470 #define SYNC_RUP                0xFF    /* Download internal */
471 #define COMMAND_RUP             0xFE    /* Command ack/status */
472 #define ERROR_RUP               0xFD    /* Download internal */
473 #define POLL_RUP                0xFC    /* Download internal */
474 #define BOOT_RUP                0xFB    /* Used to boot RTAs */
475 #define ROUTE_RUP               0xFA    /* Used to specify routing/topology */
476 #define STATUS_RUP              0xF9    /* Not used */
477 #define POWER_RUP               0xF8    /* Download internal */
478
479 /* COMMAND_RUP definitions... */
480 #define COMPLETE                (0x20|PRE_EMPTIVE)      /* RIO->Driver Command complete */
481 #define BREAK_RECEIVED          (0x21|PRE_EMPTIVE)      /* RIO->Driver Break received */
482 #define MODEM_STATUS            (0x22|PRE_EMPTIVE)      /* RIO->Driver Modem status change */
483
484 /* BOOT_RUP definitions... */
485 #define BOOT_REQUEST            0x00    /* RIO->Driver Request for boot */
486 #define BOOT_ABORT              0x01    /* Driver->RIO Abort a boot */
487 #define BOOT_SEQUENCE           0x02    /* Driver->RIO Packet with firmware details */
488 #define BOOT_COMPLETED          0x03    /* RIO->Driver Boot completed */
489 #define IFOAD                   0x2F    /* Driver->RIO Shutdown/Reboot RTA (Fall Over And Die) */
490 #define IDENTIFY                0x30    /* Driver->RIO Identify RTA */
491 #define ZOMBIE                  0x31    /* Driver->RIO Shutdown/Flash LEDs */
492 #define UFOAD                   0x32    /* Driver->RIO Shutdown/Reboot neighbouring RTA */
493 #define IWAIT                   0x33    /* Driver->RIO Pause booting process */
494
495 /* ROUTE_RUP definitions... */
496 #define ROUTE_REQUEST           0x00    /* RIO->Driver Request an ID */
497 #define ROUTE_FOAD              0x01    /* Driver->RIO Shutdown/reboot RTA */
498 #define ROUTE_ALREADY           0x02    /* Driver->RIO Not used */
499 #define ROUTE_USED              0x03    /* Driver->RIO Not used */
500 #define ROUTE_ALLOCATE          0x04    /* Driver->RIO Allocate RTA RUP numbers */
501 #define ROUTE_REQ_TOP           0x05    /* Driver->RIO Not used */
502 #define ROUTE_TOPOLOGY          0x06    /* RIO->Driver Route/Topology status */
503
504 /*****************************************************************************
505 **********************************          **********************************
506 **********************************   OPEN   **********************************
507 **********************************          **********************************
508 *****************************************************************************/
509
510 /* (Driver->RIO,in-band)
511
512    Sent to open a port. 
513    Structure of configuration info used with OPEN, CONFIG and MOPEN packets... */
514
515 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
516 #define PKT_Cor1                (PKT_Data+1)    /* Channel Option Register 1 */
517 #define PKT_Cor2                (PKT_Data+2)    /* Channel Option Register 2 */
518 #define PKT_Cor4                (PKT_Data+3)    /* Channel Option Register 4 */
519 #define PKT_Cor5                (PKT_Data+4)    /* Channel Option Register 5 */
520 #define PKT_TxXon               (PKT_Data+5)    /* Transmit XON character */
521 #define PKT_TxXoff              (PKT_Data+6)    /* Transmit XOFF character */
522 #define PKT_RxXon               (PKT_Data+7)    /* Receive XON character */
523 #define PKT_RxXoff              (PKT_Data+8)    /* Receive XOFF character */
524 #define PKT_Lnext               (PKT_Data+9)    /* Lnext character */
525 #define PKT_TxBaud              (PKT_Data+10)   /* Transmit baud rate */
526 #define PKT_RxBaud              (PKT_Data+11)   /* Receive baud rate */
527
528 /* COR1 definitions... */
529 #define COR1_PARITY             0xE0    /* Parity mask */
530 #define COR1_NONE               0x00    /* No parity */
531 #define COR1_SPACE              0x20    /* Space parity */
532 #define COR1_EVEN               0x40    /* Even parity */
533 #define COR1_MARK               0xA0    /* Mark parity */
534 #define COR1_ODD                0xC0    /* Odd parity */
535
536 #define COR1_STOPBITS           0x0C    /* Stop bits mask */
537 #define COR1_STOP1              0x00    /* 1 stop bit */
538 #define COR1_STOP1_5            0x04    /* 1.5 stop bits */
539 #define COR1_STOP2              0x08    /* 2 stop bits */
540
541 #define COR1_DATABITS           0x03    /* Data bits mask */
542 #define COR1_DATA5              0x00    /* 5 data bits */
543 #define COR1_DATA6              0x01    /* 6 data bits */
544 #define COR1_DATA7              0x02    /* 7 data bits */
545 #define COR1_DATA8              0x03    /* 8 data bits */
546
547 /* COR2 definitions... */
548 #define COR2_XON_TXFLOW         0x40    /* XON/XOFF Transmit Flow */
549 #define COR2_XANY_TXFLOW        0xC0    /* XON/XANY Transmit Flow */
550 #define COR2_HUPCL              0x20    /* Hang Up On Close */
551 #define COR2_DSR_TXFLOW         0x08    /* DSR Transmit Flow Control */
552 #define COR2_RTS_RXFLOW         0x04    /* RTS Receive Flow Control */
553 #define COR2_CTS_TXFLOW         0x02    /* CTS Transmit Flow Control */
554 #define COR2_XON_RXFLOW         0x01    /* XON/XOFF Receive Flow */
555
556 /* COR4 definition... */
557 #define COR4_IGNCR              0x80    /* Discard received CR */
558 #define COR4_ICRNL              0x40    /* Map received CR -> NL */
559 #define COR4_INLCR              0x20    /* Map received NL -> CR */
560 #define COR4_IGNBRK             0x10    /* Ignore Received Break */
561 #define COR4_NBRKINT            0x08    /* No interrupt on rx Break */
562 #define COR4_IGNPAR             0x04    /* ignore rx parity error chars */
563 #define COR4_PARMRK             0x02    /* Mark rx parity error chars */
564 #define COR4_RAISEMOD           0x01    /* Raise modem lines on !0 baud */
565
566 /* COR5 definitions... */
567 #define COR5_ISTRIP             0x80    /* Strip input chars to 7 bits */
568 #define COR5_LNE                0x40    /* Enable LNEXT processing */
569 #define COR5_CMOE               0x20    /* Match good & error characters */
570 #define COR5_TAB3               0x10    /* TAB3 mode */
571 #define COR5_TSTATE_ON          0x08    /* Enable tbusy/tstop monitoring */
572 #define COR5_TSTATE_OFF         0x04    /* Disable tbusy/tstop monitoring */
573 #define COR5_ONLCR              0x02    /* NL -> CR NL on output */
574 #define COR5_OCRNL              0x01    /* CR -> NL on output */
575
576 /* RxBaud and TxBaud definitions... */
577 #define RIO_B0                  0x00    /* RTS / DTR signals dropped */
578 #define RIO_B50                 0x01    /* 50 baud */
579 #define RIO_B75                 0x02    /* 75 baud */
580 #define RIO_B110                0x03    /* 110 baud */
581 #define RIO_B134                0x04    /* 134.5 baud */
582 #define RIO_B150                0x05    /* 150 baud */
583 #define RIO_B200                0x06    /* 200 baud */
584 #define RIO_B300                0x07    /* 300 baud */
585 #define RIO_B600                0x08    /* 600 baud */
586 #define RIO_B1200               0x09    /* 1200 baud */
587 #define RIO_B1800               0x0A    /* 1800 baud */
588 #define RIO_B2400               0x0B    /* 2400 baud */
589 #define RIO_B4800               0x0C    /* 4800 baud */
590 #define RIO_B9600               0x0D    /* 9600 baud */
591 #define RIO_B19200              0x0E    /* 19200 baud */
592 #define RIO_B38400              0x0F    /* 38400 baud */
593 #define RIO_B56000              0x10    /* 56000 baud */
594 #define RIO_B57600              0x11    /* 57600 baud */
595 #define RIO_B64000              0x12    /* 64000 baud */
596 #define RIO_B115200             0x13    /* 115200 baud */
597 #define RIO_B2000               0x14    /* 2000 baud */
598
599 /*****************************************************************************
600 *********************************            *********************************
601 *********************************   CONFIG   *********************************
602 *********************************            *********************************
603 *****************************************************************************/
604
605 /* (Driver->RIO,in-band)
606
607    CONFIG is sent from the driver to configure an already opened port.
608    Packet structure is same as OPEN.  */
609
610 /*****************************************************************************
611 *********************************           **********************************
612 *********************************   MOPEN   **********************************
613 *********************************           **********************************
614 *****************************************************************************/
615
616 /* (Driver->RIO,in-band)
617
618    MOPEN is sent from the driver to open a port attached to a modem. (in-band)
619    Packet structure is same as OPEN.  */
620
621 /*****************************************************************************
622 *********************************           **********************************
623 *********************************   CLOSE   **********************************
624 *********************************           **********************************
625 *****************************************************************************/
626
627 /* (Driver->RIO,in-band)
628
629    CLOSE is sent from the driver to close a previously opened port.
630    No parameters.
631  */
632 #if 0
633 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
634 #endif
635 /*****************************************************************************
636 *********************************            *********************************
637 *********************************   WFLUSH   *********************************
638 *********************************            *********************************
639 *****************************************************************************/
640
641 /* (Driver->RIO,pre-emptive)
642
643    WFLUSH is sent pre-emptively from the driver to flush the write buffers and
644    packets of a port.  (pre-emptive)
645    
646    WFLUSH is also sent in-band from the driver to a port as a marker to end
647    write flushing previously started by a pre-emptive WFLUSH packet. (in-band)
648    */
649 #if 0
650 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
651 #endif
652 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
653
654 /*****************************************************************************
655 *********************************            *********************************
656 *********************************   RFLUSH   *********************************
657 *********************************            *********************************
658 *****************************************************************************/
659
660 /* (Driver->RIO,pre-emptive)
661
662    RFLUSH is sent pre-emptively from the driver to flush the read buffers and
663    packets of a port.
664    */
665 #if 0
666 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
667 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
668 #endif
669
670 /*****************************************************************************
671 *********************************            *********************************
672 *********************************   RESUME   *********************************
673 *********************************            *********************************
674 *****************************************************************************/
675
676 /* (Driver->RIO,pre-emptive)
677
678    RESUME is sent pre-emptively from the driver to cause a port to resume 
679    transmission of data if blocked by XOFF.  (as if XON had been received)
680    */
681 #if 0
682 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
683 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
684 #endif
685
686 /*****************************************************************************
687 *********************************            *********************************
688 *********************************   SBREAK   *********************************
689 *********************************            *********************************
690 *****************************************************************************/
691
692 /* (Driver->RIO,in-band)
693
694    SBREAK is sent in-band from the driver to a port to suspend data and start
695    break signal transmission.
696
697    If the break delay is 0, the break signal will be acknowledged with a
698    RUP_COMMAND, COMPLETE packet and continue until an EBREAK packet is received.
699
700    Otherwise, there is no acknowledgement and the break signal will last for the
701    specified number of mS.
702    */
703 #if 0
704 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
705 #endif
706 #define PKT_BreakDelay          (PKT_Data+1)    /* Break delay in mS */
707
708 /*****************************************************************************
709 *********************************            *********************************
710 *********************************   EBREAK   *********************************
711 *********************************            *********************************
712 *****************************************************************************/
713
714 /* (Driver->RIO,in-band)
715
716    EBREAK is sent in-band from the driver to a port to stop transmission of a
717    break signal.
718
719    No parameters.  */
720
721 /*****************************************************************************
722 *********************************             ********************************
723 *********************************   SUSPEND   ********************************
724 *********************************             ********************************
725 *****************************************************************************/
726
727 /* (Driver->RIO,pre-emptive)
728
729    SUSPEND is sent pre-emptively from the driver to cause a port to suspend
730    transmission of data.  (as if XOFF had been received)
731    */
732 #if 0
733 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
734 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
735 #endif
736
737 /*****************************************************************************
738 *********************************            *********************************
739 *********************************   FCLOSE   *********************************
740 *********************************            *********************************
741 *****************************************************************************/
742
743 /* (Driver->RIO,pre-emptive)
744
745    FCLOSE is sent pre-emptively from the driver to force close a port.
746    A force close flushes receive and transmit queues, and also lowers all output
747    modem signals if the COR5_HUPCL (Hang Up On Close) flag is set.
748    */
749 #if 0
750 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
751 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
752 #endif
753
754 /*****************************************************************************
755 *********************************            *********************************
756 *********************************   XPRINT   *********************************
757 *********************************            *********************************
758 *****************************************************************************/
759
760 /* (Driver->RIO,in-band)
761
762    XPRINT is sent as a normal I/O data packet except that the PKT_CMD_BIT of
763    the "len" field is set, and the first "data" byte is XPRINT.
764
765    The I/O data in the XPRINT packet will contain the following:
766    -    Transparent Print Start Sequence
767    -    Transparent Print Data
768    -    Transparent Print Stop Sequence.
769    */
770 #if 0
771 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
772 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
773 #endif
774
775 /*****************************************************************************
776 **********************************          **********************************
777 **********************************   MBIS   **********************************
778 **********************************          **********************************
779 *****************************************************************************/
780
781 /* (Driver->RIO,pre-emptive)
782
783    MBIS is sent pre-emptively from the driver to set a port's modem signals.
784    */
785 #if 0
786 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
787 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
788 #endif
789 #define PKT_ModemSet            (PKT_Data+4)    /* Modem set signals mask */
790
791 /* ModemSet definitions... */
792 #define MBIS_RTS                0x01    /* RTS modem signal */
793 #define MBIS_DTR                0x02    /* DTR modem signal */
794
795 /*****************************************************************************
796 **********************************          **********************************
797 **********************************   MBIC   **********************************
798 **********************************          **********************************
799 *****************************************************************************/
800
801 /* (Driver->RIO,pre-emptive)
802
803    MBIC is sent pre-emptively from the driver to clear a port's modem signals.
804    */
805 #if 0
806 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
807 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
808 #endif
809
810 #define PKT_ModemClear          (PKT_Data+4)    /* Modem clear signals mask */
811
812 /* ModemClear definitions... */
813 #define MBIC_RTS                0x01    /* RTS modem signal */
814 #define MBIC_DTR                0x02    /* DTR modem signal */
815
816 /*****************************************************************************
817 **********************************          **********************************
818 **********************************   MSET   **********************************
819 **********************************          **********************************
820 *****************************************************************************/
821
822 /* (Driver->RIO,pre-emptive)
823
824    MSET is sent pre-emptively from the driver to set/clear a port's modem signals. */
825 #if 0
826 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
827 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
828 #endif
829
830 #define PKT_ModemSet            (PKT_Data+4)    /* Modem set signals mask */
831
832 /* ModemSet definitions... */
833 #define MSET_RTS                0x01    /* RTS modem signal */
834 #define MSET_DTR                0x02    /* DTR modem signal */
835
836 /*****************************************************************************
837 *********************************            *********************************
838 *********************************   PCLOSE   *********************************
839 *********************************            *********************************
840 *****************************************************************************/
841
842 /* (Driver->RIO,in-band)
843
844    PCLOSE is sent from the driver to pseudo close a previously opened port.
845    
846    The port will close when all data has been sent/received, however, the
847    port's transmit / receive and modem signals will be left enabled and the
848    port marked internally as Pseudo Closed. */
849
850 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
851
852 /*****************************************************************************
853 **********************************          **********************************
854 **********************************   MGET   **********************************
855 **********************************          **********************************
856 *****************************************************************************/
857
858 /* (Driver->RIO,pre-emptive)
859
860    MGET is sent pre-emptively from the driver to request the port's current modem signals. */
861
862 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
863 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
864
865 /*****************************************************************************
866 *********************************             ********************************
867 *********************************   MEMDUMP   ********************************
868 *********************************             ********************************
869 *****************************************************************************/
870
871 /* (Driver->RIO,pre-emptive)
872
873    MEMDUMP is sent pre-emptively from the driver to request a dump of 32 bytes
874    of the specified port's RTA address space.
875    */
876 #if 0
877 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
878 #endif
879 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
880 #define PKT_SubCmd              (PKT_Data+5)    /* Sub Command */
881 #define PKT_Address             (PKT_Data+6)    /* Requested address */
882
883 /*****************************************************************************
884 ******************************                   *****************************
885 ******************************   READ_REGISTER   *****************************
886 ******************************                   *****************************
887 *****************************************************************************/
888
889 /* (Driver->RIO,pre-emptive)
890
891    READ_REGISTER is sent pre-emptively from the driver to request the contents
892    of the CD1400 register specified in address.
893    */
894 #if 0
895 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
896 #endif
897 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
898 #define PKT_SubCmd              (PKT_Data+5)    /* Sub Command */
899 #define PKT_Address             (PKT_Data+6)    /* Requested address */
900
901 /*****************************************************************************
902 ************************                            **************************
903 ************************   COMMAND_RUP - COMPLETE   **************************
904 ************************                            **************************
905 *****************************************************************************/
906
907 /* (RIO->Driver,pre-emptive)
908
909    COMMAND_RUP - COMPLETE is sent in response to all port I/O control command
910    packets, except MEMDUMP and READ_REGISTER.
911    */
912 #if 0
913 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
914 #endif
915 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
916 #define PKT_Cmd2                (PKT_Data+2)    /* Command code copy */
917 #define PKT_ModemStatus         (PKT_Data+3)    /* Modem signal status */
918 #define PKT_PortStatus          (PKT_Data+4)    /* Port signal status */
919 #define PKT_SubCmd              (PKT_Data+5)    /* Sub Command */
920
921 /* ModemStatus definitions... */
922 #define MODEM_DSR               0x80    /* Data Set Ready modem state */
923 #define MODEM_CTS               0x40    /* Clear To Send modem state */
924 #define MODEM_RI                0x20    /* Ring Indicate modem state */
925 #define MODEM_CD                0x10    /* Carrier Detect modem state */
926 #define MODEM_TSTOP             0x08    /* Transmit Stopped state */
927 #define MODEM_TEMPTY            0x04    /* Transmit Empty state */
928 #define MODEM_DTR               0x02    /* DTR modem output state */
929 #define MODEM_RTS               0x01    /* RTS modem output state */
930
931 /* PortStatus definitions... */
932 #define PORT_ISOPEN             0x01    /* Port open ? */
933 #define PORT_HUPCL              0x02    /* Hangup on close? */
934 #define PORT_MOPENPEND          0x04    /* Modem open pending */
935 #define PORT_ISPARALLEL         0x08    /* Parallel port */
936 #define PORT_BREAK              0x10    /* Port on break */
937 #define PORT_STATUSPEND         0020    /* Status packet pending */
938 #define PORT_BREAKPEND          0x40    /* Break packet pending */
939 #define PORT_MODEMPEND          0x80    /* Modem status packet pending */
940
941 /*****************************************************************************
942 ************************                            **************************
943 ************************   COMMAND_RUP - COMPLETE   **************************
944 ************************                            **************************
945 *****************************************************************************/
946
947 /* (RIO->Driver,pre-emptive)
948
949    COMMAND_RUP - COMPLETE is sent in response to all port I/O control command
950    packets, except MEMDUMP and READ_REGISTER.
951    */
952 #if 0
953 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
954 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
955 #define PKT_Cmd2                (PKT_Data+2)    /* Command code copy */
956 #endif
957 #define PKT_ModemStatus         (PKT_Data+3)    /* Modem signal status */
958 #define PKT_PortStatus          (PKT_Data+4)    /* Port signal status */
959 #if 0
960 #define PKT_SubCmd              (PKT_Data+5)    /* Sub Command */
961 #endif
962
963 /* ModemStatus definitions... */
964 #define MODEM_DSR               0x80    /* Data Set Ready modem state */
965 #define MODEM_CTS               0x40    /* Clear To Send modem state */
966 #define MODEM_RI                0x20    /* Ring Indicate modem state */
967 #define MODEM_CD                0x10    /* Carrier Detect modem state */
968 #define MODEM_TSTOP             0x08    /* Transmit Stopped state */
969 #define MODEM_TEMPTY            0x04    /* Transmit Empty state */
970 #define MODEM_DTR               0x02    /* DTR modem output state */
971 #define MODEM_RTS               0x01    /* RTS modem output state */
972
973 /* PortStatus definitions... */
974 #define PORT_ISOPEN             0x01    /* Port open ? */
975 #define PORT_HUPCL              0x02    /* Hangup on close? */
976 #define PORT_MOPENPEND          0x04    /* Modem open pending */
977 #define PORT_ISPARALLEL         0x08    /* Parallel port */
978 #define PORT_BREAK              0x10    /* Port on break */
979 #define PORT_STATUSPEND         0020    /* Status packet pending */
980 #define PORT_BREAKPEND          0x40    /* Break packet pending */
981 #define PORT_MODEMPEND          0x80    /* Modem status packet pending */
982
983 /*****************************************************************************
984 ********************                                      ********************
985 ********************   COMMAND_RUP - COMPLETE - MEMDUMP   ********************
986 ********************                                      ********************
987 *****************************************************************************/
988
989 /* (RIO->Driver,pre-emptive)
990
991    COMMAND_RUP - COMPLETE - MEMDUMP is sent as an acknowledgement for a MEMDUMP
992    port I/O control command packet.
993    */
994 #if 0
995 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
996 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
997 #define PKT_Cmd2                (PKT_Data+2)    /* Command code copy */
998 #define PKT_ModemStatus         (PKT_Data+3)    /* Modem signal status */
999 #define PKT_PortStatus          (PKT_Data+4)    /* Port signal status */
1000 #define PKT_SubCmd              (PKT_Data+5)    /* Sub Command */
1001 #define PKT_Address             (PKT_Data+6)    /* Requested address */
1002 #endif
1003 #define PKT_Dump                (PKT_Data+8)    /* 32bytes of requested dump data */
1004
1005 /*****************************************************************************
1006 *****************                                            *****************
1007 *****************   COMMAND_RUP - COMPLETE - READ_REGISTER   *****************
1008 *****************                                            *****************
1009 *****************************************************************************/
1010
1011 /* (RIO->Driver,pre-emptive)
1012
1013    COMMAND_RUP - COMPLETE - READ_REGISTER is sent as an acknowledgement for a
1014    READ_REGISTER port I/O control command packet.
1015    */
1016 #if 0
1017 #define PKT_Cmd                 (PKT_Data+0)    /*Command code */
1018 #define PKT_PhbNum              (PKT_Data+1)    /*Port number wrt RTA */
1019 #define PKT_Cmd2                (PKT_Data+2)    /* Command code copy */
1020 #endif
1021 #define PKT_RegisterValue       (PKT_Data+3)    /* Modem signal status */
1022 #if 0
1023 #define PKT_PortStatus          (PKT_Data+4)    /* Port signal status */
1024 #define PKT_SubCmd              (PKT_Data+5)    /* Sub Command */
1025 #endif
1026
1027 /*****************************************************************************
1028 *********************                                  ***********************
1029 *********************   COMMAND_RUP - BREAK_RECEIVED   ***********************
1030 *********************                                  ***********************
1031 *****************************************************************************/
1032
1033 /* (RIO->Driver,pre-emptive)
1034
1035    COMMAND_RUP - BREAK_RECEIVED packets are sent when the port detects a receive BREAK signal.
1036    */
1037 #if 0
1038 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1039 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
1040 #define PKT_Cmd2                (PKT_Data+2)    /* Command code copy */
1041 #endif
1042
1043 /*****************************************************************************
1044 *********************                                *************************
1045 *********************   COMMAND_RUP - MODEM_STATUS   *************************
1046 *********************                                *************************
1047 *****************************************************************************/
1048
1049 /* (RIO->Driver,pre-emptive)
1050
1051    COMMAND_RUP - MODEM_STATUS packets are sent whenever the port detects a
1052    change in the input modem signal states.
1053
1054    */
1055 #if 0
1056 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1057 #define PKT_PhbNum              (PKT_Data+1)    /* Port number wrt RTA */
1058 #define PKT_Cmd2                (PKT_Data+2)    /* Command code copy */
1059 #define PKT_ModemStatus         (PKT_Data+3)    /* Modem signal status */
1060 #endif
1061
1062 /*****************************************************************************
1063 ************************                             *************************
1064 ************************   BOOT_RUP - BOOT_REQUEST   *************************
1065 ************************                             *************************
1066 *****************************************************************************/
1067
1068 /* (RIO->Driver,pre-emptive)
1069
1070    BOOT_RUP - BOOT_REQUEST packets are sent to the Driver from RIO to request
1071    firmware code to load onto attached RTAs.
1072    */
1073 #if 0
1074 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1075 #endif
1076
1077 /*****************************************************************************
1078 ************************                              ************************
1079 ************************   BOOT_RUP - BOOT_SEQUENCE   ************************
1080 ************************                              ************************
1081 *****************************************************************************/
1082
1083 /* (Driver->RIO,pre-emptive)
1084
1085    BOOT_RUP - BOOT_SEQUENCE packets are sent from the Driver to RIO in response
1086    to a BOOT_RUP - BOOT_REQUEST packet.
1087    */
1088 #if 0
1089 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1090 #endif
1091 #define PKT_NumPackets          (PKT_Data+2)    /* Packets required to load firmware */
1092 #define PKT_LoadBase            (PKT_Data+4)    /* RTA firmware load address */
1093 #define PKT_CodeSize            (PKT_Data+6)    /* Size of firmware in bytes */
1094 #define PKT_CmdString           (PKT_Data+8)    /* Command string */
1095
1096 /*****************************************************************************
1097 ************************                               ***********************
1098 ************************   BOOT_RUP - BOOT_COMPLETED   ***********************
1099 ************************                               ***********************
1100 *****************************************************************************/
1101
1102 /* (RIO->Driver,pre-emptive)
1103
1104    BOOT_RUP - BOOT_COMPLETE is sent to the Driver from RIO when downloading of
1105    RTA firmware has completed.
1106    */
1107 #if 0
1108 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1109 #endif
1110 #define PKT_LinkNumber          (PKT_Data+1)    /* Link number RTA booted on */
1111 #define PKT_SerialNumber        (PKT_Data+2)    /* 4 byte serial number */
1112
1113 /*****************************************************************************
1114 ************************                               ***********************
1115 ************************   BOOT_RUP - Packet Request   ***********************
1116 ************************                               ***********************
1117 *****************************************************************************/
1118
1119 /* (RIO->Driver,pre-emptive)
1120
1121    BOOT_RUP packet without the PKT_CMD_BIT set in the PKT->len field is sent
1122    from RIO to the Driver as a request for a firmware boot packet. */
1123
1124 #define PKT_SequenceNumber      (PKT_Data+0)    /* Packet sequence number */
1125
1126 /*****************************************************************************
1127 ***********************                                ***********************
1128 ***********************   BOOT_RUP - Packet Response   ***********************
1129 ***********************                                ***********************
1130 *****************************************************************************/
1131
1132 /* (Driver->RIO,pre-emptive)
1133
1134    In response to a BOOT_RUP boot packet request, the driver fills out the response
1135    packet with the 70 bytes of the requested sequence.
1136    */
1137 #if 0
1138 #define PKT_SequenceNumber      (PKT_Data+0)    /* Packet sequence number */
1139 #endif
1140 #define PKT_FirmwarePacket      (PKT_Data+2)    /* Firmware packet */
1141
1142 /*****************************************************************************
1143 ****************************                      ****************************
1144 ****************************   BOOT_RUP - IFOAD   ****************************
1145 ****************************                      ****************************
1146 *****************************************************************************/
1147
1148 /* (Driver->RIO,pre-emptive)
1149
1150    BOOT_RUP - IFOAD packets are sent from the Driver to an RTA to cause the
1151    RTA to shut down and reboot.
1152    */
1153 #if 0
1154 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1155 #endif
1156 #define PKT_IfoadId1            (PKT_Data+2)    /* IFOAD Id 1 */
1157 #define PKT_IfoadId2            (PKT_Data+3)    /* IFOAD Id 2 */
1158
1159 #define IFOADID1                0xAD
1160 #define IFOADID2                0xF0
1161
1162 /*****************************************************************************
1163 **************************                         ***************************
1164 **************************   BOOT_RUP - IDENTIFY   ***************************
1165 **************************                         ***************************
1166 *****************************************************************************/
1167
1168 /* (Driver->RIO,pre-emptive)
1169
1170    BOOT_RUP - IDENTIFY packets are sent from the Driver to an RTA to cause the
1171    RTA to flash its LEDs for a period of time.
1172    */
1173 #if 0
1174 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1175 #endif
1176 #define PKT_IdentifyId          (PKT_Data+2)    /* defines pattern to flash */
1177
1178 /*****************************************************************************
1179 ****************************                       ***************************
1180 ****************************   BOOT_RUP - ZOMBIE   ***************************
1181 ****************************                       ***************************
1182 *****************************************************************************/
1183
1184 /* (Driver->RIO,pre-emptive)
1185
1186    BOOT_RUP - ZOMBIE packets are sent from the Driver to an RTA to cause the
1187    RTA to shut down and flash it's LEDs.
1188    */
1189 #if 0
1190 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1191 #endif
1192 #define PKT_ZombieId1           (PKT_Data+2)    /* ZOMBIE Id 1 */
1193 #define PKT_ZombieId2           (PKT_Data+3)    /* ZOMBIE Id 2 */
1194
1195 #define ZOMBIEID1               0x52
1196 #define ZOMBIEID2               0x21
1197
1198 /*****************************************************************************
1199 ****************************                      ****************************
1200 ****************************   BOOT_RUP - UFOAD   ****************************
1201 ****************************                      ****************************
1202 *****************************************************************************/
1203
1204 /* (Driver->RIO,pre-emptive)
1205
1206    BOOT_RUP - UFOAD packets are sent from the Driver to an RTA to cause the RTA
1207    to ask it's neighbouring RTA to shut down and reboot.
1208    */
1209 #if 0
1210 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1211 #define PKT_LinkNumber          (PKT_Data+1)    /* Link number of RTA to UFOAD */
1212 #endif
1213 #define PKT_UfoadId1            (PKT_Data+2)    /* UFOAD Id 1 */
1214 #define PKT_UfoadId2            (PKT_Data+3)    /* UFOAD Id 2 */
1215
1216 #define UFOADID1                0x1E
1217 #define UFOADID2                0x0D
1218
1219 /*****************************************************************************
1220 ****************************                      ****************************
1221 ****************************   BOOT_RUP - IWAIT   ****************************
1222 ****************************                      ****************************
1223 *****************************************************************************/
1224
1225 /* (Driver->RIO,pre-emptive)
1226
1227    BOOT_RUP - IWAIT packets are sent from the Driver to an RTA to cause the RTA
1228    to pause booting on the specified link for 30 seconds.
1229    */
1230 #if 0
1231 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1232 #define PKT_LinkNumber          (PKT_Data+1)    /* Link number of RTA to UFOAD */
1233 #endif
1234 #define PKT_IwaitId1            (PKT_Data+2)    /* IWAIT Id 1 */
1235 #define PKT_IwaitId2            (PKT_Data+3)    /* IWAIT Id 2 */
1236
1237 #define IWAITID1                0xDE
1238 #define IWAITID2                0xB1
1239
1240 /*****************************************************************************
1241 ************************                               ***********************
1242 ************************   ROUTE_RUP - ROUTE_REQUEST   ***********************
1243 ************************                               ***********************
1244 *****************************************************************************/
1245
1246 /* (RIO->Driver,pre-emptive)
1247
1248    ROUTE_RUP - ROUTE_REQUEST packets are sent from a newly booted or connected
1249    RTA to a Driver to request an ID (RUP or unit number).
1250    */
1251 #if 0
1252 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1253 #endif
1254 #define PKT_SerialNumber        (PKT_Data+2)    /* 4 byte serial number */
1255 #define PKT_ModuleTypes         (PKT_Data+6)    /* RTA Module types */
1256
1257 /* ModuleTypes definitions... */
1258 #define MOD_BLANK               0x0F    /* Blank plate attached */
1259 #define MOD_RS232DB25           0x00    /* RS232 DB25 connector */
1260 #define MOD_RS232RJ45           0x01    /* RS232 RJ45 connector */
1261 #define MOD_RS422DB25           0x02    /* RS422 DB25 connector */
1262 #define MOD_RS485DB25           0x03    /* RS485 DB25 connector */
1263 #define MOD_PARALLEL            0x04    /* Centronics parallel */
1264
1265 #define MOD2                    0x08    /* Set to indicate Rev2 module */
1266
1267 /*****************************************************************************
1268 *************************                            *************************
1269 *************************   ROUTE_RUP - ROUTE_FOAD   *************************
1270 *************************                            *************************
1271 *****************************************************************************/
1272
1273 /* (Driver->RIO,pre-emptive)
1274
1275    ROUTE_RUP - ROUTE_FOAD packet is sent as a response to a ROUTE_RUP - ROUTE_REQUEST
1276    packet to cause the RTA to "Fall Over And Die"., i.e. shutdown and reboot.
1277    */
1278 #if 0
1279 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1280 #endif
1281 #define PKT_RouteCmdString      (PKT_Data+2)    /* Command string */
1282
1283 /*****************************************************************************
1284 ***********************                                ***********************
1285 ***********************   ROUTE_RUP - ROUTE_ALLOCATE   ***********************
1286 ***********************                                ***********************
1287 *****************************************************************************/
1288
1289 /* (Driver->RIO,pre-emptive)
1290
1291    ROUTE_RUP - ROUTE_ALLOCATE packet is sent as a response to a ROUTE_RUP - ROUTE_REQUEST
1292    packet to allocate the RTA's Id number (RUP number 1..16)
1293    */
1294 #if 0
1295 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1296 #endif
1297 #define PKT_IdNum               (PKT_Data+1)    /* RUP number for ports 1..8 */
1298 #if 0
1299 #define PKT_RouteCmdString      (PKT_Data+2)    /* Command string */
1300 #endif
1301 #define PKT_IdNum2              (PKT_Data+0x17) /* RUP number for ports 9..16 */
1302
1303 /*****************************************************************************
1304 ***********************                                ***********************
1305 ***********************   ROUTE_RUP - ROUTE_TOPOLOGY   ***********************
1306 ***********************                                ***********************
1307 *****************************************************************************/
1308
1309 /* (RIO->Driver,pre-emptive)
1310
1311    ROUTE_RUP - ROUTE_TOPOLOGY packet is sent to inform the driver of an RTA's
1312    current link status.
1313    */
1314 #if 0
1315 #define PKT_Cmd                 (PKT_Data+0)    /* Command code */
1316 #endif
1317 #define PKT_Link1Rup            (PKT_Data+2)    /* Link 1 RUP number */
1318 #define PKT_Link1Link           (PKT_Data+3)    /* Link 1 link number */
1319 #define PKT_Link2Rup            (PKT_Data+4)    /* Link 2 RUP number */
1320 #define PKT_Link2Link           (PKT_Data+5)    /* Link 2 link number */
1321 #define PKT_Link3Rup            (PKT_Data+6)    /* Link 3 RUP number */
1322 #define PKT_Link3Link           (PKT_Data+7)    /* Link 3 link number */
1323 #define PKT_Link4Rup            (PKT_Data+8)    /* Link 4 RUP number */
1324 #define PKT_Link4Link           (PKT_Data+9)    /* Link 4 link number */
1325 #define PKT_RtaVpdProm          (PKT_Data+10)   /* 32 bytes of RTA VPD PROM Contents */
1326
1327 #endif                          /* _sxwinif_h */
1328
1329 /* End of RIOWINIF.H */