X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Frio%2Flink.h;fp=drivers%2Fchar%2Frio%2Flink.h;h=48d68ca7f825e15a6d390b1d5ef1924ec6d5f4f4;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=f3bf11a04d41c7cb20a4672865888d37f9160195;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/char/rio/link.h b/drivers/char/rio/link.h index f3bf11a04..48d68ca7f 100644 --- a/drivers/char/rio/link.h +++ b/drivers/char/rio/link.h @@ -37,9 +37,38 @@ #ifndef _link_h #define _link_h 1 +#ifndef lint +#ifdef SCCS_LABELS +/* static char *_rio_link_h_sccs = "@(#)link.h 1.15"; */ +#endif +#endif + + + /************************************************* * Define the Link Status stuff ************************************************/ +#define LRT_ACTIVE ((ushort) 0x01) +#define LRT_SPARE1 ((ushort) 0x02) +#define INTRO_RCVD ((ushort) 0x04) +#define FORCED_DISCONNECT ((ushort) 0x08) +#define LRT_SPARE2 ((ushort) 0x80) + +#define TOP_OF_RTA_RAM ((ushort) 0x7000) +#define HOST_SERIAL_POINTER (unsigned char **) (TOP_OF_RTA_RAM - 2 * sizeof (ushort)) + +/* Flags for ltt_status */ +#define WAITING_ACK (ushort) 0x0001 +#define DATA_SENT (ushort) 0x0002 +#define WAITING_RUP (ushort) 0x0004 +#define WAITING_RETRY (ushort) 0x0008 +#define WAITING_TOPOLOGY (ushort) 0x0010 +#define SEND_SYNC (ushort) 0x0020 +#define FOAD_THIS_LINK (ushort) 0x0040 +#define REQUEST_SYNC (ushort) 0x0080 +#define REMOTE_DYING (ushort) 0x0100 +#define DIE_NOW (ushort) 0x0200 + /* Boot request stuff */ #define BOOT_REQUEST ((ushort) 0) /* Request for a boot */ #define BOOT_ABORT ((ushort) 1) /* Abort a boot */ @@ -47,48 +76,77 @@ and load address */ #define BOOT_COMPLETED ((ushort) 3) /* Boot completed */ +/* States that a link can be in */ +#define LINK_DISCONNECTED ((ushort) 0) /* Disconnected */ +#define LINK_BOOT1 ((ushort) 1) /* Trying to send 1st stage boot */ +#define LINK_BOOT2 ((ushort) 2) /* Trying to send 2nd stage boot */ +#define LINK_BOOT2WAIT ((ushort) 3) /* Waiting for selftest results */ +#define LINK_BOOT3 ((ushort) 4) /* Trying to send 3rd stage boots */ +#define LINK_SYNC ((ushort) 5) /* Syncing */ + +#define LINK_INTRO ((ushort) 10) /* Introductory packet */ +#define LINK_SUPPLYID ((ushort) 11) /* Trying to supply an ID */ +#define LINK_TOPOLOGY ((ushort) 12) /* Send a topology update */ +#define LINK_REQUESTID ((ushort) 13) /* Waiting for an ID */ +#define LINK_CONNECTED ((ushort) 14) /* Connected */ + +#define LINK_INTERCONNECT ((ushort) 20) /* Subnets interconnected */ + +#define LINK_SPARE ((ushort) 40) + +/* +** Set the default timeout for link communications. +*/ +#define LINKTIMEOUT (400 * MILLISECOND) + +/* +** LED stuff +*/ +#define LED_SET_COLOUR(colour) +#define LED_OR_COLOUR(colour) +#define LED_TIMEOUT(time) struct LPB { - u16 link_number; /* Link Number */ - u16 in_ch; /* Link In Channel */ - u16 out_ch; /* Link Out Channel */ - u8 attached_serial[4]; /* Attached serial number */ - u8 attached_host_serial[4]; + WORD link_number; /* Link Number */ + Channel_ptr in_ch; /* Link In Channel */ + Channel_ptr out_ch; /* Link Out Channel */ + BYTE attached_serial[4]; /* Attached serial number */ + BYTE attached_host_serial[4]; /* Serial number of Host who booted the other end */ - u16 descheduled; /* Currently Descheduled */ - u16 state; /* Current state */ - u16 send_poll; /* Send a Poll Packet */ - u16 ltt_p; /* Process Descriptor */ - u16 lrt_p; /* Process Descriptor */ - u16 lrt_status; /* Current lrt status */ - u16 ltt_status; /* Current ltt status */ - u16 timeout; /* Timeout value */ - u16 topology; /* Topology bits */ - u16 mon_ltt; - u16 mon_lrt; - u16 WaitNoBoot; /* Secs to hold off booting */ - u16 add_packet_list; /* Add packets to here */ - u16 remove_packet_list; /* Send packets from here */ - - u16 lrt_fail_chan; /* Lrt's failure channel */ - u16 ltt_fail_chan; /* Ltt's failure channel */ + WORD descheduled; /* Currently Descheduled */ + WORD state; /* Current state */ + WORD send_poll; /* Send a Poll Packet */ + Process_ptr ltt_p; /* Process Descriptor */ + Process_ptr lrt_p; /* Process Descriptor */ + WORD lrt_status; /* Current lrt status */ + WORD ltt_status; /* Current ltt status */ + WORD timeout; /* Timeout value */ + WORD topology; /* Topology bits */ + WORD mon_ltt; + WORD mon_lrt; + WORD WaitNoBoot; /* Secs to hold off booting */ + PKT_ptr add_packet_list; /* Add packets to here */ + PKT_ptr remove_packet_list; /* Send packets from here */ + + Channel_ptr lrt_fail_chan; /* Lrt's failure channel */ + Channel_ptr ltt_fail_chan; /* Ltt's failure channel */ /* RUP structure for HOST to driver communications */ struct RUP rup; struct RUP link_rup; /* RUP for the link (POLL, topology etc.) */ - u16 attached_link; /* Number of attached link */ - u16 csum_errors; /* csum errors */ - u16 num_disconnects; /* number of disconnects */ - u16 num_sync_rcvd; /* # sync's received */ - u16 num_sync_rqst; /* # sync requests */ - u16 num_tx; /* Num pkts sent */ - u16 num_rx; /* Num pkts received */ - u16 module_attached; /* Module tpyes of attached */ - u16 led_timeout; /* LED timeout */ - u16 first_port; /* First port to service */ - u16 last_port; /* Last port to service */ + WORD attached_link; /* Number of attached link */ + WORD csum_errors; /* csum errors */ + WORD num_disconnects; /* number of disconnects */ + WORD num_sync_rcvd; /* # sync's received */ + WORD num_sync_rqst; /* # sync requests */ + WORD num_tx; /* Num pkts sent */ + WORD num_rx; /* Num pkts received */ + WORD module_attached; /* Module tpyes of attached */ + WORD led_timeout; /* LED timeout */ + WORD first_port; /* First port to service */ + WORD last_port; /* Last port to service */ }; #endif