Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135297
b: refs/heads/master
c: 785b6f9
h: refs/heads/master
i:
  135295: 0570e76
v: v3
  • Loading branch information
Steve Glendinning authored and David S. Miller committed Mar 20, 2009
1 parent d40383c commit 958200a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 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: 2e1ab634bf013792d8803ec57c7a428a76f50028
refs/heads/master: 785b6f977a89aaabc3dd3e3bfc87f36015cb8050
18 changes: 8 additions & 10 deletions trunk/drivers/net/smsc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,22 +895,22 @@ static void smsc911x_tx_update_txcounters(struct net_device *dev)
SMSC_WARNING(HW,
"Packet tag reserved bit is high");
} else {
if (unlikely(tx_stat & 0x00008000)) {
if (unlikely(tx_stat & TX_STS_ES_)) {
dev->stats.tx_errors++;
} else {
dev->stats.tx_packets++;
dev->stats.tx_bytes += (tx_stat >> 16);
}
if (unlikely(tx_stat & 0x00000100)) {
if (unlikely(tx_stat & TX_STS_EXCESS_COL_)) {
dev->stats.collisions += 16;
dev->stats.tx_aborted_errors += 1;
} else {
dev->stats.collisions +=
((tx_stat >> 3) & 0xF);
}
if (unlikely(tx_stat & 0x00000800))
if (unlikely(tx_stat & TX_STS_LOST_CARRIER_))
dev->stats.tx_carrier_errors += 1;
if (unlikely(tx_stat & 0x00000200)) {
if (unlikely(tx_stat & TX_STS_LATE_COL_)) {
dev->stats.collisions++;
dev->stats.tx_aborted_errors++;
}
Expand All @@ -924,19 +924,17 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)
{
int crc_err = 0;

if (unlikely(rxstat & 0x00008000)) {
if (unlikely(rxstat & RX_STS_ES_)) {
dev->stats.rx_errors++;
if (unlikely(rxstat & 0x00000002)) {
if (unlikely(rxstat & RX_STS_CRC_ERR_)) {
dev->stats.rx_crc_errors++;
crc_err = 1;
}
}
if (likely(!crc_err)) {
if (unlikely((rxstat & 0x00001020) == 0x00001020)) {
/* Frame type indicates length,
* and length error is set */
if (unlikely((rxstat & RX_STS_FRAME_TYPE_) &&
(rxstat & RX_STS_LENGTH_ERR_)))
dev->stats.rx_length_errors++;
}
if (rxstat & RX_STS_MCAST_)
dev->stats.multicast++;
}
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/net/smsc911x.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,19 @@

#define RX_STATUS_FIFO 0x40
#define RX_STS_ES_ 0x00008000
#define RX_STS_LENGTH_ERR_ 0x00001000
#define RX_STS_MCAST_ 0x00000400
#define RX_STS_FRAME_TYPE_ 0x00000020
#define RX_STS_CRC_ERR_ 0x00000002

#define RX_STATUS_FIFO_PEEK 0x44

#define TX_STATUS_FIFO 0x48
#define TX_STS_ES_ 0x00008000
#define TX_STS_LOST_CARRIER_ 0x00000800
#define TX_STS_NO_CARRIER_ 0x00000400
#define TX_STS_LATE_COL_ 0x00000200
#define TX_STS_EXCESS_COL_ 0x00000100

#define TX_STATUS_FIFO_PEEK 0x4C

Expand Down

0 comments on commit 958200a

Please sign in to comment.