Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256279
b: refs/heads/master
c: 69f11c9
h: refs/heads/master
i:
  256277: 731b739
  256275: 22cbb7d
  256271: 244df51
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Jul 14, 2011
1 parent bbc5533 commit d27e22a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bed9829f3ec4b30d5cbec6511a11368ba5f169fb
refs/heads/master: 69f11c9936ba310ed3620072983da6ed95e86cc0
14 changes: 11 additions & 3 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ static int tg3_mdio_init(struct tg3 *tp)
if (tg3_flag(tp, 5717_PLUS)) {
u32 is_serdes;

tp->phy_addr = PCI_FUNC(tp->pdev->devfn) + 1;
tp->phy_addr = tp->pci_fn + 1;

if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES;
Expand Down Expand Up @@ -13951,6 +13951,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
val = tr32(MEMARB_MODE);
tw32(MEMARB_MODE, val | MEMARB_MODE_ENABLE);

if (tg3_flag(tp, PCIX_MODE)) {
pci_read_config_dword(tp->pdev,
tp->pcix_cap + PCI_X_STATUS, &val);
tp->pci_fn = val & 0x7;
} else {
tp->pci_fn = PCI_FUNC(tp->pdev->devfn) & 3;
}

/* Get eeprom hw config before calling tg3_set_power_state().
* In particular, the TG3_FLAG_IS_NIC flag must be
* determined before calling tg3_set_power_state() so that
Expand Down Expand Up @@ -14316,9 +14324,9 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
else
tg3_nvram_unlock(tp);
} else if (tg3_flag(tp, 5717_PLUS)) {
if (PCI_FUNC(tp->pdev->devfn) & 1)
if (tp->pci_fn & 1)
mac_offset = 0xcc;
if (PCI_FUNC(tp->pdev->devfn) > 1)
if (tp->pci_fn > 1)
mac_offset += 0x18c;
} else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
mac_offset = 0x10;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/tg3.h
Original file line number Diff line number Diff line change
Expand Up @@ -3020,6 +3020,7 @@ struct tg3 {
u8 pci_cacheline_sz;
u8 pci_lat_timer;

int pci_fn;
int pm_cap;
int msi_cap;
int pcix_cap;
Expand Down

0 comments on commit d27e22a

Please sign in to comment.