home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / p / pcrte224.zip / SOURCE.ZIP / WD.INC < prev    next >
Text File  |  1992-06-09  |  14KB  |  275 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. ;       StarLAN controller board offsets
  32. ;       IO port definition (BASE in WD8_base)
  33. ;*****************************************************************************
  34.  
  35. W83CREG  EQU    00h                     ; 8003 control register
  36. W83CREG  EQU    00h                     ; 8003 status register
  37. LAAR     EQU    05h                     ; LA Address Register (write only)
  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. RCVR    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. ; LAAR register Masks
  96.  
  97. LAN16ENB    EQU  40h            ; Enables 16bit shrd RAM for LAN
  98. MEM16ENB    EQU  80h            ; Enables 16bit shrd RAM for host
  99. LA19        EQU  01h            ; Address line 19 for enabling
  100.  
  101. ;***********************************************************************
  102. ;
  103. ;       8390 CMDR MASK
  104. ;***********************************************************************
  105.  
  106. MSK_STP         EQU     01h             ; software reset, take 8390 off line
  107. MSK_STA         EQU     02h             ; activate the 8390 NIC
  108. MSK_TXP         EQU     04h             ; initial txing of a frm
  109. MSK_RD2         EQU     20h             ; abort remote DMA
  110. MSK_PG0         EQU     00h             ; select register page 0
  111. MSK_PG1         EQU     40h             ; select register page 1
  112.  
  113. ;***********************************************************************
  114. ;
  115. ;       8390 ISR & IMR MASK
  116. ;***********************************************************************
  117.  
  118. MSK_PRX  EQU    01h             ; rx with no error
  119. MSK_PTX  EQU    02h             ; tx with no error
  120. MSK_RXE  EQU    04h             ; rx with error
  121. MSK_TXE  EQU    08h             ; tx with error
  122. MSK_OVW  EQU    10h             ; overwrite warning
  123. MSK_CNT  EQU    20h             ; MSB of one of the tally counters is set
  124. MSK_RDC  EQU    40h             ; remote dma completed
  125. MSK_RST  EQU    80h             ; reset state indicator
  126.  
  127. ;***********************************************************************
  128. ;
  129. ;       8390 DCR MASK
  130. ;***********************************************************************
  131.  
  132. MSK_WTS EQU     01h             ; word transfer mode selection
  133. MSK_BOS EQU     02h             ; byte order selection
  134. MSK_LAS EQU     04h             ; long addr selection
  135. MSK_BMS EQU     08h             ; burst mode selection
  136. MSK_ARM EQU     10h             ; atuoinitialize remote
  137. MSK_FT00 EQU    00h             ; burst lrngth selection
  138. MSK_FT01 EQU    20h             ; burst lrngth selection
  139. MSK_FT10 EQU    40h             ; burst lrngth selection
  140. MSK_FT11 EQU    60h             ; burst lrngth selection
  141.  
  142. ;***********************************************************************
  143. ;
  144. ;       8390 RCVR MASK
  145. ;***********************************************************************
  146.  
  147. MSK_SEP EQU     01h             ; save error pkts
  148. MSK_AR  EQU     02h             ; accept runt pkt
  149. MSK_AB  EQU     04h             ; accept broadcast 
  150. MSK_AM  EQU     08h             ; accept multicast 
  151. MSK_PRO EQU     10h             ; promiscuous physical
  152.                                 ; accept all pkt with physical adr
  153. MSK_MON EQU     20h             ; monitor mode
  154.  
  155. ;***********************************************************************
  156. ;
  157. ;       8390 TCR MASK
  158. ;***********************************************************************
  159.  
  160. MSK_CRC EQU     01h             ; inhibit CRC, do not append crc
  161.  
  162. MSK_LBm1 EQU    02h             ; mode 1; internal loopback LPBK=0
  163. MSK_LB01 EQU    06h             ; encoded loopback control
  164. MSK_ATD EQU     08h             ; auto tx disable
  165. MSK_OFST EQU    10h             ; collision offset enable
  166.  
  167. ;***********************************************************************
  168. ;
  169. ;       8390 RSR MASK
  170. ;***********************************************************************
  171.  
  172. SMK_PRX  EQU    01h             ; rx without error
  173. SMK_CRC  EQU    02h             ; CRC error
  174. SMK_FAE  EQU    04h             ; frame alignment error
  175. SMK_FO   EQU    08h             ; FIFO overrun
  176. SMK_MPA  EQU    10h             ; missed pkt
  177. SMK_PHY  EQU    20h             ; physical/multicase address
  178. SMK_DIS  EQU    40h             ; receiver disable. set in monitor mode
  179. SMK_DEF  EQU    80h             ; deferring
  180.  
  181. ;***********************************************************************
  182. ;
  183. ;       8390 TSR MASK
  184. ;***********************************************************************
  185.  
  186. SMK_PTX  EQU    01h             ; tx without error
  187. SMK_DFR  EQU    02h             ; non deferred tx
  188. SMK_COL  EQU    04h             ; tx collided
  189. SMK_ABT  EQU    08h             ; tx aboort because of excessive collisions
  190. SMK_CRS  EQU    10h             ; carrier sense lost
  191. SMK_FU   EQU    20h             ; FIFO underrun
  192. SMK_CDH  EQU    40h             ; collision detect heartbeat
  193. SMK_OWC  EQU    80h             ; out of window collision
  194.  
  195.  
  196.  
  197. ;***********************************************************************
  198. ;
  199. ;       Miscellaneous Constants
  200. ;***********************************************************************
  201.  
  202. ;
  203. ; PIC (8259) Information 
  204. ;
  205. EOI     EQU     20h                     ; End Of Interrupt
  206. INTA00  EQU     20h                     ; 8259 port
  207. INTA01  EQU     21h                     ; 8259 port
  208. ;
  209. ; Buffer Length and Field Definition Info
  210. ;
  211. BPNA    EQU     6                       ; Bytes Per Network Address
  212. MIN_DATA  EQU   52 + BPNA               ; 52 bytes data + 6 bytes address
  213. TX_BLK_LEN      EQU     2               ; Offset to Dest Address in TX Block
  214. TX_BLK_ADD      EQU     BPNA            ; Length of TX block dest addr field
  215. TX_HDR_LEN   EQU  TX_BLK_LEN + TX_BLK_ADD       ; Offset to Data in TX Block
  216. RX_TRAIL        EQU     02              ; Trailer def for Received Frame Status
  217. RX_HDR_LEN      EQU     12              ; Offset to Data in Received Frame
  218.  
  219. ;***********************************************************************
  220. ;
  221. ;       shared memory constant definition
  222. ;***********************************************************************
  223. ; for rcv buff ring of shr mem
  224. STRT_PG EQU     6                       ; start at page 6
  225. STOP_PG EQU     32                      ; end at page 31
  226. ; for tx buff of shr mem
  227. TB_SIZE EQU     2                       ; number of tb buff in shr mem
  228. TB_PGNO EQU     3                       ; number of pages in one tb buff
  229.  
  230. ;***********************************************************************
  231. ;
  232. ;       Structure definitions
  233. ;***********************************************************************
  234.  
  235. ;
  236. ; MAC LAYER STATS
  237. ;
  238. mstats struc                    ; MAC Layer Statistics
  239.         t0      dd      0               ; number of attempts to transmit 
  240.         txok    dd      0               ; number of successful transmissions 
  241.         txbad   dd      0               ; number of failed transmits 
  242.         collsn  dd      0               ; number of collisions occured 
  243.         lostcrs dd      0               ; number of times the CRS was lost during tx 
  244.         lostcts dd      0               ; lost CTS 
  245.         underrun        dd      0       ; number of underrun errors 
  246.  
  247.         rxrd    dd      0               ; number of times the receiver was ready to receive 
  248.         rxok    dd      0               ; number of mpdus rxed w/o error 
  249.         rxnrd   dd      0               ; number rx's aborted for receive processing 
  250.         crcerr  dd      0               ; number of mpdus received with CRC error 
  251.         overrun dd      0               ; number of overrun errors 
  252.         algerr  dd      0               ; number of alignment errors 
  253.         srtfrm  dd      0               ; number of short frame receiver error 
  254.         rxnom   dd      0               ; number of receives lost due to lack of mem 
  255.         rxblkd  dd      0               ; NOT USED
  256.  
  257. ;  The following are not used right now....
  258.         ex_lockup       dd      0       ; number of times the execution unit of the chip was in lockup situation 
  259.         ia_corrup       dd      0       ; number of times the IA is corrupted 
  260.         spur_int        dd      0       ; # of spurious interrupts
  261. mstats ENDS
  262.  
  263. ;
  264. ; BUFFER DESCRIPTOR
  265. ;
  266. bufp    struc                   ; Buffer Descriptor Block
  267.         bd_next dw      0               ; Pointer to next block in chain
  268.         bd_prev dw      0               ; Pointer to previous block in chain
  269.         bd_global dw    0               ;
  270.         bd_addr dw      0               ; Address of buffer associated w/this block
  271.         bd_seq dd       2 DUP (?)       ;
  272.         bd_info dw      0               ;
  273. bufp    ENDS
  274.  
  275.