summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-04-27 14:09:10 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-04-27 16:54:58 +0100
commit43bf63e854b17b279f83d3f78110f3282d4c035f (patch)
tree8767a19bef25c0bd6c8d974114c0ea43da8b06a6
parent8c9419fb2fda6c784624d6acdcdbc336dd7d6270 (diff)
net: phylink: add debug for phylink_major_config()
Now that we have a more complexity in phylink_major_config(), augment the debugging so we can see what's going on there. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/phy/phylink.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 39c4b8e29fae..fd57dc3f1bcb 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -179,6 +179,24 @@ static const char *phylink_an_mode_str(unsigned int mode)
return mode < ARRAY_SIZE(modestr) ? modestr[mode] : "unknown";
}
+static const char *phylink_pcs_mode_str(unsigned int mode)
+{
+ if (!mode)
+ return "none";
+
+ if (mode & PHYLINK_PCS_NEG_OUTBAND)
+ return "outband";
+
+ if (mode & PHYLINK_PCS_NEG_INBAND) {
+ if (mode & PHYLINK_PCS_NEG_ENABLED)
+ return "inband/an-enabled";
+ else
+ return "inband/an-disabled";
+ }
+
+ return "unknown";
+}
+
static unsigned int phylink_interface_signal_rate(phy_interface_t interface)
{
switch (interface) {
@@ -1162,7 +1180,9 @@ static void phylink_major_config(struct phylink *pl, bool restart,
unsigned int neg_mode;
int err;
- phylink_dbg(pl, "major config %s\n", phy_modes(state->interface));
+ phylink_dbg(pl, "major config, requested %s/%s\n",
+ phylink_an_mode_str(pl->req_link_an_mode),
+ phy_modes(state->interface));
pl->pcs_neg_mode = phylink_pcs_neg_mode(pl->req_link_an_mode,
state->interface,
@@ -1185,6 +1205,11 @@ static void phylink_major_config(struct phylink *pl, bool restart,
*/
pl->act_link_an_mode = phylink_choose_act_link_an_mode(pl);
+ phylink_dbg(pl, "major config, active %s/%s/%s\n",
+ phylink_an_mode_str(pl->act_link_an_mode),
+ phylink_pcs_mode_str(pl->pcs_neg_mode),
+ phy_modes(state->interface));
+
phylink_pcs_poll_stop(pl);
if (pl->mac_ops->mac_prepare) {