[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BYAPR11MB3558A296C1D1830F15AC6BEFEC3FA@BYAPR11MB3558.namprd11.prod.outlook.com>
Date: Fri, 21 Jul 2023 22:09:57 +0000
From: <Tristram.Ha@...rochip.com>
To: <o.rempel@...gutronix.de>
CC: <kernel@...gutronix.de>, <linux-kernel@...r.kernel.org>,
<netdev@...r.kernel.org>, <UNGLinuxDriver@...rochip.com>,
<Woojung.Huh@...rochip.com>, <andrew@...n.ch>, <linux@...linux.org.uk>,
<devicetree@...r.kernel.org>, <pabeni@...hat.com>, <kuba@...nel.org>,
<davem@...emloft.net>, <Arun.Ramadoss@...rochip.com>, <edumazet@...gle.com>,
<f.fainelli@...il.com>, <conor+dt@...nel.org>, <olteanv@...il.com>,
<krzysztof.kozlowski+dt@...aro.org>, <robh+dt@...nel.org>
Subject: RE: [PATCH net-next v2 6/6] net: dsa: microchip: ksz9477: make switch
MAC address configurable
> The switch MAC address is used for sending pause frames and for Wake on Magic
> Packet. So, make use of local-mac-address property in the switch node
> root and configure it in the HW.
>
> @@ -1211,6 +1211,14 @@ int ksz9477_setup(struct dsa_switch *ds)
> if (dev->wakeup_source)
> ksz_write8(dev, REG_SW_PME_CTRL, PME_ENABLE);
>
> + if (is_valid_ether_addr(dev->mac_addr)) {
> + int i;
> +
> + for (i = 0; i < ETH_ALEN; i++)
> + ksz_write8(dev, REG_SW_MAC_ADDR_0 + i,
> + dev->mac_addr[i]);
> + }
> +
> +
> + mac = of_get_property(dev->dev->of_node, "local-mac-address",
> + NULL);
> + if (mac)
> + memcpy(dev->mac_addr, mac, ETH_ALEN);
So the Magic Packet uses the same MAC address for all KSZ9477 switches
if local-mac-address is not defined. Is that practical in real operating
environment?
The DSA driver used to have an API to set the MAC address to the switch,
but it was removed because nobody used it.
Powered by blists - more mailing lists