if_cnwreg.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* $OpenBSD: if_cnwreg.h,v 1.3 2008/06/26 05:42:17 ray Exp $ */
  2. /*-
  3. * Copyright (c) 1998 The NetBSD Foundation, Inc.
  4. * All rights reserved.
  5. *
  6. * This code is derived from software contributed to The NetBSD Foundation
  7. * by Michael Eriksson.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  19. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  20. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  21. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  22. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  23. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  24. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  25. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  26. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  27. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  28. * POSSIBILITY OF SUCH DAMAGE.
  29. */
  30. /* I/O area */
  31. #define CNW_IO_SIZE 0x10
  32. /* I/O registers */
  33. #define CNW_REG_COR 0x0
  34. # define CNW_COR_IENA 0x01 /* Interrupt enable */
  35. # define CNW_COR_LVLREQ 0x40 /* Keep high */
  36. #define CNW_REG_CCSR 0x2
  37. #define CNW_REG_ASR 0x4
  38. # define CNW_ASR_TXBA 0x01 /* Trasmit buffer available */
  39. # define CNW_ASR_WOC 0x08 /* Write Operation Complete */
  40. # define CNW_ASR_TXDN 0x20 /* Transmit done */
  41. # define CNW_ASR_RXERR 0x40 /* Receive error */
  42. # define CNW_ASR_RXRDY 0x80 /* Packet received */
  43. #define CNW_REG_IOLOW 0x6
  44. #define CNW_REG_IOHI 0x7
  45. #define CNW_REG_IOCONTROL 0x8
  46. #define CNW_REG_IMR 0xa
  47. # define CNW_IMR_IENA 0x02 /* Interrupt enable */
  48. # define CNW_IMR_RFU1 0x10 /* RFU intr mask, keep high */
  49. #define CNW_REG_PMR 0xc
  50. # define CNW_PMR_RESET 0x80
  51. #define CNW_REG_DATA 0xf
  52. /* Mapped memory */
  53. #define CNW_MEM_ADDR 0x20000
  54. #define CNW_MEM_SIZE 0x8000
  55. /* Extended I/O registers (memory mapped) */
  56. #define CNW_EREG_CB 0x100
  57. #define CNW_EREG_ASCC 0x114
  58. #define CNW_EREG_RSER 0x120
  59. # define CNW_RSER_RXBIG 0x02
  60. # define CNW_RSER_RXCRC 0x04
  61. # define CNW_RSER_RXOVERRUN 0x08
  62. # define CNW_RSER_RXOVERFLOW 0x10
  63. # define CNW_RSER_RXERR 0x40
  64. # define CNW_RSER_RXAVAIL 0x80
  65. #define CNW_EREG_RSERW 0x124
  66. #define CNW_EREG_TSER 0x130
  67. # define CNW_TSER_RTRY 0x0f
  68. # define CNW_TSER_TXERR 0x10
  69. # define CNW_TSER_TXOK 0x20
  70. # define CNW_TSER_TXNOAP 0x40
  71. # define CNW_TSER_TXGU 0x80
  72. # define CNW_TSER_ERROR (CNW_TSER_TXERR | CNW_TSER_TXNOAP | \
  73. CNW_TSER_TXGU)
  74. #define CNW_EREG_TSERW 0x134
  75. #define CNW_EREG_TDP 0x140
  76. #define CNW_EREG_LIF 0x14e
  77. #define CNW_EREG_RDP 0x150
  78. #define CNW_EREG_SPCQ 0x154
  79. #define CNW_EREG_SPU 0x155
  80. #define CNW_EREG_ISPLQ 0x156
  81. #define CNW_EREG_HHC 0x158
  82. #define CNW_EREG_PA 0x160
  83. #define CNW_EREG_ARW 0x166
  84. #define CNW_EREG_MHS 0x16b
  85. #define CNW_EREG_NI 0x16e
  86. #define CNW_EREG_CRBP 0x17a
  87. #define CNW_EREG_EC 0x180
  88. #define CNW_EREG_STAT_RXERR 0x184
  89. #define CNW_EREG_STAT_FRAME 0x186
  90. #define CNW_EREG_STAT_IBEAT 0x188
  91. #define CNW_EREG_STAT_RXBUF 0x18e
  92. #define CNW_EREG_STAT_RXMULTI 0x190
  93. #define CNW_EREG_STAT_TXRETRY 0x192
  94. #define CNW_EREG_STAT_TXABORT 0x194
  95. #define CNW_EREG_STAT_OBEAT 0x198
  96. #define CNW_EREG_STAT_TXOK 0x19a
  97. #define CNW_EREG_STAT_TXSENT 0x19c
  98. /*
  99. * Commands used in the extended command buffer
  100. * CNW_EREG_CB (0x100-0x10f)
  101. */
  102. #define CNW_CMD_NOP 0x00
  103. #define CNW_CMD_SRC 0x01
  104. # define CNW_RXCONF_RXENA 0x80 /* Receive Enable */
  105. # define CNW_RXCONF_MAC 0x20 /* MAC host receive mode */
  106. # define CNW_RXCONF_PRO 0x10 /* Promiscuous */
  107. # define CNW_RXCONF_AMP 0x08 /* Accept Multicast Packets */
  108. # define CNW_RXCONF_BCAST 0x04 /* Accept Broadcast Packets */
  109. #define CNW_CMD_STC 0x02
  110. # define CNW_TXCONF_TXENA 0x80 /* Transmit Enable */
  111. # define CNW_TXCONF_MAC 0x20 /* Host sends MAC mode */
  112. # define CNW_TXCONF_EUD 0x10 /* Enable Uni-Data packets */
  113. # define CNW_TXCONF_KEY 0x02 /* Scramble data packets */
  114. # define CNW_TXCONF_LOOP 0x01 /* Loopback mode */
  115. #define CNW_CMD_AMA 0x03
  116. #define CNW_CMD_DMA 0x04
  117. #define CNW_CMD_SAMA 0x05
  118. #define CNW_CMD_ER 0x06
  119. #define CNW_CMD_DR 0x07
  120. #define CNW_CMD_TL 0x08
  121. #define CNW_CMD_SRP 0x09
  122. #define CNW_CMD_SSK 0x0a
  123. #define CNW_CMD_SMD 0x0b
  124. #define CNW_CMD_SAPD 0x0c
  125. #define CNW_CMD_SSS 0x11
  126. #define CNW_CMD_EOC 0x00 /* End-of-command marker */