From 71a52cb469f9b924cc9d687ee5ece33ae22a8a1e Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Sun, 6 Jan 2013 12:51:09 +0000 Subject: [PATCH] --- yaml --- r: 351295 b: refs/heads/master c: 857001f06f6bec17cafd567a03b24968902a4744 h: refs/heads/master i: 351293: a38a5025c6a66ec9417c77f18ab73e961a85cf93 351291: f0e76e0f007cd6c64a095c3ba5692fb6f29bd4de 351287: 49c0ac25456adc04a37ba5c484000c604c6c6df3 351279: 3648c87810791712176c692cfc1324aa69b803cb 351263: ebf96194c5679e4eed6594b945b0ff65d501351b 351231: e0521f96fc912b2c74b6905cb729e1213fc64e5c v: v3 --- [refs] | 2 +- trunk/drivers/net/ethernet/broadcom/tg3.c | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 3c5f755d52b4..fd4c693e5ad1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c86a8560e2dd800b619056c25b3f0ab8f5c59156 +refs/heads/master: 857001f06f6bec17cafd567a03b24968902a4744 diff --git a/trunk/drivers/net/ethernet/broadcom/tg3.c b/trunk/drivers/net/ethernet/broadcom/tg3.c index 6eab7d7ae4df..3596b7b23da1 100644 --- a/trunk/drivers/net/ethernet/broadcom/tg3.c +++ b/trunk/drivers/net/ethernet/broadcom/tg3.c @@ -15441,21 +15441,18 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) &val); tp->pci_fn = val & 0x7; } - } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { - tg3_read_mem(tp, NIC_SRAM_CPMU_STATUS, &val); - if ((val & NIC_SRAM_CPMUSTAT_SIG_MSK) == - NIC_SRAM_CPMUSTAT_SIG) { - tp->pci_fn = val & TG3_CPMU_STATUS_FMSK_5717; - tp->pci_fn = tp->pci_fn ? 1 : 0; - } - } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || + } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) { tg3_read_mem(tp, NIC_SRAM_CPMU_STATUS, &val); - if ((val & NIC_SRAM_CPMUSTAT_SIG_MSK) == - NIC_SRAM_CPMUSTAT_SIG) { + if ((val & NIC_SRAM_CPMUSTAT_SIG_MSK) != NIC_SRAM_CPMUSTAT_SIG) + val = tr32(TG3_CPMU_STATUS); + + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) + tp->pci_fn = (val & TG3_CPMU_STATUS_FMSK_5717) ? 1 : 0; + else tp->pci_fn = (val & TG3_CPMU_STATUS_FMSK_5719) >> TG3_CPMU_STATUS_FSHFT_5719; - } } /* Get eeprom hw config before calling tg3_set_power_state().