home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / NCSATELN / TEL23SRC.ZIP / NET / ENET / NET8003.INC < prev    next >
Encoding:
Text File  |  1990-05-23  |  9.6 KB  |  264 lines

  1.         SUBTTL    WD8STAR2.EQU - StarLAN equates
  2.  
  3.  
  4. COMMENT \
  5. /************************************************************************
  6. * WD8STAR2.EQU                                *
  7. *                                    *
  8. * Provides constants and data definitions for WD8STAR2.ASM file        *
  9. * ( For WD8003 StarLAN PC Adapter Board ).                *
  10. *                                    *
  11. * CONTENTS:                                *
  12. * --------                                *
  13. *    external definition                        *
  14. *    I/O port offset definition                    *
  15. *    I/O register mask definition                    *
  16. *    miscellaneous constants    definition                *
  17. *    structure definition                        *
  18. *                                    *
  19. * NOTE:                                    *
  20. * ----                                    *
  21. *    variable definition and reserved patch area are in asm file now    *
  22. *                                    *
  23. * HISTORY:                                *
  24. * -------                                *
  25. *                                    *
  26. *                                    *
  27. *************************************************************************\
  28.  
  29.  
  30. ;*****************************************************************************
  31. ;
  32. ;    StarLAN controller board offsets
  33. ;    IO port definition (BASE in WD8_base)
  34. ;*****************************************************************************
  35.  
  36. W83CREG  EQU    00h            ; 8003 control register
  37. W83CREG  EQU    00h            ; 8003 status register
  38. ADDROM   EQU    08h            ; LAN Address ROM
  39. ; 8390 LAN Controller (page0) register offset for read and write 
  40. CMDR    EQU    10h            ; command register for read & write
  41. CLDA0    EQU    11h            ; current local dma addr 0 for read
  42. PSTART    EQU    11h            ; page start register for write
  43. CLDA1    EQU    12h            ; current local dma addr 1 for read
  44. PSTOP    EQU    12h            ; page stop register for write
  45. BNRY    EQU    13h            ; boundary reg for rd and wr
  46. TSR    EQU    14h            ; tx status reg for rd
  47. TPSR    EQU    14h            ; tx start page start reg for wr    
  48. NCR    EQU    15h            ; number of collision reg for rd
  49. TBCR0    EQU    15h            ; tx byte count 0 reg for wr
  50. FIFO    EQU    16h            ; FIFO for rd
  51. TBCR1    EQU    16h            ; tx byte count 1 reg for wr
  52. ISR    EQU    17h            ; interrupt status reg for rd and wr
  53. CRDA0    EQU    18h            ; current remote dma address 0 for rd
  54. RSAR0    EQU    18h            ; remote start address reg 0  for wr
  55. CRDA1    EQU    19h            ; current remote dma address 1 for rd
  56. RSAR1    EQU    19h            ; remote start address reg 1 for wr
  57. RBCR0    EQU    1Ah            ; remote byte count reg 0 for wr
  58. RBCR1    EQU    1Bh            ; remote byte count reg 1 for wr
  59. RSR    EQU    1Ch            ; rx status reg for rd
  60. XRCR    EQU    1Ch            ; rx configuration reg for wr
  61. CNTR0    EQU    1Dh            ; tally cnt 0 for frm alg err for rd
  62. TCR    EQU    1Dh            ; tx configuration reg for wr
  63. CNTR1    EQU    1Eh            ; tally cnt 1 for crc err for rd
  64. DCR    EQU    1Eh            ; data configuration reg for wr
  65. CNTR2    EQU    1Fh            ; tally cnt 2 for missed pkt for rd
  66. IMR    EQU    1Fh            ; interrupt mask reg for wr
  67. ; 8390 LAN Controller (page1) register offset for read and write 
  68. PAR0    EQU    11h             ; physical addr reg 0 for rd and wr
  69. PAR1    EQU    12h             ; physical addr reg 1 for rd and wr
  70. PAR2    EQU    13h             ; physical addr reg 2 for rd and wr
  71. PAR3    EQU    14h             ; physical addr reg 3 for rd and wr
  72. PAR4    EQU    15h             ; physical addr reg 4 for rd and wr
  73. PAR5    EQU    16h             ; physical addr reg 5 for rd and wr
  74. CURR    EQU    17h            ; current page reg for rd and wr
  75. MAR0    EQU    18h            ; multicast addr reg 0 fro rd and WR
  76. MAR1    EQU    19h            ; multicast addr reg 1 fro rd and WR
  77. MAR2    EQU    1Ah            ; multicast addr reg 2 fro rd and WR
  78. MAR3    EQU    1Bh            ; multicast addr reg 3 fro rd and WR
  79. MAR4    EQU    1Ch            ; multicast addr reg 4 fro rd and WR
  80. MAR5    EQU    1Dh            ; multicast addr reg 5 fro rd and WR
  81. MAR6    EQU    1Eh            ; multicast addr reg 6 fro rd and WR
  82. MAR7    EQU    1Fh            ; multicast addr reg 7 fro rd and WR
  83.  
  84. ;***********************************************************************
  85. ;
  86. ;    8003 control register operations
  87. ;***********************************************************************
  88.  
  89. MSK_RESET    EQU    80h            ; reset LAN controller
  90. MSK_ENASH    EQU    40h        ; enable PC access to shared mem
  91. MSK_DECOD    EQU    3Fh         ; ???? memory decode bits, corresponding
  92.                     ; to SA 18-13. SA 19 assumed to be 1
  93. ;***********************************************************************
  94. ;
  95. ;    8390 CMDR MASK
  96. ;***********************************************************************
  97.  
  98. MSK_STP        EQU    01h        ; software reset, take 8390 off line
  99. MSK_STA        EQU    02h        ; activate the 8390 NIC
  100. MSK_TXP        EQU    04h        ; initial txing of a frm
  101. MSK_RD2        EQU    20h        ; abort remote DMA
  102. MSK_PG0        EQU    00h        ; select register page 0
  103. MSK_PG1        EQU    40h        ; select register page 1
  104.  
  105. ;***********************************************************************
  106. ;
  107. ;    8390 ISR & IMR MASK
  108. ;***********************************************************************
  109.  
  110. MSK_PRX  EQU    01h        ; rx with no error
  111. MSK_PTX  EQU    02h        ; tx with no error
  112. MSK_RXE  EQU    04h        ; rx with error
  113. MSK_TXE  EQU    08h        ; tx with error
  114. MSK_OVW  EQU    10h        ; overwrite warning
  115. MSK_CNT  EQU    20h        ; MSB of one of the tally counters is set
  116. MSK_RDC  EQU    40h        ; remote dma completed
  117. MSK_RST     EQU    80h        ; reset state indicator
  118.  
  119. ;***********************************************************************
  120. ;
  121. ;    8390 DCR MASK
  122. ;***********************************************************************
  123.  
  124. MSK_WTS EQU    01h        ; word transfer mode selection
  125. MSK_BOS    EQU    02h        ; byte order selection
  126. MSK_LAS    EQU    04h        ; long addr selection
  127. MSK_BMS    EQU    08h        ; burst mode selection
  128. MSK_ARM    EQU    10h        ; atuoinitialize remote
  129. MSK_FT00 EQU    00h        ; burst lrngth selection
  130. MSK_FT01 EQU    20h        ; burst lrngth selection
  131. MSK_FT10 EQU    40h        ; burst lrngth selection
  132. MSK_FT11 EQU    60h        ; burst lrngth selection
  133.  
  134. ;***********************************************************************
  135. ;
  136. ;    8390 RCR MASK
  137. ;***********************************************************************
  138.  
  139. MSK_SEP EQU    01h        ; save error pkts
  140. MSK_AR     EQU    02h        ; accept runt pkt
  141. MSK_AB     EQU    04h        ; accept broadcast 
  142. MSK_AM     EQU    08h        ; accept multicast 
  143. MSK_PRO    EQU    10h        ; promiscuous physical
  144.                 ; accept all pkt with physical adr
  145. MSK_MON EQU    20h        ; monitor mode
  146.  
  147. ;***********************************************************************
  148. ;
  149. ;    8390 TCR MASK
  150. ;***********************************************************************
  151.  
  152. MSK_CRC EQU    01h        ; inhibit CRC, do not append crc
  153. MSK_LB01 EQU    06h        ; encoded loopback control
  154. MSK_ATD    EQU    08h        ; auto tx disable
  155. MSK_OFST EQU    10h        ; collision offset enable 
  156.  
  157. ;***********************************************************************
  158. ;
  159. ;    8390 RSR MASK
  160. ;***********************************************************************
  161.  
  162. SMK_PRX  EQU    01h        ; rx without error
  163. SMK_CRC  EQU    02h        ; CRC error
  164. SMK_FAE  EQU    04h        ; frame alignment error
  165. SMK_FO   EQU    08h        ; FIFO overrun
  166. SMK_MPA  EQU    10h        ; missed pkt
  167. SMK_PHY  EQU    20h        ; physical/multicase address
  168. SMK_DIS  EQU    40h        ; receiver disable. set in monitor mode
  169. SMK_DEF     EQU    80h        ; deferring
  170.  
  171. ;***********************************************************************
  172. ;
  173. ;    8390 TSR MASK
  174. ;***********************************************************************
  175.  
  176. SMK_PTX  EQU    01h        ; tx without error
  177. SMK_DFR  EQU    02h        ; non deferred tx
  178. SMK_COL  EQU    04h        ; tx collided
  179. SMK_ABT  EQU    08h        ; tx aboort because of excessive collisions
  180. SMK_CRS  EQU    10h        ; carrier sense lost
  181. SMK_FU   EQU    20h        ; FIFO underrun
  182. SMK_CDH  EQU    40h        ; collision detect heartbeat
  183. SMK_OWC     EQU    80h        ; out of window collision
  184.  
  185.  
  186.  
  187. ;***********************************************************************
  188. ;
  189. ;    Miscellaneous Constants
  190. ;***********************************************************************
  191.  
  192. ;
  193. ; PIC (8259) Information 
  194. ;
  195. EOI    EQU    20h            ; End Of Interrupt
  196. INTA00    EQU    20h            ; 8259 port
  197. INTA01    EQU    21h            ; 8259 port
  198. ;
  199. ; Buffer Length and Field Definition Info
  200. ;
  201. BPNA    EQU    6            ; Bytes Per Network Address
  202. MIN_DATA  EQU   52 + BPNA        ; 52 bytes data + 6 bytes address
  203. TX_BLK_LEN    EQU    2        ; Offset to Dest Address in TX Block
  204. TX_BLK_ADD    EQU    BPNA        ; Length of TX block dest addr field
  205. TX_HDR_LEN   EQU  TX_BLK_LEN + TX_BLK_ADD    ; Offset to Data in TX Block
  206. RX_TRAIL    EQU    02        ; Trailer def for Received Frame Status
  207. RX_HDR_LEN    EQU    12        ; Offset to Data in Received Frame
  208.  
  209. ;***********************************************************************
  210. ;
  211. ;    shared memory constant definition
  212. ;***********************************************************************
  213. ; for rcv buff ring of shr mem
  214. STRT_PG EQU    6                  ; start at page 6
  215. STOP_PG EQU    32            ; end at page 31 
  216. ; for tx buff of shr mem
  217. TB_SIZE EQU    2            ; number of tb buff in shr mem
  218. TB_PGNO EQU    3            ; number of pages in one tb buff
  219.  
  220. ;***********************************************************************
  221. ;
  222. ;    Structure definitions
  223. ;***********************************************************************
  224.  
  225. ;
  226. ; MAC LAYER STATS
  227. ;
  228. mstats struc            ; MAC Layer Statistics
  229.     t0    dd    0        ; number of attempts to transmit 
  230.     txok    dd    0        ; number of successful transmissions 
  231.     txbad    dd    0        ; number of failed transmits 
  232.     collsn    dd    0        ; number of collisions occured 
  233.     lostcrs    dd    0        ; number of times the CRS was lost during tx 
  234.     lostcts    dd    0        ; lost CTS 
  235.     underrun    dd    0    ; number of underrun errors 
  236.  
  237.     rxrd    dd    0        ; number of times the receiver was ready to receive 
  238.     rxok    dd    0        ; number of mpdus rxed w/o error 
  239.     rxnrd    dd    0        ; number rx's aborted for receive processing 
  240.     crcerr    dd    0        ; number of mpdus received with CRC error 
  241.     overrun    dd    0        ; number of overrun errors 
  242.     algerr    dd    0        ; number of alignment errors 
  243.     srtfrm    dd    0        ; number of short frame receiver error 
  244.     rxnom    dd    0        ; number of receives lost due to lack of mem 
  245.     rxblkd    dd    0        ; NOT USED
  246.  
  247. ;  The following are not used right now....
  248.     ex_lockup    dd    0    ; number of times the execution unit of the chip was in lockup situation 
  249.     ia_corrup    dd    0    ; number of times the IA is corrupted 
  250.     spur_int    dd    0    ; # of spurious interrupts
  251. mstats ENDS
  252.  
  253. ;
  254. ; BUFFER DESCRIPTOR
  255. ;
  256. bufp    struc            ; Buffer Descriptor Block
  257.     bd_next    dw    0        ; Pointer to next block in chain
  258.     bd_prev    dw    0        ; Pointer to previous block in chain
  259.     bd_global dw    0        ;
  260.     bd_addr dw    0        ; Address of buffer associated w/this block
  261.     bd_seq dd    2 DUP (?)    ;
  262.     bd_info dw    0        ;
  263. bufp    ENDS
  264.