mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
net: 3c574_cs fix stats.tx_bytes counter
Update the stats counter calculation in 3c574_cs, similar to the method used in 3c589_cs. This corrects the contents of the counter on tests using a "Megahertz 574B" card. [linux@dominikbrodowski.net: clean up commit message] Signed-off-by: Alexander Kurz <linux@kbdbabel.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
bc8e4b954e
commit
df245dce57
1 changed files with 5 additions and 2 deletions
|
@ -781,8 +781,13 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
|
||||||
inw(ioaddr + EL3_STATUS));
|
inw(ioaddr + EL3_STATUS));
|
||||||
|
|
||||||
spin_lock_irqsave(&lp->window_lock, flags);
|
spin_lock_irqsave(&lp->window_lock, flags);
|
||||||
|
|
||||||
|
dev->stats.tx_bytes += skb->len;
|
||||||
|
|
||||||
|
/* Put out the doubleword header... */
|
||||||
outw(skb->len, ioaddr + TX_FIFO);
|
outw(skb->len, ioaddr + TX_FIFO);
|
||||||
outw(0, ioaddr + TX_FIFO);
|
outw(0, ioaddr + TX_FIFO);
|
||||||
|
/* ... and the packet rounded to a doubleword. */
|
||||||
outsl(ioaddr + TX_FIFO, skb->data, (skb->len+3)>>2);
|
outsl(ioaddr + TX_FIFO, skb->data, (skb->len+3)>>2);
|
||||||
|
|
||||||
dev->trans_start = jiffies;
|
dev->trans_start = jiffies;
|
||||||
|
@ -1021,8 +1026,6 @@ static void update_stats(struct net_device *dev)
|
||||||
/* BadSSD */ inb(ioaddr + 12);
|
/* BadSSD */ inb(ioaddr + 12);
|
||||||
up = inb(ioaddr + 13);
|
up = inb(ioaddr + 13);
|
||||||
|
|
||||||
dev->stats.tx_bytes += tx + ((up & 0xf0) << 12);
|
|
||||||
|
|
||||||
EL3WINDOW(1);
|
EL3WINDOW(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue