|
@@ -312,8 +312,6 @@ struct de_private {
|
|
|
|
|
|
u32 msg_enable;
|
|
u32 msg_enable;
|
|
|
|
|
|
- struct net_device_stats net_stats;
|
|
|
|
-
|
|
|
|
struct pci_dev *pdev;
|
|
struct pci_dev *pdev;
|
|
|
|
|
|
u16 setup_frame[DE_SETUP_FRAME_WORDS];
|
|
u16 setup_frame[DE_SETUP_FRAME_WORDS];
|
|
@@ -388,14 +386,14 @@ static void de_rx_err_acct (struct de_private *de, unsigned rx_tail,
|
|
netif_warn(de, rx_err, de->dev,
|
|
netif_warn(de, rx_err, de->dev,
|
|
"Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
|
|
"Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
|
|
status);
|
|
status);
|
|
- de->net_stats.rx_length_errors++;
|
|
|
|
|
|
+ de->dev->stats.rx_length_errors++;
|
|
}
|
|
}
|
|
} else if (status & RxError) {
|
|
} else if (status & RxError) {
|
|
/* There was a fatal error. */
|
|
/* There was a fatal error. */
|
|
- de->net_stats.rx_errors++; /* end of a packet.*/
|
|
|
|
- if (status & 0x0890) de->net_stats.rx_length_errors++;
|
|
|
|
- if (status & RxErrCRC) de->net_stats.rx_crc_errors++;
|
|
|
|
- if (status & RxErrFIFO) de->net_stats.rx_fifo_errors++;
|
|
|
|
|
|
+ de->dev->stats.rx_errors++; /* end of a packet.*/
|
|
|
|
+ if (status & 0x0890) de->dev->stats.rx_length_errors++;
|
|
|
|
+ if (status & RxErrCRC) de->dev->stats.rx_crc_errors++;
|
|
|
|
+ if (status & RxErrFIFO) de->dev->stats.rx_fifo_errors++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -423,7 +421,7 @@ static void de_rx (struct de_private *de)
|
|
mapping = de->rx_skb[rx_tail].mapping;
|
|
mapping = de->rx_skb[rx_tail].mapping;
|
|
|
|
|
|
if (unlikely(drop)) {
|
|
if (unlikely(drop)) {
|
|
- de->net_stats.rx_dropped++;
|
|
|
|
|
|
+ de->dev->stats.rx_dropped++;
|
|
goto rx_next;
|
|
goto rx_next;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -441,7 +439,7 @@ static void de_rx (struct de_private *de)
|
|
buflen = copying_skb ? (len + RX_OFFSET) : de->rx_buf_sz;
|
|
buflen = copying_skb ? (len + RX_OFFSET) : de->rx_buf_sz;
|
|
copy_skb = netdev_alloc_skb(de->dev, buflen);
|
|
copy_skb = netdev_alloc_skb(de->dev, buflen);
|
|
if (unlikely(!copy_skb)) {
|
|
if (unlikely(!copy_skb)) {
|
|
- de->net_stats.rx_dropped++;
|
|
|
|
|
|
+ de->dev->stats.rx_dropped++;
|
|
drop = 1;
|
|
drop = 1;
|
|
rx_work = 100;
|
|
rx_work = 100;
|
|
goto rx_next;
|
|
goto rx_next;
|
|
@@ -470,8 +468,8 @@ static void de_rx (struct de_private *de)
|
|
|
|
|
|
skb->protocol = eth_type_trans (skb, de->dev);
|
|
skb->protocol = eth_type_trans (skb, de->dev);
|
|
|
|
|
|
- de->net_stats.rx_packets++;
|
|
|
|
- de->net_stats.rx_bytes += skb->len;
|
|
|
|
|
|
+ de->dev->stats.rx_packets++;
|
|
|
|
+ de->dev->stats.rx_bytes += skb->len;
|
|
rc = netif_rx (skb);
|
|
rc = netif_rx (skb);
|
|
if (rc == NET_RX_DROP)
|
|
if (rc == NET_RX_DROP)
|
|
drop = 1;
|
|
drop = 1;
|
|
@@ -572,18 +570,18 @@ static void de_tx (struct de_private *de)
|
|
netif_dbg(de, tx_err, de->dev,
|
|
netif_dbg(de, tx_err, de->dev,
|
|
"tx err, status 0x%x\n",
|
|
"tx err, status 0x%x\n",
|
|
status);
|
|
status);
|
|
- de->net_stats.tx_errors++;
|
|
|
|
|
|
+ de->dev->stats.tx_errors++;
|
|
if (status & TxOWC)
|
|
if (status & TxOWC)
|
|
- de->net_stats.tx_window_errors++;
|
|
|
|
|
|
+ de->dev->stats.tx_window_errors++;
|
|
if (status & TxMaxCol)
|
|
if (status & TxMaxCol)
|
|
- de->net_stats.tx_aborted_errors++;
|
|
|
|
|
|
+ de->dev->stats.tx_aborted_errors++;
|
|
if (status & TxLinkFail)
|
|
if (status & TxLinkFail)
|
|
- de->net_stats.tx_carrier_errors++;
|
|
|
|
|
|
+ de->dev->stats.tx_carrier_errors++;
|
|
if (status & TxFIFOUnder)
|
|
if (status & TxFIFOUnder)
|
|
- de->net_stats.tx_fifo_errors++;
|
|
|
|
|
|
+ de->dev->stats.tx_fifo_errors++;
|
|
} else {
|
|
} else {
|
|
- de->net_stats.tx_packets++;
|
|
|
|
- de->net_stats.tx_bytes += skb->len;
|
|
|
|
|
|
+ de->dev->stats.tx_packets++;
|
|
|
|
+ de->dev->stats.tx_bytes += skb->len;
|
|
netif_dbg(de, tx_done, de->dev,
|
|
netif_dbg(de, tx_done, de->dev,
|
|
"tx done, slot %d\n", tx_tail);
|
|
"tx done, slot %d\n", tx_tail);
|
|
}
|
|
}
|
|
@@ -814,9 +812,9 @@ static void de_set_rx_mode (struct net_device *dev)
|
|
static inline void de_rx_missed(struct de_private *de, u32 rx_missed)
|
|
static inline void de_rx_missed(struct de_private *de, u32 rx_missed)
|
|
{
|
|
{
|
|
if (unlikely(rx_missed & RxMissedOver))
|
|
if (unlikely(rx_missed & RxMissedOver))
|
|
- de->net_stats.rx_missed_errors += RxMissedMask;
|
|
|
|
|
|
+ de->dev->stats.rx_missed_errors += RxMissedMask;
|
|
else
|
|
else
|
|
- de->net_stats.rx_missed_errors += (rx_missed & RxMissedMask);
|
|
|
|
|
|
+ de->dev->stats.rx_missed_errors += (rx_missed & RxMissedMask);
|
|
}
|
|
}
|
|
|
|
|
|
static void __de_get_stats(struct de_private *de)
|
|
static void __de_get_stats(struct de_private *de)
|
|
@@ -836,7 +834,7 @@ static struct net_device_stats *de_get_stats(struct net_device *dev)
|
|
__de_get_stats(de);
|
|
__de_get_stats(de);
|
|
spin_unlock_irq(&de->lock);
|
|
spin_unlock_irq(&de->lock);
|
|
|
|
|
|
- return &de->net_stats;
|
|
|
|
|
|
+ return &dev->stats;
|
|
}
|
|
}
|
|
|
|
|
|
static inline int de_is_running (struct de_private *de)
|
|
static inline int de_is_running (struct de_private *de)
|
|
@@ -1348,7 +1346,7 @@ static void de_clean_rings (struct de_private *de)
|
|
struct sk_buff *skb = de->tx_skb[i].skb;
|
|
struct sk_buff *skb = de->tx_skb[i].skb;
|
|
if ((skb) && (skb != DE_DUMMY_SKB)) {
|
|
if ((skb) && (skb != DE_DUMMY_SKB)) {
|
|
if (skb != DE_SETUP_SKB) {
|
|
if (skb != DE_SETUP_SKB) {
|
|
- de->net_stats.tx_dropped++;
|
|
|
|
|
|
+ de->dev->stats.tx_dropped++;
|
|
pci_unmap_single(de->pdev,
|
|
pci_unmap_single(de->pdev,
|
|
de->tx_skb[i].mapping,
|
|
de->tx_skb[i].mapping,
|
|
skb->len, PCI_DMA_TODEVICE);
|
|
skb->len, PCI_DMA_TODEVICE);
|