Commit d9830352 authored by Roger Luethi's avatar Roger Luethi Committed by Jeff Garzik

[PATCH] via-rhine: Fix force media

Lucas Nussbaum and Dirk Koeppen each found independently that the code
for forcing media options in via-rhine is borked and suggested the fix
below. I've been sitting on this way too long because there is more
badness in the immediate vicinity which needs a bigger surgery.

The second hunk fixes a braino I managed to introduce myself.
parent 3d61e387
......@@ -860,7 +860,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
if (option & 0x220)
np->mii_if.full_duplex = 1;
np->default_port = option & 0x3ff;
if (np->default_port & 0x330) {
if (option & 0x330) {
/* FIXME: shouldn't someone check this variable? */
/* np->medialock = 1; */
printk(KERN_INFO " Forcing %dMbs %s-duplex operation.\n",
......@@ -1683,8 +1683,9 @@ static void via_rhine_error(struct net_device *dev, int intr_status)
printk(KERN_INFO "%s: Tx descriptor write-back race.\n",
dev->name);
}
if ((intr_status & IntrTxError) && ~( IntrTxAborted | IntrTxUnderrun |
IntrTxDescRace )) {
if ((intr_status & IntrTxError) &&
(intr_status & ( IntrTxAborted |
IntrTxUnderrun | IntrTxDescRace )) == 0) {
if (np->tx_thresh < 0xE0) {
writeb(np->tx_thresh += 0x20, ioaddr + TxConfig);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment