lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJN1KkzYOYKuFqo4Ew0sURwNTso0op3MWWpGmmgoqRP_sHeXxg@mail.gmail.com>
Date: Fri, 23 Aug 2024 10:46:44 +0200
From: Paweł Dembicki <paweldembicki@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, Heiner Kallweit <hkallweit1@...il.com>, 
	Russell King <linux@...linux.org.uk>, "David S. Miller" <davem@...emloft.net>, 
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: phy: vitesse: implement MDI-X configuration
 in vsc73xx

czw., 22 sie 2024 o 17:58 Andrew Lunn <andrew@...n.ch> napisał(a):
>
> > +static int vsc73xx_mdix_set(struct phy_device *phydev, u8 mdix)
> > +{
> > +     int ret;
> > +     u16 val;
> > +
> > +     val = phy_read(phydev, MII_VSC73XX_PHY_BYPASS_CTRL);
> > +
> > +     switch (mdix) {
> > +     case ETH_TP_MDI:
> > +             val |= MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS |
> > +                    MII_VSC73XX_PBC_PAIR_SWAP_DIS |
> > +                    MII_VSC73XX_PBC_POL_INV_DIS;
> > +             break;
> > +     case ETH_TP_MDI_X:
> > +             /* When MDI-X auto configuration is disabled, is possible
> > +              * to force only MDI mode. Let's use autoconfig for forced
> > +              * MDIX mode.
> > +              */
> > +     default:
> > +             val &= ~(MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS |
>
> This could be a little bit more readable if rather than default: you
> used case ETH_TP_MDI_AUTO: . Then after this code, add a real default:
> which returns -EINVAL,
>

How should I handle ETH_TP_MDI_INVALID? Should I do it like in
marvell.c or rockchip.c, or leave it as the default?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ