[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170310002928.GC22101@lunn.ch>
Date: Fri, 10 Mar 2017 01:29:28 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel@...oirfairelinux.com,
"David S. Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH net-next 10/14] net: dsa: mv88e6xxx: rework port mode
setup
Hi Vivien
> +static int mv88e6xxx_set_port_mode_normal(struct mv88e6xxx_chip *chip, int port)
> +{
> + return mv88e6xxx_set_port_mode(chip, port, MV88E6XXX_FRAME_MODE_NORMAL,
> + PORT_CONTROL_EGRESS_UNMODIFIED, 0x9100);
It would be nice to replace this magic number with a #define. How does
the datasheet describe this? 0x9100 is ETH_P_QINQ1. Would that
actually fit?
> +static int mv88e6xxx_setup_port_mode(struct mv88e6xxx_chip *chip, int port)
> +{
> + if (dsa_is_dsa_port(chip->ds, port))
> + return mv88e6xxx_set_port_mode_dsa(chip, port);
> +
> + if (!dsa_is_cpu_port(chip->ds, port))
> + return mv88e6xxx_set_port_mode_normal(chip, port);
Maybe add a dsa_is_normal_port() helper? It just makes the code even
easier to read.
Andrew
Powered by blists - more mailing lists