Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224479
b: refs/heads/master
c: cf79003
h: refs/heads/master
i:
  224477: a3104ca
  224475: 38d90ac
  224471: dfeb548
  224463: f941562
  224447: b026b34
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Nov 24, 2010
1 parent 6aee965 commit 5cd8b96
Show file tree
Hide file tree
Showing 3 changed files with 43 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: d2394e6bb1aa636f3bd142cb6f7845a4332514b5
refs/heads/master: cf79003d598b1f82a4caa0564107283b4f560e14
44 changes: 41 additions & 3 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -6985,7 +6985,7 @@ static void tg3_restore_pci_state(struct tg3 *tp)

if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785) {
if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)
pcie_set_readrq(tp->pdev, 4096);
pcie_set_readrq(tp->pdev, tp->pcie_readrq);
else {
pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
tp->pci_cacheline_sz);
Expand Down Expand Up @@ -7179,7 +7179,7 @@ static int tg3_chip_reset(struct tg3 *tp)
tp->pcie_cap + PCI_EXP_DEVCTL,
val16);

pcie_set_readrq(tp->pdev, 4096);
pcie_set_readrq(tp->pdev, tp->pcie_readrq);

/* Clear error status */
pci_write_config_word(tp->pdev,
Expand Down Expand Up @@ -13366,7 +13366,45 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)

tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;

pcie_set_readrq(tp->pdev, 4096);
tp->pcie_readrq = 4096;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
u16 word;

pci_read_config_word(tp->pdev,
tp->pcie_cap + PCI_EXP_LNKSTA,
&word);
switch (word & PCI_EXP_LNKSTA_CLS) {
case PCI_EXP_LNKSTA_CLS_2_5GB:
word &= PCI_EXP_LNKSTA_NLW;
word >>= PCI_EXP_LNKSTA_NLW_SHIFT;
switch (word) {
case 2:
tp->pcie_readrq = 2048;
break;
case 4:
tp->pcie_readrq = 1024;
break;
}
break;

case PCI_EXP_LNKSTA_CLS_5_0GB:
word &= PCI_EXP_LNKSTA_NLW;
word >>= PCI_EXP_LNKSTA_NLW_SHIFT;
switch (word) {
case 1:
tp->pcie_readrq = 2048;
break;
case 2:
tp->pcie_readrq = 1024;
break;
case 4:
tp->pcie_readrq = 512;
break;
}
}
}

pcie_set_readrq(tp->pdev, tp->pcie_readrq);

pci_read_config_word(tp->pdev,
tp->pcie_cap + PCI_EXP_LNKCTL,
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 @@ -2948,6 +2948,7 @@ struct tg3 {
int pcix_cap;
int pcie_cap;
};
int pcie_readrq;

struct mii_bus *mdio_bus;
int mdio_irq[PHY_MAX_ADDR];
Expand Down

0 comments on commit 5cd8b96

Please sign in to comment.