Skip to content

Commit 860a9be

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: dsa: xrs700x: provide own phylink MAC operations
Convert xrs700x to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c. We need to provide stubs for the mac_link_down() and mac_config() methods which are mandatory. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/r/E1rwfu8-007531-TG@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a3c363d commit 860a9be

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

drivers/net/dsa/xrs700x/xrs700x.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,25 @@ static void xrs700x_phylink_get_caps(struct dsa_switch *ds, int port,
466466
}
467467
}
468468

469-
static void xrs700x_mac_link_up(struct dsa_switch *ds, int port,
470-
unsigned int mode, phy_interface_t interface,
469+
static void xrs700x_mac_config(struct phylink_config *config, unsigned int mode,
470+
const struct phylink_link_state *state)
471+
{
472+
}
473+
474+
static void xrs700x_mac_link_down(struct phylink_config *config,
475+
unsigned int mode, phy_interface_t interface)
476+
{
477+
}
478+
479+
static void xrs700x_mac_link_up(struct phylink_config *config,
471480
struct phy_device *phydev,
481+
unsigned int mode, phy_interface_t interface,
472482
int speed, int duplex,
473483
bool tx_pause, bool rx_pause)
474484
{
475-
struct xrs700x *priv = ds->priv;
485+
struct dsa_port *dp = dsa_phylink_to_port(config);
486+
struct xrs700x *priv = dp->ds->priv;
487+
int port = dp->index;
476488
unsigned int val;
477489

478490
switch (speed) {
@@ -699,13 +711,18 @@ static int xrs700x_hsr_leave(struct dsa_switch *ds, int port,
699711
return 0;
700712
}
701713

714+
static const struct phylink_mac_ops xrs700x_phylink_mac_ops = {
715+
.mac_config = xrs700x_mac_config,
716+
.mac_link_down = xrs700x_mac_link_down,
717+
.mac_link_up = xrs700x_mac_link_up,
718+
};
719+
702720
static const struct dsa_switch_ops xrs700x_ops = {
703721
.get_tag_protocol = xrs700x_get_tag_protocol,
704722
.setup = xrs700x_setup,
705723
.teardown = xrs700x_teardown,
706724
.port_stp_state_set = xrs700x_port_stp_state_set,
707725
.phylink_get_caps = xrs700x_phylink_get_caps,
708-
.phylink_mac_link_up = xrs700x_mac_link_up,
709726
.get_strings = xrs700x_get_strings,
710727
.get_sset_count = xrs700x_get_sset_count,
711728
.get_ethtool_stats = xrs700x_get_ethtool_stats,

0 commit comments

Comments
 (0)