diff options
author | Michael Chan <mchan@broadcom.com> | 2007-05-05 16:08:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-05-05 16:08:32 -0400 |
commit | 7544b0972c1fc1a0e6c54baa1f44c81019743daa (patch) | |
tree | 90c8ca52ab4bb01b83c51f2c6ea91b1a6854a1a1 /drivers/net/tg3.c | |
parent | 98efd8a6be79550767f5a9be6f3db8e7e9b747da (diff) |
[TG3]: Add TG3_FLAG_SUPPORT_MSI flag.
And fix up the code to always allow MSI on 5714 A2.
Call tg3_find_peer() earlier because we need that information before
we can determine whether we can set TG3_FLAG_SUPPORT_MSI or not.
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.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 4154e1285d5a..59d6e74a4a5f 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -7033,11 +7033,7 @@ static int tg3_open(struct net_device *dev) | |||
7033 | if (err) | 7033 | if (err) |
7034 | return err; | 7034 | return err; |
7035 | 7035 | ||
7036 | if ((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) && | 7036 | if (tp->tg3_flags & TG3_FLAG_SUPPORT_MSI) { |
7037 | (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5750_AX) && | ||
7038 | (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5750_BX) && | ||
7039 | !((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714) && | ||
7040 | (tp->pdev_peer == tp->pdev))) { | ||
7041 | /* All MSI supporting chips should support tagged | 7037 | /* All MSI supporting chips should support tagged |
7042 | * status. Assert that this is the case. | 7038 | * status. Assert that this is the case. |
7043 | */ | 7039 | */ |
@@ -10404,6 +10400,8 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp) | |||
10404 | } | 10400 | } |
10405 | } | 10401 | } |
10406 | 10402 | ||
10403 | static struct pci_dev * __devinit tg3_find_peer(struct tg3 *); | ||
10404 | |||
10407 | static int __devinit tg3_get_invariants(struct tg3 *tp) | 10405 | static int __devinit tg3_get_invariants(struct tg3 *tp) |
10408 | { | 10406 | { |
10409 | static struct pci_device_id write_reorder_chipsets[] = { | 10407 | static struct pci_device_id write_reorder_chipsets[] = { |
@@ -10559,6 +10557,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
10559 | tp->pci_hdr_type = (cacheline_sz_reg >> 16) & 0xff; | 10557 | tp->pci_hdr_type = (cacheline_sz_reg >> 16) & 0xff; |
10560 | tp->pci_bist = (cacheline_sz_reg >> 24) & 0xff; | 10558 | tp->pci_bist = (cacheline_sz_reg >> 24) & 0xff; |
10561 | 10559 | ||
10560 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || | ||
10561 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) | ||
10562 | tp->pdev_peer = tg3_find_peer(tp); | ||
10563 | |||
10562 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 || | 10564 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 || |
10563 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 || | 10565 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 || |
10564 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | 10566 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || |
@@ -10572,6 +10574,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
10572 | tp->tg3_flags2 |= TG3_FLG2_5705_PLUS; | 10574 | tp->tg3_flags2 |= TG3_FLG2_5705_PLUS; |
10573 | 10575 | ||
10574 | if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) { | 10576 | if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) { |
10577 | tp->tg3_flags |= TG3_FLAG_SUPPORT_MSI; | ||
10578 | if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5750_AX || | ||
10579 | GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5750_BX || | ||
10580 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714 && | ||
10581 | tp->pci_chip_rev_id <= CHIPREV_ID_5714_A2 && | ||
10582 | tp->pdev_peer == tp->pdev)) | ||
10583 | tp->tg3_flags &= ~TG3_FLAG_SUPPORT_MSI; | ||
10584 | |||
10575 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | 10585 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || |
10576 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | 10586 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || |
10577 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) { | 10587 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) { |
@@ -11897,10 +11907,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
11897 | tp->rx_pending = 63; | 11907 | tp->rx_pending = 63; |
11898 | } | 11908 | } |
11899 | 11909 | ||
11900 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) || | ||
11901 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714)) | ||
11902 | tp->pdev_peer = tg3_find_peer(tp); | ||
11903 | |||
11904 | err = tg3_get_device_address(tp); | 11910 | err = tg3_get_device_address(tp); |
11905 | if (err) { | 11911 | if (err) { |
11906 | printk(KERN_ERR PFX "Could not obtain valid ethernet address, " | 11912 | printk(KERN_ERR PFX "Could not obtain valid ethernet address, " |