aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2009-03-26 11:11:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-27 03:46:39 -0400
commitcfa8707aa65f7ec8ed2130937810b4fb05b40cfa (patch)
treefcf1c3be12d5dd607e746bb800b5d85eda73ce3c /arch/um/drivers
parent1ace90fe0a36ae9da0b2e1211e6a30ec244e9bd0 (diff)
uml: convert network device to internal network device stats
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>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r--arch/um/drivers/net_kern.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index fde510b664d3..6d2b1004d1e1 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -86,7 +86,7 @@ static int uml_net_rx(struct net_device *dev)
86 drop_skb->dev = dev; 86 drop_skb->dev = dev;
87 /* Read a packet into drop_skb and don't do anything with it. */ 87 /* Read a packet into drop_skb and don't do anything with it. */
88 (*lp->read)(lp->fd, drop_skb, lp); 88 (*lp->read)(lp->fd, drop_skb, lp);
89 lp->stats.rx_dropped++; 89 dev->stats.rx_dropped++;
90 return 0; 90 return 0;
91 } 91 }
92 92
@@ -99,8 +99,8 @@ static int uml_net_rx(struct net_device *dev)
99 skb_trim(skb, pkt_len); 99 skb_trim(skb, pkt_len);
100 skb->protocol = (*lp->protocol)(skb); 100 skb->protocol = (*lp->protocol)(skb);
101 101
102 lp->stats.rx_bytes += skb->len; 102 dev->stats.rx_bytes += skb->len;
103 lp->stats.rx_packets++; 103 dev->stats.rx_packets++;
104 netif_rx(skb); 104 netif_rx(skb);
105 return pkt_len; 105 return pkt_len;
106 } 106 }
@@ -224,8 +224,8 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
224 len = (*lp->write)(lp->fd, skb, lp); 224 len = (*lp->write)(lp->fd, skb, lp);
225 225
226 if (len == skb->len) { 226 if (len == skb->len) {
227 lp->stats.tx_packets++; 227 dev->stats.tx_packets++;
228 lp->stats.tx_bytes += skb->len; 228 dev->stats.tx_bytes += skb->len;
229 dev->trans_start = jiffies; 229 dev->trans_start = jiffies;
230 netif_start_queue(dev); 230 netif_start_queue(dev);
231 231
@@ -234,7 +234,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
234 } 234 }
235 else if (len == 0) { 235 else if (len == 0) {
236 netif_start_queue(dev); 236 netif_start_queue(dev);
237 lp->stats.tx_dropped++; 237 dev->stats.tx_dropped++;
238 } 238 }
239 else { 239 else {
240 netif_start_queue(dev); 240 netif_start_queue(dev);
@@ -248,12 +248,6 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
248 return 0; 248 return 0;
249} 249}
250 250
251static struct net_device_stats *uml_net_get_stats(struct net_device *dev)
252{
253 struct uml_net_private *lp = netdev_priv(dev);
254 return &lp->stats;
255}
256
257static void uml_net_set_multicast_list(struct net_device *dev) 251static void uml_net_set_multicast_list(struct net_device *dev)
258{ 252{
259 return; 253 return;
@@ -476,7 +470,6 @@ static void eth_configure(int n, void *init, char *mac,
476 dev->open = uml_net_open; 470 dev->open = uml_net_open;
477 dev->hard_start_xmit = uml_net_start_xmit; 471 dev->hard_start_xmit = uml_net_start_xmit;
478 dev->stop = uml_net_close; 472 dev->stop = uml_net_close;
479 dev->get_stats = uml_net_get_stats;
480 dev->set_multicast_list = uml_net_set_multicast_list; 473 dev->set_multicast_list = uml_net_set_multicast_list;
481 dev->tx_timeout = uml_net_tx_timeout; 474 dev->tx_timeout = uml_net_tx_timeout;
482 dev->set_mac_address = uml_net_set_mac; 475 dev->set_mac_address = uml_net_set_mac;