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: <20c0ed0f-712d-46d4-8a49-e92835f47f9e@lunn.ch>
Date: Mon, 28 Oct 2024 13:15:42 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Florian Fainelli <f.fainelli@...il.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Vladimir Oltean <olteanv@...il.com>,
	Woojung Huh <woojung.huh@...rochip.com>,
	Arun Ramadoss <arun.ramadoss@...rochip.com>,
	Conor Dooley <conor+dt@...nel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
	Rob Herring <robh+dt@...nel.org>, kernel@...gutronix.de,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	UNGLinuxDriver@...rochip.com,
	"Russell King (Oracle)" <linux@...linux.org.uk>,
	devicetree@...r.kernel.org
Subject: Re: [PATCH net-next v1 5/5] net: dsa: microchip: add support for
 side MDIO interface in LAN937x

> +static const u8 lan9370_phy_addr[] = {
> +	[0] = 2, /* Port 1, T1 AFE0 */
> +	[1] = 3, /* Port 2, T1 AFE1 */
> +	[2] = 5, /* Port 3, T1 AFE3 */
> +	[3] = 6, /* Port 4, T1 AFE4 */
> +	[4] = U8_MAX, /* Port 5, RGMII 2 */
> +};

I think it would be good to add a #define for U8_MAX which gives a
hint at its meaning.


> +	for (i = 0; i < dev->info->port_cnt; i++) {
> +		if (phy_addr_map[i] == U8_MAX)
> +			dev->phy_addr_map[i] = phy_addr_map[i];
> +		else
> +			dev->phy_addr_map[i] = phy_addr_map[i] + offset;
> +	}

My first guess was that U8_MAX means the PHY is external, so could be
on any address depending on strapping. Looking at this code, i'm not
sure it does actually mean that.


    Andrew

---
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ