Skip to content

Commit

Permalink
net: dpaa2-mac: populate supported_interfaces member
Browse files Browse the repository at this point in the history
Populate the phy interface mode bitmap for the Freescale DPAA2 driver
with interfaces modes supported by the MAC.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Russell King authored and David S. Miller committed Nov 18, 2021
1 parent 2228380 commit 15d0b14
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,30 @@ int dpaa2_mac_connect(struct dpaa2_mac *mac)
return err;
}

memset(&mac->phylink_config, 0, sizeof(mac->phylink_config));
mac->phylink_config.dev = &net_dev->dev;
mac->phylink_config.type = PHYLINK_NETDEV;

/* We support the current interface mode, and if we have a PCS
* similar interface modes that do not require the PLLs to be
* reconfigured.
*/
__set_bit(mac->if_mode, mac->phylink_config.supported_interfaces);
if (mac->pcs) {
switch (mac->if_mode) {
case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_SGMII:
__set_bit(PHY_INTERFACE_MODE_1000BASEX,
mac->phylink_config.supported_interfaces);
__set_bit(PHY_INTERFACE_MODE_SGMII,
mac->phylink_config.supported_interfaces);
break;

default:
break;
}
}

phylink = phylink_create(&mac->phylink_config,
dpmac_node, mac->if_mode,
&dpaa2_mac_phylink_ops);
Expand Down

0 comments on commit 15d0b14

Please sign in to comment.