diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-13 21:17:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-13 21:17:26 -0500 |
commit | 551a10c7fc14640d484ee3dda699758041d8123f (patch) | |
tree | d04cb9a72b97aa4abac9e82b479be3d721fcbac5 /drivers | |
parent | f90203e0cf0d5a8b027d511af318bb3db4758fe2 (diff) | |
parent | 928ba4169dc1d82c83105831f5ddb5472379b440 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[IPSEC]: Fix the address family to refer encap_family
[IPSEC]: changing API of xfrm6_tunnel_register
[IPSEC]: make sit use the xfrm4_tunnel_register
[IPSEC]: Changing API of xfrm4_tunnel_register.
[TCP]: Prevent pseudo garbage in SYN's advertized window
[NET_SCHED]: sch_hfsc: replace ASSERT macro by WARN_ON
[BRIDGE] br_if: Fix oops in port_carrier_check
[NETFILTER]: Clear GSO bits for TCP reset packet
[TG3]: Update copyright, version, and reldate.
[TG3]: Add some tx timeout debug messages.
[TG3]: Use constant for PHY register 0x1e.
[TG3]: Power down 5704 serdes transceiver when shutting down.
[TG3]: 5906 doesn't need to switch to slower clock.
[TG3]: 5722/5756 don't need PHY jitter workaround.
[TG3]: Use lower DMA watermark for 5703.
[TG3]: Save MSI state before suspend.
[XFRM]: Fix IPv4 tunnel mode decapsulation with IPV6=n
[IPV6] HASHTABLES: Use appropriate seed for caluculating ehash index.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/tg3.c | 58 | ||||
-rw-r--r-- | drivers/net/tg3.h | 1 |
2 files changed, 47 insertions, 12 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e136bae61970..81a1c2e1a3f5 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) |
5 | * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) | 5 | * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com) |
6 | * Copyright (C) 2004 Sun Microsystems Inc. | 6 | * Copyright (C) 2004 Sun Microsystems Inc. |
7 | * Copyright (C) 2005 Broadcom Corporation. | 7 | * Copyright (C) 2005-2007 Broadcom Corporation. |
8 | * | 8 | * |
9 | * Firmware is: | 9 | * Firmware is: |
10 | * Derived from proprietary unpublished source code, | 10 | * Derived from proprietary unpublished source code, |
@@ -64,8 +64,8 @@ | |||
64 | 64 | ||
65 | #define DRV_MODULE_NAME "tg3" | 65 | #define DRV_MODULE_NAME "tg3" |
66 | #define PFX DRV_MODULE_NAME ": " | 66 | #define PFX DRV_MODULE_NAME ": " |
67 | #define DRV_MODULE_VERSION "3.72" | 67 | #define DRV_MODULE_VERSION "3.73" |
68 | #define DRV_MODULE_RELDATE "January 8, 2007" | 68 | #define DRV_MODULE_RELDATE "February 12, 2007" |
69 | 69 | ||
70 | #define TG3_DEF_MAC_MODE 0 | 70 | #define TG3_DEF_MAC_MODE 0 |
71 | #define TG3_DEF_RX_MODE 0 | 71 | #define TG3_DEF_RX_MODE 0 |
@@ -1175,8 +1175,18 @@ static void tg3_nvram_unlock(struct tg3 *); | |||
1175 | 1175 | ||
1176 | static void tg3_power_down_phy(struct tg3 *tp) | 1176 | static void tg3_power_down_phy(struct tg3 *tp) |
1177 | { | 1177 | { |
1178 | if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) | 1178 | if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) { |
1179 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { | ||
1180 | u32 sg_dig_ctrl = tr32(SG_DIG_CTRL); | ||
1181 | u32 serdes_cfg = tr32(MAC_SERDES_CFG); | ||
1182 | |||
1183 | sg_dig_ctrl |= | ||
1184 | SG_DIG_USING_HW_AUTONEG | SG_DIG_SOFT_RESET; | ||
1185 | tw32(SG_DIG_CTRL, sg_dig_ctrl); | ||
1186 | tw32(MAC_SERDES_CFG, serdes_cfg | (1 << 15)); | ||
1187 | } | ||
1179 | return; | 1188 | return; |
1189 | } | ||
1180 | 1190 | ||
1181 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) { | 1191 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) { |
1182 | u32 val; | 1192 | u32 val; |
@@ -1340,7 +1350,8 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | |||
1340 | 1350 | ||
1341 | tw32_wait_f(TG3PCI_CLOCK_CTRL, base_val | CLOCK_CTRL_ALTCLK | | 1351 | tw32_wait_f(TG3PCI_CLOCK_CTRL, base_val | CLOCK_CTRL_ALTCLK | |
1342 | CLOCK_CTRL_PWRDOWN_PLL133, 40); | 1352 | CLOCK_CTRL_PWRDOWN_PLL133, 40); |
1343 | } else if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { | 1353 | } else if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) || |
1354 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)) { | ||
1344 | /* do nothing */ | 1355 | /* do nothing */ |
1345 | } else if (!((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) && | 1356 | } else if (!((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) && |
1346 | (tp->tg3_flags & TG3_FLAG_ENABLE_ASF))) { | 1357 | (tp->tg3_flags & TG3_FLAG_ENABLE_ASF))) { |
@@ -3724,13 +3735,23 @@ out: | |||
3724 | tg3_full_unlock(tp); | 3735 | tg3_full_unlock(tp); |
3725 | } | 3736 | } |
3726 | 3737 | ||
3738 | static void tg3_dump_short_state(struct tg3 *tp) | ||
3739 | { | ||
3740 | printk(KERN_ERR PFX "DEBUG: MAC_TX_STATUS[%08x] MAC_RX_STATUS[%08x]\n", | ||
3741 | tr32(MAC_TX_STATUS), tr32(MAC_RX_STATUS)); | ||
3742 | printk(KERN_ERR PFX "DEBUG: RDMAC_STATUS[%08x] WDMAC_STATUS[%08x]\n", | ||
3743 | tr32(RDMAC_STATUS), tr32(WDMAC_STATUS)); | ||
3744 | } | ||
3745 | |||
3727 | static void tg3_tx_timeout(struct net_device *dev) | 3746 | static void tg3_tx_timeout(struct net_device *dev) |
3728 | { | 3747 | { |
3729 | struct tg3 *tp = netdev_priv(dev); | 3748 | struct tg3 *tp = netdev_priv(dev); |
3730 | 3749 | ||
3731 | if (netif_msg_tx_err(tp)) | 3750 | if (netif_msg_tx_err(tp)) { |
3732 | printk(KERN_ERR PFX "%s: transmit timed out, resetting\n", | 3751 | printk(KERN_ERR PFX "%s: transmit timed out, resetting\n", |
3733 | dev->name); | 3752 | dev->name); |
3753 | tg3_dump_short_state(tp); | ||
3754 | } | ||
3734 | 3755 | ||
3735 | schedule_work(&tp->reset_task); | 3756 | schedule_work(&tp->reset_task); |
3736 | } | 3757 | } |
@@ -6583,8 +6604,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6583 | u32 tmp; | 6604 | u32 tmp; |
6584 | 6605 | ||
6585 | /* Clear CRC stats. */ | 6606 | /* Clear CRC stats. */ |
6586 | if (!tg3_readphy(tp, 0x1e, &tmp)) { | 6607 | if (!tg3_readphy(tp, MII_TG3_TEST1, &tmp)) { |
6587 | tg3_writephy(tp, 0x1e, tmp | 0x8000); | 6608 | tg3_writephy(tp, MII_TG3_TEST1, |
6609 | tmp | MII_TG3_TEST1_CRC_EN); | ||
6588 | tg3_readphy(tp, 0x14, &tmp); | 6610 | tg3_readphy(tp, 0x14, &tmp); |
6589 | } | 6611 | } |
6590 | } | 6612 | } |
@@ -7408,8 +7430,9 @@ static unsigned long calc_crc_errors(struct tg3 *tp) | |||
7408 | u32 val; | 7430 | u32 val; |
7409 | 7431 | ||
7410 | spin_lock_bh(&tp->lock); | 7432 | spin_lock_bh(&tp->lock); |
7411 | if (!tg3_readphy(tp, 0x1e, &val)) { | 7433 | if (!tg3_readphy(tp, MII_TG3_TEST1, &val)) { |
7412 | tg3_writephy(tp, 0x1e, val | 0x8000); | 7434 | tg3_writephy(tp, MII_TG3_TEST1, |
7435 | val | MII_TG3_TEST1_CRC_EN); | ||
7413 | tg3_readphy(tp, 0x14, &val); | 7436 | tg3_readphy(tp, 0x14, &val); |
7414 | } else | 7437 | } else |
7415 | val = 0; | 7438 | val = 0; |
@@ -10779,7 +10802,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
10779 | if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { | 10802 | if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { |
10780 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | 10803 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || |
10781 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) { | 10804 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) { |
10782 | tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG; | 10805 | if (tp->pdev->device != PCI_DEVICE_ID_TIGON3_5756 && |
10806 | tp->pdev->device != PCI_DEVICE_ID_TIGON3_5722) | ||
10807 | tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG; | ||
10783 | if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5755M) | 10808 | if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5755M) |
10784 | tp->tg3_flags2 |= TG3_FLG2_PHY_ADJUST_TRIM; | 10809 | tp->tg3_flags2 |= TG3_FLG2_PHY_ADJUST_TRIM; |
10785 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906) | 10810 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906) |
@@ -11314,6 +11339,7 @@ static int __devinit tg3_test_dma(struct tg3 *tp) | |||
11314 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 || | 11339 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703 || |
11315 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { | 11340 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { |
11316 | u32 ccval = (tr32(TG3PCI_CLOCK_CTRL) & 0x1f); | 11341 | u32 ccval = (tr32(TG3PCI_CLOCK_CTRL) & 0x1f); |
11342 | u32 read_water = 0x7; | ||
11317 | 11343 | ||
11318 | /* If the 5704 is behind the EPB bridge, we can | 11344 | /* If the 5704 is behind the EPB bridge, we can |
11319 | * do the less restrictive ONE_DMA workaround for | 11345 | * do the less restrictive ONE_DMA workaround for |
@@ -11325,8 +11351,13 @@ static int __devinit tg3_test_dma(struct tg3 *tp) | |||
11325 | else if (ccval == 0x6 || ccval == 0x7) | 11351 | else if (ccval == 0x6 || ccval == 0x7) |
11326 | tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA; | 11352 | tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA; |
11327 | 11353 | ||
11354 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703) | ||
11355 | read_water = 4; | ||
11328 | /* Set bit 23 to enable PCIX hw bug fix */ | 11356 | /* Set bit 23 to enable PCIX hw bug fix */ |
11329 | tp->dma_rwctrl |= 0x009f0000; | 11357 | tp->dma_rwctrl |= |
11358 | (read_water << DMA_RWCTRL_READ_WATER_SHIFT) | | ||
11359 | (0x3 << DMA_RWCTRL_WRITE_WATER_SHIFT) | | ||
11360 | (1 << 23); | ||
11330 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) { | 11361 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) { |
11331 | /* 5780 always in PCIX mode */ | 11362 | /* 5780 always in PCIX mode */ |
11332 | tp->dma_rwctrl |= 0x00144000; | 11363 | tp->dma_rwctrl |= 0x00144000; |
@@ -12016,6 +12047,9 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state) | |||
12016 | tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; | 12047 | tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; |
12017 | tg3_full_unlock(tp); | 12048 | tg3_full_unlock(tp); |
12018 | 12049 | ||
12050 | /* Save MSI address and data for resume. */ | ||
12051 | pci_save_state(pdev); | ||
12052 | |||
12019 | err = tg3_set_power_state(tp, pci_choose_state(pdev, state)); | 12053 | err = tg3_set_power_state(tp, pci_choose_state(pdev, state)); |
12020 | if (err) { | 12054 | if (err) { |
12021 | tg3_full_lock(tp, 0); | 12055 | tg3_full_lock(tp, 0); |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 80f59ac7ec58..45d477e8f374 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -1660,6 +1660,7 @@ | |||
1660 | 1660 | ||
1661 | #define MII_TG3_TEST1 0x1e | 1661 | #define MII_TG3_TEST1 0x1e |
1662 | #define MII_TG3_TEST1_TRIM_EN 0x0010 | 1662 | #define MII_TG3_TEST1_TRIM_EN 0x0010 |
1663 | #define MII_TG3_TEST1_CRC_EN 0x8000 | ||
1663 | 1664 | ||
1664 | /* There are two ways to manage the TX descriptors on the tigon3. | 1665 | /* There are two ways to manage the TX descriptors on the tigon3. |
1665 | * Either the descriptors are in host DMA'able memory, or they | 1666 | * Either the descriptors are in host DMA'able memory, or they |