lkml.org 
[lkml]   [2021]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [net-next PATCH v5 05/14] drivers: net: dsa: qca8k: add support for cpu port 6
From
For consistency with other patch subjects, drop the "drivers: " prefix.

On 10/10/2021 6:30 PM, Ansuel Smith wrote:
> Currently CPU port is always hardcoded to port 0. This switch have 2 CPU
> port.

Plural: ports.

The original intention of this driver seems to be use the
> mac06_exchange bit to swap MAC0 with MAC6 in the strange configuration
> where device have connected only the CPU port 6. To skip the
> introduction of a new binding, rework the driver to address the
> secondary CPU port as primary and drop any reference of hardcoded port.
> With configuration of mac06 exchange, just skip the definition of port0
> and define the CPU port as a secondary. The driver will autoconfigure
> the switch to use that as the primary CPU port.
>
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> ---
> drivers/net/dsa/qca8k.c | 50 +++++++++++++++++++++++++++++------------
> drivers/net/dsa/qca8k.h | 2 --
> 2 files changed, 36 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
> index e335a4cfcb75..de50116d483e 100644
> --- a/drivers/net/dsa/qca8k.c
> +++ b/drivers/net/dsa/qca8k.c
> @@ -977,6 +977,22 @@ qca8k_setup_mac_pwr_sel(struct qca8k_priv *priv)
> return ret;
> }
>
> +static int qca8k_find_cpu_port(struct dsa_switch *ds)
> +{
> + struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;

For new functions please avoid the cast from void * which is unnecessary.

With those comments addressed:

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian

\
 
 \ /
  Last update: 2021-10-11 04:01    [W:0.109 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site