Skip to content

Commit 544435c

Browse files
colin-foster-in-advantagedavem330
authored andcommitted
net: dsa: felix: allow configurable phylink_mac_config
If a user of the Felix driver has a port running in SGMII / QSGMII mode, it will need to utilize phylink_mac_config(). Add this configurability. Signed-off-by: Colin Foster <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3821fd0 commit 544435c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

drivers/net/dsa/ocelot/felix.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,17 @@ static void felix_phylink_get_caps(struct dsa_switch *ds, int port,
10561056
config->supported_interfaces);
10571057
}
10581058

1059+
static void felix_phylink_mac_config(struct dsa_switch *ds, int port,
1060+
unsigned int mode,
1061+
const struct phylink_link_state *state)
1062+
{
1063+
struct ocelot *ocelot = ds->priv;
1064+
struct felix *felix = ocelot_to_felix(ocelot);
1065+
1066+
if (felix->info->phylink_mac_config)
1067+
felix->info->phylink_mac_config(ocelot, port, mode, state);
1068+
}
1069+
10591070
static struct phylink_pcs *felix_phylink_mac_select_pcs(struct dsa_switch *ds,
10601071
int port,
10611072
phy_interface_t iface)
@@ -2088,6 +2099,7 @@ const struct dsa_switch_ops felix_switch_ops = {
20882099
.get_sset_count = felix_get_sset_count,
20892100
.get_ts_info = felix_get_ts_info,
20902101
.phylink_get_caps = felix_phylink_get_caps,
2102+
.phylink_mac_config = felix_phylink_mac_config,
20912103
.phylink_mac_select_pcs = felix_phylink_mac_select_pcs,
20922104
.phylink_mac_link_down = felix_phylink_mac_link_down,
20932105
.phylink_mac_link_up = felix_phylink_mac_link_up,

drivers/net/dsa/ocelot/felix.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ struct felix_info {
5858
void (*tas_guard_bands_update)(struct ocelot *ocelot, int port);
5959
void (*port_sched_speed_set)(struct ocelot *ocelot, int port,
6060
u32 speed);
61+
void (*phylink_mac_config)(struct ocelot *ocelot, int port,
62+
unsigned int mode,
63+
const struct phylink_link_state *state);
6164
};
6265

6366
/* Methods for initializing the hardware resources specific to a tagging

0 commit comments

Comments
 (0)