net: axienet: populate supported_interfaces member
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 16 Nov 2021 09:55:22 +0000 (09:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Nov 2021 11:17:44 +0000 (11:17 +0000)
Populate the phy_interface_t bitmap for the Xilinx axienet driver with
interfaces modes supported by the MAC.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index 9b068b8..8a0a43d 100644 (file)
@@ -2105,6 +2105,14 @@ static int axienet_probe(struct platform_device *pdev)
        lp->phylink_config.dev = &ndev->dev;
        lp->phylink_config.type = PHYLINK_NETDEV;
 
+       __set_bit(lp->phy_mode, lp->phylink_config.supported_interfaces);
+       if (lp->switch_x_sgmii) {
+               __set_bit(PHY_INTERFACE_MODE_1000BASEX,
+                         lp->phylink_config.supported_interfaces);
+               __set_bit(PHY_INTERFACE_MODE_SGMII,
+                         lp->phylink_config.supported_interfaces);
+       }
+
        lp->phylink = phylink_create(&lp->phylink_config, pdev->dev.fwnode,
                                     lp->phy_mode,
                                     &axienet_phylink_ops);