diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-20 15:36:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-22 01:43:58 -0400 |
commit | 385e63fb1e469739e90b32f4c07fed48baf2721a (patch) | |
tree | 00e91183e7e4938ce062f298ca346928f57cdfe4 | |
parent | 1cc5920f0f6077e36e259e149548ef9a94335382 (diff) |
wavelan: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wireless/wavelan_cs.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/wavelan_cs.p.h | 6 |
2 files changed, 17 insertions, 39 deletions
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 1565a0a60973..90235fb3d862 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -1352,21 +1352,6 @@ wv_init_info(struct net_device * dev) | |||
1352 | * or wireless extensions | 1352 | * or wireless extensions |
1353 | */ | 1353 | */ |
1354 | 1354 | ||
1355 | /*------------------------------------------------------------------*/ | ||
1356 | /* | ||
1357 | * Get the current ethernet statistics. This may be called with the | ||
1358 | * card open or closed. | ||
1359 | * Used when the user read /proc/net/dev | ||
1360 | */ | ||
1361 | static en_stats * | ||
1362 | wavelan_get_stats(struct net_device * dev) | ||
1363 | { | ||
1364 | #ifdef DEBUG_IOCTL_TRACE | ||
1365 | printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name); | ||
1366 | #endif | ||
1367 | |||
1368 | return(&((net_local *)netdev_priv(dev))->stats); | ||
1369 | } | ||
1370 | 1355 | ||
1371 | /*------------------------------------------------------------------*/ | 1356 | /*------------------------------------------------------------------*/ |
1372 | /* | 1357 | /* |
@@ -2817,7 +2802,7 @@ wv_packet_read(struct net_device * dev, | |||
2817 | printk(KERN_INFO "%s: wv_packet_read(): could not alloc_skb(%d, GFP_ATOMIC)\n", | 2802 | printk(KERN_INFO "%s: wv_packet_read(): could not alloc_skb(%d, GFP_ATOMIC)\n", |
2818 | dev->name, sksize); | 2803 | dev->name, sksize); |
2819 | #endif | 2804 | #endif |
2820 | lp->stats.rx_dropped++; | 2805 | dev->stats.rx_dropped++; |
2821 | /* | 2806 | /* |
2822 | * Not only do we want to return here, but we also need to drop the | 2807 | * Not only do we want to return here, but we also need to drop the |
2823 | * packet on the floor to clear the interrupt. | 2808 | * packet on the floor to clear the interrupt. |
@@ -2877,8 +2862,8 @@ wv_packet_read(struct net_device * dev, | |||
2877 | netif_rx(skb); | 2862 | netif_rx(skb); |
2878 | 2863 | ||
2879 | /* Keep stats up to date */ | 2864 | /* Keep stats up to date */ |
2880 | lp->stats.rx_packets++; | 2865 | dev->stats.rx_packets++; |
2881 | lp->stats.rx_bytes += sksize; | 2866 | dev->stats.rx_bytes += sksize; |
2882 | 2867 | ||
2883 | #ifdef DEBUG_RX_TRACE | 2868 | #ifdef DEBUG_RX_TRACE |
2884 | printk(KERN_DEBUG "%s: <-wv_packet_read()\n", dev->name); | 2869 | printk(KERN_DEBUG "%s: <-wv_packet_read()\n", dev->name); |
@@ -2980,13 +2965,13 @@ wv_packet_rcv(struct net_device * dev) | |||
2980 | /* Check status */ | 2965 | /* Check status */ |
2981 | if((status & RX_RCV_OK) != RX_RCV_OK) | 2966 | if((status & RX_RCV_OK) != RX_RCV_OK) |
2982 | { | 2967 | { |
2983 | lp->stats.rx_errors++; | 2968 | dev->stats.rx_errors++; |
2984 | if(status & RX_NO_SFD) | 2969 | if(status & RX_NO_SFD) |
2985 | lp->stats.rx_frame_errors++; | 2970 | dev->stats.rx_frame_errors++; |
2986 | if(status & RX_CRC_ERR) | 2971 | if(status & RX_CRC_ERR) |
2987 | lp->stats.rx_crc_errors++; | 2972 | dev->stats.rx_crc_errors++; |
2988 | if(status & RX_OVRRUN) | 2973 | if(status & RX_OVRRUN) |
2989 | lp->stats.rx_over_errors++; | 2974 | dev->stats.rx_over_errors++; |
2990 | 2975 | ||
2991 | #ifdef DEBUG_RX_FAIL | 2976 | #ifdef DEBUG_RX_FAIL |
2992 | printk(KERN_DEBUG "%s: wv_packet_rcv(): packet not received ok, status = 0x%x\n", | 2977 | printk(KERN_DEBUG "%s: wv_packet_rcv(): packet not received ok, status = 0x%x\n", |
@@ -3073,7 +3058,7 @@ wv_packet_write(struct net_device * dev, | |||
3073 | dev->trans_start = jiffies; | 3058 | dev->trans_start = jiffies; |
3074 | 3059 | ||
3075 | /* Keep stats up to date */ | 3060 | /* Keep stats up to date */ |
3076 | lp->stats.tx_bytes += length; | 3061 | dev->stats.tx_bytes += length; |
3077 | 3062 | ||
3078 | spin_unlock_irqrestore(&lp->spinlock, flags); | 3063 | spin_unlock_irqrestore(&lp->spinlock, flags); |
3079 | 3064 | ||
@@ -4106,7 +4091,7 @@ wavelan_interrupt(int irq, | |||
4106 | printk(KERN_INFO "%s: wv_interrupt(): receive buffer overflow\n", | 4091 | printk(KERN_INFO "%s: wv_interrupt(): receive buffer overflow\n", |
4107 | dev->name); | 4092 | dev->name); |
4108 | #endif | 4093 | #endif |
4109 | lp->stats.rx_over_errors++; | 4094 | dev->stats.rx_over_errors++; |
4110 | lp->overrunning = 1; | 4095 | lp->overrunning = 1; |
4111 | } | 4096 | } |
4112 | 4097 | ||
@@ -4155,7 +4140,7 @@ wavelan_interrupt(int irq, | |||
4155 | /* Check for possible errors */ | 4140 | /* Check for possible errors */ |
4156 | if((tx_status & TX_OK) != TX_OK) | 4141 | if((tx_status & TX_OK) != TX_OK) |
4157 | { | 4142 | { |
4158 | lp->stats.tx_errors++; | 4143 | dev->stats.tx_errors++; |
4159 | 4144 | ||
4160 | if(tx_status & TX_FRTL) | 4145 | if(tx_status & TX_FRTL) |
4161 | { | 4146 | { |
@@ -4170,14 +4155,14 @@ wavelan_interrupt(int irq, | |||
4170 | printk(KERN_DEBUG "%s: wv_interrupt(): DMA underrun\n", | 4155 | printk(KERN_DEBUG "%s: wv_interrupt(): DMA underrun\n", |
4171 | dev->name); | 4156 | dev->name); |
4172 | #endif | 4157 | #endif |
4173 | lp->stats.tx_aborted_errors++; | 4158 | dev->stats.tx_aborted_errors++; |
4174 | } | 4159 | } |
4175 | if(tx_status & TX_LOST_CTS) | 4160 | if(tx_status & TX_LOST_CTS) |
4176 | { | 4161 | { |
4177 | #ifdef DEBUG_TX_FAIL | 4162 | #ifdef DEBUG_TX_FAIL |
4178 | printk(KERN_DEBUG "%s: wv_interrupt(): no CTS\n", dev->name); | 4163 | printk(KERN_DEBUG "%s: wv_interrupt(): no CTS\n", dev->name); |
4179 | #endif | 4164 | #endif |
4180 | lp->stats.tx_carrier_errors++; | 4165 | dev->stats.tx_carrier_errors++; |
4181 | } | 4166 | } |
4182 | if(tx_status & TX_LOST_CRS) | 4167 | if(tx_status & TX_LOST_CRS) |
4183 | { | 4168 | { |
@@ -4185,14 +4170,14 @@ wavelan_interrupt(int irq, | |||
4185 | printk(KERN_DEBUG "%s: wv_interrupt(): no carrier\n", | 4170 | printk(KERN_DEBUG "%s: wv_interrupt(): no carrier\n", |
4186 | dev->name); | 4171 | dev->name); |
4187 | #endif | 4172 | #endif |
4188 | lp->stats.tx_carrier_errors++; | 4173 | dev->stats.tx_carrier_errors++; |
4189 | } | 4174 | } |
4190 | if(tx_status & TX_HRT_BEAT) | 4175 | if(tx_status & TX_HRT_BEAT) |
4191 | { | 4176 | { |
4192 | #ifdef DEBUG_TX_FAIL | 4177 | #ifdef DEBUG_TX_FAIL |
4193 | printk(KERN_DEBUG "%s: wv_interrupt(): heart beat\n", dev->name); | 4178 | printk(KERN_DEBUG "%s: wv_interrupt(): heart beat\n", dev->name); |
4194 | #endif | 4179 | #endif |
4195 | lp->stats.tx_heartbeat_errors++; | 4180 | dev->stats.tx_heartbeat_errors++; |
4196 | } | 4181 | } |
4197 | if(tx_status & TX_DEFER) | 4182 | if(tx_status & TX_DEFER) |
4198 | { | 4183 | { |
@@ -4216,14 +4201,14 @@ wavelan_interrupt(int irq, | |||
4216 | #endif | 4201 | #endif |
4217 | if(!(tx_status & TX_NCOL_MASK)) | 4202 | if(!(tx_status & TX_NCOL_MASK)) |
4218 | { | 4203 | { |
4219 | lp->stats.collisions += 0x10; | 4204 | dev->stats.collisions += 0x10; |
4220 | } | 4205 | } |
4221 | } | 4206 | } |
4222 | } | 4207 | } |
4223 | } /* if(!(tx_status & TX_OK)) */ | 4208 | } /* if(!(tx_status & TX_OK)) */ |
4224 | 4209 | ||
4225 | lp->stats.collisions += (tx_status & TX_NCOL_MASK); | 4210 | dev->stats.collisions += (tx_status & TX_NCOL_MASK); |
4226 | lp->stats.tx_packets++; | 4211 | dev->stats.tx_packets++; |
4227 | 4212 | ||
4228 | netif_wake_queue(dev); | 4213 | netif_wake_queue(dev); |
4229 | outb(CR0_INT_ACK | OP0_NOP, LCCR(base)); /* Acknowledge the interrupt */ | 4214 | outb(CR0_INT_ACK | OP0_NOP, LCCR(base)); /* Acknowledge the interrupt */ |
@@ -4514,7 +4499,6 @@ wavelan_probe(struct pcmcia_device *p_dev) | |||
4514 | dev->open = &wavelan_open; | 4499 | dev->open = &wavelan_open; |
4515 | dev->stop = &wavelan_close; | 4500 | dev->stop = &wavelan_close; |
4516 | dev->hard_start_xmit = &wavelan_packet_xmit; | 4501 | dev->hard_start_xmit = &wavelan_packet_xmit; |
4517 | dev->get_stats = &wavelan_get_stats; | ||
4518 | dev->set_multicast_list = &wavelan_set_multicast_list; | 4502 | dev->set_multicast_list = &wavelan_set_multicast_list; |
4519 | #ifdef SET_MAC_ADDRESS | 4503 | #ifdef SET_MAC_ADDRESS |
4520 | dev->set_mac_address = &wavelan_set_mac_address; | 4504 | dev->set_mac_address = &wavelan_set_mac_address; |
diff --git a/drivers/net/wireless/wavelan_cs.p.h b/drivers/net/wireless/wavelan_cs.p.h index 628192d7248f..706fd3007d21 100644 --- a/drivers/net/wireless/wavelan_cs.p.h +++ b/drivers/net/wireless/wavelan_cs.p.h | |||
@@ -576,7 +576,6 @@ struct wavepoint_table | |||
576 | /****************************** TYPES ******************************/ | 576 | /****************************** TYPES ******************************/ |
577 | 577 | ||
578 | /* Shortcuts */ | 578 | /* Shortcuts */ |
579 | typedef struct net_device_stats en_stats; | ||
580 | typedef struct iw_statistics iw_stats; | 579 | typedef struct iw_statistics iw_stats; |
581 | typedef struct iw_quality iw_qual; | 580 | typedef struct iw_quality iw_qual; |
582 | typedef struct iw_freq iw_freq; | 581 | typedef struct iw_freq iw_freq; |
@@ -592,8 +591,6 @@ typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address */ | |||
592 | * For each network interface, Linux keep data in two structure. "device" | 591 | * For each network interface, Linux keep data in two structure. "device" |
593 | * keep the generic data (same format for everybody) and "net_local" keep | 592 | * keep the generic data (same format for everybody) and "net_local" keep |
594 | * the additional specific data. | 593 | * the additional specific data. |
595 | * Note that some of this specific data is in fact generic (en_stats, for | ||
596 | * example). | ||
597 | */ | 594 | */ |
598 | struct net_local | 595 | struct net_local |
599 | { | 596 | { |
@@ -601,7 +598,6 @@ struct net_local | |||
601 | struct net_device * dev; /* Reverse link... */ | 598 | struct net_device * dev; /* Reverse link... */ |
602 | spinlock_t spinlock; /* Serialize access to the hardware (SMP) */ | 599 | spinlock_t spinlock; /* Serialize access to the hardware (SMP) */ |
603 | struct pcmcia_device * link; /* pcmcia structure */ | 600 | struct pcmcia_device * link; /* pcmcia structure */ |
604 | en_stats stats; /* Ethernet interface statistics */ | ||
605 | int nresets; /* Number of hw resets */ | 601 | int nresets; /* Number of hw resets */ |
606 | u_char configured; /* If it is configured */ | 602 | u_char configured; /* If it is configured */ |
607 | u_char reconfig_82593; /* Need to reconfigure the controller */ | 603 | u_char reconfig_82593; /* Need to reconfigure the controller */ |
@@ -694,8 +690,6 @@ static void | |||
694 | static void | 690 | static void |
695 | wv_init_info(struct net_device *); /* display startup info */ | 691 | wv_init_info(struct net_device *); /* display startup info */ |
696 | /* ------------------- IOCTL, STATS & RECONFIG ------------------- */ | 692 | /* ------------------- IOCTL, STATS & RECONFIG ------------------- */ |
697 | static en_stats * | ||
698 | wavelan_get_stats(struct net_device *); /* Give stats /proc/net/dev */ | ||
699 | static iw_stats * | 693 | static iw_stats * |
700 | wavelan_get_wireless_stats(struct net_device *); | 694 | wavelan_get_wireless_stats(struct net_device *); |
701 | /* ----------------------- PACKET RECEPTION ----------------------- */ | 695 | /* ----------------------- PACKET RECEPTION ----------------------- */ |