aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/tg3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 0413e1e8564..6973d01ae85 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -14230,12 +14230,30 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
14230 val = tr32(MEMARB_MODE); 14230 val = tr32(MEMARB_MODE);
14231 tw32(MEMARB_MODE, val | MEMARB_MODE_ENABLE); 14231 tw32(MEMARB_MODE, val | MEMARB_MODE_ENABLE);
14232 14232
14233 if (tg3_flag(tp, PCIX_MODE)) { 14233 tp->pci_fn = PCI_FUNC(tp->pdev->devfn) & 3;
14234 pci_read_config_dword(tp->pdev, 14234 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 ||
14235 tp->pcix_cap + PCI_X_STATUS, &val); 14235 tg3_flag(tp, 5780_CLASS)) {
14236 tp->pci_fn = val & 0x7; 14236 if (tg3_flag(tp, PCIX_MODE)) {
14237 } else { 14237 pci_read_config_dword(tp->pdev,
14238 tp->pci_fn = PCI_FUNC(tp->pdev->devfn) & 3; 14238 tp->pcix_cap + PCI_X_STATUS,
14239 &val);
14240 tp->pci_fn = val & 0x7;
14241 }
14242 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
14243 tg3_read_mem(tp, NIC_SRAM_CPMU_STATUS, &val);
14244 if ((val & NIC_SRAM_CPMUSTAT_SIG_MSK) ==
14245 NIC_SRAM_CPMUSTAT_SIG) {
14246 tp->pci_fn = val & TG3_CPMU_STATUS_FMSK_5717;
14247 tp->pci_fn = tp->pci_fn ? 1 : 0;
14248 }
14249 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
14250 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) {
14251 tg3_read_mem(tp, NIC_SRAM_CPMU_STATUS, &val);
14252 if ((val & NIC_SRAM_CPMUSTAT_SIG_MSK) ==
14253 NIC_SRAM_CPMUSTAT_SIG) {
14254 tp->pci_fn = (val & TG3_CPMU_STATUS_FMSK_5719) >>
14255 TG3_CPMU_STATUS_FSHFT_5719;
14256 }
14239 } 14257 }
14240 14258
14241 /* Get eeprom hw config before calling tg3_set_power_state(). 14259 /* Get eeprom hw config before calling tg3_set_power_state().