netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bage@linutronix.de
To: Michal Kubecek <mkubecek@suse.cz>
Cc: netdev@vger.kernel.org, Bastian Germann <bage@linutronix.de>
Subject: [PATCH ethtool 2/2] netlink: settings: Drop port filter for MDI-X
Date: Wed, 27 Oct 2021 20:11:40 +0200	[thread overview]
Message-ID: <20211027181140.46971-3-bage@linutronix.de> (raw)
In-Reply-To: <20211027181140.46971-1-bage@linutronix.de>

From: Bastian Germann <bage@linutronix.de>

The port == PORT_TP condition on printing linkinfo's MDI-X field prevents
ethtool from printing that info even if it is present and valid, e.g. with
the port being MII and still having that info.

Signed-off-by: Bastian Germann <bage@linutronix.de>
---
 netlink/settings.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/netlink/settings.c b/netlink/settings.c
index c4f5d61..4da251b 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -560,8 +560,7 @@ int linkinfo_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 		print_enum(names_transceiver, ARRAY_SIZE(names_transceiver),
 			   val, "Transceiver");
 	}
-	if (tb[ETHTOOL_A_LINKINFO_TP_MDIX] && tb[ETHTOOL_A_LINKINFO_TP_MDIX_CTRL] &&
-	    port == PORT_TP) {
+	if (tb[ETHTOOL_A_LINKINFO_TP_MDIX] && tb[ETHTOOL_A_LINKINFO_TP_MDIX_CTRL]) {
 		uint8_t mdix = mnl_attr_get_u8(tb[ETHTOOL_A_LINKINFO_TP_MDIX]);
 		uint8_t mdix_ctrl =
 			mnl_attr_get_u8(tb[ETHTOOL_A_LINKINFO_TP_MDIX_CTRL]);
-- 
2.30.2


  parent reply	other threads:[~2021-10-27 18:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 18:11 [PATCH ethtool 0/2] Fix condition for showing MDI-X status bage
2021-10-27 18:11 ` [PATCH ethtool 1/2] netlink: settings: Correct duplicate condition bage
2021-10-27 20:13   ` Michal Kubecek
2021-10-27 18:11 ` bage [this message]
2021-10-27 19:59   ` [PATCH ethtool 2/2] netlink: settings: Drop port filter for MDI-X Michal Kubecek
2021-10-27 20:17     ` Michal Kubecek
2021-10-28 15:30 ` [PATCH ethtool 0/2] Fix condition for showing MDI-X status Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211027181140.46971-3-bage@linutronix.de \
    --to=bage@linutronix.de \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).