uml: convert network device to internal network device stats
authorStephen Hemminger <shemminger@linux-foundation.org>
Thu, 26 Mar 2009 15:11:16 +0000 (15:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2009 07:46:39 +0000 (00:46 -0700)
Convert the UML network device to use internal network device stats.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/um/drivers/net_kern.c
arch/um/include/shared/net_kern.h

index fde510b..6d2b100 100644 (file)
@@ -86,7 +86,7 @@ static int uml_net_rx(struct net_device *dev)
                drop_skb->dev = dev;
                /* Read a packet into drop_skb and don't do anything with it. */
                (*lp->read)(lp->fd, drop_skb, lp);
-               lp->stats.rx_dropped++;
+               dev->stats.rx_dropped++;
                return 0;
        }
 
@@ -99,8 +99,8 @@ static int uml_net_rx(struct net_device *dev)
                skb_trim(skb, pkt_len);
                skb->protocol = (*lp->protocol)(skb);
 
-               lp->stats.rx_bytes += skb->len;
-               lp->stats.rx_packets++;
+               dev->stats.rx_bytes += skb->len;
+               dev->stats.rx_packets++;
                netif_rx(skb);
                return pkt_len;
        }
@@ -224,8 +224,8 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
        len = (*lp->write)(lp->fd, skb, lp);
 
        if (len == skb->len) {
-               lp->stats.tx_packets++;
-               lp->stats.tx_bytes += skb->len;
+               dev->stats.tx_packets++;
+               dev->stats.tx_bytes += skb->len;
                dev->trans_start = jiffies;
                netif_start_queue(dev);
 
@@ -234,7 +234,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
        else if (len == 0) {
                netif_start_queue(dev);
-               lp->stats.tx_dropped++;
+               dev->stats.tx_dropped++;
        }
        else {
                netif_start_queue(dev);
@@ -248,12 +248,6 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
        return 0;
 }
 
-static struct net_device_stats *uml_net_get_stats(struct net_device *dev)
-{
-       struct uml_net_private *lp = netdev_priv(dev);
-       return &lp->stats;
-}
-
 static void uml_net_set_multicast_list(struct net_device *dev)
 {
        return;
@@ -476,7 +470,6 @@ static void eth_configure(int n, void *init, char *mac,
        dev->open = uml_net_open;
        dev->hard_start_xmit = uml_net_start_xmit;
        dev->stop = uml_net_close;
-       dev->get_stats = uml_net_get_stats;
        dev->set_multicast_list = uml_net_set_multicast_list;
        dev->tx_timeout = uml_net_tx_timeout;
        dev->set_mac_address = uml_net_set_mac;
index d843c79..5c367f2 100644 (file)
@@ -26,7 +26,7 @@ struct uml_net_private {
        spinlock_t lock;
        struct net_device *dev;
        struct timer_list tl;
-       struct net_device_stats stats;
+
        struct work_struct work;
        int fd;
        unsigned char mac[ETH_ALEN];