linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / char / rio / link.h
1 /****************************************************************************
2  *******                                                              *******
3  *******                      L I N K
4  *******                                                              *******
5  ****************************************************************************
6
7  Author  : Ian Nandhra / Jeremy Rolls
8  Date    :
9
10  *
11  *  (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
12  *
13  *      This program is free software; you can redistribute it and/or modify
14  *      it under the terms of the GNU General Public License as published by
15  *      the Free Software Foundation; either version 2 of the License, or
16  *      (at your option) any later version.
17  *
18  *      This program is distributed in the hope that it will be useful,
19  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
20  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  *      GNU General Public License for more details.
22  *
23  *      You should have received a copy of the GNU General Public License
24  *      along with this program; if not, write to the Free Software
25  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27  Version : 0.01
28
29
30                             Mods
31  ----------------------------------------------------------------------------
32   Date     By                Description
33  ----------------------------------------------------------------------------
34
35  ***************************************************************************/
36
37 #ifndef _link_h
38 #define _link_h 1
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 /*************************************************
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)
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 */
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
76                                            and load address */
77 #define BOOT_COMPLETED     ((ushort) 3) /* Boot completed */
78
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
109 struct LPB {
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 */
126         WORD mon_ltt;
127         WORD mon_lrt;
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 */
131
132         Channel_ptr lrt_fail_chan;      /* Lrt's failure channel */
133         Channel_ptr ltt_fail_chan;      /* Ltt's failure channel */
134
135         /* RUP structure for HOST to driver communications */
136         struct RUP rup;
137         struct RUP link_rup;    /* RUP for the link (POLL,
138                                    topology etc.) */
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 */
150 };
151
152 #endif
153
154 /*********** end of file ***********/