netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>
Subject: [RFT/RFC PATCH 7/8] net: dsa: mv88e6171: Use common port configuration
Date: Mon, 23 Feb 2015 11:35:49 -0800	[thread overview]
Message-ID: <1424720150-27564-8-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1424720150-27564-1-git-send-email-linux@roeck-us.net>

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/net/dsa/mv88e6171.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c
index 2374205..339484a 100644
--- a/drivers/net/dsa/mv88e6171.c
+++ b/drivers/net/dsa/mv88e6171.c
@@ -226,23 +226,6 @@ static int mv88e6171_setup_port(struct dsa_switch *ds, int p)
 	 */
 	REG_WRITE(addr, 0x05, dsa_is_cpu_port(ds, p) ? 0x8000 : 0x0000);
 
-	/* Port based VLAN map: give each port its own address
-	 * database, allow the CPU port to talk to each of the 'real'
-	 * ports, and allow each of the 'real' ports to only talk to
-	 * the upstream port.
-	 */
-	val = (p & 0xf) << 12;
-	if (dsa_is_cpu_port(ds, p))
-		val |= ds->phys_port_mask;
-	else
-		val |= 1 << dsa_upstream_port(ds);
-	REG_WRITE(addr, 0x06, val);
-
-	/* Default VLAN ID and priority: don't set a default VLAN
-	 * ID, and set the default packet priority to zero.
-	 */
-	REG_WRITE(addr, 0x07, 0x0000);
-
 	/* Port Control 2: don't force a good FCS, set the maximum
 	 * frame size to 10240 bytes, don't let the switch add or
 	 * strip 802.1q tags, don't discard tagged or untagged frames
@@ -287,7 +270,7 @@ static int mv88e6171_setup_port(struct dsa_switch *ds, int p)
 	 */
 	REG_WRITE(addr, 0x19, 0x7654);
 
-	return 0;
+	return mv88e6xxx_setup_port_common(ds, p);
 }
 
 static int mv88e6171_setup(struct dsa_switch *ds)
-- 
2.1.0

  parent reply	other threads:[~2015-02-23 19:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 19:35 [RFT/RFC PATCH 0/8] net: dsa: mv88e6xxx: Add support for HW bridging Guenter Roeck
2015-02-23 19:35 ` [RFT/RFC PATCH 1/8] net: dsa: mv88e6xxx: Factor out common initialization code Guenter Roeck
2015-02-23 19:35 ` [RFT/RFC PATCH 2/8] net: dsa: mv88e6xxx: Provide function for common port initialization Guenter Roeck
2015-02-23 19:35 ` [RFT/RFC PATCH 3/8] net: dsa: mv88e6xxx: Split mv88e6xxx_reg_read and mv88e6xxx_reg_write Guenter Roeck
2015-02-23 19:35 ` [RFT/RFC PATCH 4/8] net: dsa: mv88e6xxx: Add Hardware bridging support Guenter Roeck
2015-02-23 19:35 ` [RFT/RFC PATCH 5/8] net: dsa: mv88e6352: Use common port initialization code Guenter Roeck
2015-02-23 19:35 ` [RFT/RFC PATCH 6/8] net: dsa: mv88e6123_61_65: Use common port configuration Guenter Roeck
2015-02-23 19:35 ` Guenter Roeck [this message]
2015-02-23 19:35 ` [RFT/RFC PATCH 8/8] net: dsa: mv88e6352: Add support for hardware bridging Guenter Roeck
2015-03-08 16:40 ` [RFT/RFC PATCH 0/8] net: dsa: mv88e6xxx: Add support for HW bridging Guenter Roeck

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=1424720150-27564-8-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).