Re: [PATCH net-next v2 5/9] net: ethernet: oa_tc6: Adding vendor specific MMS
From: Andrew Lunn
Date: Tue May 12 2026 - 10:38:49 EST
On Tue, May 12, 2026 at 04:57:01AM +0000, Selvamani Rajagopal wrote:
> [..]
>
> >
> > > -static int oa_tc6_get_phy_c45_mms(int devnum)
> > > +static int oa_tc6_get_phy_c45_mms(struct oa_tc6 *tc6, int devnum)
> > > {
> > > switch (devnum) {
> > > case MDIO_MMD_PCS:
> > > @@ -456,6 +470,8 @@ static int oa_tc6_get_phy_c45_mms(int devnum)
> > > return OA_TC6_PHY_C45_AUTO_NEG_MMS5;
> > > case MDIO_MMD_POWER_UNIT:
> > > return OA_TC6_PHY_C45_POWER_UNIT_MMS6;
> > > + case MDIO_MMD_VEND1:
> > > + return tc6->vend1_mms;
> >
> > MMS 0 would be against the specification. So i would do
> >
> > case MDIO_MMD_VEND1:
> > if (!tc6->vend1_mms)
> > return -EOPNOTSUPP;
> > return tc6->vend1_mms;
> >
> > That should catch uses of VEND1 without first defining the mapping to
> > the MMS.
>
>
> vend1_mms is initialized to -EOPNOTSUPP in oa_tc6_init. So, it won't be 0 by default.
Ah, missed that. So this is O.K.
Andrew