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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20d00e72-f342-4dac-ba4c-1a66c8b25ef6@lunn.ch>
Date: Mon, 9 Dec 2024 18:03:09 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Tarun Alle <Tarun.Alle@...rochip.com>
Cc: arun.ramadoss@...rochip.com, UNGLinuxDriver@...rochip.com,
	hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
	edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] net: phy: microchip_t1: Autonegotiaion
 support for LAN887x T1 phy

> -	if (phydev->master_slave_set == MASTER_SLAVE_CFG_MASTER_FORCE ||
> -	    phydev->master_slave_set == MASTER_SLAVE_CFG_MASTER_PREFERRED){
> -		static const struct lan887x_regwr_map phy_cfg[] = {
> -			{MDIO_MMD_PMAPMD, LAN887X_AFE_PORT_TESTBUS_CTRL4, 0x00b8},
> -			{MDIO_MMD_PMAPMD, LAN887X_TX_AMPLT_1000T1_REG, 0x0038},
> -			{MDIO_MMD_VEND1,  LAN887X_INIT_COEFF_DFE1_100, 0x000f},
> -		};
> -
> -		ret = lan887x_phy_config(phydev, phy_cfg, ARRAY_SIZE(phy_cfg));
> +	if (phydev->autoneg == AUTONEG_DISABLE) {
> +		if (phydev->master_slave_set == MASTER_SLAVE_CFG_MASTER_FORCE ||
> +		    phydev->master_slave_set ==
> +		    MASTER_SLAVE_CFG_MASTER_PREFERRED) {
> +			ret = lan887x_phy_config(phydev, phy_comm_cfg,
> +						 ARRAY_SIZE(phy_comm_cfg));
> +		} else {
> +			static const struct lan887x_regwr_map phy_cfg[] = {
> +				{MDIO_MMD_PMAPMD, LAN887X_AFE_PORT_TESTBUS_CTRL4,
> +				 0x0038},
> +				{MDIO_MMD_VEND1, LAN887X_INIT_COEFF_DFE1_100,
> +				 0x0014},
> +			};
> +
> +			ret = lan887x_phy_config(phydev, phy_cfg,
> +						 ARRAY_SIZE(phy_cfg));
> +		}

It might be better to pull this apart into two helper functions? That
would avoid most of the not so nice wrapping.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ