Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203375
b: refs/heads/master
c: d117b66
h: refs/heads/master
i:
  203373: 66d31df
  203371: 66b02d0
  203367: 261f9dc
  203359: fe77f83
v: v3
  • Loading branch information
Kulikov Vasiliy authored and David S. Miller committed Jul 6, 2010
1 parent 36cf226 commit 90f1911
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 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: 78e8c5325aa8ae99b6738eaab0ebb7e3f53007ff
refs/heads/master: d117b6665847084cfe8a44b870f771153e18991d
68 changes: 36 additions & 32 deletions trunk/drivers/net/fealnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,6 @@ struct netdev_private {

spinlock_t lock;

struct net_device_stats stats;

/* Media monitoring timer. */
struct timer_list timer;

Expand Down Expand Up @@ -1234,7 +1232,7 @@ static void fealnx_tx_timeout(struct net_device *dev)
spin_unlock_irqrestore(&np->lock, flags);

dev->trans_start = jiffies; /* prevent tx timeout */
np->stats.tx_errors++;
dev->stats.tx_errors++;
netif_wake_queue(dev); /* or .._start_.. ?? */
}

Expand Down Expand Up @@ -1479,10 +1477,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)

if (intr_status & CNTOVF) {
/* missed pkts */
np->stats.rx_missed_errors += ioread32(ioaddr + TALLY) & 0x7fff;
dev->stats.rx_missed_errors +=
ioread32(ioaddr + TALLY) & 0x7fff;

/* crc error */
np->stats.rx_crc_errors +=
dev->stats.rx_crc_errors +=
(ioread32(ioaddr + TALLY) & 0x7fff0000) >> 16;
}

Expand Down Expand Up @@ -1513,30 +1512,30 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)

if (!(np->crvalue & CR_W_ENH)) {
if (tx_status & (CSL | LC | EC | UDF | HF)) {
np->stats.tx_errors++;
dev->stats.tx_errors++;
if (tx_status & EC)
np->stats.tx_aborted_errors++;
dev->stats.tx_aborted_errors++;
if (tx_status & CSL)
np->stats.tx_carrier_errors++;
dev->stats.tx_carrier_errors++;
if (tx_status & LC)
np->stats.tx_window_errors++;
dev->stats.tx_window_errors++;
if (tx_status & UDF)
np->stats.tx_fifo_errors++;
dev->stats.tx_fifo_errors++;
if ((tx_status & HF) && np->mii.full_duplex == 0)
np->stats.tx_heartbeat_errors++;
dev->stats.tx_heartbeat_errors++;

} else {
np->stats.tx_bytes +=
dev->stats.tx_bytes +=
((tx_control & PKTSMask) >> PKTSShift);

np->stats.collisions +=
dev->stats.collisions +=
((tx_status & NCRMask) >> NCRShift);
np->stats.tx_packets++;
dev->stats.tx_packets++;
}
} else {
np->stats.tx_bytes +=
dev->stats.tx_bytes +=
((tx_control & PKTSMask) >> PKTSShift);
np->stats.tx_packets++;
dev->stats.tx_packets++;
}

/* Free the original skb. */
Expand Down Expand Up @@ -1564,10 +1563,12 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
long data;

data = ioread32(ioaddr + TSR);
np->stats.tx_errors += (data & 0xff000000) >> 24;
np->stats.tx_aborted_errors += (data & 0xff000000) >> 24;
np->stats.tx_window_errors += (data & 0x00ff0000) >> 16;
np->stats.collisions += (data & 0x0000ffff);
dev->stats.tx_errors += (data & 0xff000000) >> 24;
dev->stats.tx_aborted_errors +=
(data & 0xff000000) >> 24;
dev->stats.tx_window_errors +=
(data & 0x00ff0000) >> 16;
dev->stats.collisions += (data & 0x0000ffff);
}

if (--boguscnt < 0) {
Expand All @@ -1593,10 +1594,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)

/* read the tally counters */
/* missed pkts */
np->stats.rx_missed_errors += ioread32(ioaddr + TALLY) & 0x7fff;
dev->stats.rx_missed_errors += ioread32(ioaddr + TALLY) & 0x7fff;

/* crc error */
np->stats.rx_crc_errors += (ioread32(ioaddr + TALLY) & 0x7fff0000) >> 16;
dev->stats.rx_crc_errors +=
(ioread32(ioaddr + TALLY) & 0x7fff0000) >> 16;

if (debug)
printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n",
Expand Down Expand Up @@ -1635,13 +1637,13 @@ static int netdev_rx(struct net_device *dev)
"%s: Receive error, Rx status %8.8x.\n",
dev->name, rx_status);

np->stats.rx_errors++; /* end of a packet. */
dev->stats.rx_errors++; /* end of a packet. */
if (rx_status & (LONG | RUNT))
np->stats.rx_length_errors++;
dev->stats.rx_length_errors++;
if (rx_status & RXER)
np->stats.rx_frame_errors++;
dev->stats.rx_frame_errors++;
if (rx_status & CRC)
np->stats.rx_crc_errors++;
dev->stats.rx_crc_errors++;
} else {
int need_to_reset = 0;
int desno = 0;
Expand All @@ -1667,7 +1669,7 @@ static int netdev_rx(struct net_device *dev)
if (need_to_reset == 0) {
int i;

np->stats.rx_length_errors++;
dev->stats.rx_length_errors++;

/* free all rx descriptors related this long pkt */
for (i = 0; i < desno; ++i) {
Expand Down Expand Up @@ -1733,8 +1735,8 @@ static int netdev_rx(struct net_device *dev)
}
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
np->stats.rx_packets++;
np->stats.rx_bytes += pkt_len;
dev->stats.rx_packets++;
dev->stats.rx_bytes += pkt_len;
}

np->cur_rx = np->cur_rx->next_desc_logical;
Expand All @@ -1754,11 +1756,13 @@ static struct net_device_stats *get_stats(struct net_device *dev)

/* The chip only need report frame silently dropped. */
if (netif_running(dev)) {
np->stats.rx_missed_errors += ioread32(ioaddr + TALLY) & 0x7fff;
np->stats.rx_crc_errors += (ioread32(ioaddr + TALLY) & 0x7fff0000) >> 16;
dev->stats.rx_missed_errors +=
ioread32(ioaddr + TALLY) & 0x7fff;
dev->stats.rx_crc_errors +=
(ioread32(ioaddr + TALLY) & 0x7fff0000) >> 16;
}

return &np->stats;
return &dev->stats;
}


Expand Down

0 comments on commit 90f1911

Please sign in to comment.