From: Andrew Lunn <andrew@lunn.ch>
To: davem@davemloft.net, linux@roeck-us.net
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH 12/12] net: dsa: mv88e6xxx: Fix stats counters for 6352 family
Date: Thu, 2 Apr 2015 03:21:59 +0200 [thread overview]
Message-ID: <1427937719-11630-13-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1427937719-11630-1-git-send-email-andrew@lunn.ch>
The statistic counters for the mv88e6172 never worked. This device is
a member of the 6352 family of chips, which has a slightly different
layout of the register used for capturing statistics. Add support for
detecting this family and poking the port in the right place in the
register.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/net/dsa/mv88e6xxx.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 488b6545dfb5..fc8d3b6ffe8e 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -434,6 +434,19 @@ void mv88e6xxx_poll_link(struct dsa_switch *ds)
}
}
+static bool mv88e6xxx_6352_family(struct dsa_switch *ds)
+{
+ struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+
+ switch (ps->id) {
+ case PORT_SWITCH_ID_6352:
+ case PORT_SWITCH_ID_6172:
+ case PORT_SWITCH_ID_6176:
+ return true;
+ }
+ return false;
+}
+
static int mv88e6xxx_stats_wait(struct dsa_switch *ds)
{
int ret;
@@ -452,6 +465,9 @@ static int mv88e6xxx_stats_snapshot(struct dsa_switch *ds, int port)
{
int ret;
+ if (mv88e6xxx_6352_family(ds))
+ port = (port + 1) << 5;
+
/* Snapshot the hardware statistics counters for this port. */
REG_WRITE(REG_GLOBAL, GLOBAL_STATS_OP,
GLOBAL_STATS_OP_CAPTURE_PORT |
--
2.1.4
prev parent reply other threads:[~2015-04-02 1:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-02 1:21 [PATCH 00/12] DSA Mavell drivers refactoring and cleanup Andrew Lunn
2015-04-02 1:21 ` [PATCH 01/12] net: dsa: mv88e6131: Use common initialization functions Andrew Lunn
2015-04-02 1:39 ` Guenter Roeck
2015-04-02 1:51 ` Andrew Lunn
2015-04-02 2:01 ` David Miller
2015-04-02 2:00 ` David Miller
2015-04-02 1:21 ` [PATCH 02/12] net: dsa: mv88e6xxx: Move switch product IDs into common include file Andrew Lunn
2015-04-02 1:21 ` [PATCH 03/12] net: dsa: mv88e6131: Determine and use number of switch ports Andrew Lunn
2015-04-02 1:21 ` [PATCH 04/12] net: dsa: mv88e6123_61_65: " Andrew Lunn
2015-04-02 1:21 ` [PATCH 05/12] net: dsa: Consistently set and use ps->num_ports Andrew Lunn
2015-04-02 1:35 ` Guenter Roeck
2015-04-02 1:21 ` [PATCH 06/12] net: dsa: Centralize Marvell switch reset Andrew Lunn
2015-04-02 1:21 ` [PATCH 07/12] net: dsa: Move phy page access functions into shared code Andrew Lunn
2015-04-02 1:21 ` [PATCH 08/12] net: dsa: Consolidate phy read and write functions Andrew Lunn
2015-04-02 1:21 ` [PATCH 09/12] net: dsa: mv88e6xxx: Add missing mutex's in EEE operations Andrew Lunn
2015-04-02 1:21 ` [PATCH 10/12] net: dsa: Consolidate getting the statistics Andrew Lunn
2015-04-02 1:21 ` [PATCH 11/12] net: dsa: Use mnemonics rather than register numbers Andrew Lunn
2015-04-02 1:21 ` Andrew Lunn [this message]
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=1427937719-11630-13-git-send-email-andrew@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=linux@roeck-us.net \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).