link.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /****************************************************************************
  2. ******* *******
  3. ******* L I N K
  4. ******* *******
  5. ****************************************************************************
  6. Author : Ian Nandhra / Jeremy Rolls
  7. Date :
  8. *
  9. * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. Version : 0.01
  25. Mods
  26. ----------------------------------------------------------------------------
  27. Date By Description
  28. ----------------------------------------------------------------------------
  29. ***************************************************************************/
  30. #ifndef _link_h
  31. #define _link_h 1
  32. #ifndef lint
  33. #ifdef SCCS_LABELS
  34. /* static char *_rio_link_h_sccs = "@(#)link.h 1.15"; */
  35. #endif
  36. #endif
  37. /*************************************************
  38. * Define the Link Status stuff
  39. ************************************************/
  40. #define LRT_ACTIVE ((ushort) 0x01)
  41. #define LRT_SPARE1 ((ushort) 0x02)
  42. #define INTRO_RCVD ((ushort) 0x04)
  43. #define FORCED_DISCONNECT ((ushort) 0x08)
  44. #define LRT_SPARE2 ((ushort) 0x80)
  45. #define TOP_OF_RTA_RAM ((ushort) 0x7000)
  46. #define HOST_SERIAL_POINTER (unsigned char **) (TOP_OF_RTA_RAM - 2 * sizeof (ushort))
  47. /* Flags for ltt_status */
  48. #define WAITING_ACK (ushort) 0x0001
  49. #define DATA_SENT (ushort) 0x0002
  50. #define WAITING_RUP (ushort) 0x0004
  51. #define WAITING_RETRY (ushort) 0x0008
  52. #define WAITING_TOPOLOGY (ushort) 0x0010
  53. #define SEND_SYNC (ushort) 0x0020
  54. #define FOAD_THIS_LINK (ushort) 0x0040
  55. #define REQUEST_SYNC (ushort) 0x0080
  56. #define REMOTE_DYING (ushort) 0x0100
  57. #define DIE_NOW (ushort) 0x0200
  58. /* Boot request stuff */
  59. #define BOOT_REQUEST ((ushort) 0) /* Request for a boot */
  60. #define BOOT_ABORT ((ushort) 1) /* Abort a boot */
  61. #define BOOT_SEQUENCE ((ushort) 2) /* Packet with the number of packets
  62. and load address */
  63. #define BOOT_COMPLETED ((ushort) 3) /* Boot completed */
  64. /* States that a link can be in */
  65. #define LINK_DISCONNECTED ((ushort) 0) /* Disconnected */
  66. #define LINK_BOOT1 ((ushort) 1) /* Trying to send 1st stage boot */
  67. #define LINK_BOOT2 ((ushort) 2) /* Trying to send 2nd stage boot */
  68. #define LINK_BOOT2WAIT ((ushort) 3) /* Waiting for selftest results */
  69. #define LINK_BOOT3 ((ushort) 4) /* Trying to send 3rd stage boots */
  70. #define LINK_SYNC ((ushort) 5) /* Syncing */
  71. #define LINK_INTRO ((ushort) 10) /* Introductory packet */
  72. #define LINK_SUPPLYID ((ushort) 11) /* Trying to supply an ID */
  73. #define LINK_TOPOLOGY ((ushort) 12) /* Send a topology update */
  74. #define LINK_REQUESTID ((ushort) 13) /* Waiting for an ID */
  75. #define LINK_CONNECTED ((ushort) 14) /* Connected */
  76. #define LINK_INTERCONNECT ((ushort) 20) /* Subnets interconnected */
  77. #define LINK_SPARE ((ushort) 40)
  78. /*
  79. ** Set the default timeout for link communications.
  80. */
  81. #define LINKTIMEOUT (400 * MILLISECOND)
  82. /*
  83. ** LED stuff
  84. */
  85. #define LED_SET_COLOUR(colour)
  86. #define LED_OR_COLOUR(colour)
  87. #define LED_TIMEOUT(time)
  88. struct LPB {
  89. WORD link_number; /* Link Number */
  90. Channel_ptr in_ch; /* Link In Channel */
  91. Channel_ptr out_ch; /* Link Out Channel */
  92. BYTE attached_serial[4]; /* Attached serial number */
  93. BYTE attached_host_serial[4];
  94. /* Serial number of Host who
  95. booted the other end */
  96. WORD descheduled; /* Currently Descheduled */
  97. WORD state; /* Current state */
  98. WORD send_poll; /* Send a Poll Packet */
  99. Process_ptr ltt_p; /* Process Descriptor */
  100. Process_ptr lrt_p; /* Process Descriptor */
  101. WORD lrt_status; /* Current lrt status */
  102. WORD ltt_status; /* Current ltt status */
  103. WORD timeout; /* Timeout value */
  104. WORD topology; /* Topology bits */
  105. WORD mon_ltt;
  106. WORD mon_lrt;
  107. WORD WaitNoBoot; /* Secs to hold off booting */
  108. PKT_ptr add_packet_list; /* Add packets to here */
  109. PKT_ptr remove_packet_list; /* Send packets from here */
  110. Channel_ptr lrt_fail_chan; /* Lrt's failure channel */
  111. Channel_ptr ltt_fail_chan; /* Ltt's failure channel */
  112. /* RUP structure for HOST to driver communications */
  113. struct RUP rup;
  114. struct RUP link_rup; /* RUP for the link (POLL,
  115. topology etc.) */
  116. WORD attached_link; /* Number of attached link */
  117. WORD csum_errors; /* csum errors */
  118. WORD num_disconnects; /* number of disconnects */
  119. WORD num_sync_rcvd; /* # sync's received */
  120. WORD num_sync_rqst; /* # sync requests */
  121. WORD num_tx; /* Num pkts sent */
  122. WORD num_rx; /* Num pkts received */
  123. WORD module_attached; /* Module tpyes of attached */
  124. WORD led_timeout; /* LED timeout */
  125. WORD first_port; /* First port to service */
  126. WORD last_port; /* Last port to service */
  127. };
  128. #endif
  129. /*********** end of file ***********/