summaryrefslogtreecommitdiff
path: root/target/linux/ramips
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-10-25 09:37:30 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-10-25 09:37:30 +0000
commitf4feacd7f3dd34343a81879534c82527c3777e82 (patch)
treeea181c50d61cdca775d42dde36c9b44ad6211de0 /target/linux/ramips
parent5305a949f421594e37751fdbc8aa083c95c6cf41 (diff)
ramips: nuke net_device stats from the private data of the ethernet driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18147 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips')
-rw-r--r--target/linux/ramips/files/arch/mips/include/asm/mach-ralink/eth.h1
-rw-r--r--target/linux/ramips/files/drivers/net/ramips.c21
2 files changed, 6 insertions, 16 deletions
diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/eth.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/eth.h
index efacc5d1ec..3ccd5fd1bc 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/eth.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/eth.h
@@ -209,7 +209,6 @@ struct raeth_priv
struct sk_buff *tx_skb[NUM_RX_DESC];
unsigned int skb_free_idx;
- struct net_device_stats stat;
struct ramips_eth_platform_data *plat;
};
diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c
index 338fa53992..1689f0a18f 100644
--- a/target/linux/ramips/files/drivers/net/ramips.c
+++ b/target/linux/ramips/files/drivers/net/ramips.c
@@ -136,7 +136,7 @@ ramips_eth_hard_start_xmit(struct sk_buff* skb, struct net_device *dev)
if(!(priv->tx[tx].txd2 & TX_DMA_DONE))
{
kfree_skb(skb);
- priv->stat.tx_dropped++;
+ dev->stats.tx_dropped++;
printk(KERN_ERR "%s: dropping\n", dev->name);
return 0;
}
@@ -144,12 +144,12 @@ ramips_eth_hard_start_xmit(struct sk_buff* skb, struct net_device *dev)
priv->tx[tx].txd2 &= ~(TX_DMA_PLEN0_MASK | TX_DMA_DONE);
priv->tx[tx].txd2 |= TX_DMA_PLEN0(skb->len);
ramips_fe_wr((tx + 1) % NUM_TX_DESC, RAMIPS_TX_CTX_IDX0);
- priv->stat.tx_packets++;
- priv->stat.tx_bytes += skb->len;
+ dev->stats.tx_packets++;
+ dev->stats.tx_bytes += skb->len;
priv->tx_skb[tx] = skb;
ramips_fe_wr((tx + 1) % NUM_TX_DESC, RAMIPS_TX_CTX_IDX0);
} else {
- priv->stat.tx_dropped++;
+ dev->stats.tx_dropped++;
kfree_skb(skb);
}
return 0;
@@ -178,8 +178,8 @@ ramips_eth_rx_hw(unsigned long ptr)
rx_skb->dev = dev;
rx_skb->protocol = eth_type_trans(rx_skb, dev);
rx_skb->ip_summed = CHECKSUM_NONE;
- priv->stat.rx_packets++;
- priv->stat.rx_bytes += rx_skb->len;
+ dev->stats.rx_packets++;
+ dev->stats.rx_bytes += rx_skb->len;
netif_rx(rx_skb);
new_skb = __dev_alloc_skb(MAX_RX_LENGTH + 2, GFP_DMA | GFP_ATOMIC);
@@ -220,14 +220,6 @@ ramips_eth_tx_housekeeping(unsigned long ptr)
RAMIPS_FE_INT_ENABLE);
}
-static struct net_device_stats*
-ramips_eth_get_stats(struct net_device *dev)
-{
- struct raeth_priv *priv = netdev_priv(dev);
-
- return &priv->stat;
-}
-
static int
ramips_eth_set_mac_addr(struct net_device *dev, void *priv)
{
@@ -336,7 +328,6 @@ ramips_eth_probe(struct net_device *dev)
dev->open = ramips_eth_open;
dev->stop = ramips_eth_stop;
dev->hard_start_xmit = ramips_eth_hard_start_xmit;
- dev->get_stats = ramips_eth_get_stats;
dev->set_mac_address = ramips_eth_set_mac_addr;
dev->mtu = MAX_RX_LENGTH;
dev->tx_timeout = ramips_eth_timeout;