i82593.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:5k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * Definitions for Intel 82593 CSMA/CD Core LAN Controller
  3.  * The definitions are taken from the 1992 users manual with Intel
  4.  * order number 297125-001.
  5.  *
  6.  * /usr/src/pc/RCS/i82593.h,v 1.1 1996/07/17 15:23:12 root Exp
  7.  *
  8.  * Copyright 1994, Anders Klemets <klemets@it.kth.se>
  9.  *
  10.  * This software may be freely distributed for noncommercial purposes
  11.  * as long as this notice is retained.
  12.  * 
  13.  * HISTORY
  14.  * i82593.h,v
  15.  * Revision 1.1  1996/07/17 15:23:12  root
  16.  * Initial revision
  17.  *
  18.  * Revision 1.3  1995/04/05  15:13:58  adj
  19.  * Initial alpha release
  20.  *
  21.  * Revision 1.2  1994/06/16  23:57:31  klemets
  22.  * Mirrored all the fields in the configuration block.
  23.  *
  24.  * Revision 1.1  1994/06/02  20:25:34  klemets
  25.  * Initial revision
  26.  *
  27.  *
  28.  */
  29. #ifndef _I82593_H
  30. #define _I82593_H
  31. /* Intel 82593 CSMA/CD Core LAN Controller */
  32. /* Port 0 Command Register definitions */
  33. /* Execution operations */
  34. #define OP0_NOP 0 /* CHNL = 0 */
  35. #define OP0_SWIT_TO_PORT_1 0 /* CHNL = 1 */
  36. #define OP0_IA_SETUP 1
  37. #define OP0_CONFIGURE 2
  38. #define OP0_MC_SETUP 3
  39. #define OP0_TRANSMIT 4
  40. #define OP0_TDR 5
  41. #define OP0_DUMP 6
  42. #define OP0_DIAGNOSE 7
  43. #define OP0_TRANSMIT_NO_CRC 9
  44. #define OP0_RETRANSMIT 12
  45. #define OP0_ABORT 13
  46. /* Reception operations */
  47. #define OP0_RCV_ENABLE 8
  48. #define OP0_RCV_DISABLE 10
  49. #define OP0_STOP_RCV 11
  50. /* Status pointer control operations */
  51. #define OP0_FIX_PTR 15 /* CHNL = 1 */
  52. #define OP0_RLS_PTR 15 /* CHNL = 0 */
  53. #define OP0_RESET 14
  54. #define CR0_CHNL (1 << 4) /* 0=Channel 0, 1=Channel 1 */
  55. #define CR0_STATUS_0 0x00
  56. #define CR0_STATUS_1 0x20
  57. #define CR0_STATUS_2 0x40
  58. #define CR0_STATUS_3 0x60
  59. #define CR0_INT_ACK (1 << 7) /* 0=No ack, 1=acknowledge */
  60. /* Port 0 Status Register definitions */
  61. #define SR0_NO_RESULT 0 /* dummy */
  62. #define SR0_EVENT_MASK 0x0f
  63. #define SR0_IA_SETUP_DONE 1
  64. #define SR0_CONFIGURE_DONE 2
  65. #define SR0_MC_SETUP_DONE 3
  66. #define SR0_TRANSMIT_DONE 4
  67. #define SR0_TDR_DONE 5
  68. #define SR0_DUMP_DONE 6
  69. #define SR0_DIAGNOSE_PASSED 7
  70. #define SR0_TRANSMIT_NO_CRC_DONE 9
  71. #define SR0_RETRANSMIT_DONE 12
  72. #define SR0_EXECUTION_ABORTED 13
  73. #define SR0_END_OF_FRAME 8
  74. #define SR0_RECEPTION_ABORTED 10
  75. #define SR0_DIAGNOSE_FAILED 15
  76. #define SR0_STOP_REG_HIT 11
  77. #define SR0_CHNL (1 << 4)
  78. #define SR0_EXECUTION (1 << 5)
  79. #define SR0_RECEPTION (1 << 6)
  80. #define SR0_INTERRUPT (1 << 7)
  81. #define SR0_BOTH_RX_TX (SR0_EXECUTION | SR0_RECEPTION)
  82. #define SR3_EXEC_STATE_MASK 0x03
  83. #define SR3_EXEC_IDLE 0
  84. #define SR3_TX_ABORT_IN_PROGRESS 1
  85. #define SR3_EXEC_ACTIVE 2
  86. #define SR3_ABORT_IN_PROGRESS 3
  87. #define SR3_EXEC_CHNL (1 << 2)
  88. #define SR3_STP_ON_NO_RSRC (1 << 3)
  89. #define SR3_RCVING_NO_RSRC (1 << 4)
  90. #define SR3_RCV_STATE_MASK 0x60
  91. #define SR3_RCV_IDLE 0x00
  92. #define SR3_RCV_READY 0x20
  93. #define SR3_RCV_ACTIVE 0x40
  94. #define SR3_RCV_STOP_IN_PROG 0x60
  95. #define SR3_RCV_CHNL (1 << 7)
  96. /* Port 1 Command Register definitions */
  97. #define OP1_NOP 0
  98. #define OP1_SWIT_TO_PORT_0 1
  99. #define OP1_INT_DISABLE 2
  100. #define OP1_INT_ENABLE 3
  101. #define OP1_SET_TS 5
  102. #define OP1_RST_TS 7
  103. #define OP1_POWER_DOWN 8
  104. #define OP1_RESET_RING_MNGMT 11
  105. #define OP1_RESET 14
  106. #define OP1_SEL_RST 15
  107. #define CR1_STATUS_4 0x00
  108. #define CR1_STATUS_5 0x20
  109. #define CR1_STATUS_6 0x40
  110. #define CR1_STOP_REG_UPDATE (1 << 7)
  111. /* Receive frame status bits */
  112. #define RX_RCLD (1 << 0)
  113. #define RX_IA_MATCH (1 << 1)
  114. #define RX_NO_AD_MATCH (1 << 2)
  115. #define RX_NO_SFD (1 << 3)
  116. #define RX_SRT_FRM (1 << 7)
  117. #define RX_OVRRUN (1 << 8)
  118. #define RX_ALG_ERR (1 << 10)
  119. #define RX_CRC_ERR (1 << 11)
  120. #define RX_LEN_ERR (1 << 12)
  121. #define RX_RCV_OK (1 << 13)
  122. #define RX_TYP_LEN (1 << 15)
  123. /* Transmit status bits */
  124. #define TX_NCOL_MASK 0x0f
  125. #define TX_FRTL (1 << 4)
  126. #define TX_MAX_COL (1 << 5)
  127. #define TX_HRT_BEAT (1 << 6)
  128. #define TX_DEFER (1 << 7)
  129. #define TX_UND_RUN (1 << 8)
  130. #define TX_LOST_CTS (1 << 9)
  131. #define TX_LOST_CRS (1 << 10)
  132. #define TX_LTCOL (1 << 11)
  133. #define TX_OK (1 << 13)
  134. #define TX_COLL (1 << 15)
  135. struct i82593_conf_block {
  136.   u_char fifo_limit : 4,
  137.     forgnesi   : 1,
  138.     fifo_32    : 1,
  139.     d6mod      : 1,
  140.     throttle_enb : 1;
  141.   u_char throttle   : 6,
  142.  cntrxint   : 1,
  143.  contin     : 1;
  144.   u_char addr_len   : 3,
  145.     acloc      : 1,
  146.    preamb_len : 2,
  147.     loopback   : 2;
  148.   u_char lin_prio   : 3,
  149.  tbofstop   : 1,
  150.  exp_prio   : 3,
  151.  bof_met    : 1;
  152.   u_char     : 4,
  153.  ifrm_spc   : 4;
  154.   u_char     : 5,
  155.  slottim_low : 3;
  156.   u_char slottim_hi : 3,
  157.     : 1,
  158.  max_retr   : 4;
  159.   u_char prmisc     : 1,
  160.  bc_dis     : 1,
  161.        : 1,
  162.  crs_1     : 1,
  163.  nocrc_ins  : 1,
  164.  crc_1632   : 1,
  165.          : 1,
  166.     crs_cdt    : 1;
  167.   u_char cs_filter  : 3,
  168.  crs_src    : 1,
  169.  cd_filter  : 3,
  170.     : 1;
  171.   u_char     : 2,
  172.     min_fr_len : 6;
  173.   u_char lng_typ    : 1,
  174.  lng_fld    : 1,
  175.  rxcrc_xf   : 1,
  176.  artx     : 1,
  177.  sarec     : 1,
  178.  tx_jabber  : 1, /* why is this called max_len in the manual? */
  179.  hash_1     : 1,
  180.     lbpkpol    : 1;
  181.   u_char     : 6,
  182.     fdx     : 1,
  183.           : 1;
  184.   u_char dummy_6    : 6, /* supposed to be ones */
  185.     mult_ia    : 1,
  186.     dis_bof    : 1;
  187.   u_char dummy_1    : 1, /* supposed to be one */
  188.  tx_ifs_retrig : 2,
  189.  mc_all     : 1,
  190.  rcv_mon    : 2,
  191.  frag_acpt  : 1,
  192.     tstrttrs   : 1;
  193.   u_char fretx     : 1,
  194.  runt_eop   : 1,
  195.  hw_sw_pin  : 1,
  196.  big_endn   : 1,
  197.  syncrqs    : 1,
  198.  sttlen     : 1,
  199.  tx_eop     : 1,
  200.     rx_eop     : 1;
  201.   u_char rbuf_size  : 5,
  202.  rcvstop    : 1,
  203.          : 2;
  204. };
  205. #define I82593_MAX_MULTICAST_ADDRESSES 128 /* Hardware hashed filter */
  206. #endif /* _I82593_H */