Skip to contentSkip to conversation

ethtool.c: Report transceiver correctly

PATCH In review Florian Fainelli 2 participants 2 messages Apr 4, 2020 – May 13, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethtool.c: Report transceiver correctly

After the transition to the extended link settings ioctl API, the kernel, up until commit 9b3004953503462a4fab31b85e44ae446d48f0bd ("ethtool: drop get_settings and set_settings callbacks") would support the legacy link settings operation and report the transceiver type. After this commit, we lost that information although the Linux PHY library populates it correctly even with get_link_ksettings() method.

Ensure that we report the transceiver type correctly for such cases.

Fixes 33133abf3b77 ("ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls")
---
 ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ethtool.c +1 -1
index 1b4e08b6e60f..21748fc909eb 100644
@@ -2497,8 +2497,8 @@ do_ioctl_glinksettings(struct cmd_context *ctx)
 	if (link_usettings == NULL)
 		return NULL;
 
-	/* keep transceiver 0 */
 	memcpy(&link_usettings->base, &ecmd.req, sizeof(link_usettings->base));
+	link_usettings->deprecated.transceiver = ecmd.req.transceiver;
 
 	/* copy link mode bitmaps */
 	u32_offs = 0;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 11 lines · Florian Fainelli

After the transition to the extended link settings ioctl API, the kernel, up until commit 9b3004953503462a4fab31b85e44ae446d48f0bd ("ethtool: drop get_settings and set_settings callbacks") would support the legacy link settings operation and report the transceiver type. After this commit, we lost that information although the Linux PHY library populates it correctly even with get_link_ksettings() method.

Ensure that we report the transceiver type correctly for such cases.

Fixes 33133abf3b77 ("ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls")

Thanks (belatedly) -- queued for next release!

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.