提交 8c2dc7e1 编写于 作者: M Michael Chan 提交者: David S. Miller

[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: NMichael Chan <mchan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 df7addbb
...@@ -1017,13 +1017,16 @@ static void tg3_frob_aux_power(struct tg3 *tp) ...@@ -1017,13 +1017,16 @@ static void tg3_frob_aux_power(struct tg3 *tp)
if ((tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) != 0) if ((tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) != 0)
return; return;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
tp_peer = pci_get_drvdata(tp->pdev_peer); (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) {
if (!tp_peer) struct net_device *dev_peer;
dev_peer = pci_get_drvdata(tp->pdev_peer);
if (!dev_peer)
BUG(); BUG();
tp_peer = netdev_priv(dev_peer);
} }
if ((tp->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || if ((tp->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 ||
(tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 || (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 ||
(tp_peer->tg3_flags & TG3_FLAG_WOL_ENABLE) != 0 || (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,7 +10469,7 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str)
return str; return str;
} }
static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp) static struct pci_dev * __devinit tg3_find_peer(struct tg3 *tp)
{ {
struct pci_dev *peer; struct pci_dev *peer;
unsigned int func, devnr = tp->pdev->devfn & ~7; unsigned int func, devnr = tp->pdev->devfn & ~7;
...@@ -10719,8 +10722,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, ...@@ -10719,8 +10722,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
tp->rx_pending = 63; tp->rx_pending = 63;
} }
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) ||
tp->pdev_peer = tg3_find_5704_peer(tp); (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714))
tp->pdev_peer = tg3_find_peer(tp);
err = tg3_get_device_address(tp); err = tg3_get_device_address(tp);
if (err) { if (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册