aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2009-09-01 09:19:53 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-02 03:44:01 -0400
commitf6eb9b1fc1411d22c073f5264e5630a541d0f7df (patch)
tree8966482a7874e3087301fc3b9c0a5a2e9870eed8 /drivers/net
parent8d9d7cfc0ec2fe37ff9afd74326d03f38f96ad1b (diff)
tg3: Add 5717 asic rev
This patch adds the 5717 asic rev. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tg3.c130
-rw-r--r--drivers/net/tg3.h25
2 files changed, 119 insertions, 36 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index f71ea462ca41..f8bb5b737eb8 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -111,7 +111,8 @@
111 * replace things like '% foo' with '& (foo - 1)'. 111 * replace things like '% foo' with '& (foo - 1)'.
112 */ 112 */
113#define TG3_RX_RCB_RING_SIZE(tp) \ 113#define TG3_RX_RCB_RING_SIZE(tp) \
114 ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ? 512 : 1024) 114 (((tp->tg3_flags & TG3_FLAG_JUMBO_CAPABLE) && \
115 !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) ? 512 : 1024)
115 116
116#define TG3_TX_RING_SIZE 512 117#define TG3_TX_RING_SIZE 512
117#define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1) 118#define TG3_DEF_TX_RING_PENDING (TG3_TX_RING_SIZE - 1)
@@ -733,13 +734,15 @@ static inline void tg3_netif_start(struct tg3 *tp)
733 734
734static void tg3_switch_clocks(struct tg3 *tp) 735static void tg3_switch_clocks(struct tg3 *tp)
735{ 736{
736 u32 clock_ctrl = tr32(TG3PCI_CLOCK_CTRL); 737 u32 clock_ctrl;
737 u32 orig_clock_ctrl; 738 u32 orig_clock_ctrl;
738 739
739 if ((tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) || 740 if ((tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) ||
740 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) 741 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS))
741 return; 742 return;
742 743
744 clock_ctrl = tr32(TG3PCI_CLOCK_CTRL);
745
743 orig_clock_ctrl = clock_ctrl; 746 orig_clock_ctrl = clock_ctrl;
744 clock_ctrl &= (CLOCK_CTRL_FORCE_CLKRUN | 747 clock_ctrl &= (CLOCK_CTRL_FORCE_CLKRUN |
745 CLOCK_CTRL_CLKRUN_OENABLE | 748 CLOCK_CTRL_CLKRUN_OENABLE |
@@ -1993,8 +1996,9 @@ static void tg3_frob_aux_power(struct tg3 *tp)
1993 if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0) 1996 if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0)
1994 return; 1997 return;
1995 1998
1996 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || 1999 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
1997 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) { 2000 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 ||
2001 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
1998 struct net_device *dev_peer; 2002 struct net_device *dev_peer;
1999 2003
2000 dev_peer = pci_get_drvdata(tp->pdev_peer); 2004 dev_peer = pci_get_drvdata(tp->pdev_peer);
@@ -5211,6 +5215,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
5211 mss = 0; 5215 mss = 0;
5212 if ((mss = skb_shinfo(skb)->gso_size) != 0) { 5216 if ((mss = skb_shinfo(skb)->gso_size) != 0) {
5213 int tcp_opt_len, ip_tcp_len; 5217 int tcp_opt_len, ip_tcp_len;
5218 u32 hdrlen;
5214 5219
5215 if (skb_header_cloned(skb) && 5220 if (skb_header_cloned(skb) &&
5216 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { 5221 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
@@ -5219,7 +5224,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
5219 } 5224 }
5220 5225
5221 if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) 5226 if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)
5222 mss |= (skb_headlen(skb) - ETH_HLEN) << 9; 5227 hdrlen = skb_headlen(skb) - ETH_HLEN;
5223 else { 5228 else {
5224 struct iphdr *iph = ip_hdr(skb); 5229 struct iphdr *iph = ip_hdr(skb);
5225 5230
@@ -5228,9 +5233,17 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
5228 5233
5229 iph->check = 0; 5234 iph->check = 0;
5230 iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len); 5235 iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
5231 mss |= (ip_tcp_len + tcp_opt_len) << 9; 5236 hdrlen = ip_tcp_len + tcp_opt_len;
5232 } 5237 }
5233 5238
5239 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
5240 mss |= (hdrlen & 0xc) << 12;
5241 if (hdrlen & 0x10)
5242 base_flags |= 0x00000010;
5243 base_flags |= (hdrlen & 0x3e0) << 5;
5244 } else
5245 mss |= hdrlen << 9;
5246
5234 base_flags |= (TXD_FLAG_CPU_PRE_DMA | 5247 base_flags |= (TXD_FLAG_CPU_PRE_DMA |
5235 TXD_FLAG_CPU_POST_DMA); 5248 TXD_FLAG_CPU_POST_DMA);
5236 5249
@@ -5258,6 +5271,10 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb,
5258 5271
5259 len = skb_headlen(skb); 5272 len = skb_headlen(skb);
5260 5273
5274 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
5275 !mss && skb->len > ETH_DATA_LEN)
5276 base_flags |= TXD_FLAG_JMB_PKT;
5277
5261 tg3_set_txd(tnapi, entry, mapping, len, base_flags, 5278 tg3_set_txd(tnapi, entry, mapping, len, base_flags,
5262 (skb_shinfo(skb)->nr_frags == 0) | (mss << 1)); 5279 (skb_shinfo(skb)->nr_frags == 0) | (mss << 1));
5263 5280
@@ -6564,7 +6581,9 @@ static int tg3_chip_reset(struct tg3 *tp)
6564 tg3_mdio_start(tp); 6581 tg3_mdio_start(tp);
6565 6582
6566 if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) && 6583 if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
6567 tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) { 6584 tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
6585 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
6586 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
6568 val = tr32(0x7c00); 6587 val = tr32(0x7c00);
6569 6588
6570 tw32(0x7c00, val | (1 << 25)); 6589 tw32(0x7c00, val | (1 << 25));
@@ -6993,7 +7012,9 @@ static void tg3_rings_reset(struct tg3 *tp)
6993 7012
6994 7013
6995 /* Disable all receive return rings but the first. */ 7014 /* Disable all receive return rings but the first. */
6996 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) 7015 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
7016 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 17;
7017 else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
6997 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16; 7018 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16;
6998 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) 7019 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
6999 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 4; 7020 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 4;
@@ -7197,7 +7218,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
7197 return err; 7218 return err;
7198 7219
7199 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 && 7220 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 &&
7200 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761) { 7221 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761 &&
7222 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
7201 /* This value is determined during the probe time DMA 7223 /* This value is determined during the probe time DMA
7202 * engine test, tg3_test_dma. 7224 * engine test, tg3_test_dma.
7203 */ 7225 */
@@ -7351,7 +7373,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
7351 BDINFO_FLAGS_DISABLED); 7373 BDINFO_FLAGS_DISABLED);
7352 } 7374 }
7353 7375
7354 val = RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT; 7376 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
7377 val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) |
7378 (RX_STD_MAX_SIZE << 2);
7379 else
7380 val = RX_STD_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT;
7355 } else 7381 } else
7356 val = RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT; 7382 val = RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT;
7357 7383
@@ -7366,6 +7392,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
7366 tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW, 7392 tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
7367 tpr->rx_jmb_ptr); 7393 tpr->rx_jmb_ptr);
7368 7394
7395 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
7396 tw32(STD_REPLENISH_LWM, 32);
7397 tw32(JMB_REPLENISH_LWM, 16);
7398 }
7399
7369 tg3_rings_reset(tp); 7400 tg3_rings_reset(tp);
7370 7401
7371 /* Initialize MAC address and backoff seed. */ 7402 /* Initialize MAC address and backoff seed. */
@@ -8021,6 +8052,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
8021 struct tg3_napi *tnapi = &tp->napi[0]; 8052 struct tg3_napi *tnapi = &tp->napi[0];
8022 struct net_device *dev = tp->dev; 8053 struct net_device *dev = tp->dev;
8023 int err, i, intr_ok = 0; 8054 int err, i, intr_ok = 0;
8055 u32 val;
8024 8056
8025 if (!netif_running(dev)) 8057 if (!netif_running(dev))
8026 return -ENODEV; 8058 return -ENODEV;
@@ -8029,6 +8061,16 @@ static int tg3_test_interrupt(struct tg3 *tp)
8029 8061
8030 free_irq(tnapi->irq_vec, tnapi); 8062 free_irq(tnapi->irq_vec, tnapi);
8031 8063
8064 /*
8065 * Turn off MSI one shot mode. Otherwise this test has no
8066 * observable way to know whether the interrupt was delivered.
8067 */
8068 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
8069 (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
8070 val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE;
8071 tw32(MSGINT_MODE, val);
8072 }
8073
8032 err = request_irq(tnapi->irq_vec, tg3_test_isr, 8074 err = request_irq(tnapi->irq_vec, tg3_test_isr,
8033 IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, tnapi); 8075 IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, tnapi);
8034 if (err) 8076 if (err)
@@ -8064,8 +8106,15 @@ static int tg3_test_interrupt(struct tg3 *tp)
8064 if (err) 8106 if (err)
8065 return err; 8107 return err;
8066 8108
8067 if (intr_ok) 8109 if (intr_ok) {
8110 /* Reenable MSI one shot mode. */
8111 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
8112 (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
8113 val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE;
8114 tw32(MSGINT_MODE, val);
8115 }
8068 return 0; 8116 return 0;
8117 }
8069 8118
8070 return -EIO; 8119 return -EIO;
8071} 8120}
@@ -8350,13 +8399,13 @@ static int tg3_open(struct net_device *dev)
8350 goto err_out2; 8399 goto err_out2;
8351 } 8400 }
8352 8401
8353 if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { 8402 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
8354 if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) { 8403 (tp->tg3_flags2 & TG3_FLG2_USING_MSI) &&
8355 u32 val = tr32(PCIE_TRANSACTION_CFG); 8404 (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) {
8405 u32 val = tr32(PCIE_TRANSACTION_CFG);
8356 8406
8357 tw32(PCIE_TRANSACTION_CFG, 8407 tw32(PCIE_TRANSACTION_CFG,
8358 val | PCIE_TRANS_CFG_1SHOT_MSI); 8408 val | PCIE_TRANS_CFG_1SHOT_MSI);
8359 }
8360 } 8409 }
8361 } 8410 }
8362 8411
@@ -9392,7 +9441,8 @@ static int tg3_set_tso(struct net_device *dev, u32 value)
9392 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && 9441 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
9393 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || 9442 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) ||
9394 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || 9443 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
9395 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) 9444 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
9445 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
9396 dev->features |= NETIF_F_TSO_ECN; 9446 dev->features |= NETIF_F_TSO_ECN;
9397 } else 9447 } else
9398 dev->features &= ~(NETIF_F_TSO6 | NETIF_F_TSO_ECN); 9448 dev->features &= ~(NETIF_F_TSO6 | NETIF_F_TSO_ECN);
@@ -12291,8 +12341,17 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
12291 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_USE_PROD_ID_REG) { 12341 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_USE_PROD_ID_REG) {
12292 u32 prod_id_asic_rev; 12342 u32 prod_id_asic_rev;
12293 12343
12294 pci_read_config_dword(tp->pdev, TG3PCI_PRODID_ASICREV, 12344 if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717C ||
12295 &prod_id_asic_rev); 12345 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717S ||
12346 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718C ||
12347 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718S)
12348 pci_read_config_dword(tp->pdev,
12349 TG3PCI_GEN2_PRODID_ASICREV,
12350 &prod_id_asic_rev);
12351 else
12352 pci_read_config_dword(tp->pdev, TG3PCI_PRODID_ASICREV,
12353 &prod_id_asic_rev);
12354
12296 tp->pci_chip_rev_id = prod_id_asic_rev; 12355 tp->pci_chip_rev_id = prod_id_asic_rev;
12297 } 12356 }
12298 12357
@@ -12430,8 +12489,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
12430 pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL, 12489 pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL,
12431 tp->misc_host_ctrl); 12490 tp->misc_host_ctrl);
12432 12491
12433 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || 12492 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
12434 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) 12493 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 ||
12494 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
12435 tp->pdev_peer = tg3_find_peer(tp); 12495 tp->pdev_peer = tg3_find_peer(tp);
12436 12496
12437 /* Intentionally exclude ASIC_REV_5906 */ 12497 /* Intentionally exclude ASIC_REV_5906 */
@@ -12440,7 +12500,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
12440 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 12500 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
12441 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 12501 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
12442 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || 12502 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
12443 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) 12503 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
12504 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
12444 tp->tg3_flags3 |= TG3_FLG3_5755_PLUS; 12505 tp->tg3_flags3 |= TG3_FLG3_5755_PLUS;
12445 12506
12446 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 || 12507 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 ||
@@ -12490,8 +12551,16 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
12490 12551
12491 tp->irq_max = 1; 12552 tp->irq_max = 1;
12492 12553
12554#ifdef TG3_NAPI
12555 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
12556 tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
12557 tp->irq_max = TG3_IRQ_MAX_VECS;
12558 }
12559#endif
12560
12493 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) || 12561 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
12494 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) 12562 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
12563 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
12495 tp->tg3_flags |= TG3_FLAG_JUMBO_CAPABLE; 12564 tp->tg3_flags |= TG3_FLAG_JUMBO_CAPABLE;
12496 12565
12497 pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, 12566 pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE,
@@ -12625,7 +12694,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
12625 tp->write32 = tg3_write_flush_reg32; 12694 tp->write32 = tg3_write_flush_reg32;
12626 } 12695 }
12627 12696
12628
12629 if ((tp->tg3_flags & TG3_FLAG_TXD_MBOX_HWBUG) || 12697 if ((tp->tg3_flags & TG3_FLAG_TXD_MBOX_HWBUG) ||
12630 (tp->tg3_flags & TG3_FLAG_MBOX_WRITE_REORDER)) { 12698 (tp->tg3_flags & TG3_FLAG_MBOX_WRITE_REORDER)) {
12631 tp->write32_tx_mbox = tg3_write32_tx_mbox; 12699 tp->write32_tx_mbox = tg3_write32_tx_mbox;
@@ -12684,7 +12752,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
12684 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 12752 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
12685 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 12753 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
12686 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || 12754 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
12687 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) 12755 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
12756 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
12688 tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT; 12757 tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
12689 12758
12690 /* Set up tp->grc_local_ctrl before calling tg3_set_power_state(). 12759 /* Set up tp->grc_local_ctrl before calling tg3_set_power_state().
@@ -12762,7 +12831,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
12762 if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) && 12831 if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) &&
12763 !(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) && 12832 !(tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) &&
12764 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 && 12833 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
12765 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780) { 12834 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 &&
12835 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
12766 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 12836 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
12767 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 12837 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
12768 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 12838 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
@@ -13486,7 +13556,8 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
13486 13556
13487static void __devinit tg3_init_bufmgr_config(struct tg3 *tp) 13557static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
13488{ 13558{
13489 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { 13559 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS &&
13560 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) {
13490 tp->bufmgr_config.mbuf_read_dma_low_water = 13561 tp->bufmgr_config.mbuf_read_dma_low_water =
13491 DEFAULT_MB_RDMA_LOW_WATER_5705; 13562 DEFAULT_MB_RDMA_LOW_WATER_5705;
13492 tp->bufmgr_config.mbuf_mac_rx_low_water = 13563 tp->bufmgr_config.mbuf_mac_rx_low_water =
@@ -13925,7 +13996,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
13925 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && 13996 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
13926 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || 13997 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) ||
13927 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || 13998 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
13928 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) 13999 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
14000 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
13929 dev->features |= NETIF_F_TSO_ECN; 14001 dev->features |= NETIF_F_TSO_ECN;
13930 } 14002 }
13931 14003
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 685d9712a802..5994476a2508 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -46,6 +46,10 @@
46#define TG3PCI_DEVICE_TIGON3_57788 0x1691 46#define TG3PCI_DEVICE_TIGON3_57788 0x1691
47#define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */ 47#define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */
48#define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */ 48#define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */
49#define TG3PCI_DEVICE_TIGON3_5717C 0x1655
50#define TG3PCI_DEVICE_TIGON3_5717S 0x1656
51#define TG3PCI_DEVICE_TIGON3_5718C 0x1665
52#define TG3PCI_DEVICE_TIGON3_5718S 0x1666
49/* 0x04 --> 0x64 unused */ 53/* 0x04 --> 0x64 unused */
50#define TG3PCI_MSI_DATA 0x00000064 54#define TG3PCI_MSI_DATA 0x00000064
51/* 0x66 --> 0x68 unused */ 55/* 0x66 --> 0x68 unused */
@@ -117,6 +121,7 @@
117#define ASIC_REV_5761 0x5761 121#define ASIC_REV_5761 0x5761
118#define ASIC_REV_5785 0x5785 122#define ASIC_REV_5785 0x5785
119#define ASIC_REV_57780 0x57780 123#define ASIC_REV_57780 0x57780
124#define ASIC_REV_5717 0x5717
120#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) 125#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
121#define CHIPREV_5700_AX 0x70 126#define CHIPREV_5700_AX 0x70
122#define CHIPREV_5700_BX 0x71 127#define CHIPREV_5700_BX 0x71
@@ -203,20 +208,20 @@
203#define TG3PCI_MEM_WIN_BASE_ADDR 0x0000007c 208#define TG3PCI_MEM_WIN_BASE_ADDR 0x0000007c
204#define TG3PCI_REG_DATA 0x00000080 209#define TG3PCI_REG_DATA 0x00000080
205#define TG3PCI_MEM_WIN_DATA 0x00000084 210#define TG3PCI_MEM_WIN_DATA 0x00000084
206#define TG3PCI_MODE_CTRL 0x00000088
207#define TG3PCI_MISC_CFG 0x0000008c
208#define TG3PCI_MISC_LOCAL_CTRL 0x00000090 211#define TG3PCI_MISC_LOCAL_CTRL 0x00000090
209/* 0x94 --> 0x98 unused */ 212/* 0x94 --> 0x98 unused */
210#define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */ 213#define TG3PCI_STD_RING_PROD_IDX 0x00000098 /* 64-bit */
211#define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */ 214#define TG3PCI_RCV_RET_RING_CON_IDX 0x000000a0 /* 64-bit */
212#define TG3PCI_SND_PROD_IDX 0x000000a8 /* 64-bit */ 215/* 0xa0 --> 0xb8 unused */
213/* 0xb0 --> 0xb8 unused */
214#define TG3PCI_DUAL_MAC_CTRL 0x000000b8 216#define TG3PCI_DUAL_MAC_CTRL 0x000000b8
215#define DUAL_MAC_CTRL_CH_MASK 0x00000003 217#define DUAL_MAC_CTRL_CH_MASK 0x00000003
216#define DUAL_MAC_CTRL_ID 0x00000004 218#define DUAL_MAC_CTRL_ID 0x00000004
217#define TG3PCI_PRODID_ASICREV 0x000000bc 219#define TG3PCI_PRODID_ASICREV 0x000000bc
218#define PROD_ID_ASIC_REV_MASK 0x0fffffff 220#define PROD_ID_ASIC_REV_MASK 0x0fffffff
219/* 0xc0 --> 0x110 unused */ 221/* 0xc0 --> 0xf4 unused */
222
223#define TG3PCI_GEN2_PRODID_ASICREV 0x000000f4
224/* 0xf8 --> 0x200 unused */
220 225
221#define TG3_CORR_ERR_STAT 0x00000110 226#define TG3_CORR_ERR_STAT 0x00000110
222#define TG3_CORR_ERR_STAT_CLEAR 0xffffffff 227#define TG3_CORR_ERR_STAT_CLEAR 0xffffffff
@@ -972,7 +977,11 @@
972#define RCVBDI_MINI_THRESH 0x00002c14 977#define RCVBDI_MINI_THRESH 0x00002c14
973#define RCVBDI_STD_THRESH 0x00002c18 978#define RCVBDI_STD_THRESH 0x00002c18
974#define RCVBDI_JUMBO_THRESH 0x00002c1c 979#define RCVBDI_JUMBO_THRESH 0x00002c1c
975/* 0x2c20 --> 0x3000 unused */ 980/* 0x2c20 --> 0x2d00 unused */
981
982#define STD_REPLENISH_LWM 0x00002d00
983#define JMB_REPLENISH_LWM 0x00002d04
984/* 0x2d08 --> 0x3000 unused */
976 985
977/* Receive BD Completion Control Registers */ 986/* Receive BD Completion Control Registers */
978#define RCVCC_MODE 0x00003000 987#define RCVCC_MODE 0x00003000
@@ -1486,6 +1495,7 @@
1486#define MSGINT_MODE 0x00006000 1495#define MSGINT_MODE 0x00006000
1487#define MSGINT_MODE_RESET 0x00000001 1496#define MSGINT_MODE_RESET 0x00000001
1488#define MSGINT_MODE_ENABLE 0x00000002 1497#define MSGINT_MODE_ENABLE 0x00000002
1498#define MSGINT_MODE_ONE_SHOT_DISABLE 0x00000020
1489#define MSGINT_MODE_MULTIVEC_EN 0x00000080 1499#define MSGINT_MODE_MULTIVEC_EN 0x00000080
1490#define MSGINT_STATUS 0x00006004 1500#define MSGINT_STATUS 0x00006004
1491#define MSGINT_FIFO 0x00006008 1501#define MSGINT_FIFO 0x00006008
@@ -2124,6 +2134,7 @@ struct tg3_tx_buffer_desc {
2124#define TXD_FLAG_IP_CSUM 0x0002 2134#define TXD_FLAG_IP_CSUM 0x0002
2125#define TXD_FLAG_END 0x0004 2135#define TXD_FLAG_END 0x0004
2126#define TXD_FLAG_IP_FRAG 0x0008 2136#define TXD_FLAG_IP_FRAG 0x0008
2137#define TXD_FLAG_JMB_PKT 0x0008
2127#define TXD_FLAG_IP_FRAG_END 0x0010 2138#define TXD_FLAG_IP_FRAG_END 0x0010
2128#define TXD_FLAG_VLAN 0x0040 2139#define TXD_FLAG_VLAN 0x0040
2129#define TXD_FLAG_COAL_NOW 0x0080 2140#define TXD_FLAG_COAL_NOW 0x0080
@@ -2520,7 +2531,7 @@ struct tg3_rx_prodring_set {
2520 dma_addr_t rx_jmb_mapping; 2531 dma_addr_t rx_jmb_mapping;
2521}; 2532};
2522 2533
2523#define TG3_IRQ_MAX_VECS 1 2534#define TG3_IRQ_MAX_VECS 5
2524 2535
2525struct tg3_napi { 2536struct tg3_napi {
2526 struct napi_struct napi ____cacheline_aligned; 2537 struct napi_struct napi ____cacheline_aligned;