From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36BDCC4332F for ; Wed, 27 Oct 2021 18:12:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E16861040 for ; Wed, 27 Oct 2021 18:12:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238342AbhJ0SOf (ORCPT ); Wed, 27 Oct 2021 14:14:35 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:42010 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236579AbhJ0SOc (ORCPT ); Wed, 27 Oct 2021 14:14:32 -0400 From: bage@linutronix.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1635358325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rNVQc9ygjD1LlmMAQOwIyecjzMr/zGo9tbfPABSVDO0=; b=jT+DLQOCFfWo5qDjQSU8H5mgQNBmduDxWrB901xqKkYxLXtwZzLP9O2R6lEV/jxuGAPt57 /etuuItLpAFtr26J+tixmjWlpUArLlcmMc3L0Td9CKUJS5N1qOAGfAahvKu5yCfhcBMSs0 DuEkwZcwEUN/G+b1I8XCXkBKGMb9yfFAQ9HxW298nXtRcctJufawmtmxWUc1EVbPvDkAs5 CuaLG2ZgHtnC6KGOeHmzIurd/KCJ5Y7CI9vQvLdWX0cHd+wiN6NLKo9JtTi2v/4iK5yC23 f6ngW0L+7GhFbjwjjCd4d66MtQ/EpR6MSKFwwEDZ0AWjuh2y8ykGZO1WsMkyoA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1635358325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rNVQc9ygjD1LlmMAQOwIyecjzMr/zGo9tbfPABSVDO0=; b=IvVjDmecs2LV+ytOSQh6D1l9Ffm+5WdpZdDprhdr3k5Ufmo93/UYqq9EG/qu+MKXLk73or lmlDWZ+sk57zlSCQ== To: Michal Kubecek Cc: netdev@vger.kernel.org, Bastian Germann Subject: [PATCH ethtool 2/2] netlink: settings: Drop port filter for MDI-X Date: Wed, 27 Oct 2021 20:11:40 +0200 Message-Id: <20211027181140.46971-3-bage@linutronix.de> In-Reply-To: <20211027181140.46971-1-bage@linutronix.de> References: <20211027181140.46971-1-bage@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Bastian Germann 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 --- 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