All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Fernando Alencar Maróstica" <famarost@unimep.br>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	RealTek Mailing List <realtek@scyld.com>
Subject: [PATCH 2.6] Realtek RTL-8169 RX/TX Statistics
Date: Tue, 02 Dec 2003 22:59:58 -0200	[thread overview]
Message-ID: <1070413198.1091.10.camel@oxygenium> (raw)
In-Reply-To: <20031202010649.A27879@electric-eye.fr.zoreil.com>

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

Hello Francois

It's a simple and small patch.
This patch add stats improvements and fixes.


Cheers!

-- 
Fernando Alencar Maróstica
Graduate Student, Computer Science
Linux Register User Id #281457
                                                                     
University Methodist of Piracicaba
Departament of Computer Science
email: famarost@unimep.br
homepage: http://www.unimep.br/~famarost




[-- Attachment #2: r8169-getstats.patch --]
[-- Type: text/x-patch, Size: 1365 bytes --]

--- r8169.c.orig	2003-12-02 20:36:07.000000000 -0200
+++ r8169.c	2003-12-02 20:52:19.000000000 -0200
@@ -303,7 +303,7 @@
 static int rtl8169_close(struct net_device *dev);
 static void rtl8169_set_rx_mode(struct net_device *dev);
 static void rtl8169_tx_timeout(struct net_device *dev);
-static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev);
+static struct net_device_stats *rtl8169_get_stats(struct net_device *ethernet_device);
 
 static const u16 rtl8169_intr_mask =
     SYSErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK |
@@ -1113,11 +1113,26 @@
 	spin_unlock_irqrestore(&tp->lock, flags);
 }
 
+/**
+ *  rtl8169_get_stats: - Get rtl8169 read/write statistics
+ *  @ethernet_device: The Ethernet Device to get statistics for
+ *
+ *  Get TX/RX statistics for rtl8169
+ */
 struct net_device_stats *
-rtl8169_get_stats(struct net_device *dev)
+rtl8169_get_stats(struct net_device *ethernet_device)
 {
-	struct rtl8169_private *tp = dev->priv;
+	struct rtl8169_private *tp = ethernet_device->priv;
+	void *ioaddr = tp->mmio_addr;
+	unsigned long flags;
 
+        if (netif_running(ethernet_device)) {
+	    spin_lock_irqsave (&tp->lock, flags);
+	    tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
+	    RTL_W32 (RxMissed, 0);
+	    spin_unlock_irqrestore (&tp->lock, flags);
+	}
+		
 	return &tp->stats;
 }
 

  reply	other threads:[~2003-12-03  1:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1070212415.1607.17.camel@oxygenium>
2003-12-01  1:04 ` [PATCH 2.6] RTL8169 Suspend and Resume Stuff Francois Romieu
2003-12-02  0:06   ` [PATCH 2.6] 2.6.0-test11 - more rtl8169 Francois Romieu
2003-12-03  0:59     ` Fernando Alencar Maróstica [this message]
2003-12-06 19:41       ` [PATCH 2.6] Realtek RTL-8169 RX/TX Statistics Francois Romieu
2003-12-03 23:26     ` [PATCH 2.6] 2.6.0-test11 - rtl8169 endianness Francois Romieu
2003-12-03 23:30       ` Brad House
2003-12-07 18:14     ` [PATCH 2.6] 2.6.0-test11 - more rtl8169 Jeff Garzik
2003-12-07 23:01       ` [PATCH 2.6] 2.6.0-test11-bk5 - rtl8169 Francois Romieu
2003-12-08  0:00         ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1070413198.1091.10.camel@oxygenium \
    --to=famarost@unimep.br \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=realtek@scyld.com \
    --cc=romieu@fr.zoreil.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.