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: <7d62064e-c303-4d74-b213-a29ce16dbb39@csgroup.eu>
Date: Wed, 28 Aug 2024 12:27:42 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>, davem@...emloft.net,
 Pantelis Antoniou <pantelis.antoniou@...il.com>, Andrew Lunn
 <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>,
 Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
 Russell King <linux@...linux.org.uk>, Florian Fainelli
 <f.fainelli@...il.com>, Heiner Kallweit <hkallweit1@...il.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 thomas.petazzoni@...tlin.com, Herve Codina <herve.codina@...tlin.com>,
 linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH net-next 5/6] net: ethernet: fs_enet: fcc: use macros for
 speed and duplex values



Le 28/08/2024 à 11:51, Maxime Chevallier a écrit :
> The PHY speed and duplex should be manipulated using the SPEED_XXX and
> DUPLEX_XXX macros available. Use it in the fcc, fec and scc MAC for fs_enet.
> 
> Signed-off-by: Maxime Chevallier <maxime.chevallier@...tlin.com>

Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>


> ---
>   drivers/net/ethernet/freescale/fs_enet/mac-fcc.c | 4 ++--
>   drivers/net/ethernet/freescale/fs_enet/mac-fec.c | 2 +-
>   drivers/net/ethernet/freescale/fs_enet/mac-scc.c | 2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c b/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
> index add062928d99..056909156b4f 100644
> --- a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
> +++ b/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
> @@ -361,7 +361,7 @@ static void restart(struct net_device *dev)
>   
>   	/* adjust to speed (for RMII mode) */
>   	if (fpi->use_rmii) {
> -		if (dev->phydev->speed == 100)
> +		if (dev->phydev->speed == SPEED_100)
>   			C8(fcccp, fcc_gfemr, 0x20);
>   		else
>   			S8(fcccp, fcc_gfemr, 0x20);
> @@ -387,7 +387,7 @@ static void restart(struct net_device *dev)
>   		S32(fccp, fcc_fpsmr, FCC_PSMR_RMII);
>   
>   	/* adjust to duplex mode */
> -	if (dev->phydev->duplex)
> +	if (dev->phydev->duplex == DUPLEX_FULL)
>   		S32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB);
>   	else
>   		C32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB);
> diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
> index f75acb3b358f..855ee9e3f042 100644
> --- a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
> +++ b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
> @@ -309,7 +309,7 @@ static void restart(struct net_device *dev)
>   	/*
>   	 * adjust to duplex mode
>   	 */
> -	if (dev->phydev->duplex) {
> +	if (dev->phydev->duplex == DUPLEX_FULL) {
>   		FC(fecp, r_cntrl, FEC_RCNTRL_DRT);
>   		FS(fecp, x_cntrl, FEC_TCNTRL_FDEN);	/* FD enable */
>   	} else {
> diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-scc.c b/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
> index 29ba0048396b..9e5e29312c27 100644
> --- a/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
> +++ b/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
> @@ -338,7 +338,7 @@ static void restart(struct net_device *dev)
>   	W16(sccp, scc_psmr, SCC_PSMR_ENCRC | SCC_PSMR_NIB22);
>   
>   	/* Set full duplex mode if needed */
> -	if (dev->phydev->duplex)
> +	if (dev->phydev->duplex == DUPLEX_FULL)
>   		S16(sccp, scc_psmr, SCC_PSMR_LPB | SCC_PSMR_FDE);
>   
>   	/* Restore multicast and promiscuous settings */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ