選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

sk_g16.h 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*-
  2. *
  3. * This software may be used and distributed according to the terms
  4. * of the GNU Public License, incorporated herein by reference.
  5. *
  6. * Module : sk_g16.h
  7. * Version : $Revision$
  8. *
  9. * Author : M.Hipp (mhipp@student.uni-tuebingen.de)
  10. * changes by : Patrick J.D. Weichmann
  11. *
  12. * Date Created : 94/05/25
  13. *
  14. * Description : In here are all necessary definitions of
  15. * the am7990 (LANCE) chip used for writing a
  16. * network device driver which uses this chip
  17. *
  18. * $Log$
  19. * Revision 1.1 2005/03/08 18:53:40 mcb30
  20. * Initial revision
  21. *
  22. * Revision 1.1 2002/12/12 02:18:20 ebiederm
  23. * Moved network drivers into drivers/net
  24. *
  25. -*/
  26. #ifndef SK_G16_H
  27. #define SK_G16_H
  28. /*
  29. * Control and Status Register 0 (CSR0) bit definitions
  30. *
  31. * (R=Readable) (W=Writeable) (S=Set on write) (C-Clear on write)
  32. *
  33. */
  34. #define CSR0_ERR 0x8000 /* Error summary (R) */
  35. #define CSR0_BABL 0x4000 /* Babble transmitter timeout error (RC) */
  36. #define CSR0_CERR 0x2000 /* Collision Error (RC) */
  37. #define CSR0_MISS 0x1000 /* Missed packet (RC) */
  38. #define CSR0_MERR 0x0800 /* Memory Error (RC) */
  39. #define CSR0_RINT 0x0400 /* Receiver Interrupt (RC) */
  40. #define CSR0_TINT 0x0200 /* Transmit Interrupt (RC) */
  41. #define CSR0_IDON 0x0100 /* Initialization Done (RC) */
  42. #define CSR0_INTR 0x0080 /* Interrupt Flag (R) */
  43. #define CSR0_INEA 0x0040 /* Interrupt Enable (RW) */
  44. #define CSR0_RXON 0x0020 /* Receiver on (R) */
  45. #define CSR0_TXON 0x0010 /* Transmitter on (R) */
  46. #define CSR0_TDMD 0x0008 /* Transmit Demand (RS) */
  47. #define CSR0_STOP 0x0004 /* Stop (RS) */
  48. #define CSR0_STRT 0x0002 /* Start (RS) */
  49. #define CSR0_INIT 0x0001 /* Initialize (RS) */
  50. #define CSR0_CLRALL 0x7f00 /* mask for all clearable bits */
  51. /*
  52. * Control and Status Register 3 (CSR3) bit definitions
  53. *
  54. */
  55. #define CSR3_BSWAP 0x0004 /* Byte Swap (RW) */
  56. #define CSR3_ACON 0x0002 /* ALE Control (RW) */
  57. #define CSR3_BCON 0x0001 /* Byte Control (RW) */
  58. /*
  59. * Initialization Block Mode operation Bit Definitions.
  60. */
  61. #define MODE_PROM 0x8000 /* Promiscuous Mode */
  62. #define MODE_INTL 0x0040 /* Internal Loopback */
  63. #define MODE_DRTY 0x0020 /* Disable Retry */
  64. #define MODE_COLL 0x0010 /* Force Collision */
  65. #define MODE_DTCR 0x0008 /* Disable Transmit CRC) */
  66. #define MODE_LOOP 0x0004 /* Loopback */
  67. #define MODE_DTX 0x0002 /* Disable the Transmitter */
  68. #define MODE_DRX 0x0001 /* Disable the Receiver */
  69. #define MODE_NORMAL 0x0000 /* Normal operation mode */
  70. /*
  71. * Receive message descriptor status bit definitions.
  72. */
  73. #define RX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */
  74. #define RX_ERR 0x40 /* Error Summary */
  75. #define RX_FRAM 0x20 /* Framing Error */
  76. #define RX_OFLO 0x10 /* Overflow Error */
  77. #define RX_CRC 0x08 /* CRC Error */
  78. #define RX_BUFF 0x04 /* Buffer Error */
  79. #define RX_STP 0x02 /* Start of Packet */
  80. #define RX_ENP 0x01 /* End of Packet */
  81. /*
  82. * Transmit message descriptor status bit definitions.
  83. */
  84. #define TX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */
  85. #define TX_ERR 0x40 /* Error Summary */
  86. #define TX_MORE 0x10 /* More the 1 retry needed to Xmit */
  87. #define TX_ONE 0x08 /* One retry needed to Xmit */
  88. #define TX_DEF 0x04 /* Deferred */
  89. #define TX_STP 0x02 /* Start of Packet */
  90. #define TX_ENP 0x01 /* End of Packet */
  91. /*
  92. * Transmit status (2) (valid if TX_ERR == 1)
  93. */
  94. #define TX_BUFF 0x8000 /* Buffering error (no ENP) */
  95. #define TX_UFLO 0x4000 /* Underflow (late memory) */
  96. #define TX_LCOL 0x1000 /* Late collision */
  97. #define TX_LCAR 0x0400 /* Loss of Carrier */
  98. #define TX_RTRY 0x0200 /* Failed after 16 retransmissions */
  99. #define TX_TDR 0x003f /* Time-domain-reflectometer-value */
  100. /*
  101. * Structures used for Communication with the LANCE
  102. */
  103. /* LANCE Initialize Block */
  104. struct init_block
  105. {
  106. unsigned short mode; /* Mode Register */
  107. unsigned char paddr[6]; /* Physical Address (MAC) */
  108. unsigned char laddr[8]; /* Logical Filter Address (not used) */
  109. unsigned int rdrp; /* Receive Descriptor Ring pointer */
  110. unsigned int tdrp; /* Transmit Descriptor Ring pointer */
  111. };
  112. /* Receive Message Descriptor Entry */
  113. struct rmd
  114. {
  115. union rmd_u
  116. {
  117. unsigned long buffer; /* Address of buffer */
  118. struct rmd_s
  119. {
  120. unsigned char unused[3];
  121. unsigned volatile char status; /* Status Bits */
  122. } s;
  123. } u;
  124. volatile short blen; /* Buffer Length (two's complement) */
  125. unsigned short mlen; /* Message Byte Count */
  126. };
  127. /* Transmit Message Descriptor Entry */
  128. struct tmd
  129. {
  130. union tmd_u
  131. {
  132. unsigned long buffer; /* Address of buffer */
  133. struct tmd_s
  134. {
  135. unsigned char unused[3];
  136. unsigned volatile char status; /* Status Bits */
  137. } s;
  138. } u;
  139. unsigned short blen; /* Buffer Length (two's complement) */
  140. unsigned volatile short status2; /* Error Status Bits */
  141. };
  142. #endif /* End of SK_G16_H */