aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2005-12-19 19:26:02 -0500
committerDavid S. Miller <davem@davemloft.net>2005-12-19 19:26:02 -0500
commit8c2dc7e1e7213c55f1b97eba09de6c0cee9ad12f (patch)
tree47bc9b91cc44c68701004494bb9dc9d777ba27a4 /drivers/net/tg3.c
parentdf7addbb45874f0f992266003155de5a22e1872f (diff)
[TG3]: Fix peer device handling
Locate the pdev_peer for dual port 5714 NIC devices in addition to 5704 devices. The name is also changed to tg3_find_peer() from tg3_find_5704_peer(). It is also necessary to call netdev_priv() to get to the peer's private tg3 structure. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a23ed28a72b8..d8691224b0b3 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1017,13 +1017,16 @@ static void tg3_frob_aux_power(struct tg3 *tp)
1017 if ((tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) != 0) 1017 if ((tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) != 0)
1018 return; 1018 return;
1019 1019
1020 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { 1020 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
1021 tp_peer = pci_get_drvdata(tp->pdev_peer); 1021 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) {
1022 if (!tp_peer) 1022 struct net_device *dev_peer;
1023
1024 dev_peer = pci_get_drvdata(tp->pdev_peer);
1025 if (!dev_peer)
1023 BUG(); 1026 BUG();
1027 tp_peer = netdev_priv(dev_peer);
1024 } 1028 }
1025 1029
1026
1027 if ((tp->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || 1030 if ((tp->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 ||
1028 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 || 1031 (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 ||
1029 (tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || 1032 (tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 ||
@@ -10466,7 +10469,7 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str)
10466 return str; 10469 return str;
10467} 10470}
10468 10471
10469static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp) 10472static struct pci_dev * __devinit tg3_find_peer(struct tg3 *tp)
10470{ 10473{
10471 struct pci_dev *peer; 10474 struct pci_dev *peer;
10472 unsigned int func, devnr = tp->pdev->devfn & ~7; 10475 unsigned int func, devnr = tp->pdev->devfn & ~7;
@@ -10719,8 +10722,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
10719 tp->rx_pending = 63; 10722 tp->rx_pending = 63;
10720 } 10723 }
10721 10724
10722 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) 10725 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
10723 tp->pdev_peer = tg3_find_5704_peer(tp); 10726 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714))
10727 tp->pdev_peer = tg3_find_peer(tp);
10724 10728
10725 err = tg3_get_device_address(tp); 10729 err = tg3_get_device_address(tp);
10726 if (err) { 10730 if (err) {