Re: [PATCH net-next v2 8/9] onsemi: s2500: Add driver support for TS2500 MAC-PHY

From: Andrew Lunn

Date: Mon May 18 2026 - 08:11:54 EST


On Mon, May 18, 2026 at 04:03:38AM +0000, Selvamani Rajagopal wrote:
>
>
>
> > > +static int s2500_hwtstamp_get(struct net_device *ndev,
> > > + struct kernel_hwtstamp_config *cfg)
> > > +{
> > > + struct s2500_info *priv = netdev_priv(ndev);
> > > +
> > > + if (!priv->ptp_clock) {
> > > + cfg->tx_type = 0;
> > > + cfg->rx_filter = 0;
> > > + } else {
> > > + oa_tc6_hwtstamp_get(priv->tc6, cfg);
> > > + }
> > > + return 0;
> >
> > What is actually specific to the s2500 here? Your aim should be to put
> > everything you can into the core.
>
> I agree on this and the next comment as well. Nothing really vendor specific.
>
> Question is,
> 1) Should we add the PTP code in oa_tc6.c? This PTP code add 200+ lines. My preference is to add a new file oa_tc6_ptp.c under the directory where oa_tc6.c resides.

oa_tc6_ptp.c is good. Maybe create a directory oa_tc6 and move the
code into there. Especially if you need to add a local header which is
shared by oa_tc6.c and oa_tc6_ptp.c, but is not needed by the drivers.

> 2) If we are adding a new file, should it be under same CONFIG_OA_TC6 or add a new CONFIG_OA_TC6_HW_TIMESTAMP or something similar?

I would not bother with a new symbol. It adds build testing complexity
having to build with and without it, to test the stubs are correct
etc.

Andrew