aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2007-05-05 16:08:32 -0400
committerDavid S. Miller <davem@davemloft.net>2007-05-05 16:08:32 -0400
commit7544b0972c1fc1a0e6c54baa1f44c81019743daa (patch)
tree90c8ca52ab4bb01b83c51f2c6ea91b1a6854a1a1 /drivers
parent98efd8a6be79550767f5a9be6f3db8e7e9b747da (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')
-rw-r--r--drivers/net/tg3.c24
-rw-r--r--drivers/net/tg3.h2
2 files changed, 17 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
10403static struct pci_dev * __devinit tg3_find_peer(struct tg3 *);
10404
10407static int __devinit tg3_get_invariants(struct tg3 *tp) 10405static 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, "
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index c52acb0a602b..dcdfc084966c 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -131,6 +131,7 @@
131#define CHIPREV_ID_5752_A0_HW 0x5000 131#define CHIPREV_ID_5752_A0_HW 0x5000
132#define CHIPREV_ID_5752_A0 0x6000 132#define CHIPREV_ID_5752_A0 0x6000
133#define CHIPREV_ID_5752_A1 0x6001 133#define CHIPREV_ID_5752_A1 0x6001
134#define CHIPREV_ID_5714_A2 0x9002
134#define CHIPREV_ID_5906_A1 0xc001 135#define CHIPREV_ID_5906_A1 0xc001
135#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12) 136#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
136#define ASIC_REV_5700 0x07 137#define ASIC_REV_5700 0x07
@@ -2221,6 +2222,7 @@ struct tg3 {
2221#define TG3_FLAG_IN_RESET_TASK 0x04000000 2222#define TG3_FLAG_IN_RESET_TASK 0x04000000
2222#define TG3_FLAG_40BIT_DMA_BUG 0x08000000 2223#define TG3_FLAG_40BIT_DMA_BUG 0x08000000
2223#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000 2224#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000
2225#define TG3_FLAG_SUPPORT_MSI 0x20000000
2224#define TG3_FLAG_CHIP_RESETTING 0x40000000 2226#define TG3_FLAG_CHIP_RESETTING 0x40000000
2225#define TG3_FLAG_INIT_COMPLETE 0x80000000 2227#define TG3_FLAG_INIT_COMPLETE 0x80000000
2226 u32 tg3_flags2; 2228 u32 tg3_flags2;