Skip to content

Commit

Permalink
net: dsa: mv88e6123_61_65: Use common port configuration
Browse files Browse the repository at this point in the history
This will simplify adding offloaded bridge support later on.

Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
groeck authored and davem330 committed Mar 29, 2015
1 parent 2089052 commit 54af0cf
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions drivers/net/dsa/mv88e6123_61_65.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,28 +222,6 @@ static int mv88e6123_61_65_setup_port(struct dsa_switch *ds, int p)
val |= 0x000c;
REG_WRITE(addr, 0x04, val);

/* Port Control 1: disable trunking. Also, if this is the
* CPU port, enable learn messages to be sent to this port.
*/
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
Expand Down Expand Up @@ -288,7 +266,7 @@ static int mv88e6123_61_65_setup_port(struct dsa_switch *ds, int p)
*/
REG_WRITE(addr, 0x19, 0x7654);

return 0;
return mv88e6xxx_setup_port_common(ds, p);
}

static int mv88e6123_61_65_setup(struct dsa_switch *ds)
Expand Down

0 comments on commit 54af0cf

Please sign in to comment.