diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2009-03-26 11:11:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-27 03:46:39 -0400 |
commit | cfa8707aa65f7ec8ed2130937810b4fb05b40cfa (patch) | |
tree | fcf1c3be12d5dd607e746bb800b5d85eda73ce3c /arch/um | |
parent | 1ace90fe0a36ae9da0b2e1211e6a30ec244e9bd0 (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')
-rw-r--r-- | arch/um/drivers/net_kern.c | 19 | ||||
-rw-r--r-- | arch/um/include/shared/net_kern.h | 2 |
2 files changed, 7 insertions, 14 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 | ||
251 | static 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 | |||
257 | static void uml_net_set_multicast_list(struct net_device *dev) | 251 | static 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; |
diff --git a/arch/um/include/shared/net_kern.h b/arch/um/include/shared/net_kern.h index d843c7924a7c..5c367f22595b 100644 --- a/arch/um/include/shared/net_kern.h +++ b/arch/um/include/shared/net_kern.h | |||
@@ -26,7 +26,7 @@ struct uml_net_private { | |||
26 | spinlock_t lock; | 26 | spinlock_t lock; |
27 | struct net_device *dev; | 27 | struct net_device *dev; |
28 | struct timer_list tl; | 28 | struct timer_list tl; |
29 | struct net_device_stats stats; | 29 | |
30 | struct work_struct work; | 30 | struct work_struct work; |
31 | int fd; | 31 | int fd; |
32 | unsigned char mac[ETH_ALEN]; | 32 | unsigned char mac[ETH_ALEN]; |