Massive net driver stats cleanup
Subsystems (5)
PATCH 1/1 Massive net driver stats cleanup
I would appreciate people building this on non-x86 architectures. The compile breakage is always the same: naming of the local variable representing struct net_device.
I pushed into into netdev-2.6.git#ALL so that it will show in -mm too.
commit e64060e11a401aa7c723d00270896d2cb99faac3
Author: Jeff Garzik <[email protected]> Date: Sat Sep 1 12:21:41 2007 -0400
drivers/net: statistics cleanup #1 -- save memory and shrink code
We now have struct net_device_stats embedded in struct net_device, and the default ->get_stats() hook does the obvious thing for us.
Run through drivers/net/* and remove the driver-local storage of statistics, and driver-local ->get_stats() hook where applicable.
This was just the low-hanging fruit in drivers/net; plenty more drivers remain to be updated.
drivers/net/3c501.c | 41 ++++------------- drivers/net/3c501.h | 2 drivers/net/3c507.c | 52 ++++++++-------------- drivers/net/7990.c | 47 ++++++++------------ drivers/net/7990.h | 2 drivers/net/82596.c | 65 +++++++++++----------------- drivers/net/a2065.c | 51 +++++++++------------- drivers/net/at1700.c | 39 +++++----------- drivers/net/atarilance.c | 58 ++++++++----------------- drivers/net/atp.c | 49 +++++++-------------- drivers/net/au1000_eth.c | 23 +-------- drivers/net/au1000_eth.h | 1 drivers/net/bfin_mac.c | 25 ++-------- drivers/net/bfin_mac.h | 2 drivers/net/bmac.c | 48 ++++++++------------ drivers/net/de600.c | 15 +----- drivers/net/de600.h | 1 drivers/net/de620.c | 26 +++-------- drivers/net/declance.c | 52 +++++++++------------- drivers/net/depca.c | 42 ++++++------------ drivers/net/dgrs.c | 24 +--------- drivers/net/dm9000.c | 29 +++--------- drivers/net/e100.c | 23 +++------ drivers/net/eepro.c | 47 +++++++------------- drivers/net/eexpress.c | 56 +++++++++--------------- drivers/net/eql.c | 12 ----- drivers/net/eth16i.c | 49 ++++++++------------- drivers/net/ewrk3.c | 37 +++++----------- drivers/net/fec.c | 50 ++++++++------------- drivers/net/gianfar.c | 40 ++++++----------- drivers/net/hplance.c | 1 drivers/net/ibmlana.c | 37 ++++++---------- drivers/net/ibmlana.h | 1 drivers/net/ibmveth.c | 18 ++----- drivers/net/ifb.c | 20 -------- drivers/net/iseries_veth.c | 22 ++------- drivers/net/lib82596.c | 64 +++++++++++---------------- drivers/net/lp486e.c | 56 +++++++++--------------- drivers/net/mace.c | 51 ++++++++-------------- drivers/net/macmace.c | 49 ++++++++------------- drivers/net/meth.c | 28 ++++-------- drivers/net/mipsnet.c | 26 ++--------- drivers/net/mv643xx_eth.c | 25 +--------- drivers/net/myri_sbus.c | 20 +++----- drivers/net/myri_sbus.h | 1 drivers/net/netx-eth.c | 18 ++----- drivers/net/ni5010.c | 47 +++++--------------- drivers/net/pasemi_mac.c | 17 +------ drivers/net/pasemi_mac.h | 1 drivers/net/pci-skeleton.c | 74 +++++++++----------------------- drivers/net/plip.c | 32 ++++--------- drivers/net/qla3xxx.c | 23 +++------ drivers/net/qla3xxx.h | 1 drivers/net/rionet.c | 20 ++------ drivers/net/rrunner.c | 31 ++++--------- drivers/net/rrunner.h | 2 drivers/net/saa9730.c | 93 ++++++++++++++++++---------------------- drivers/net/saa9730.h | 1 drivers/net/sb1000.c | 19 ++------ drivers/net/sb1250-mac.c | 37 +++------------- drivers/net/seeq8005.c | 33 ++++---------- drivers/net/sgiseeq.c | 34 +++++--------- drivers/net/shaper.c | 15 +----- drivers/net/sis190.c | 19 ++------ drivers/net/sis900.c | 56 ++++++++---------------- drivers/net/smc911x.c | 77 ++++++++++++--------------------- drivers/net/smc9194.c | 59 +++++++------------------ drivers/net/smc91x.c | 69 ++++++++++------------------- drivers/net/spider_net.c | 31 +++---------- drivers/net/spider_net.h | 1 drivers/net/sun3lance.c | 53 ++++++++-------------- drivers/net/sunlance.c | 87 ++++++++++++++++--------------------- drivers/net/sunqe.c | 104 ++++++++++++++++++++------------------------- drivers/net/sunqe.h | 1 drivers/net/tun.c | 23 +++------ drivers/net/ucc_geth.c | 27 +++-------- drivers/net/ucc_geth.h | 1 drivers/net/xen-netfront.c | 26 +++-------- drivers/net/yellowfin.c | 63 +++++++++++---------------- drivers/net/znet.c | 50 ++++++++------------- include/linux/if_eql.h | 1 include/linux/if_shaper.h | 1 include/linux/if_tun.h | 1 83 files changed, 930 insertions(+), 1745 deletions(-)
e64060e11a401aa7c723d00270896d2cb99faac3
drivers/net/3c501.c +11 -30
@@ -317,7 +317,6 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr) dev->tx_timeout = &el_timeout; dev->watchdog_timeo =HZ ; dev->stop = &el1_close; - dev->get_stats = &el1_get_stats; dev->set_multicast_list = &set_multicast_list; dev->ethtool_ops = &netdev_ethtool_ops;return 0 ;
@@ -376,7 +375,7 @@ static void el_timeout(struct net_device *dev)if (el_debug)printk (KERN_DEBUG "%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n" , dev->name,inb (TX_STATUS ),inb (AX_STATUS ),inb (RX_STATUS )); - lp->stats.tx_errors++; + dev->stats.tx_errors++;outb (TX_NORM ,TX_CMD );outb (RX_NORM ,RX_CMD );outb (AX_OFF ,AX_CMD );/* Just trigger a false interrupt. */
@@ -443,7 +442,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev) lp->tx_pkt_start = gp_start; lp->collisions =0 ; - lp->stats.tx_bytes += skb->len; + dev->stats.tx_bytes += skb->len;/* * Command mode with status cleared should [in theory]
@@ -590,7 +589,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)printk (KERN_DEBUG "%s: Transmit failed 16 times, Ethernet jammed?\n" ,dev->name);outb (AX_SYS ,AX_CMD ); lp->txing =0 ; - lp->stats.tx_aborted_errors++; + dev->stats.tx_aborted_errors++;netif_wake_queue (dev); }else if (txsr &TX_COLLISION )
@@ -608,7 +607,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)outb (AX_SYS ,AX_CMD );outw (lp->tx_pkt_start,GP_LOW );outb (AX_XMIT ,AX_CMD ); - lp->stats.collisions++; + dev->stats.collisions++;spin_unlock (&lp->lock); goto out; }
@@ -617,7 +616,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)/* * It worked.. we will now fall through and receive */ - lp->stats.tx_packets++; + dev->stats.tx_packets++;if (el_debug >6 )printk (KERN_DEBUG " Tx succeeded %s\n" , (txsr &TX_RDY ) ?"." :"but tx is busy!" );
@@ -642,10 +641,10 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)* Just reading rx_status fixes most errors. */ if (rxsr &RX_MISSED ) - lp->stats.rx_missed_errors++; + dev->stats.rx_missed_errors++;else if (rxsr &RX_RUNT ) {/* Handled to avoid board lock-up. */ - lp->stats.rx_length_errors++; + dev->stats.rx_length_errors++;if (el_debug >5 )printk (KERN_DEBUG " runt.\n" ); }
@@ -696,7 +695,6 @@ out:static void el_receive (struct net_device *dev) { -struct net_local *lp =netdev_priv (dev);int ioaddr = dev->base_addr;int pkt_len;struct sk_buff *skb;
@@ -710,7 +708,7 @@ static void el_receive(struct net_device *dev) {if (el_debug)printk (KERN_DEBUG "%s: bogus packet, length=%d\n" , dev->name, pkt_len); - lp->stats.rx_over_errors++; + dev->stats.rx_over_errors++;return ; }
@@ -729,7 +727,7 @@ static void el_receive(struct net_device *dev)if (skb ==NULL ) {printk (KERN_INFO "%s: Memory squeeze, dropping packet.\n" , dev->name); - lp->stats.rx_dropped++; + dev->stats.rx_dropped++;return ; }else
@@ -744,8 +742,8 @@ static void el_receive(struct net_device *dev) skb->protocol=eth_type_trans (skb,dev);netif_rx (skb); dev->last_rx = jiffies; - lp->stats.rx_packets++; - lp->stats.rx_bytes+=pkt_len; + dev->stats.rx_packets++; + dev->stats.rx_bytes+=pkt_len; }return ; }
@@ -813,23 +811,6 @@ static int el1_close(struct net_device *dev) }/** -* el1_get_stats: -* @dev: The card to get the statistics for -* -* In smarter devices this function is needed to pull statistics off the -* board itself. The 3c501 has no hardware statistics. We maintain them all -* so they are by definition always up to date. -* -* Returns the statistics for the card from the card private data -*/ - -static struct net_device_stats *el1_get_stats (struct net_device *dev) -{ -struct net_local *lp =netdev_priv (dev); -return &lp->stats; -} - -/** * set_multicast_list: * @dev: The device to adjust *
drivers/net/3c501.h +0 -2
@@ -11,7 +11,6 @@ static irqreturn_t el_interrupt(int irq, void *dev_id);static void el_receive (struct net_device *dev);static void el_reset (struct net_device *dev);static int el1_close (struct net_device *dev); -static struct net_device_stats *el1_get_stats (struct net_device *dev);static void set_multicast_list (struct net_device *dev);static const struct ethtool_ops netdev_ethtool_ops;
@@ -29,7 +28,6 @@ static int el_debug = EL_DEBUG;struct net_local { -struct net_device_stats stats;int tx_pkt_start;/* The length of the current Tx packet. */ int collisions;/* Tx collisions this packet */ int loading;/* Spot buffer load collisions */
drivers/net/3c507.c +19 -33
119 lines not on this page · raw message
drivers/net/7990.c +20 -27
107 lines not on this page · raw message
drivers/net/7990.h +0 -2
@@ -111,7 +111,6 @@ struct lance_privateint lance_log_rx_bufs, lance_log_tx_bufs;int rx_ring_mod_mask, tx_ring_mod_mask; -struct net_device_stats stats;int tpe;/* TPE is selected */ int auto_select;/* cable-selection is by carrier */ unsigned short busmaster_regval;
@@ -246,7 +245,6 @@ struct lance_privateextern int lance_open (struct net_device *dev);extern int lance_close (struct net_device *dev);extern int lance_start_xmit (struct sk_buff *skb,struct net_device *dev); -extern struct net_device_stats *lance_get_stats (struct net_device *dev);extern void lance_set_multicast (struct net_device *dev);extern void lance_tx_timeout (struct net_device *dev);#ifdef CONFIG_NET_POLL_CONTROLLER
drivers/net/82596.c +27 -38
162 lines not on this page · raw message
drivers/net/a2065.c +21 -30
129 lines not on this page · raw message
drivers/net/at1700.c +12 -27
@@ -109,7 +109,6 @@ typedef unsigned char uchar;/* Information that need to be kept for each board. */ struct net_local { -struct net_device_stats stats;spinlock_t lock;unsigned char mc_filter[8 ];uint jumpered:1 ;/* Set iff the board has jumper config. */
@@ -164,7 +163,6 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev);static irqreturn_t net_interrupt (int irq,void *dev_id);static void net_rx (struct net_device *dev);static int net_close (struct net_device *dev); -static struct net_device_stats *net_get_stats (struct net_device *dev);static void set_rx_mode (struct net_device *dev);static void net_tx_timeout (struct net_device *dev);
@@ -458,7 +456,6 @@ found: dev->open = net_open; dev->stop = net_close; dev->hard_start_xmit = net_send_packet; - dev->get_stats = net_get_stats; dev->set_multicast_list = &set_rx_mode; dev->tx_timeout = net_tx_timeout; dev->watchdog_timeo =TX_TIMEOUT ;
@@ -573,7 +570,7 @@ static void net_tx_timeout (struct net_device *dev) dev->name,inw (ioaddr +TX_STATUS ),inw (ioaddr +TX_INTR ),inw (ioaddr +TX_MODE ),inw (ioaddr +CONFIG_0 ),inw (ioaddr +DATAPORT ),inw (ioaddr +TX_START ), inw(ioaddr + MODE13 - 1), inw(ioaddr + RX_CTRL)); - lp->stats.tx_errors++; + dev->stats.tx_errors++;/* ToDo: We should try to restart the adaptor... */ outw (0xffff , ioaddr +MODE24 );outw (0xffff , ioaddr +TX_STATUS );
@@ -693,10 +690,10 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)printk ("%s: 16 Collision occur during Txing.\n" , dev->name);/* Cancel sending a packet. */ outb (0x03 , ioaddr +COL16CNTL ); - lp->stats.collisions++; + dev->stats.collisions++; }if (status &0x82 ) { - lp->stats.tx_packets++; + dev->stats.tx_packets++;/* The Tx queue has any packets and is not being transferred a packet from the host, start transmitting. */
@@ -721,7 +718,6 @@ static irqreturn_t net_interrupt(int irq, void *dev_id)static void net_rx (struct net_device *dev) { -struct net_local *lp =netdev_priv (dev);int ioaddr = dev->base_addr;int boguscount =5 ;
@@ -740,11 +736,11 @@ net_rx(struct net_device *dev)#endif if ((status &0xF0 ) !=0x20 ) {/* There was an error. */ - lp->stats.rx_errors++; -if (status &0x08 ) lp->stats.rx_length_errors++; -if (status &0x04 ) lp->stats.rx_frame_errors++; -if (status &0x02 ) lp->stats.rx_crc_errors++; -if (status &0x01 ) lp->stats.rx_over_errors++; + dev->stats.rx_errors++; +if (status &0x08 ) dev->stats.rx_length_errors++; +if (status &0x04 ) dev->stats.rx_frame_errors++; +if (status &0x02 ) dev->stats.rx_crc_errors++; +if (status &0x01 ) dev->stats.rx_over_errors++; }else {/* Malloc up new buffer. */ struct sk_buff *skb;
@@ -755,7 +751,7 @@ net_rx(struct net_device *dev)/* Prime the FIFO and then flush the packet. */ inw (ioaddr +DATAPORT );inw (ioaddr +DATAPORT );outb (0x05 , ioaddr +RX_CTRL ); - lp->stats.rx_errors++; + dev->stats.rx_errors++;break ; } skb =dev_alloc_skb (pkt_len+3 );
@@ -765,7 +761,7 @@ net_rx(struct net_device *dev)/* Prime the FIFO and then flush the packet. */ inw (ioaddr +DATAPORT );inw (ioaddr +DATAPORT );outb (0x05 , ioaddr +RX_CTRL ); - lp->stats.rx_dropped++; + dev->stats.rx_dropped++;break ; }skb_reserve (skb,2 );
@@ -774,8 +770,8 @@ net_rx(struct net_device *dev) skb->protocol=eth_type_trans (skb, dev);netif_rx (skb); dev->last_rx = jiffies; - lp->stats.rx_packets++; - lp->stats.rx_bytes += pkt_len; + dev->stats.rx_packets++; + dev->stats.rx_bytes += pkt_len; }if (--boguscount <=0 )break ;
@@ -824,17 +820,6 @@ static int net_close(struct net_device *dev)return 0 ; } -/* Get the current statistics. -This may be called with the card open or closed. -There are no on-chip counters, so this function is trivial. -*/ -static struct net_device_stats * -net_get_stats (struct net_device *dev) -{ -struct net_local *lp =netdev_priv (dev); -return &lp->stats; -} -/* Set the multicast/promiscuous mode for this adaptor. */
drivers/net/atarilance.c +20 -38
144 lines not on this page · raw message
drivers/net/atp.c +18 -31
144 lines not on this page · raw message
drivers/net/au1000_eth.c +4 -19
@@ -90,7 +90,6 @@ static int au1000_rx(struct net_device *);static irqreturn_t au1000_interrupt (int ,void *);static void au1000_tx_timeout (struct net_device *);static void set_rx_mode (struct net_device *); -static struct net_device_stats *au1000_get_stats (struct net_device *);static int au1000_ioctl (struct net_device *,struct ifreq *,int );static int mdio_read (struct net_device *,int ,int );static void mdio_write (struct net_device *,int ,int ,u16 );
@@ -772,7 +771,6 @@ static struct net_device * au1000_probe(int port_num) dev->open = au1000_open; dev->hard_start_xmit = au1000_tx; dev->stop = au1000_close; - dev->get_stats = au1000_get_stats; dev->set_multicast_list = &set_rx_mode; dev->do_ioctl = &au1000_ioctl;SET_ETHTOOL_OPS (dev, &au1000_ethtool_ops);
@@ -1038,7 +1036,7 @@ static void __exit au1000_cleanup_module(void)static void update_tx_stats (struct net_device *dev,u32 status) {struct au1000_private *aup = (struct au1000_private *) dev->priv; -struct net_device_stats *ps = &aup->stats; +struct net_device_stats *ps = &dev->stats;if (status &TX_FRAME_ABORTED ) {if (!aup->phy_dev || (DUPLEX_FULL == aup->phy_dev->duplex)) {
@@ -1094,7 +1092,7 @@ static void au1000_tx_ack(struct net_device *dev)static int au1000_tx (struct sk_buff *skb,struct net_device *dev) {struct au1000_private *aup = (struct au1000_private *) dev->priv; -struct net_device_stats *ps = &aup->stats; +struct net_device_stats *ps = &dev->stats;volatile tx_dma_t *ptxd;u32 buff_stat;db_dest_t *pDB;
@@ -1148,7 +1146,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)static inline void update_rx_stats (struct net_device *dev,u32 status) {struct au1000_private *aup = (struct au1000_private *) dev->priv; -struct net_device_stats *ps = &aup->stats; +struct net_device_stats *ps = &dev->stats; ps->rx_packets++;if (status &RX_MCAST_FRAME )
@@ -1201,7 +1199,7 @@ static int au1000_rx(struct net_device *dev)printk (KERN_ERR "%s: Memory squeeze, dropping packet.\n" , dev->name); - aup->stats.rx_dropped++; + dev->stats.rx_dropped++;continue ; }skb_reserve (skb,2 );/* 16 byte IP header align */
@@ -1324,18 +1322,5 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)return phy_mii_ioctl (aup->phy_dev,if_mii (rq), cmd); } -static struct net_device_stats *au1000_get_stats (struct net_device *dev) -{ -struct au1000_private *aup = (struct au1000_private *) dev->priv; - -if (au1000_debug >4 ) -printk ("%s: au1000_get_stats: dev=%p\n" , dev->name, dev); - -if (netif_device_present (dev)) { -return &aup->stats; - } -return 0 ; -} -module_init (au1000_init_module);module_exit (au1000_cleanup_module);
drivers/net/au1000_eth.h +0 -1
@@ -115,6 +115,5 @@ struct au1000_private {u32 vaddr;/* virtual address of rx/tx buffers */ dma_addr_t dma_addr;/* dma address of rx/tx buffers */ -struct net_device_stats stats;spinlock_t lock;/* Serialise access to device */ };
drivers/net/bfin_mac.c +5 -20
@@ -579,8 +579,8 @@ out:adjust_tx_list (); current_tx_ptr = current_tx_ptr->next; dev->trans_start = jiffies; - lp->stats.tx_packets++; - lp->stats.tx_bytes += (skb->len); + dev->stats.tx_packets++; + dev->stats.tx_bytes += (skb->len);return 0 ; }
@@ -596,7 +596,7 @@ static void bf537mac_rx(struct net_device *dev)if (!new_skb) { printk(KERN_NOTICE DRV_NAME ": rx: low on mem - packet dropped\n"); - lp->stats.rx_dropped++; + dev->stats.rx_dropped++; goto out; }/* reserve 2 bytes for RXDWA padding */
@@ -618,8 +618,8 @@ static void bf537mac_rx(struct net_device *dev)#endif netif_rx (skb); - lp->stats.rx_packets++; - lp->stats.rx_bytes += len; + dev->stats.rx_packets++; + dev->stats.rx_bytes += len; current_rx_ptr->status.status_word =0x00000000 ; current_rx_ptr = current_rx_ptr->next;
@@ -733,20 +733,6 @@ static void bf537mac_timeout(struct net_device *dev) }/* -* Get the current statistics. -* This may be called with the card open or closed. -*/ -static struct net_device_stats *bf537mac_query_statistics (struct net_device - *dev) -{ -struct bf537mac_local *lp =netdev_priv (dev); - -pr_debug ("%s: %s\n" , dev->name, __FUNCTION__); - -return &lp->stats; -} - -/* * This routine will, depending on the values passed to it, * either make it accept multicast packets, go into * promiscuous mode (for TCPDUMP and cousins) or accept
@@ -891,7 +877,6 @@ static int __init bf537mac_probe(struct net_device *dev) dev->stop = bf537mac_close; dev->hard_start_xmit = bf537mac_hard_start_xmit; dev->tx_timeout = bf537mac_timeout; - dev->get_stats = bf537mac_query_statistics; dev->set_multicast_list = bf537mac_set_multicast_list;#ifdef CONFIG_NET_POLL_CONTROLLER dev->poll_controller = bf537mac_poll;
drivers/net/bfin_mac.h +0 -2
@@ -104,8 +104,6 @@ struct bf537mac_local {* can find out semi-useless statistics of how well the card is * performing */ -struct net_device_stats stats; -int version;int FlowEnabled;/* record if data flow is active */
drivers/net/bmac.c +19 -29
109 lines not on this page · raw message
drivers/net/de600.c +4 -11
@@ -154,11 +154,6 @@ static int de600_close(struct net_device *dev)return 0 ; } -static struct net_device_stats *get_stats (struct net_device *dev) -{ -return (struct net_device_stats *)(dev->priv); -} -static inline void trigger_interrupt (struct net_device *dev) {de600_put_command (FLIP_IRQ );
@@ -308,7 +303,7 @@ static int de600_tx_intr(struct net_device *dev, int irq_status)if (!(irq_status &TX_FAILED16 )) { tx_fifo_out = (tx_fifo_out +1 ) %TX_PAGES ; ++free_tx_pages; - ((struct net_device_stats *)(dev->priv))->tx_packets++; + dev->stats.tx_packets++;netif_wake_queue (dev); }
@@ -375,8 +370,8 @@ static void de600_rx_intr(struct net_device *dev)/* update stats */ dev->last_rx = jiffies; - ((struct net_device_stats *)(dev->priv))->rx_packets++;/* count all receives */ - ((struct net_device_stats *)(dev->priv))->rx_bytes += size;/* count all received bytes */ + dev->stats.rx_packets++;/* count all receives */ + dev->stats.rx_bytes += size;/* count all received bytes */ /* * If any worth-while packets have been received, netif_rx()
@@ -390,7 +385,7 @@ static struct net_device * __init de600_probe(void)struct net_device *dev;int err; - dev =alloc_etherdev (sizeof (struct net_device_stats )); + dev =alloc_etherdev (0 );if (!dev)return ERR_PTR (-ENOMEM );
@@ -449,8 +444,6 @@ static struct net_device * __init de600_probe(void)printk (":%02X" ,dev->dev_addr[i]);printk ("\n" ); - dev->get_stats = get_stats; - dev->open = de600_open; dev->stop = de600_close; dev->hard_start_xmit = &de600_start_xmit;
drivers/net/de600.h +0 -1
@@ -121,7 +121,6 @@ static u8 de600_read_byte(unsigned char type, struct net_device *dev);/* Put in the device structure. */ static int de600_open (struct net_device *dev);static int de600_close (struct net_device *dev); -static struct net_device_stats *get_stats (struct net_device *dev);static int de600_start_xmit (struct sk_buff *skb,struct net_device *dev);/* Dispatch from interrupts. */
drivers/net/de620.c +7 -19
@@ -216,7 +216,6 @@ MODULE_PARM_DESC(de620_debug, "DE-620 debug level (0-2)");/* Put in the device structure. */ static int de620_open (struct net_device *);static int de620_close (struct net_device *); -static struct net_device_stats *get_stats (struct net_device *);static void de620_set_multicast_list (struct net_device *);static int de620_start_xmit (struct sk_buff *,struct net_device *);
@@ -480,16 +479,6 @@ static int de620_close(struct net_device *dev)/********************************************* * -* Return current statistics -* -*/ -static struct net_device_stats *get_stats (struct net_device *dev) -{ -return (struct net_device_stats *)(dev->priv); -} - -/********************************************* -* * Set or clear the multicast filter for this adaptor. * (no real multicast implemented for the DE-620, but she can be promiscuous...) *
@@ -579,7 +568,7 @@ static int de620_start_xmit(struct sk_buff *skb, struct net_device *dev)if (!(using_txbuf == (TXBF0 |TXBF1 )))netif_wake_queue (dev); - ((struct net_device_stats *)(dev->priv))->tx_packets++; + dev->stats.tx_packets++;spin_unlock_irqrestore (&de620_lock, flags);dev_kfree_skb (skb);return 0 ;
@@ -660,7 +649,7 @@ static int de620_rx_intr(struct net_device *dev)/* You win some, you lose some. And sometimes plenty... */ adapter_init (dev);netif_wake_queue (dev); - ((struct net_device_stats *)(dev->priv))->rx_over_errors++; + dev->stats.rx_over_errors++;return 0 ; }
@@ -680,7 +669,7 @@ static int de620_rx_intr(struct net_device *dev) next_rx_page = header_buf.Rx_NextPage;/* at least a try... */ de620_send_command (dev,W_DUMMY );de620_set_register (dev,W_NPRF , next_rx_page); - ((struct net_device_stats *)(dev->priv))->rx_over_errors++; + dev->stats.rx_over_errors++;return 0 ; } next_rx_page = pagelink;
@@ -693,7 +682,7 @@ static int de620_rx_intr(struct net_device *dev) skb =dev_alloc_skb (size+2 );if (skb ==NULL ) {/* Yeah, but no place to put it... */ printk (KERN_WARNING "%s: Couldn't allocate a sk_buff of size %d.\n" , dev->name, size); - ((struct net_device_stats *)(dev->priv))->rx_dropped++; + dev->stats.rx_dropped++; }else {/* Yep! Go get it! */ skb_reserve (skb,2 );/* Align */
@@ -706,8 +695,8 @@ static int de620_rx_intr(struct net_device *dev)netif_rx (skb);/* deliver it "upstairs" */ dev->last_rx = jiffies;/* count all receives */ - ((struct net_device_stats *)(dev->priv))->rx_packets++; - ((struct net_device_stats *)(dev->priv))->rx_bytes += size; + dev->stats.rx_packets++; + dev->stats.rx_bytes += size; } }
@@ -819,7 +808,7 @@ struct net_device * __init de620_probe(int unit)int err = -ENOMEM ;int i; - dev =alloc_etherdev (sizeof (struct net_device_stats )); + dev =alloc_etherdev (0 );if (!dev) goto out;
@@ -881,7 +870,6 @@ struct net_device * __init de620_probe(int unit)else printk (" UTP)\n" ); - dev->get_stats = get_stats; dev->open = de620_open; dev->stop = de620_close; dev->hard_start_xmit = de620_start_xmit;
drivers/net/declance.c +21 -31
143 lines not on this page · raw message
drivers/net/depca.c +15 -27
105 lines not on this page · raw message
drivers/net/dgrs.c +4 -20
@@ -194,11 +194,6 @@ static int dgrs_nicmode; typedef struct { /* - * Stuff for generic ethercard I/F - */ - struct net_device_stats stats; - - /* * DGRS specific data */ char *vmem;
@@ -499,7 +494,7 @@ dgrs_rcv_frame(if ((skb =dev_alloc_skb (len+5 )) ==NULL ) {printk ("%s: dev_alloc_skb failed for rcv buffer\n" , devN->name); - ++privN->stats.rx_dropped; + ++dev0->stats.rx_dropped;/* discarding the frame */ goto out; }
@@ -667,8 +662,8 @@ again: skb->protocol =eth_type_trans (skb, devN);netif_rx (skb); devN->last_rx = jiffies; - ++privN->stats.rx_packets; - privN->stats.rx_bytes += len; + ++devN->stats.rx_packets; + devN->stats.rx_bytes += len; out: cbp->xmit.status =I596_CB_STATUS_C |I596_CB_STATUS_OK ;
@@ -776,7 +771,7 @@ frame_done: priv0->rfdp->status =I596_RFD_C |I596_RFD_OK ; priv0->rfdp = (I596_RFD *)S2H (priv0->rfdp->next); - ++privN->stats.tx_packets; + ++devN->stats.tx_packets;dev_kfree_skb (skb);return (0 );
@@ -806,16 +801,6 @@ static int dgrs_close( struct net_device *dev ) }/* -* Get statistics -*/ -static struct net_device_stats *dgrs_get_stats (struct net_device *dev ) -{ -DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv; - -return (&priv->stats); -} - -/* * Set multicast list and/or promiscuous mode */
@@ -1213,7 +1198,6 @@ dgrs_probe1(struct net_device *dev)*/ dev->open = &dgrs_open; dev->stop = &dgrs_close; - dev->get_stats = &dgrs_get_stats; dev->hard_start_xmit = &dgrs_start_xmit; dev->set_multicast_list = &dgrs_set_multicast_list; dev->do_ioctl = &dgrs_ioctl;
drivers/net/dm9000.c +7 -22
@@ -148,7 +148,6 @@ typedef struct board_info {struct resource *irq_res;struct timer_list timer; -struct net_device_stats stats;unsigned char srom[128 ];spinlock_t lock;
@@ -166,8 +165,6 @@ static int dm9000_stop(struct net_device *);static void dm9000_timer (unsigned long );static void dm9000_init_dm9000 (struct net_device *); -static struct net_device_stats *dm9000_get_stats (struct net_device *); -static irqreturn_t dm9000_interrupt (int ,void *);static int dm9000_phy_read (struct net_device *dev,int phyaddr_unsused,int reg);
@@ -559,7 +556,6 @@ dm9000_probe(struct platform_device *pdev) ndev->tx_timeout = &dm9000_timeout; ndev->watchdog_timeo =msecs_to_jiffies (watchdog); ndev->stop = &dm9000_stop; - ndev->get_stats = &dm9000_get_stats; ndev->set_multicast_list = &dm9000_hash_table;#ifdef CONFIG_NET_POLL_CONTROLLER ndev->poll_controller = &dm9000_poll_controller;
@@ -714,7 +710,7 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)writeb (DM9000_MWCMD , db->io_addr); (db->outblk)(db->io_data, skb->data, skb->len); - db->stats.tx_bytes += skb->len; + dev->stats.tx_bytes += skb->len; db->tx_pkt_cnt++;/* TX control: First packet immediately send, second packet queue */
@@ -791,7 +787,7 @@ dm9000_tx_done(struct net_device *dev, board_info_t * db)if (tx_status & (NSR_TX2END |NSR_TX1END )) {/* One packet sent complete */ db->tx_pkt_cnt--; - db->stats.tx_packets++; + dev->stats.tx_packets++;/* Queue packet check & send */ if (db->tx_pkt_cnt >0 ) {
@@ -853,17 +849,6 @@ dm9000_interrupt(int irq, void *dev_id) }/* -* Get statistics from driver. -*/ -static struct net_device_stats * -dm9000_get_stats (struct net_device *dev) -{ -board_info_t *db = (board_info_t *) dev->priv; -return &db->stats; -} - - -/* * A periodic timer routine * Dynamic media sense, allocated Rx buffer... */
@@ -940,15 +925,15 @@ dm9000_rx(struct net_device *dev) GoodPacket = false;if (rxhdr.RxStatus &0x100 ) {PRINTK1 ("fifo error\n" ); - db->stats.rx_fifo_errors++; + dev->stats.rx_fifo_errors++; }if (rxhdr.RxStatus &0x200 ) {PRINTK1 ("crc error\n" ); - db->stats.rx_crc_errors++; + dev->stats.rx_crc_errors++; }if (rxhdr.RxStatus &0x8000 ) {PRINTK1 ("length error\n" ); - db->stats.rx_length_errors++; + dev->stats.rx_length_errors++; } }
@@ -961,12 +946,12 @@ dm9000_rx(struct net_device *dev)/* Read received packet from RX SRAM */ (db->inblk)(db->io_data, rdptr, RxLen); - db->stats.rx_bytes += RxLen; + dev->stats.rx_bytes += RxLen;/* Pass to upper layer */ skb->protocol =eth_type_trans (skb, dev);netif_rx (skb); - db->stats.rx_packets++; + dev->stats.rx_packets++; }else {/* need to dump the packet's data */
drivers/net/e100.c +9 -14
@@ -557,7 +557,6 @@ struct nic {enum mac mac;enum phy phy;struct params params; -struct net_device_stats net_stats;struct timer_list watchdog;struct timer_list blink_timer;struct mii_if_info mii;
@@ -1482,7 +1481,8 @@ static void e100_set_multicast_list(struct net_device *netdev)static void e100_update_stats (struct nic *nic) { -struct net_device_stats *ns = &nic->net_stats; +struct net_device *dev = nic->netdev; +struct net_device_stats *ns = &dev->stats;struct stats *s = &nic->mem->stats;u32 *complete = (nic->mac < mac_82558_D101_A4) ? &s->fc_xmt_pause : (nic->mac < mac_82559_D101M) ? (u32 *)&s->xmt_tco_frames :
@@ -1659,6 +1659,7 @@ static int e100_xmit_frame(struct sk_buff *skb, struct net_device *netdev)static int e100_tx_clean (struct nic *nic) { +struct net_device *dev = nic->netdev;struct cb *cb;int tx_cleaned =0 ;
@@ -1673,8 +1674,8 @@ static int e100_tx_clean(struct nic *nic) cb->status);if (likely (cb->skb !=NULL )) { - nic->net_stats.tx_packets++; - nic->net_stats.tx_bytes += cb->skb->len; + dev->stats.tx_packets++; + dev->stats.tx_bytes += cb->skb->len; pci_unmap_single(nic->pdev, le32_to_cpu(cb->u.tcb.tbd.buf_addr),
@@ -1805,6 +1806,7 @@ static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)static int e100_rx_indicate (struct nic *nic,struct rx *rx,unsigned int *work_done,unsigned int work_to_do) { +struct net_device *dev = nic->netdev;struct sk_buff *skb = rx->skb;struct rfd *rfd = (struct rfd *)skb->data;u16 rfd_status, actual_size;
@@ -1849,8 +1851,8 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx, nic->rx_over_length_errors++;dev_kfree_skb_any (skb); }else { - nic->net_stats.rx_packets++; - nic->net_stats.rx_bytes += actual_size; + dev->stats.rx_packets++; + dev->stats.rx_bytes += actual_size; nic->netdev->last_rx = jiffies;netif_receive_skb (skb);if (work_done)
@@ -2017,12 +2019,6 @@ static void e100_netpoll(struct net_device *netdev) }#endif -static struct net_device_stats *e100_get_stats (struct net_device *netdev) -{ -struct nic *nic =netdev_priv (netdev); -return &nic->net_stats; -} -static int e100_set_mac_address (struct net_device *netdev,void *p) {struct nic *nic =netdev_priv (netdev);
@@ -2459,7 +2455,7 @@ static void e100_get_ethtool_stats(struct net_device *netdev,int i;for (i =0 ; i <E100_NET_STATS_LEN ; i++) - data[i] = ((unsigned long *)&nic->net_stats)[i]; + data[i] = ((unsigned long *)&netdev->stats)[i]; data[i++] = nic->tx_deferred; data[i++] = nic->tx_single_collisions;
@@ -2564,7 +2560,6 @@ static int __devinit e100_probe(struct pci_dev *pdev, netdev->open = e100_open; netdev->stop = e100_close; netdev->hard_start_xmit = e100_xmit_frame; - netdev->get_stats = e100_get_stats; netdev->set_multicast_list = e100_set_multicast_list; netdev->set_mac_address = e100_set_mac_address; netdev->change_mtu = e100_change_mtu;
drivers/net/eepro.c +17 -30
139 lines not on this page · raw message
drivers/net/eexpress.c +21 -35
154 lines not on this page · raw message
drivers/net/eql.c +2 -10
@@ -127,7 +127,6 @@ static int eql_open(struct net_device *dev);static int eql_close (struct net_device *dev);static int eql_ioctl (struct net_device *dev,struct ifreq *ifr,int cmd);static int eql_slave_xmit (struct sk_buff *skb,struct net_device *dev); -static struct net_device_stats *eql_get_stats (struct net_device *dev);#define eql_is_slave (dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE)#define eql_is_master (dev) ((dev->flags & IFF_MASTER) == IFF_MASTER)
@@ -181,7 +180,6 @@ static void __init eql_setup(struct net_device *dev) dev->stop = eql_close; dev->do_ioctl = eql_ioctl; dev->hard_start_xmit = eql_slave_xmit; - dev->get_stats = eql_get_stats;/* * Now we undo some of the things that eth_setup does
@@ -338,9 +336,9 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) skb->priority =1 ; slave->bytes_queued += skb->len;dev_queue_xmit (skb); - eql->stats.tx_packets++; + dev->stats.tx_packets++; }else { - eql->stats.tx_dropped++; + dev->stats.tx_dropped++;dev_kfree_skb (skb); }
@@ -349,12 +347,6 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)return 0 ; } -static struct net_device_stats *eql_get_stats (struct net_device *dev) -{ -equalizer_t *eql =netdev_priv (dev); -return &eql->stats; -} -/* * Private ioctl functions */
drivers/net/eth16i.c +19 -30
138 lines not on this page · raw message
drivers/net/ewrk3.c +13 -24
@@ -275,7 +275,6 @@ struct ewrk3_private {u_long shmem_base;/* Shared memory start address */ void __iomem *shmem;u_long shmem_length;/* Shared memory window length */ -struct net_device_stats stats;/* Public stats */ struct ewrk3_stats pktStats;/* Private stats counters */ u_char irq_mask;/* Adapter IRQ mask bits */ u_char mPage;/* Maximum 2kB Page number */
@@ -302,7 +301,6 @@ static int ewrk3_open(struct net_device *dev);static int ewrk3_queue_pkt (struct sk_buff *skb,struct net_device *dev);static irqreturn_t ewrk3_interrupt (int irq,void *dev_id);static int ewrk3_close (struct net_device *dev); -static struct net_device_stats *ewrk3_get_stats (struct net_device *dev);static void set_multicast_list (struct net_device *dev);static int ewrk3_ioctl (struct net_device *dev,struct ifreq *rq,int cmd);static const struct ethtool_ops ethtool_ops_203;
@@ -612,7 +610,6 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase) dev->open = ewrk3_open; dev->hard_start_xmit = ewrk3_queue_pkt; dev->stop = ewrk3_close; - dev->get_stats = ewrk3_get_stats; dev->set_multicast_list = set_multicast_list; dev->do_ioctl = ewrk3_ioctl;if (lp->adapter_name[4 ] =='3' )
@@ -864,7 +861,7 @@ static int ewrk3_queue_pkt (struct sk_buff *skb, struct net_device *dev) ENABLE_IRQs;spin_unlock_irq (&lp->hw_lock); - lp->stats.tx_bytes += skb->len; + dev->stats.tx_bytes += skb->len; dev->trans_start = jiffies;dev_kfree_skb (skb);
@@ -981,13 +978,13 @@ static int ewrk3_rx(struct net_device *dev) }if (!(rx_status &R_ROK )) {/* There was an error. */ - lp->stats.rx_errors++;/* Update the error stats. */ + dev->stats.rx_errors++;/* Update the error stats. */ if (rx_status &R_DBE ) - lp->stats.rx_frame_errors++; + dev->stats.rx_frame_errors++;if (rx_status &R_CRC ) - lp->stats.rx_crc_errors++; + dev->stats.rx_crc_errors++;if (rx_status &R_PLL ) - lp->stats.rx_fifo_errors++; + dev->stats.rx_fifo_errors++; }else {struct sk_buff *skb;
@@ -1038,11 +1035,11 @@ static int ewrk3_rx(struct net_device *dev)** Update stats */ dev->last_rx = jiffies; - lp->stats.rx_packets++; - lp->stats.rx_bytes += pkt_len; + dev->stats.rx_packets++; + dev->stats.rx_bytes += pkt_len; }else {printk ("%s: Insufficient memory; nuking packet.\n" , dev->name); - lp->stats.rx_dropped++;/* Really, deferred. */ + dev->stats.rx_dropped++;/* Really, deferred. */ break ; } }
@@ -1072,11 +1069,11 @@ static int ewrk3_tx(struct net_device *dev)while ((tx_status =inb (EWRK3_TDQ )) >0 ) {/* Whilst there's old buffers */ if (tx_status &T_VSTS ) {/* The status is valid */ if (tx_status &T_TXE ) { - lp->stats.tx_errors++; + dev->stats.tx_errors++;if (tx_status &T_NCL ) - lp->stats.tx_carrier_errors++; + dev->stats.tx_carrier_errors++;if (tx_status &T_LCL ) - lp->stats.tx_window_errors++; + dev->stats.tx_window_errors++;if (tx_status &T_CTU ) {if ((tx_status &T_COLL ) ^T_XUR ) { lp->pktStats.tx_underruns++;
@@ -1085,13 +1082,13 @@ static int ewrk3_tx(struct net_device *dev) } }else if (tx_status &T_COLL ) {if ((tx_status &T_COLL ) ^T_XCOLL ) { - lp->stats.collisions++; + dev->stats.collisions++; }else { lp->pktStats.excessive_collisions++; } } }else { - lp->stats.tx_packets++; + dev->stats.tx_packets++; } } }
@@ -1134,14 +1131,6 @@ static int ewrk3_close(struct net_device *dev)return 0 ; } -static struct net_device_stats *ewrk3_get_stats (struct net_device *dev) -{ -struct ewrk3_private *lp =netdev_priv (dev); - -/* Null body since there is no framing error counter */ -return &lp->stats; -} -/* ** Set or clear the multicast filter for this adapter. */
drivers/net/fec.c +20 -30
134 lines not on this page · raw message
drivers/net/gianfar.c +15 -25
@@ -116,7 +116,6 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev);static void gfar_timeout (struct net_device *dev);static int gfar_close (struct net_device *dev);struct sk_buff *gfar_new_skb (struct net_device *dev,struct rxbd8 *bdp); -static struct net_device_stats *gfar_get_stats (struct net_device *dev);static int gfar_set_mac_address (struct net_device *dev);static int gfar_change_mtu (struct net_device *dev,int new_mtu);static irqreturn_t gfar_error (int irq,void *dev_id);
@@ -269,7 +268,6 @@ static int gfar_probe(struct platform_device *pdev) dev->poll_controller = gfar_netpoll;#endif dev->stop = gfar_close; - dev->get_stats = gfar_get_stats; dev->change_mtu = gfar_change_mtu; dev->mtu =1500 ; dev->set_multicast_list = gfar_set_multi;
@@ -1010,7 +1008,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)unsigned long flags;/* Update transmit stats */ - priv->stats.tx_bytes += skb->len; + dev->stats.tx_bytes += skb->len;/* Lock priv now */ spin_lock_irqsave (&priv->txlock, flags);
@@ -1083,7 +1081,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)if (txbdp == priv->dirty_tx) {netif_stop_queue (dev); - priv->stats.tx_fifo_errors++; + dev->stats.tx_fifo_errors++; }/* Update the current txbd to the next one */
@@ -1113,14 +1111,6 @@ static int gfar_close(struct net_device *dev)return 0 ; } -/* returns a net_device_stats structure pointer */ -static struct net_device_stats *gfar_get_stats (struct net_device *dev) -{ -struct gfar_private *priv =netdev_priv (dev); - -return &(priv->stats); -} -/* Changes the mac address if the controller is not running. */ int gfar_set_mac_address (struct net_device *dev) {
@@ -1232,7 +1222,7 @@ static void gfar_timeout(struct net_device *dev) {struct gfar_private *priv =netdev_priv (dev); - priv->stats.tx_errors++; + dev->stats.tx_errors++;if (dev->flags &IFF_UP ) {stop_gfar (dev);
@@ -1262,12 +1252,12 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id)if ((bdp == priv->cur_tx) && (netif_queue_stopped (dev) ==0 ))break ; - priv->stats.tx_packets++; + dev->stats.tx_packets++;/* Deferred means some collisions occurred during transmit, */ /* but we eventually sent the packet. */ if (bdp->status &TXBD_DEF ) - priv->stats.collisions++; + dev->stats.collisions++;/* Free the sk buffer associated with this TxBD */ dev_kfree_skb_irq (priv->tx_skbuff[priv->skb_dirtytx]);
@@ -1339,7 +1329,7 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp)static inline void count_errors (unsigned short status,struct gfar_private *priv) { -struct net_device_stats *stats = &priv->stats; +struct net_device_stats *stats = &dev->stats;struct gfar_extra_stats *estats = &priv->extra_stats;/* If the packet was truncated, none of the other errors
@@ -1464,7 +1454,7 @@ static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb,if (NULL == skb) {if (netif_msg_rx_err (priv))printk (KERN_WARNING "%s: Missing skb!!.\n" , dev->name); - priv->stats.rx_dropped++; + dev->stats.rx_dropped++; priv->extra_stats.rx_skbmissing++; }else {int ret;
@@ -1522,7 +1512,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET | RXBD_CRCERR | RXBD_OVERRUN | RXBD_TRUNCATED))) {/* Increment the number of packets */ - priv->stats.rx_packets++; + dev->stats.rx_packets++; howmany++;/* Remove the FCS from the packet length */
@@ -1530,7 +1520,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)gfar_process_frame (dev, skb, pkt_len); - priv->stats.rx_bytes += pkt_len; + dev->stats.rx_bytes += pkt_len; }else {count_errors (bdp->status, priv);
@@ -1918,17 +1908,17 @@ static irqreturn_t gfar_error(int irq, void *dev_id)/* Update the error counters */ if (events &IEVENT_TXE ) { - priv->stats.tx_errors++; + dev->stats.tx_errors++;if (events &IEVENT_LC ) - priv->stats.tx_window_errors++; + dev->stats.tx_window_errors++;if (events &IEVENT_CRL ) - priv->stats.tx_aborted_errors++; + dev->stats.tx_aborted_errors++;if (events &IEVENT_XFUN ) {if (netif_msg_tx_err (priv))printk (KERN_DEBUG "%s: TX FIFO underrun, " "packet dropped.\n" , dev->name); - priv->stats.tx_dropped++; + dev->stats.tx_dropped++; priv->extra_stats.tx_underrun++;/* Reactivate the Tx Queues */
@@ -1938,7 +1928,7 @@ static irqreturn_t gfar_error(int irq, void *dev_id)printk (KERN_DEBUG "%s: Transmit Error\n" , dev->name); }if (events &IEVENT_BSY ) { - priv->stats.rx_errors++; + dev->stats.rx_errors++; priv->extra_stats.rx_bsy++;gfar_receive (irq, dev_id);
@@ -1953,7 +1943,7 @@ static irqreturn_t gfar_error(int irq, void *dev_id) dev->name, gfar_read(&priv->regs->rstat)); }if (events &IEVENT_BABR ) { - priv->stats.rx_errors++; + dev->stats.rx_errors++; priv->extra_stats.rx_babr++;if (netif_msg_rx_err (priv))
drivers/net/hplance.c +0 -1
@@ -141,7 +141,6 @@ static void __init hplance_init(struct net_device *dev, struct dio_dev *d) dev->poll_controller = lance_poll;#endif dev->hard_start_xmit = &lance_start_xmit; - dev->get_stats = &lance_get_stats; dev->set_multicast_list = &lance_set_multicast; dev->dma =0 ;
drivers/net/ibmlana.c +14 -23
@@ -591,7 +591,7 @@ static void irqrx_handler(struct net_device *dev) skb =dev_alloc_skb (rda.length +2 );if (skb ==NULL ) - priv->stat.rx_dropped++; + dev->stats.rx_dropped++;else {/* copy out data */
@@ -606,8 +606,8 @@ static void irqrx_handler(struct net_device *dev)/* bookkeeping */ dev->last_rx = jiffies; - priv->stat.rx_packets++; - priv->stat.rx_bytes += rda.length; + dev->stats.rx_packets++; + dev->stats.rx_bytes += rda.length;/* pass to the upper layers */ netif_rx (skb);
@@ -617,11 +617,11 @@ static void irqrx_handler(struct net_device *dev)/* otherwise check error status bits and increase statistics */ else { - priv->stat.rx_errors++; + dev->stats.rx_errors++;if (rda.status &RCREG_FAER ) - priv->stat.rx_frame_errors++; + dev->stats.rx_frame_errors++;if (rda.status &RCREG_CRCR ) - priv->stat.rx_crc_errors++; + dev->stats.rx_crc_errors++; }/* descriptor processed, will become new last descriptor in queue */
@@ -656,8 +656,8 @@ static void irqtx_handler(struct net_device *dev)memcpy_fromio (&tda, priv->base + priv->tdastart + (priv->currtxdescr *sizeof (tda_t)),sizeof (tda_t));/* update statistics */ - priv->stat.tx_packets++; - priv->stat.tx_bytes += tda.length; + dev->stats.tx_packets++; + dev->stats.tx_bytes += tda.length;/* update our pointers */ priv->txused[priv->currtxdescr] =0 ;
@@ -680,15 +680,15 @@ static void irqtxerr_handler(struct net_device *dev)memcpy_fromio (&tda, priv->base + priv->tdastart + (priv->currtxdescr *sizeof (tda_t)),sizeof (tda_t));/* update statistics */ - priv->stat.tx_errors++; + dev->stats.tx_errors++;if (tda.status & (TCREG_NCRS |TCREG_CRSL )) - priv->stat.tx_carrier_errors++; + dev->stats.tx_carrier_errors++;if (tda.status &TCREG_EXC ) - priv->stat.tx_aborted_errors++; + dev->stats.tx_aborted_errors++;if (tda.status &TCREG_OWC ) - priv->stat.tx_window_errors++; + dev->stats.tx_window_errors++;if (tda.status &TCREG_FU ) - priv->stat.tx_fifo_errors++; + dev->stats.tx_fifo_errors++;/* update our pointers */ priv->txused[priv->currtxdescr] =0 ;
@@ -824,7 +824,7 @@ static int ibmlana_tx(struct sk_buff *skb, struct net_device *dev)if (priv->txusedcnt >=TXBUFCNT ) { retval = -EIO ; - priv->stat.tx_dropped++; + dev->stats.tx_dropped++; goto tx_done; }
@@ -876,14 +876,6 @@ tx_done:return retval; } -/* return pointer to Ethernet statistics */ - -static struct net_device_stats *ibmlana_stats (struct net_device *dev) -{ -ibmlana_priv *priv =netdev_priv (dev); -return &priv->stat; -} -/* switch receiver mode. */ static void ibmlana_set_multicast_list (struct net_device *dev)
@@ -980,7 +972,6 @@ static int ibmlana_probe(struct net_device *dev) dev->stop = ibmlana_close; dev->hard_start_xmit = ibmlana_tx; dev->do_ioctl =NULL ; - dev->get_stats = ibmlana_stats; dev->set_multicast_list = ibmlana_set_multicast_list; dev->flags |=IFF_MULTICAST ;
drivers/net/ibmlana.h +0 -1
@@ -26,7 +26,6 @@ typedef enum { typedef struct { unsigned int slot; /* MCA-Slot-# */ - struct net_device_stats stat; /* packet statistics */ int realirq; /* memorizes actual IRQ, even when currently not allocated */ ibmlana_medium medium; /* physical cannector */
drivers/net/ibmveth.c +5 -13
@@ -86,7 +86,6 @@ static int ibmveth_close(struct net_device *dev);static int ibmveth_ioctl (struct net_device *dev,struct ifreq *ifr,int cmd);static int ibmveth_poll (struct net_device *dev,int *budget);static int ibmveth_start_xmit (struct sk_buff *skb,struct net_device *dev); -static struct net_device_stats *ibmveth_get_stats (struct net_device *dev);static void ibmveth_set_multicast_list (struct net_device *dev);static int ibmveth_change_mtu (struct net_device *dev,int new_mtu);static void ibmveth_proc_register_driver (void );
@@ -898,9 +897,9 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) skb->len, DMA_TO_DEVICE); out:spin_lock_irqsave (&adapter->stats_lock, flags); - adapter->stats.tx_dropped += tx_dropped; - adapter->stats.tx_bytes += tx_bytes; - adapter->stats.tx_packets += tx_packets; + dev->stats.tx_dropped += tx_dropped; + dev->stats.tx_bytes += tx_bytes; + dev->stats.tx_packets += tx_packets; adapter->tx_send_failed += tx_send_failed; adapter->tx_map_failed += tx_map_failed;spin_unlock_irqrestore (&adapter->stats_lock, flags);
@@ -948,8 +947,8 @@ static int ibmveth_poll(struct net_device *netdev, int *budget)netif_receive_skb (skb);/* send it up */ - adapter->stats.rx_packets++; - adapter->stats.rx_bytes += length; + dev->stats.rx_packets++; + dev->stats.rx_bytes += length; frames_processed++; netdev->last_rx = jiffies; }
@@ -1003,12 +1002,6 @@ static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance)return IRQ_HANDLED ; } -static struct net_device_stats *ibmveth_get_stats (struct net_device *dev) -{ -struct ibmveth_adapter *adapter = dev->priv; -return &adapter->stats; -} -static void ibmveth_set_multicast_list (struct net_device *netdev) {struct ibmveth_adapter *adapter = netdev->priv;
@@ -1172,7 +1165,6 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ netdev->weight =16 ; netdev->stop = ibmveth_close; netdev->hard_start_xmit = ibmveth_start_xmit; - netdev->get_stats = ibmveth_get_stats; netdev->set_multicast_list = ibmveth_set_multicast_list; netdev->do_ioctl = ibmveth_ioctl; netdev->ethtool_ops = &netdev_ethtool_ops;
drivers/net/ifb.c +2 -18
@@ -39,7 +39,6 @@#define TX_Q_LIMIT 32struct ifb_private { -struct net_device_stats stats;struct tasklet_struct ifb_tasklet;int tasklet_pending;/* mostly debug stats leave in for now */
@@ -60,7 +59,6 @@ static int numifbs = 2;static void ri_tasklet (unsigned long dev);static int ifb_xmit (struct sk_buff *skb,struct net_device *dev); -static struct net_device_stats *ifb_get_stats (struct net_device *dev);static int ifb_open (struct net_device *dev);static int ifb_close (struct net_device *dev);
@@ -69,7 +67,7 @@ static void ri_tasklet(unsigned long dev)struct net_device *_dev = (struct net_device *)dev;struct ifb_private *dp =netdev_priv (_dev); -struct net_device_stats *stats = &dp->stats; +struct net_device_stats *stats = &_dev->stats;struct sk_buff *skb; dp->st_task_enter++;
@@ -139,7 +137,6 @@ resched:static void ifb_setup (struct net_device *dev) {/* Initialize the device structure. */ - dev->get_stats = ifb_get_stats; dev->hard_start_xmit = ifb_xmit; dev->open = &ifb_open; dev->stop = &ifb_close;
@@ -158,7 +155,7 @@ static void ifb_setup(struct net_device *dev)static int ifb_xmit (struct sk_buff *skb,struct net_device *dev) {struct ifb_private *dp =netdev_priv (dev); -struct net_device_stats *stats = &dp->stats; +struct net_device_stats *stats = &dev->stats;int ret =0 ;u32 from =G_TC_FROM (skb->tc_verd);
@@ -185,19 +182,6 @@ static int ifb_xmit(struct sk_buff *skb, struct net_device *dev)return ret; } -static struct net_device_stats *ifb_get_stats (struct net_device *dev) -{ -struct ifb_private *dp =netdev_priv (dev); -struct net_device_stats *stats = &dp->stats; - -pr_debug ("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n" , - dp->st_task_enter, dp->st_txq_refl_try, dp->st_rxq_enter, - dp->st_rx2tx_tran, dp->st_rxq_notenter, dp->st_rx_frm_egr, - dp->st_rx_frm_ing, dp->st_rxq_check, dp->st_rxq_rsch); - -return stats; -} -static int ifb_close (struct net_device *dev) {struct ifb_private *dp =netdev_priv (dev);
drivers/net/iseries_veth.c +5 -17
@@ -196,7 +196,6 @@ struct veth_lpar_connection {struct veth_port {struct device *dev; -struct net_device_stats stats;u64 mac_addr;HvLpIndexMap lpar_map;
@@ -936,9 +935,6 @@ static void veth_release_connection(struct kobject *kobj)static int veth_open (struct net_device *dev) { -struct veth_port *port = (struct veth_port *) dev->priv; - -memset (&port->stats,0 ,sizeof (port->stats));netif_start_queue (dev);return 0 ; }
@@ -949,13 +945,6 @@ static int veth_close(struct net_device *dev)return 0 ; } -static struct net_device_stats *veth_get_stats (struct net_device *dev) -{ -struct veth_port *port = (struct veth_port *) dev->priv; - -return &port->stats; -} -static int veth_change_mtu (struct net_device *dev,int new_mtu) {if ((new_mtu <68 ) || (new_mtu >VETH_MAX_MTU ))
@@ -1084,7 +1073,6 @@ static struct net_device * __init veth_probe_one(int vlan, dev->open = veth_open; dev->hard_start_xmit = veth_start_xmit; dev->stop = veth_close; - dev->get_stats = veth_get_stats; dev->change_mtu = veth_change_mtu; dev->set_mac_address =NULL ; dev->set_multicast_list = veth_set_multicast_list;
@@ -1199,11 +1187,11 @@ static void veth_transmit_to_many(struct sk_buff *skb, }if (error) - port->stats.tx_errors++; + dev->stats.tx_errors++;if (success) { - port->stats.tx_packets++; - port->stats.tx_bytes += skb->len; + dev->stats.tx_packets++; + dev->stats.tx_bytes += skb->len; } }
Lines of this file are not shown. View the raw message.
drivers/net/lib82596.c +27 -37
64 lines not on this page · raw message
drivers/net/lp486e.c +23 -33
56 lines not on this page · raw message
drivers/net/mace.c +20 -31
51 lines not on this page · raw message
drivers/net/macmace.c +19 -30
49 lines not on this page · raw message
drivers/net/ni5010.c +13 -34
47 lines not on this page · raw message
drivers/net/pci-skeleton.c +23 -51
74 lines not on this page · raw message
drivers/net/saa9730.c +42 -51
93 lines not on this page · raw message
drivers/net/sis900.c +19 -37
56 lines not on this page · raw message
drivers/net/smc911x.c +28 -49
77 lines not on this page · raw message
drivers/net/smc9194.c +17 -42
59 lines not on this page · raw message
drivers/net/smc91x.c +24 -45
69 lines not on this page · raw message
drivers/net/sun3lance.c +20 -33
53 lines not on this page · raw message
drivers/net/sunlance.c +39 -48
87 lines not on this page · raw message
drivers/net/sunqe.c +48 -56
104 lines not on this page · raw message
drivers/net/yellowfin.c +26 -37
63 lines not on this page · raw message
drivers/net/znet.c +19 -31
50 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 2 lines · Jeff Garzik
drivers/net/xen-netfront.c | 26 +++--------
Hey, look, its identical to the patch I have here.
J