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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*******************************************************************************
  2.   
  3.   Copyright(c) 1999 - 2002 Intel Corporation. All rights reserved.
  4.   
  5.   This program is free software; you can redistribute it and/or modify it 
  6.   under the terms of the GNU General Public License as published by the Free 
  7.   Software Foundation; either version 2 of the License, or (at your option) 
  8.   any later version.
  9.   
  10.   This program is distributed in the hope that it will be useful, but WITHOUT 
  11.   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  12.   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
  13.   more details.
  14.   
  15.   You should have received a copy of the GNU General Public License along with
  16.   this program; if not, write to the Free Software Foundation, Inc., 59 
  17.   Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.   
  19.   The full GNU General Public License is included in this distribution in the
  20.   file called LICENSE.
  21.   
  22.   Contact Information:
  23.   Linux NICS <linux.nics@intel.com>
  24.   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  25. *******************************************************************************/
  26. #ifndef _E100_CONFIG_INC_
  27. #define _E100_CONFIG_INC_
  28. #include "e100.h"
  29. #define E100_CONFIG(bdp, X) ((bdp)->config[0] = max_t(u8, (bdp)->config[0], (X)+1))
  30. #define CB_CFIG_MIN_PARAMS         8
  31. /* byte 0 bit definitions*/
  32. #define CB_CFIG_BYTE_COUNT_MASK     BIT_0_5 /* Byte count occupies bit 5-0 */
  33. /* byte 1 bit definitions*/
  34. #define CB_CFIG_RXFIFO_LIMIT_MASK   BIT_0_4 /* RxFifo limit mask */
  35. #define CB_CFIG_TXFIFO_LIMIT_MASK   BIT_4_7 /* TxFifo limit mask */
  36. /* byte 2 bit definitions -- ADAPTIVE_IFS*/
  37. /* word 3 bit definitions -- RESERVED*/
  38. /* Changed for 82558 enhancements */
  39. /* byte 3 bit definitions */
  40. #define CB_CFIG_MWI_EN      BIT_0 /* Enable MWI on PCI bus */
  41. #define CB_CFIG_TYPE_EN     BIT_1 /* Type Enable */
  42. #define CB_CFIG_READAL_EN   BIT_2 /* Enable Read Align */
  43. #define CB_CFIG_TERMCL_EN   BIT_3 /* Cache line write  */
  44. /* byte 4 bit definitions*/
  45. #define CB_CFIG_RX_MIN_DMA_MASK     BIT_0_6 /* Rx minimum DMA count mask */
  46. /* byte 5 bit definitions*/
  47. #define CB_CFIG_TX_MIN_DMA_MASK BIT_0_6 /* Tx minimum DMA count mask */
  48. #define CB_CFIG_DMBC_EN         BIT_7 /* Enable Tx/Rx min. DMA counts */
  49. /* Changed for 82558 enhancements */
  50. /* byte 6 bit definitions*/
  51. #define CB_CFIG_LATE_SCB           BIT_0 /* Update SCB After New Tx Start */
  52. #define CB_CFIG_DIRECT_DMA_DIS     BIT_1 /* Direct DMA mode */
  53. #define CB_CFIG_TNO_INT            BIT_2 /* Tx Not OK Interrupt */
  54. #define CB_CFIG_TCO_STAT           BIT_2 /* TCO statistics in 559 and above */
  55. #define CB_CFIG_CI_INT             BIT_3 /* Command Complete Interrupt */
  56. #define CB_CFIG_EXT_TCB_DIS        BIT_4 /* Extended TCB */
  57. #define CB_CFIG_EXT_STAT_DIS       BIT_5 /* Extended Stats */
  58. #define CB_CFIG_SAVE_BAD_FRAMES    BIT_7 /* Save Bad Frames Enabled */
  59. /* byte 7 bit definitions*/
  60. #define CB_CFIG_DISC_SHORT_FRAMES   BIT_0 /* Discard Short Frames */
  61. #define CB_CFIG_DYNTBD_EN           BIT_7 /* Enable dynamic TBD */
  62. /* Enable extended RFD's on D102 */
  63. #define CB_CFIG_EXTENDED_RFD        BIT_5
  64. /* byte 8 bit definitions*/
  65. #define CB_CFIG_503_MII             BIT_0 /* 503 vs. MII mode */
  66. /* byte 9 bit definitions -- pre-defined all zeros*/
  67. #define CB_LINK_STATUS_WOL BIT_5
  68. /* byte 10 bit definitions*/
  69. #define CB_CFIG_NO_SRCADR       BIT_3 /* No Source Address Insertion */
  70. #define CB_CFIG_PREAMBLE_LEN    BIT_4_5 /* Preamble Length */
  71. #define CB_CFIG_LOOPBACK_MODE   BIT_6_7 /* Loopback Mode */
  72. #define CB_CFIG_LOOPBACK_NORMAL 0
  73. #define CB_CFIG_LOOPBACK_INTERNAL BIT_6
  74. #define CB_CFIG_LOOPBACK_EXTERNAL BIT_6_7
  75. /* byte 11 bit definitions*/
  76. #define CB_CFIG_LINEAR_PRIORITY     BIT_0_2 /* Linear Priority */
  77. /* byte 12 bit definitions*/
  78. #define CB_CFIG_LINEAR_PRI_MODE     BIT_0 /* Linear Priority mode */
  79. #define CB_CFIG_IFS_MASK            BIT_4_7 /* Interframe Spacing mask */
  80. /* byte 13 bit definitions -- pre-defined all zeros*/
  81. /* byte 14 bit definitions -- pre-defined 0xf2*/
  82. /* byte 15 bit definitions*/
  83. #define CB_CFIG_PROMISCUOUS         BIT_0 /* Promiscuous Mode Enable */
  84. #define CB_CFIG_BROADCAST_DIS       BIT_1 /* Broadcast Mode Disable */
  85. #define CB_CFIG_CRS_OR_CDT          BIT_7 /* CRS Or CDT */
  86. /* byte 16 bit definitions -- pre-defined all zeros*/
  87. #define DFLT_FC_DELAY_LSB  0x1f /* Delay for outgoing Pause frames */
  88. #define DFLT_NO_FC_DELAY_LSB  0x00 /* no flow control default value */
  89. /* byte 17 bit definitions -- pre-defined 0x40*/
  90. #define DFLT_FC_DELAY_MSB  0x01 /* Delay for outgoing Pause frames */
  91. #define DFLT_NO_FC_DELAY_MSB  0x40 /* no flow control default value */
  92. /* byte 18 bit definitions*/
  93. #define CB_CFIG_STRIPPING           BIT_0 /* Padding Disabled */
  94. #define CB_CFIG_PADDING             BIT_1 /* Padding Disabled */
  95. #define CB_CFIG_CRC_IN_MEM          BIT_2 /* Transfer CRC To Memory */
  96. /* byte 19 bit definitions*/
  97. #define CB_CFIG_TX_ADDR_WAKE        BIT_0 /* Address Wakeup */
  98. #define CB_DISABLE_MAGPAK_WAKE      BIT_1 /* Magic Packet Wakeup disable */
  99. /* Changed TX_FC_EN to TX_FC_DIS because 0 enables, 1 disables. Jul 8, 1999 */
  100. #define CB_CFIG_TX_FC_DIS           BIT_2 /* Tx Flow Control Disable */
  101. #define CB_CFIG_FC_RESTOP           BIT_3 /* Rx Flow Control Restop */
  102. #define CB_CFIG_FC_RESTART          BIT_4 /* Rx Flow Control Restart */
  103. #define CB_CFIG_FC_REJECT           BIT_5 /* Rx Flow Control Restart */
  104. #define CB_CFIG_FC_OPTS (CB_CFIG_FC_RESTOP | CB_CFIG_FC_RESTART | CB_CFIG_FC_REJECT)
  105. /* end 82558/9 specifics */
  106. #define CB_CFIG_FORCE_FDX           BIT_6 /* Force Full Duplex */
  107. #define CB_CFIG_FDX_ENABLE          BIT_7 /* Full Duplex Enabled */
  108. /* byte 20 bit definitions*/
  109. #define CB_CFIG_MULTI_IA            BIT_6 /* Multiple IA Addr */
  110. /* byte 21 bit definitions*/
  111. #define CB_CFIG_MULTICAST_ALL       BIT_3 /* Multicast All */
  112. /* byte 22 bit defines */
  113. #define CB_CFIG_RECEIVE_GAMLA_MODE  BIT_0 /* D102 receive mode */
  114. #define CB_CFIG_VLAN_DROP_ENABLE    BIT_1 /* vlan stripping */
  115. #define CB_CFIG_LONG_RX_OK     BIT_3
  116. #define NO_LOOPBACK 0
  117. #define MAC_LOOPBACK 0x01
  118. #define PHY_LOOPBACK 0x02
  119. /* function prototypes */
  120. extern void e100_config_init(struct e100_private *bdp);
  121. extern unsigned char e100_force_config(struct e100_private *bdp);
  122. extern unsigned char e100_config(struct e100_private *bdp);
  123. extern void e100_config_fc(struct e100_private *bdp);
  124. extern void e100_config_promisc(struct e100_private *bdp, unsigned char enable);
  125. extern void e100_config_brdcast_dsbl(struct e100_private *bdp);
  126. extern void e100_config_mulcast_enbl(struct e100_private *bdp,
  127.      unsigned char enable);
  128. extern void e100_config_ifs(struct e100_private *bdp);
  129. extern void e100_config_force_dplx(struct e100_private *bdp);
  130. extern u8 e100_config_loopback_mode(struct e100_private *bdp, u8 mode);
  131. extern u8 e100_config_dynamic_tbd(struct e100_private *bdp, u8 enable);
  132. extern u8 e100_config_tcb_ext_enable(struct e100_private *bdp, u8 enable);
  133. #endif /* _E100_CONFIG_INC_ */