home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / KERNEL-S / V1.2 / LINUX-1.2 / LINUX-1 / linux / drivers / net / depca.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-22  |  5.2 KB  |  149 lines

  1. /*
  2.     Written 1994 by David C. Davies.
  3.  
  4.     Copyright 1994 David C. Davies. This software may be used and distributed
  5.     according to the terms of the GNU Public License, incorporated herein by
  6.     reference.
  7. */
  8.  
  9. /*
  10. ** I/O addresses. Note that the 2k buffer option is not supported in
  11. ** this driver.
  12. */
  13. #define DEPCA_NICSR ioaddr+0x00   /* Network interface CSR */
  14. #define DEPCA_RBI   ioaddr+0x02   /* RAM buffer index (2k buffer mode) */
  15. #define DEPCA_DATA  ioaddr+0x04   /* LANCE registers' data port */
  16. #define DEPCA_ADDR  ioaddr+0x06   /* LANCE registers' address port */
  17. #define DEPCA_HBASE ioaddr+0x08   /* EISA high memory base address reg. */
  18. #define DEPCA_PROM  ioaddr+0x0c   /* Ethernet address ROM data port */
  19. #define DEPCA_CNFG  ioaddr+0x0c   /* EISA Configuration port */
  20. #define DEPCA_RBSA  ioaddr+0x0e   /* RAM buffer starting address (2k buff.) */
  21.  
  22. /*
  23. ** These are LANCE registers addressable through DEPCA_ADDR 
  24. */
  25. #define CSR0       0
  26. #define CSR1       1
  27. #define CSR2       2
  28. #define CSR3       3
  29.  
  30. /* 
  31. ** NETWORK INTERFACE CSR (NI_CSR) bit definitions 
  32. */
  33.  
  34. #define TO           0x0100    /* Time Out for remote boot */
  35. #define SHE          0x0080  /* SHadow memory Enable */
  36. #define BS           0x0040  /* Bank Select */
  37. #define BUF          0x0020    /* BUFfer size (1->32k, 0->64k) */
  38. #define RBE          0x0010    /* Remote Boot Enable (1->net boot) */
  39. #define AAC          0x0008  /* Address ROM Address Counter (1->enable) */
  40. #define _128KB          0x0008  /* 128kB Network RAM (1->enable) */
  41. #define IM           0x0004    /* Interrupt Mask (1->mask) */
  42. #define IEN          0x0002    /* Interrupt tristate ENable (1->enable) */
  43. #define LED          0x0001    /* LED control */
  44.  
  45. /* 
  46. ** Control and Status Register 0 (CSR0) bit definitions 
  47. */
  48.  
  49. #define ERR         0x8000     /* Error summary */
  50. #define BABL        0x4000     /* Babble transmitter timeout error  */
  51. #define CERR        0x2000     /* Collision Error */
  52. #define MISS        0x1000     /* Missed packet */
  53. #define MERR        0x0800     /* Memory Error */
  54. #define RINT        0x0400     /* Receiver Interrupt */
  55. #define TINT        0x0200     /* Transmit Interrupt */
  56. #define IDON        0x0100     /* Initialization Done */
  57. #define INTR        0x0080     /* Interrupt Flag */
  58. #define INEA        0x0040     /* Interrupt Enable */
  59. #define RXON        0x0020     /* Receiver on */
  60. #define TXON        0x0010     /* Transmitter on */
  61. #define TDMD        0x0008     /* Transmit Demand */
  62. #define STOP        0x0004     /* Stop */
  63. #define STRT        0x0002     /* Start */
  64. #define INIT        0x0001     /* Initialize */
  65.  
  66. /*
  67. ** CONTROL AND STATUS REGISTER 3 (CSR3)
  68. */
  69.  
  70. #define BSWP        0x0004    /* Byte SWaP */
  71. #define ACON        0x0002    /* ALE control */
  72. #define BCON        0x0001    /* Byte CONtrol */
  73.  
  74. /*
  75. ** Initialization Block Mode Register 
  76. */
  77.  
  78. #define PROM           0x8000     /* Promiscuous Mode */
  79. #define EMBA           0x0080    /* Enable Modified Back-off Algorithm */
  80. #define INTL           0x0040     /* Internal Loopback */
  81. #define DRTY           0x0020     /* Disable Retry */
  82. #define COLL           0x0010     /* Force Collision */
  83. #define DTCR           0x0008     /* Disable Transmit CRC */
  84. #define LOOP           0x0004     /* Loopback */
  85. #define DTX            0x0002     /* Disable the Transmitter */
  86. #define DRX            0x0001     /* Disable the Receiver */
  87.  
  88. /*
  89. ** Receive Message Descriptor 1 (RMD1) bit definitions. 
  90. */
  91.  
  92. #define R_OWN       0x80000000     /* Owner bit 0 = host, 1 = lance */
  93. #define R_ERR         0x4000     /* Error Summary */
  94. #define R_FRAM        0x2000     /* Framing Error */
  95. #define R_OFLO        0x1000     /* Overflow Error */
  96. #define R_CRC         0x0800     /* CRC Error */
  97. #define R_BUFF        0x0400     /* Buffer Error */
  98. #define R_STP         0x0200     /* Start of Packet */
  99. #define R_ENP         0x0100     /* End of Packet */
  100.  
  101. /*
  102. ** Transmit Message Descriptor 1 (TMD1) bit definitions. 
  103. */
  104.  
  105. #define T_OWN       0x80000000     /* Owner bit 0 = host, 1 = lance */
  106. #define T_ERR         0x4000     /* Error Summary */
  107. #define T_ADD_FCS     0x2000     /* More the 1 retry needed to Xmit */
  108. #define T_MORE        0x1000    /* >1 retry to transmit packet */
  109. #define T_ONE         0x0800     /* 1 try needed to transmit the packet */
  110. #define T_DEF         0x0400     /* Deferred */
  111. #define T_STP       0x02000000     /* Start of Packet */
  112. #define T_ENP       0x01000000    /* End of Packet */
  113.  
  114. /*
  115. ** Transmit Message Descriptor 3 (TMD3) bit definitions.
  116. */
  117.  
  118. #define TMD3_BUFF    0x8000    /* BUFFer error */
  119. #define TMD3_UFLO    0x4000    /* UnderFLOw error */
  120. #define TMD3_RES     0x2000    /* REServed */
  121. #define TMD3_LCOL    0x1000    /* Late COLlision */
  122. #define TMD3_LCAR    0x0800    /* Loss of CARrier */
  123. #define TMD3_RTRY    0x0400    /* ReTRY error */
  124.  
  125. /* 
  126. ** EISA configuration Register (CNFG) bit definitions 
  127. */
  128.  
  129. #define TIMEOUT           0x0100    /* 0:2.5 mins, 1: 30 secs */
  130. #define REMOTE          0x0080  /* Remote Boot Enable -> 1 */
  131. #define IRQ11           0x0040  /* Enable -> 1 */
  132. #define IRQ10        0x0020    /* Enable -> 1 */
  133. #define IRQ9        0x0010    /* Enable -> 1 */
  134. #define IRQ5          0x0008  /* Enable -> 1 */
  135. #define BUFF         0x0004    /* 0: 64kB or 128kB, 1: 32kB */
  136. #define PADR16       0x0002    /* RAM on 64kB boundary */
  137. #define PADR17        0x0001    /* RAM on 128kB boundary */
  138.  
  139. /*
  140. ** Miscellaneous
  141. */
  142.  
  143. #define MASK_INTERRUPTS   1
  144. #define UNMASK_INTERRUPTS 0
  145.  
  146. #define EISA_EN         0x0001   /* Enable EISA bus buffers */
  147. #define DEPCA_EISA_ID   ioaddr+0x80   /* ID long word for EISA card */
  148. #define DEPCA_EISA_CTRL ioaddr+0x84   /* Control word for EISA card */
  149.