net: dsa: Converting remaining registers to mnemonics
Use defines for registers, shifts and bits in the remaining register accesses in the individual drivers, in order to aid readability. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
dbde9e6667
commit
15966a2a76
@@ -47,7 +47,9 @@ static char *mv88e6352_probe(struct device *host_dev, int sw_addr)
|
||||
|
||||
static int mv88e6352_setup_global(struct dsa_switch *ds)
|
||||
{
|
||||
u32 upstream_port = dsa_upstream_port(ds);
|
||||
int ret;
|
||||
u32 reg;
|
||||
|
||||
ret = mv88e6xxx_setup_global(ds);
|
||||
if (ret)
|
||||
@@ -56,13 +58,17 @@ static int mv88e6352_setup_global(struct dsa_switch *ds)
|
||||
/* Discard packets with excessive collisions,
|
||||
* mask all interrupt sources, enable PPU (bit 14, undocumented).
|
||||
*/
|
||||
REG_WRITE(REG_GLOBAL, 0x04, 0x6000);
|
||||
REG_WRITE(REG_GLOBAL, GLOBAL_CONTROL,
|
||||
GLOBAL_CONTROL_PPU_ENABLE | GLOBAL_CONTROL_DISCARD_EXCESS);
|
||||
|
||||
/* Configure the upstream port, and configure the upstream
|
||||
* port as the port to which ingress and egress monitor frames
|
||||
* are to be sent.
|
||||
*/
|
||||
REG_WRITE(REG_GLOBAL, 0x1a, (dsa_upstream_port(ds) * 0x1110));
|
||||
reg = upstream_port << GLOBAL_MONITOR_CONTROL_INGRESS_SHIFT |
|
||||
upstream_port << GLOBAL_MONITOR_CONTROL_EGRESS_SHIFT |
|
||||
upstream_port << GLOBAL_MONITOR_CONTROL_ARP_SHIFT;
|
||||
REG_WRITE(REG_GLOBAL, GLOBAL_MONITOR_CONTROL, reg);
|
||||
|
||||
/* Disable remote management for now, and set the switch's
|
||||
* DSA device number.
|
||||
|
Reference in New Issue
Block a user