diff options
Diffstat (limited to 'drivers/net/tg3.h')
-rw-r--r-- | drivers/net/tg3.h | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 993f84c93dc4..5c4433c147fa 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -136,6 +136,7 @@ | |||
136 | #define ASIC_REV_5705 0x03 | 136 | #define ASIC_REV_5705 0x03 |
137 | #define ASIC_REV_5750 0x04 | 137 | #define ASIC_REV_5750 0x04 |
138 | #define ASIC_REV_5752 0x06 | 138 | #define ASIC_REV_5752 0x06 |
139 | #define ASIC_REV_5780 0x08 | ||
139 | #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) | 140 | #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) |
140 | #define CHIPREV_5700_AX 0x70 | 141 | #define CHIPREV_5700_AX 0x70 |
141 | #define CHIPREV_5700_BX 0x71 | 142 | #define CHIPREV_5700_BX 0x71 |
@@ -879,31 +880,41 @@ | |||
879 | #define LOW_RXCOL_TICKS_CLRTCKS 0x00000014 | 880 | #define LOW_RXCOL_TICKS_CLRTCKS 0x00000014 |
880 | #define DEFAULT_RXCOL_TICKS 0x00000048 | 881 | #define DEFAULT_RXCOL_TICKS 0x00000048 |
881 | #define HIGH_RXCOL_TICKS 0x00000096 | 882 | #define HIGH_RXCOL_TICKS 0x00000096 |
883 | #define MAX_RXCOL_TICKS 0x000003ff | ||
882 | #define HOSTCC_TXCOL_TICKS 0x00003c0c | 884 | #define HOSTCC_TXCOL_TICKS 0x00003c0c |
883 | #define LOW_TXCOL_TICKS 0x00000096 | 885 | #define LOW_TXCOL_TICKS 0x00000096 |
884 | #define LOW_TXCOL_TICKS_CLRTCKS 0x00000048 | 886 | #define LOW_TXCOL_TICKS_CLRTCKS 0x00000048 |
885 | #define DEFAULT_TXCOL_TICKS 0x0000012c | 887 | #define DEFAULT_TXCOL_TICKS 0x0000012c |
886 | #define HIGH_TXCOL_TICKS 0x00000145 | 888 | #define HIGH_TXCOL_TICKS 0x00000145 |
889 | #define MAX_TXCOL_TICKS 0x000003ff | ||
887 | #define HOSTCC_RXMAX_FRAMES 0x00003c10 | 890 | #define HOSTCC_RXMAX_FRAMES 0x00003c10 |
888 | #define LOW_RXMAX_FRAMES 0x00000005 | 891 | #define LOW_RXMAX_FRAMES 0x00000005 |
889 | #define DEFAULT_RXMAX_FRAMES 0x00000008 | 892 | #define DEFAULT_RXMAX_FRAMES 0x00000008 |
890 | #define HIGH_RXMAX_FRAMES 0x00000012 | 893 | #define HIGH_RXMAX_FRAMES 0x00000012 |
894 | #define MAX_RXMAX_FRAMES 0x000000ff | ||
891 | #define HOSTCC_TXMAX_FRAMES 0x00003c14 | 895 | #define HOSTCC_TXMAX_FRAMES 0x00003c14 |
892 | #define LOW_TXMAX_FRAMES 0x00000035 | 896 | #define LOW_TXMAX_FRAMES 0x00000035 |
893 | #define DEFAULT_TXMAX_FRAMES 0x0000004b | 897 | #define DEFAULT_TXMAX_FRAMES 0x0000004b |
894 | #define HIGH_TXMAX_FRAMES 0x00000052 | 898 | #define HIGH_TXMAX_FRAMES 0x00000052 |
899 | #define MAX_TXMAX_FRAMES 0x000000ff | ||
895 | #define HOSTCC_RXCOAL_TICK_INT 0x00003c18 | 900 | #define HOSTCC_RXCOAL_TICK_INT 0x00003c18 |
896 | #define DEFAULT_RXCOAL_TICK_INT 0x00000019 | 901 | #define DEFAULT_RXCOAL_TICK_INT 0x00000019 |
897 | #define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014 | 902 | #define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014 |
903 | #define MAX_RXCOAL_TICK_INT 0x000003ff | ||
898 | #define HOSTCC_TXCOAL_TICK_INT 0x00003c1c | 904 | #define HOSTCC_TXCOAL_TICK_INT 0x00003c1c |
899 | #define DEFAULT_TXCOAL_TICK_INT 0x00000019 | 905 | #define DEFAULT_TXCOAL_TICK_INT 0x00000019 |
900 | #define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014 | 906 | #define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014 |
907 | #define MAX_TXCOAL_TICK_INT 0x000003ff | ||
901 | #define HOSTCC_RXCOAL_MAXF_INT 0x00003c20 | 908 | #define HOSTCC_RXCOAL_MAXF_INT 0x00003c20 |
902 | #define DEFAULT_RXCOAL_MAXF_INT 0x00000005 | 909 | #define DEFAULT_RXCOAL_MAXF_INT 0x00000005 |
910 | #define MAX_RXCOAL_MAXF_INT 0x000000ff | ||
903 | #define HOSTCC_TXCOAL_MAXF_INT 0x00003c24 | 911 | #define HOSTCC_TXCOAL_MAXF_INT 0x00003c24 |
904 | #define DEFAULT_TXCOAL_MAXF_INT 0x00000005 | 912 | #define DEFAULT_TXCOAL_MAXF_INT 0x00000005 |
913 | #define MAX_TXCOAL_MAXF_INT 0x000000ff | ||
905 | #define HOSTCC_STAT_COAL_TICKS 0x00003c28 | 914 | #define HOSTCC_STAT_COAL_TICKS 0x00003c28 |
906 | #define DEFAULT_STAT_COAL_TICKS 0x000f4240 | 915 | #define DEFAULT_STAT_COAL_TICKS 0x000f4240 |
916 | #define MAX_STAT_COAL_TICKS 0xd693d400 | ||
917 | #define MIN_STAT_COAL_TICKS 0x00000064 | ||
907 | /* 0x3c2c --> 0x3c30 unused */ | 918 | /* 0x3c2c --> 0x3c30 unused */ |
908 | #define HOSTCC_STATS_BLK_HOST_ADDR 0x00003c30 /* 64-bit */ | 919 | #define HOSTCC_STATS_BLK_HOST_ADDR 0x00003c30 /* 64-bit */ |
909 | #define HOSTCC_STATUS_BLK_HOST_ADDR 0x00003c38 /* 64-bit */ | 920 | #define HOSTCC_STATUS_BLK_HOST_ADDR 0x00003c38 /* 64-bit */ |
@@ -974,14 +985,17 @@ | |||
974 | #define DEFAULT_MB_RDMA_LOW_WATER 0x00000050 | 985 | #define DEFAULT_MB_RDMA_LOW_WATER 0x00000050 |
975 | #define DEFAULT_MB_RDMA_LOW_WATER_5705 0x00000000 | 986 | #define DEFAULT_MB_RDMA_LOW_WATER_5705 0x00000000 |
976 | #define DEFAULT_MB_RDMA_LOW_WATER_JUMBO 0x00000130 | 987 | #define DEFAULT_MB_RDMA_LOW_WATER_JUMBO 0x00000130 |
988 | #define DEFAULT_MB_RDMA_LOW_WATER_JUMBO_5780 0x00000000 | ||
977 | #define BUFMGR_MB_MACRX_LOW_WATER 0x00004414 | 989 | #define BUFMGR_MB_MACRX_LOW_WATER 0x00004414 |
978 | #define DEFAULT_MB_MACRX_LOW_WATER 0x00000020 | 990 | #define DEFAULT_MB_MACRX_LOW_WATER 0x00000020 |
979 | #define DEFAULT_MB_MACRX_LOW_WATER_5705 0x00000010 | 991 | #define DEFAULT_MB_MACRX_LOW_WATER_5705 0x00000010 |
980 | #define DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098 | 992 | #define DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098 |
993 | #define DEFAULT_MB_MACRX_LOW_WATER_JUMBO_5780 0x0000004b | ||
981 | #define BUFMGR_MB_HIGH_WATER 0x00004418 | 994 | #define BUFMGR_MB_HIGH_WATER 0x00004418 |
982 | #define DEFAULT_MB_HIGH_WATER 0x00000060 | 995 | #define DEFAULT_MB_HIGH_WATER 0x00000060 |
983 | #define DEFAULT_MB_HIGH_WATER_5705 0x00000060 | 996 | #define DEFAULT_MB_HIGH_WATER_5705 0x00000060 |
984 | #define DEFAULT_MB_HIGH_WATER_JUMBO 0x0000017c | 997 | #define DEFAULT_MB_HIGH_WATER_JUMBO 0x0000017c |
998 | #define DEFAULT_MB_HIGH_WATER_JUMBO_5780 0x00000096 | ||
985 | #define BUFMGR_RX_MB_ALLOC_REQ 0x0000441c | 999 | #define BUFMGR_RX_MB_ALLOC_REQ 0x0000441c |
986 | #define BUFMGR_MB_ALLOC_BIT 0x10000000 | 1000 | #define BUFMGR_MB_ALLOC_BIT 0x10000000 |
987 | #define BUFMGR_RX_MB_ALLOC_RESP 0x00004420 | 1001 | #define BUFMGR_RX_MB_ALLOC_RESP 0x00004420 |
@@ -2006,17 +2020,31 @@ struct tg3_ethtool_stats { | |||
2006 | struct tg3 { | 2020 | struct tg3 { |
2007 | /* begin "general, frequently-used members" cacheline section */ | 2021 | /* begin "general, frequently-used members" cacheline section */ |
2008 | 2022 | ||
2023 | /* If the IRQ handler (which runs lockless) needs to be | ||
2024 | * quiesced, the following bitmask state is used. The | ||
2025 | * SYNC flag is set by non-IRQ context code to initiate | ||
2026 | * the quiescence. | ||
2027 | * | ||
2028 | * When the IRQ handler notices that SYNC is set, it | ||
2029 | * disables interrupts and returns. | ||
2030 | * | ||
2031 | * When all outstanding IRQ handlers have returned after | ||
2032 | * the SYNC flag has been set, the setter can be assured | ||
2033 | * that interrupts will no longer get run. | ||
2034 | * | ||
2035 | * In this way all SMP driver locks are never acquired | ||
2036 | * in hw IRQ context, only sw IRQ context or lower. | ||
2037 | */ | ||
2038 | unsigned int irq_sync; | ||
2039 | |||
2009 | /* SMP locking strategy: | 2040 | /* SMP locking strategy: |
2010 | * | 2041 | * |
2011 | * lock: Held during all operations except TX packet | 2042 | * lock: Held during all operations except TX packet |
2012 | * processing. | 2043 | * processing. |
2013 | * | 2044 | * |
2014 | * tx_lock: Held during tg3_start_xmit{,_4gbug} and tg3_tx | 2045 | * tx_lock: Held during tg3_start_xmit and tg3_tx |
2015 | * | 2046 | * |
2016 | * If you want to shut up all asynchronous processing you must | 2047 | * Both of these locks are to be held with BH safety. |
2017 | * acquire both locks, 'lock' taken before 'tx_lock'. IRQs must | ||
2018 | * be disabled to take 'lock' but only softirq disabling is | ||
2019 | * necessary for acquisition of 'tx_lock'. | ||
2020 | */ | 2048 | */ |
2021 | spinlock_t lock; | 2049 | spinlock_t lock; |
2022 | spinlock_t indirect_lock; | 2050 | spinlock_t indirect_lock; |
@@ -2063,6 +2091,8 @@ struct tg3 { | |||
2063 | struct tg3_rx_buffer_desc *rx_rcb; | 2091 | struct tg3_rx_buffer_desc *rx_rcb; |
2064 | dma_addr_t rx_rcb_mapping; | 2092 | dma_addr_t rx_rcb_mapping; |
2065 | 2093 | ||
2094 | u32 rx_pkt_buf_sz; | ||
2095 | |||
2066 | /* begin "everything else" cacheline(s) section */ | 2096 | /* begin "everything else" cacheline(s) section */ |
2067 | struct net_device_stats net_stats; | 2097 | struct net_device_stats net_stats; |
2068 | struct net_device_stats net_stats_prev; | 2098 | struct net_device_stats net_stats_prev; |
@@ -2100,7 +2130,7 @@ struct tg3 { | |||
2100 | #define TG3_FLAG_NO_TX_PSEUDO_CSUM 0x00100000 | 2130 | #define TG3_FLAG_NO_TX_PSEUDO_CSUM 0x00100000 |
2101 | #define TG3_FLAG_NO_RX_PSEUDO_CSUM 0x00200000 | 2131 | #define TG3_FLAG_NO_RX_PSEUDO_CSUM 0x00200000 |
2102 | #define TG3_FLAG_SERDES_WOL_CAP 0x00400000 | 2132 | #define TG3_FLAG_SERDES_WOL_CAP 0x00400000 |
2103 | #define TG3_FLAG_JUMBO_ENABLE 0x00800000 | 2133 | #define TG3_FLAG_JUMBO_RING_ENABLE 0x00800000 |
2104 | #define TG3_FLAG_10_100_ONLY 0x01000000 | 2134 | #define TG3_FLAG_10_100_ONLY 0x01000000 |
2105 | #define TG3_FLAG_PAUSE_AUTONEG 0x02000000 | 2135 | #define TG3_FLAG_PAUSE_AUTONEG 0x02000000 |
2106 | #define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000 | 2136 | #define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000 |
@@ -2130,6 +2160,11 @@ struct tg3 { | |||
2130 | #define TG3_FLG2_5750_PLUS 0x00080000 | 2160 | #define TG3_FLG2_5750_PLUS 0x00080000 |
2131 | #define TG3_FLG2_PROTECTED_NVRAM 0x00100000 | 2161 | #define TG3_FLG2_PROTECTED_NVRAM 0x00100000 |
2132 | #define TG3_FLG2_USING_MSI 0x00200000 | 2162 | #define TG3_FLG2_USING_MSI 0x00200000 |
2163 | #define TG3_FLG2_JUMBO_CAPABLE 0x00400000 | ||
2164 | #define TG3_FLG2_MII_SERDES 0x00800000 | ||
2165 | #define TG3_FLG2_ANY_SERDES (TG3_FLG2_PHY_SERDES | \ | ||
2166 | TG3_FLG2_MII_SERDES) | ||
2167 | #define TG3_FLG2_PARALLEL_DETECT 0x01000000 | ||
2133 | 2168 | ||
2134 | u32 split_mode_max_reqs; | 2169 | u32 split_mode_max_reqs; |
2135 | #define SPLIT_MODE_5704_MAX_REQ 3 | 2170 | #define SPLIT_MODE_5704_MAX_REQ 3 |
@@ -2163,6 +2198,7 @@ struct tg3 { | |||
2163 | u8 pci_bist; | 2198 | u8 pci_bist; |
2164 | 2199 | ||
2165 | int pm_cap; | 2200 | int pm_cap; |
2201 | int msi_cap; | ||
2166 | 2202 | ||
2167 | /* PHY info */ | 2203 | /* PHY info */ |
2168 | u32 phy_id; | 2204 | u32 phy_id; |
@@ -2176,6 +2212,7 @@ struct tg3 { | |||
2176 | #define PHY_ID_BCM5705 0x600081a0 | 2212 | #define PHY_ID_BCM5705 0x600081a0 |
2177 | #define PHY_ID_BCM5750 0x60008180 | 2213 | #define PHY_ID_BCM5750 0x60008180 |
2178 | #define PHY_ID_BCM5752 0x60008100 | 2214 | #define PHY_ID_BCM5752 0x60008100 |
2215 | #define PHY_ID_BCM5780 0x60008350 | ||
2179 | #define PHY_ID_BCM8002 0x60010140 | 2216 | #define PHY_ID_BCM8002 0x60010140 |
2180 | #define PHY_ID_INVALID 0xffffffff | 2217 | #define PHY_ID_INVALID 0xffffffff |
2181 | #define PHY_ID_REV_MASK 0x0000000f | 2218 | #define PHY_ID_REV_MASK 0x0000000f |