netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ethtool.c: Report transceiver correctly
@ 2020-04-04  0:21 Florian Fainelli
  2020-05-13 19:57 ` John W. Linville
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2020-04-04  0:21 UTC (permalink / raw)
  To: netdev; +Cc: mkubecek, linville, davem, andrew, vivien.didelot,
	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")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ethtool.c b/ethtool.c
index 1b4e08b6e60f..21748fc909eb 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-13 20:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-04  0:21 [PATCH] ethtool.c: Report transceiver correctly Florian Fainelli
2020-05-13 19:57 ` John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).