RE: [PATCH net-next v2 5/9] net: ethernet: oa_tc6: Adding vendor specific MMS
From: Selvamani Rajagopal
Date: Tue May 12 2026 - 00:57:52 EST
[..]
>
> > -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.
Hopefully this is ok, unless you want to remove initializing with -EOPNOTSUPP and add the check you mentioned.
>
> Andrew