PageRenderTime 60ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/sys/arch/vax/if/if_qereg.h

https://bitbucket.org/kmv/aeriebsd-src
C Header | 191 lines | 74 code | 12 blank | 105 comment | 0 complexity | 0e2dd9dfafe8a2a8dea5f9e8f5c81b4e MD5 | raw file
  1. /*
  2. * Copyright (c) 1988 Regents of the University of California.
  3. * All rights reserved.
  4. *
  5. * This code is derived from software contributed to Berkeley by
  6. * Digital Equipment Corp.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. * 3. Neither the name of the University nor the names of its contributors
  17. * may be used to endorse or promote products derived from this software
  18. * without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  21. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  24. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  26. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  29. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * @(#)if_qereg.h 7.3 (Berkeley) 6/28/90
  33. */
  34. /* @(#)if_qereg.h 1.2 (ULTRIX) 1/3/85 */
  35. /****************************************************************
  36. * *
  37. * Licensed from Digital Equipment Corporation *
  38. * Copyright (c) *
  39. * Digital Equipment Corporation *
  40. * Maynard, Massachusetts *
  41. * 1985, 1986 *
  42. * All rights reserved. *
  43. * *
  44. * The Information in this software is subject to change *
  45. * without notice and should not be construed as a commitment *
  46. * by Digital Equipment Corporation. Digital makes no *
  47. * representations about the suitability of this software for *
  48. * any purpose. It is supplied "As Is" without expressed or *
  49. * implied warranty. *
  50. * *
  51. * If the Regents of the University of California or its *
  52. * licensees modify the software in a manner creating *
  53. * derivative copyright rights, appropriate copyright *
  54. * legends may be placed on the derivative work in addition *
  55. * to that set forth above. *
  56. * *
  57. ****************************************************************/
  58. /* ---------------------------------------------------------------------
  59. * Modification History
  60. *
  61. * 13 Feb. 84 -- rjl
  62. *
  63. * Initial version of driver. derived from IL driver.
  64. *
  65. * ---------------------------------------------------------------------
  66. */
  67. /*
  68. * Digital Q-BUS to NI Adapter
  69. */
  70. #ifdef notdef
  71. struct qedevice {
  72. u_short qe_sta_addr[2]; /* Station address (actually 6 */
  73. u_short qe_rcvlist_lo; /* Receive list lo address */
  74. u_short qe_rcvlist_hi; /* Receive list hi address */
  75. u_short qe_xmtlist_lo; /* Transmit list lo address */
  76. u_short qe_xmtlist_hi; /* Transmit list hi address */
  77. u_short qe_vector; /* Interrupt vector */
  78. u_short qe_csr; /* Command and Status Register */
  79. };
  80. #endif
  81. /*
  82. * Register offsets in register space.
  83. */
  84. #define QE_CSR_ADDR1 0
  85. #define QE_CSR_ADDR2 2
  86. #define QE_CSR_RCLL 4
  87. #define QE_CSR_RCLH 6
  88. #define QE_CSR_XMTL 8
  89. #define QE_CSR_XMTH 10
  90. #define QE_CSR_VECTOR 12
  91. #define QE_CSR_CSR 14
  92. /*
  93. * Command and status bits (csr)
  94. */
  95. #define QE_RCV_ENABLE 0x0001 /* Receiver enable */
  96. #define QE_RESET 0x0002 /* Software reset */
  97. #define QE_NEX_MEM_INT 0x0004 /* Non existent mem interrupt */
  98. #define QE_LOAD_ROM 0x0008 /* Load boot/diag from rom */
  99. #define QE_XL_INVALID 0x0010 /* Transmit list invalid */
  100. #define QE_RL_INVALID 0x0020 /* Receive list invalid */
  101. #define QE_INT_ENABLE 0x0040 /* Interrupt enable */
  102. #define QE_XMIT_INT 0x0080 /* Transmit interrupt */
  103. #define QE_ILOOP 0x0100 /* Internal loopback */
  104. #define QE_ELOOP 0x0200 /* External loopback */
  105. #define QE_STIM_ENABLE 0x0400 /* Sanity timer enable */
  106. #define QE_POWERUP 0x1000 /* Tranceiver power on */
  107. #define QE_CARRIER 0x2000 /* Carrier detect */
  108. #define QE_RCV_INT 0x8000 /* Receiver interrupt */
  109. /*
  110. * Transmit and receive ring discriptor ---------------------------
  111. *
  112. * The QNA uses the flag, status1 and the valid bit as a handshake/semiphore
  113. * mechinism.
  114. *
  115. * The flag word is written on ( bits 15,15 set to 1 ) when it reads the
  116. * descriptor. If the valid bit is set it considers the address to be valid.
  117. * When it uses the buffer pointed to by the valid address it sets status word
  118. * one.
  119. */
  120. struct qe_ring {
  121. u_short qe_flag; /* Buffer utilization flags */
  122. u_short qe_addr_hi;
  123. u_short qe_addr_lo; /* Low order bits of address */
  124. short qe_buf_len; /* Negative buffer length */
  125. u_short qe_status1; /* Status word one */
  126. u_short qe_status2; /* Status word two */
  127. };
  128. /*
  129. * High word address control bits.
  130. */
  131. #define QE_VALID 0x8000
  132. #define QE_CHAIN 0x4000
  133. #define QE_EOMSG 0x2000
  134. #define QE_SETUP 0x1000
  135. #define QE_ODDEND 0x0080
  136. #define QE_ODDBEGIN 0x0040
  137. /*
  138. * Status word definations (receive)
  139. * word1
  140. */
  141. #define QE_OVF 0x0001 /* Receiver overflow */
  142. #define QE_CRCERR 0x0002 /* CRC error */
  143. #define QE_FRAME 0x0004 /* Framing alignment error */
  144. #define QE_SHORT 0x0008 /* Packet size < 10 bytes */
  145. #define QE_RBL_HI 0x0700 /* Hi bits of receive len */
  146. #define QE_RUNT 0x0800 /* Runt packet */
  147. #define QE_DISCARD 0x1000 /* Discard the packet */
  148. #define QE_ESETUP 0x2000 /* Looped back setup or eloop */
  149. #define QE_ERROR 0x4000 /* Receiver error */
  150. #define QE_LASTNOT 0x8000 /* Not the last in the packet */
  151. /* word2 */
  152. #define QE_RBL_LO 0x00ff /* Low bits of receive len */
  153. /*
  154. * Status word definations (transmit)
  155. * word1
  156. */
  157. #define QE_CCNT 0x00f0 /* Collision count this packet */
  158. #define QE_FAIL 0x0100 /* Heart beat check failure */
  159. #define QE_ABORT 0x0200 /* Transmission abort */
  160. #define QE_STE16 0x0400 /* Sanity timer default on */
  161. #define QE_NOCAR 0x0800 /* No carrier */
  162. #define QE_LOSS 0x1000 /* Loss of carrier while xmit */
  163. /* word2 */
  164. #define QE_TDR 0x3fff /* Time domain reflectometry */
  165. /*
  166. * General constant definations
  167. */
  168. #define QEALLOC 0 /* Allocate an mbuf */
  169. #define QENOALLOC 1 /* No mbuf allocation */
  170. #define QEDEALLOC 2 /* Release an mbuf chain */
  171. #define QE_NOTYET 0x8000 /* Descriptor not in use yet */
  172. #define QE_INUSE 0x4000 /* Descriptor being used by QNA */
  173. #define QE_MASK 0xc000 /* Lastnot/error/used mask */
  174. /*
  175. * Values for the length of the setup packet that control reception filter.
  176. */
  177. #define QE_SETUPLEN 128 /* Size of setup packet */
  178. #define QE_ALLMULTI 1 /* Receive all multicasts */
  179. #define QE_PROMISC 2 /* Receive all packets */