Commit 385e63fb authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

wavelan: convert to internal net_device_stats

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1cc5920f
...@@ -1352,21 +1352,6 @@ wv_init_info(struct net_device * dev) ...@@ -1352,21 +1352,6 @@ wv_init_info(struct net_device * dev)
* or wireless extensions * or wireless extensions
*/ */
/*------------------------------------------------------------------*/
/*
* Get the current ethernet statistics. This may be called with the
* card open or closed.
* Used when the user read /proc/net/dev
*/
static en_stats *
wavelan_get_stats(struct net_device * dev)
{
#ifdef DEBUG_IOCTL_TRACE
printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name);
#endif
return(&((net_local *)netdev_priv(dev))->stats);
}
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* /*
...@@ -2817,7 +2802,7 @@ wv_packet_read(struct net_device * dev, ...@@ -2817,7 +2802,7 @@ wv_packet_read(struct net_device * dev,
printk(KERN_INFO "%s: wv_packet_read(): could not alloc_skb(%d, GFP_ATOMIC)\n", printk(KERN_INFO "%s: wv_packet_read(): could not alloc_skb(%d, GFP_ATOMIC)\n",
dev->name, sksize); dev->name, sksize);
#endif #endif
lp->stats.rx_dropped++; dev->stats.rx_dropped++;
/* /*
* Not only do we want to return here, but we also need to drop the * Not only do we want to return here, but we also need to drop the
* packet on the floor to clear the interrupt. * packet on the floor to clear the interrupt.
...@@ -2877,8 +2862,8 @@ wv_packet_read(struct net_device * dev, ...@@ -2877,8 +2862,8 @@ wv_packet_read(struct net_device * dev,
netif_rx(skb); netif_rx(skb);
/* Keep stats up to date */ /* Keep stats up to date */
lp->stats.rx_packets++; dev->stats.rx_packets++;
lp->stats.rx_bytes += sksize; dev->stats.rx_bytes += sksize;
#ifdef DEBUG_RX_TRACE #ifdef DEBUG_RX_TRACE
printk(KERN_DEBUG "%s: <-wv_packet_read()\n", dev->name); printk(KERN_DEBUG "%s: <-wv_packet_read()\n", dev->name);
...@@ -2980,13 +2965,13 @@ wv_packet_rcv(struct net_device * dev) ...@@ -2980,13 +2965,13 @@ wv_packet_rcv(struct net_device * dev)
/* Check status */ /* Check status */
if((status & RX_RCV_OK) != RX_RCV_OK) if((status & RX_RCV_OK) != RX_RCV_OK)
{ {
lp->stats.rx_errors++; dev->stats.rx_errors++;
if(status & RX_NO_SFD) if(status & RX_NO_SFD)
lp->stats.rx_frame_errors++; dev->stats.rx_frame_errors++;
if(status & RX_CRC_ERR) if(status & RX_CRC_ERR)
lp->stats.rx_crc_errors++; dev->stats.rx_crc_errors++;
if(status & RX_OVRRUN) if(status & RX_OVRRUN)
lp->stats.rx_over_errors++; dev->stats.rx_over_errors++;
#ifdef DEBUG_RX_FAIL #ifdef DEBUG_RX_FAIL
printk(KERN_DEBUG "%s: wv_packet_rcv(): packet not received ok, status = 0x%x\n", 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,7 +3058,7 @@ wv_packet_write(struct net_device * dev,
dev->trans_start = jiffies; dev->trans_start = jiffies;
/* Keep stats up to date */ /* Keep stats up to date */
lp->stats.tx_bytes += length; dev->stats.tx_bytes += length;
spin_unlock_irqrestore(&lp->spinlock, flags); spin_unlock_irqrestore(&lp->spinlock, flags);
...@@ -4106,7 +4091,7 @@ wavelan_interrupt(int irq, ...@@ -4106,7 +4091,7 @@ wavelan_interrupt(int irq,
printk(KERN_INFO "%s: wv_interrupt(): receive buffer overflow\n", printk(KERN_INFO "%s: wv_interrupt(): receive buffer overflow\n",
dev->name); dev->name);
#endif #endif
lp->stats.rx_over_errors++; dev->stats.rx_over_errors++;
lp->overrunning = 1; lp->overrunning = 1;
} }
...@@ -4155,7 +4140,7 @@ wavelan_interrupt(int irq, ...@@ -4155,7 +4140,7 @@ wavelan_interrupt(int irq,
/* Check for possible errors */ /* Check for possible errors */
if((tx_status & TX_OK) != TX_OK) if((tx_status & TX_OK) != TX_OK)
{ {
lp->stats.tx_errors++; dev->stats.tx_errors++;
if(tx_status & TX_FRTL) if(tx_status & TX_FRTL)
{ {
...@@ -4170,14 +4155,14 @@ wavelan_interrupt(int irq, ...@@ -4170,14 +4155,14 @@ wavelan_interrupt(int irq,
printk(KERN_DEBUG "%s: wv_interrupt(): DMA underrun\n", printk(KERN_DEBUG "%s: wv_interrupt(): DMA underrun\n",
dev->name); dev->name);
#endif #endif
lp->stats.tx_aborted_errors++; dev->stats.tx_aborted_errors++;
} }
if(tx_status & TX_LOST_CTS) if(tx_status & TX_LOST_CTS)
{ {
#ifdef DEBUG_TX_FAIL #ifdef DEBUG_TX_FAIL
printk(KERN_DEBUG "%s: wv_interrupt(): no CTS\n", dev->name); printk(KERN_DEBUG "%s: wv_interrupt(): no CTS\n", dev->name);
#endif #endif
lp->stats.tx_carrier_errors++; dev->stats.tx_carrier_errors++;
} }
if(tx_status & TX_LOST_CRS) if(tx_status & TX_LOST_CRS)
{ {
...@@ -4185,14 +4170,14 @@ wavelan_interrupt(int irq, ...@@ -4185,14 +4170,14 @@ wavelan_interrupt(int irq,
printk(KERN_DEBUG "%s: wv_interrupt(): no carrier\n", printk(KERN_DEBUG "%s: wv_interrupt(): no carrier\n",
dev->name); dev->name);
#endif #endif
lp->stats.tx_carrier_errors++; dev->stats.tx_carrier_errors++;
} }
if(tx_status & TX_HRT_BEAT) if(tx_status & TX_HRT_BEAT)
{ {
#ifdef DEBUG_TX_FAIL #ifdef DEBUG_TX_FAIL
printk(KERN_DEBUG "%s: wv_interrupt(): heart beat\n", dev->name); printk(KERN_DEBUG "%s: wv_interrupt(): heart beat\n", dev->name);
#endif #endif
lp->stats.tx_heartbeat_errors++; dev->stats.tx_heartbeat_errors++;
} }
if(tx_status & TX_DEFER) if(tx_status & TX_DEFER)
{ {
...@@ -4216,14 +4201,14 @@ wavelan_interrupt(int irq, ...@@ -4216,14 +4201,14 @@ wavelan_interrupt(int irq,
#endif #endif
if(!(tx_status & TX_NCOL_MASK)) if(!(tx_status & TX_NCOL_MASK))
{ {
lp->stats.collisions += 0x10; dev->stats.collisions += 0x10;
} }
} }
} }
} /* if(!(tx_status & TX_OK)) */ } /* if(!(tx_status & TX_OK)) */
lp->stats.collisions += (tx_status & TX_NCOL_MASK); dev->stats.collisions += (tx_status & TX_NCOL_MASK);
lp->stats.tx_packets++; dev->stats.tx_packets++;
netif_wake_queue(dev); netif_wake_queue(dev);
outb(CR0_INT_ACK | OP0_NOP, LCCR(base)); /* Acknowledge the interrupt */ outb(CR0_INT_ACK | OP0_NOP, LCCR(base)); /* Acknowledge the interrupt */
...@@ -4514,7 +4499,6 @@ wavelan_probe(struct pcmcia_device *p_dev) ...@@ -4514,7 +4499,6 @@ wavelan_probe(struct pcmcia_device *p_dev)
dev->open = &wavelan_open; dev->open = &wavelan_open;
dev->stop = &wavelan_close; dev->stop = &wavelan_close;
dev->hard_start_xmit = &wavelan_packet_xmit; dev->hard_start_xmit = &wavelan_packet_xmit;
dev->get_stats = &wavelan_get_stats;
dev->set_multicast_list = &wavelan_set_multicast_list; dev->set_multicast_list = &wavelan_set_multicast_list;
#ifdef SET_MAC_ADDRESS #ifdef SET_MAC_ADDRESS
dev->set_mac_address = &wavelan_set_mac_address; dev->set_mac_address = &wavelan_set_mac_address;
......
...@@ -576,7 +576,6 @@ struct wavepoint_table ...@@ -576,7 +576,6 @@ struct wavepoint_table
/****************************** TYPES ******************************/ /****************************** TYPES ******************************/
/* Shortcuts */ /* Shortcuts */
typedef struct net_device_stats en_stats;
typedef struct iw_statistics iw_stats; typedef struct iw_statistics iw_stats;
typedef struct iw_quality iw_qual; typedef struct iw_quality iw_qual;
typedef struct iw_freq iw_freq; typedef struct iw_freq iw_freq;
...@@ -592,8 +591,6 @@ typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address */ ...@@ -592,8 +591,6 @@ typedef u_char mac_addr[WAVELAN_ADDR_SIZE]; /* Hardware address */
* For each network interface, Linux keep data in two structure. "device" * For each network interface, Linux keep data in two structure. "device"
* keep the generic data (same format for everybody) and "net_local" keep * keep the generic data (same format for everybody) and "net_local" keep
* the additional specific data. * the additional specific data.
* Note that some of this specific data is in fact generic (en_stats, for
* example).
*/ */
struct net_local struct net_local
{ {
...@@ -601,7 +598,6 @@ struct net_local ...@@ -601,7 +598,6 @@ struct net_local
struct net_device * dev; /* Reverse link... */ struct net_device * dev; /* Reverse link... */
spinlock_t spinlock; /* Serialize access to the hardware (SMP) */ spinlock_t spinlock; /* Serialize access to the hardware (SMP) */
struct pcmcia_device * link; /* pcmcia structure */ struct pcmcia_device * link; /* pcmcia structure */
en_stats stats; /* Ethernet interface statistics */
int nresets; /* Number of hw resets */ int nresets; /* Number of hw resets */
u_char configured; /* If it is configured */ u_char configured; /* If it is configured */
u_char reconfig_82593; /* Need to reconfigure the controller */ u_char reconfig_82593; /* Need to reconfigure the controller */
...@@ -694,8 +690,6 @@ static void ...@@ -694,8 +690,6 @@ static void
static void static void
wv_init_info(struct net_device *); /* display startup info */ wv_init_info(struct net_device *); /* display startup info */
/* ------------------- IOCTL, STATS & RECONFIG ------------------- */ /* ------------------- IOCTL, STATS & RECONFIG ------------------- */
static en_stats *
wavelan_get_stats(struct net_device *); /* Give stats /proc/net/dev */
static iw_stats * static iw_stats *
wavelan_get_wireless_stats(struct net_device *); wavelan_get_wireless_stats(struct net_device *);
/* ----------------------- PACKET RECEPTION ----------------------- */ /* ----------------------- PACKET RECEPTION ----------------------- */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment