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] [day] [month] [year] [list]
Message-ID: <282f56e2-8acd-4298-bd48-bf036f74362f@engleder-embedded.com>
Date: Tue, 4 Feb 2025 21:26:56 +0100
From: Gerhard Engleder <gerhard@...leder-embedded.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: andrew@...n.ch, hkallweit1@...il.com, davem@...emloft.net,
 edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
 netdev@...r.kernel.org
Subject: Re: [PATCH net-next v4 3/7] net: phy: micrel: Add loopback support

On 03.02.25 20:54, Russell King (Oracle) wrote:
> On Mon, Feb 03, 2025 at 08:10:53PM +0100, Gerhard Engleder wrote:
>> +static int ksz9031_set_loopback(struct phy_device *phydev, bool enable,
>> +				int speed)
>> +{
>> +	u16 ctl = BMCR_LOOPBACK;
>> +	int ret, val;
>> +
>> +	if (!enable)
>> +		return genphy_loopback(phydev, enable, 0);
>> +
>> +	if (speed == SPEED_10 || speed == SPEED_100 || speed == SPEED_1000)
>> +		phydev->speed = speed;
>> +	else if (speed)
>> +		return -EINVAL;
>> +	phydev->duplex = DUPLEX_FULL;
>> +
>> +	ctl |= mii_bmcr_encode_fixed(phydev->speed, phydev->duplex);
>> +
>> +	phy_modify(phydev, MII_BMCR, ~0, ctl);
> 
> Why do you use phy_modify() here rather than phy_write() which is
> effectively what this is.

I copied that from genphy_loopback(). You are right, phy_modify() makes
no sense with mask 0xffff. I will change it.

Thanks!

Gerhard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ