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