RE: [PATCH net-next v2 6/6] net: dsa: microchip: ksz9477: make switch MAC address configurable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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.





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux