[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <483E1005.3080804@sngx.net>
Date: Wed, 28 May 2008 21:08:05 -0500
From: James Cammarata <jimi@...x.net>
To: linux-kernel@...r.kernel.org
CC: Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH] net: add ability to clear stats via ethtool - e1000/pcnet32
Missed an errant define in some copied code (from the get_stats function in e1000_main.c).
Signed-off-by: James Cammarata <jimi@...x.net>
---
--- linux-2.6.25.4/drivers/net/e1000/e1000_main.c 2008-05-15 10:00:12.000000000 -0500
+++ linux-2.6.25.4-jcammara/drivers/net/e1000/e1000_main.c 2008-05-28 21:06:19.000000000 -0500
@@ -141,6 +141,7 @@ static void e1000_free_tx_resources(stru
static void e1000_free_rx_resources(struct e1000_adapter *adapter,
struct e1000_rx_ring *rx_ring);
void e1000_update_stats(struct e1000_adapter *adapter);
+void e1000_clear_stats(struct e1000_adapter *adapter);
static int e1000_init_module(void);
static void e1000_exit_module(void);
@@ -3819,6 +3820,29 @@ e1000_update_stats(struct e1000_adapter
spin_unlock_irqrestore(&adapter->stats_lock, flags);
}
+void
+e1000_clear_stats(struct e1000_adapter *adapter)
+{
+ struct pci_dev *pdev = adapter->pdev;
+ unsigned long flags;
+
+ /*
+ * Prevent stats update while adapter is being reset, or if the pci
+ * connection is down.
+ */
+ if (adapter->link_speed == 0)
+ return;
+ if (pci_channel_offline(pdev))
+ return;
+
+ spin_lock_irqsave(&adapter->stats_lock, flags);
+
+ memset(&adapter->stats, 0, sizeof(struct e1000_hw_stats));
+ memset(&adapter->net_stats, 0, sizeof(struct net_device_stats));
+
+ spin_unlock_irqrestore(&adapter->stats_lock, flags);
+}
+
/**
* e1000_intr_msi - Interrupt Handler
* @irq: interrupt number
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists