summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx.c
diff options
context:
space:
mode:
authorVivien Didelot2016-05-09 19:22:53 +0200
committerDavid S. Miller2016-05-09 20:26:12 +0200
commitb0745e87943b40734e6c341dcf47a6ec80ee4346 (patch)
treec745847c711cc0906c14a4fd4f880e35a19b0bcf /drivers/net/dsa/mv88e6xxx.c
parentnet: dsa: mv88e6131: drop VLAN Ethertype setup (diff)
downloadkernel-qcow2-linux-b0745e87943b40734e6c341dcf47a6ec80ee4346.tar.gz
kernel-qcow2-linux-b0745e87943b40734e6c341dcf47a6ec80ee4346.tar.xz
kernel-qcow2-linux-b0745e87943b40734e6c341dcf47a6ec80ee4346.zip
net: dsa: mv88e6xxx: factorize GLOBAL_MONITOR_CONTROL setup
All switch drivers configure the GLOBAL_MONITOR_CONTROL register with slightly changes. Assume the setup of the upstream port, and configure it as the port to which ingress and egress and ARP monitor frames are to be sent. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx.c')
-rw-r--r--drivers/net/dsa/mv88e6xxx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index f1cd66073bf7..27551c1f1cd0 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -2922,6 +2922,8 @@ int mv88e6xxx_setup_ports(struct dsa_switch *ds)
static int mv88e6xxx_setup_global(struct mv88e6xxx_priv_state *ps)
{
+ struct dsa_switch *ds = ps->ds;
+ u32 upstream_port = dsa_upstream_port(ds);
u16 reg;
int err;
int i;
@@ -2938,6 +2940,16 @@ static int mv88e6xxx_setup_global(struct mv88e6xxx_priv_state *ps)
if (err)
return err;
+ /* Configure the upstream port, and configure it as the port to which
+ * ingress and egress and ARP monitor frames are to be sent.
+ */
+ reg = upstream_port << GLOBAL_MONITOR_CONTROL_INGRESS_SHIFT |
+ upstream_port << GLOBAL_MONITOR_CONTROL_EGRESS_SHIFT |
+ upstream_port << GLOBAL_MONITOR_CONTROL_ARP_SHIFT;
+ err = _mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_MONITOR_CONTROL, reg);
+ if (err)
+ return err;
+
/* Set the default address aging time to 5 minutes, and
* enable address learn messages to be sent to all message
* ports.