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: <20201202211134.GM2324545@lunn.ch>
Date:   Wed, 2 Dec 2020 22:11:34 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Grant Edwards <grant.b.edwards@...il.com>
Cc:     netdev@...r.kernel.org
Subject: Re: net: macb: fail when there's no PHY

> > So it will access the MDIO bus of the PHY that is attached to the
> > MAC.
> 
> If that's the case, wouldn't the ioctl() calls "just work" even when
> only the fixed-phy mdio bus and fake PHY are declared in the device
> tree?

The fixed-link PHY is connected to the MAC. So the IOCTL calls will be
made to the fixed-link fake MDIO bus.

> OK, I think I've got a vague idea of how that would be done.
> 
> [When it comes to device-tree stuff, I've learned that "a vague idea"
> is pretty much the best I can manage. Nothing ever works the way I
> think it's going to the first time, but with enough guesses I usually
> get there.]

There are plenty of examples to follow.

e.g. arch/arm/boot/dts/vf610-twr.dts

&fec0 {
        phy-mode = "rmii";
        phy-handle = <&ethphy0>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_fec0>;
        status = "okay";

        mdio {
                #address-cells = <1>;
                #size-cells = <0>;

                ethphy0: ethernet-phy@0 {
                        reg = <0>;
                };

                ethphy1: ethernet-phy@1 {
                        reg = <1>;
                };
        };
};

So one Ethernet controller with an MDIO bus with two PHYs on it. It
has a phy-handle pointing it is own PHY.

&fec1 {
        phy-mode = "rmii";
        phy-handle = <&ethphy1>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_fec1>;
        status = "okay";
};

A second Ethernet, with phy-handle pointing to the second PHY on the
other controllers MDIO bus.

	    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ