[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220428152233.tqzbdrqqgydilncw@skbuf>
Date: Thu, 28 Apr 2022 18:22:33 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Arun.Ramadoss@...rochip.com
Cc: andrew@...n.ch, linux-kernel@...r.kernel.org,
UNGLinuxDriver@...rochip.com, vivien.didelot@...il.com,
f.fainelli@...il.com, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, Woojung.Huh@...rochip.com,
davem@...emloft.net
Subject: Re: [RFC patch net-next 3/3] net: dsa: ksz: moved ksz9477 port
mirror to ksz_common.c
On Thu, Apr 28, 2022 at 03:09:50PM +0000, Arun.Ramadoss@...rochip.com wrote:
> > > +#define
> > > P_MIRROR_CTRL REG_PORT_MRI_MIRROR_CTRL
> > > +
> > > +#define S_MIRROR_CTRL REG_SW_MRI_CTRL_0
> >
> > Small comment: if P_MIRROR_CTRL and S_MIRROR_CTRL are expected to be
> > at
> > the same register offset for all switch families, why is there a
> > macro
> > behind a macro for their addresses?
>
> ksz8795 and ksz9477 have different address/register for the
> Mirror_ctrl. To make it common for the both, P_MIRROR_CTRL is defined
> in ksz8795_reg.h and ksz9477_reg.h file.
> I just carried forward to ksz_reg.h.
So if P_MIRROR_CTRL has different values for ksz9477 and ksz8795, how
exactly do you plan to mask that difference away through the C preprocessor
at the level of ksz_reg.h included by ksz_common.c, depending on which
switch driver calls ksz_port_mirror_add()?
This can't work, you need to provide the offset of P_MIRROR_CTRL as
argument to the common function. What am I missing?
Powered by blists - more mailing lists