aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/appletalk
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2009-03-26 11:11:18 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-27 03:46:40 -0400
commit8bbce3f61b63c7502b1d6228d9f59d3c6423a759 (patch)
tree52ca3721d43bc9e86eb3994cf901e6d143409382 /drivers/net/appletalk
parent8bb95b39a16ed55226810596f92216c53329d2fe (diff)
appletalk: convert cops to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/appletalk')
-rw-r--r--drivers/net/appletalk/cops.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index 54819a34ba0a..89632c5855f4 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -171,7 +171,6 @@ static unsigned int cops_debug = COPS_DEBUG;
171 171
172struct cops_local 172struct cops_local
173{ 173{
174 struct net_device_stats stats;
175 int board; /* Holds what board type is. */ 174 int board; /* Holds what board type is. */
176 int nodeid; /* Set to 1 once have nodeid. */ 175 int nodeid; /* Set to 1 once have nodeid. */
177 unsigned char node_acquire; /* Node ID when acquired. */ 176 unsigned char node_acquire; /* Node ID when acquired. */
@@ -197,7 +196,6 @@ static int cops_send_packet (struct sk_buff *skb, struct net_device *dev);
197static void set_multicast_list (struct net_device *dev); 196static void set_multicast_list (struct net_device *dev);
198static int cops_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); 197static int cops_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
199static int cops_close (struct net_device *dev); 198static int cops_close (struct net_device *dev);
200static struct net_device_stats *cops_get_stats (struct net_device *dev);
201 199
202static void cleanup_card(struct net_device *dev) 200static void cleanup_card(struct net_device *dev)
203{ 201{
@@ -337,7 +335,6 @@ static int __init cops_probe1(struct net_device *dev, int ioaddr)
337 dev->tx_timeout = cops_timeout; 335 dev->tx_timeout = cops_timeout;
338 dev->watchdog_timeo = HZ * 2; 336 dev->watchdog_timeo = HZ * 2;
339 337
340 dev->get_stats = cops_get_stats;
341 dev->open = cops_open; 338 dev->open = cops_open;
342 dev->stop = cops_close; 339 dev->stop = cops_close;
343 dev->do_ioctl = cops_ioctl; 340 dev->do_ioctl = cops_ioctl;
@@ -797,7 +794,7 @@ static void cops_rx(struct net_device *dev)
797 { 794 {
798 printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", 795 printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n",
799 dev->name); 796 dev->name);
800 lp->stats.rx_dropped++; 797 dev->stats.rx_dropped++;
801 while(pkt_len--) /* Discard packet */ 798 while(pkt_len--) /* Discard packet */
802 inb(ioaddr); 799 inb(ioaddr);
803 spin_unlock_irqrestore(&lp->lock, flags); 800 spin_unlock_irqrestore(&lp->lock, flags);
@@ -819,7 +816,7 @@ static void cops_rx(struct net_device *dev)
819 { 816 {
820 printk(KERN_WARNING "%s: Bad packet length of %d bytes.\n", 817 printk(KERN_WARNING "%s: Bad packet length of %d bytes.\n",
821 dev->name, pkt_len); 818 dev->name, pkt_len);
822 lp->stats.tx_errors++; 819 dev->stats.tx_errors++;
823 dev_kfree_skb_any(skb); 820 dev_kfree_skb_any(skb);
824 return; 821 return;
825 } 822 }
@@ -836,7 +833,7 @@ static void cops_rx(struct net_device *dev)
836 if(rsp_type != LAP_RESPONSE) 833 if(rsp_type != LAP_RESPONSE)
837 { 834 {
838 printk(KERN_WARNING "%s: Bad packet type %d.\n", dev->name, rsp_type); 835 printk(KERN_WARNING "%s: Bad packet type %d.\n", dev->name, rsp_type);
839 lp->stats.tx_errors++; 836 dev->stats.tx_errors++;
840 dev_kfree_skb_any(skb); 837 dev_kfree_skb_any(skb);
841 return; 838 return;
842 } 839 }
@@ -846,8 +843,8 @@ static void cops_rx(struct net_device *dev)
846 skb_reset_transport_header(skb); /* Point to data (Skip header). */ 843 skb_reset_transport_header(skb); /* Point to data (Skip header). */
847 844
848 /* Update the counters. */ 845 /* Update the counters. */
849 lp->stats.rx_packets++; 846 dev->stats.rx_packets++;
850 lp->stats.rx_bytes += skb->len; 847 dev->stats.rx_bytes += skb->len;
851 848
852 /* Send packet to a higher place. */ 849 /* Send packet to a higher place. */
853 netif_rx(skb); 850 netif_rx(skb);
@@ -858,7 +855,7 @@ static void cops_timeout(struct net_device *dev)
858 struct cops_local *lp = netdev_priv(dev); 855 struct cops_local *lp = netdev_priv(dev);
859 int ioaddr = dev->base_addr; 856 int ioaddr = dev->base_addr;
860 857
861 lp->stats.tx_errors++; 858 dev->stats.tx_errors++;
862 if(lp->board==TANGENT) 859 if(lp->board==TANGENT)
863 { 860 {
864 if((inb(ioaddr+TANG_CARD_STATUS)&TANG_TX_READY)==0) 861 if((inb(ioaddr+TANG_CARD_STATUS)&TANG_TX_READY)==0)
@@ -916,8 +913,8 @@ static int cops_send_packet(struct sk_buff *skb, struct net_device *dev)
916 spin_unlock_irqrestore(&lp->lock, flags); /* Restore interrupts. */ 913 spin_unlock_irqrestore(&lp->lock, flags); /* Restore interrupts. */
917 914
918 /* Done sending packet, update counters and cleanup. */ 915 /* Done sending packet, update counters and cleanup. */
919 lp->stats.tx_packets++; 916 dev->stats.tx_packets++;
920 lp->stats.tx_bytes += skb->len; 917 dev->stats.tx_bytes += skb->len;
921 dev->trans_start = jiffies; 918 dev->trans_start = jiffies;
922 dev_kfree_skb (skb); 919 dev_kfree_skb (skb);
923 return 0; 920 return 0;
@@ -986,15 +983,6 @@ static int cops_close(struct net_device *dev)
986 return 0; 983 return 0;
987} 984}
988 985
989/*
990 * Get the current statistics.
991 * This may be called with the card open or closed.
992 */
993static struct net_device_stats *cops_get_stats(struct net_device *dev)
994{
995 struct cops_local *lp = netdev_priv(dev);
996 return &lp->stats;
997}
998 986
999#ifdef MODULE 987#ifdef MODULE
1000static struct net_device *cops_dev; 988static struct net_device *cops_dev;