From patchwork Fri Sep 17 14:40:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12502325 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD820C433F5 for ; Fri, 17 Sep 2021 14:41:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA72B60F5B for ; Fri, 17 Sep 2021 14:41:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343738AbhIQOm1 (ORCPT ); Fri, 17 Sep 2021 10:42:27 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:55029 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343695AbhIQOmY (ORCPT ); Fri, 17 Sep 2021 10:42:24 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id CCF495C021E; Fri, 17 Sep 2021 10:41:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 17 Sep 2021 10:41:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=4pki6aSXrAcSkuV+lNxXgLLin8sdbB2exH8Az+G4kiQ=; b=iLlLHub8 L2Es/Kiy57KAC4+FdPF6Z/XExBwUzA3Hw5MLgv+GXHYj+dfHX+4Ld0o3K9L60g18 yZZe9Johr0b0qcc4/ZAR1EXM5ihfaZAhfXmw/+n33UdaaPLMJBU3yLn6532KWYnd WSUtBUOT6PTuhPaLsG5zcC7w3T/HSPSm1xLsiIsdyEJa7qGsdWP+BbhRkLMDZ+6h wOFkgXvKINxmKNxM0Zy5MZy1MAuM8P7bwXnFEd4q30YbK4Tb/WohwYG9XdgJKpeG pmlxcXg/B66Un0zgw+RLVMCHzLvGGTO3u2OkUnIt1IgV68KofVYxQA8Yq9MC0rNx LXLO99yJiT3gBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 10:40:59 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, vadimp@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next 1/7] cmis: Fix CLEI code parsing Date: Fri, 17 Sep 2021 17:40:37 +0300 Message-Id: <20210917144043.566049-2-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210917144043.566049-1-idosch@idosch.org> References: <20210917144043.566049-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel In CMIS, unlike SFF-8636, there is no presence indication for the CLEI code (Common Language Equipment Identification) field. The field is always present, but might not be supported. In which case, "a value of all ASCII 20h (spaces) shall be entered". Therefore, remove the erroneous check which seems to be influenced from SFF-8636 and only print the string if it is supported and has a non-zero length. Signed-off-by: Ido Schimmel --- cmis.c | 8 +++++--- cmis.h | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmis.c b/cmis.c index 1a91e798e4b8..2a48c1a1d56a 100644 --- a/cmis.c +++ b/cmis.c @@ -307,6 +307,8 @@ static void cmis_show_link_len(const __u8 *id) */ static void cmis_show_vendor_info(const __u8 *id) { + const char *clei = (const char *)(id + CMIS_CLEI_START_OFFSET); + sff_show_ascii(id, CMIS_VENDOR_NAME_START_OFFSET, CMIS_VENDOR_NAME_END_OFFSET, "Vendor name"); cmis_show_oui(id); @@ -319,9 +321,9 @@ static void cmis_show_vendor_info(const __u8 *id) sff_show_ascii(id, CMIS_DATE_YEAR_OFFSET, CMIS_DATE_VENDOR_LOT_OFFSET + 1, "Date code"); - if (id[CMIS_CLEI_PRESENT_BYTE] & CMIS_CLEI_PRESENT_MASK) - sff_show_ascii(id, CMIS_CLEI_START_OFFSET, - CMIS_CLEI_END_OFFSET, "CLEI code"); + if (strlen(clei) && strcmp(clei, CMIS_CLEI_BLANK)) + sff_show_ascii(id, CMIS_CLEI_START_OFFSET, CMIS_CLEI_END_OFFSET, + "CLEI code"); } void qsfp_dd_show_all(const __u8 *id) diff --git a/cmis.h b/cmis.h index 78ee1495bc33..d365252baa48 100644 --- a/cmis.h +++ b/cmis.h @@ -34,10 +34,9 @@ #define CMIS_DATE_VENDOR_LOT_OFFSET 0xBC /* CLEI Code (Page 0) */ -#define CMIS_CLEI_PRESENT_BYTE 0x02 -#define CMIS_CLEI_PRESENT_MASK 0x20 #define CMIS_CLEI_START_OFFSET 0xBE #define CMIS_CLEI_END_OFFSET 0xC7 +#define CMIS_CLEI_BLANK " " /* Cable assembly length */ #define CMIS_CBL_ASM_LEN_OFFSET 0xCA From patchwork Fri Sep 17 14:40:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12502327 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CF19C433EF for ; Fri, 17 Sep 2021 14:41:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72EEC60F5B for ; Fri, 17 Sep 2021 14:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343788AbhIQOm3 (ORCPT ); Fri, 17 Sep 2021 10:42:29 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:35703 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343728AbhIQOm1 (ORCPT ); Fri, 17 Sep 2021 10:42:27 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 64F815C01F5; Fri, 17 Sep 2021 10:41:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 17 Sep 2021 10:41:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=t5jgAt+413n9aYO/w9Wb0ZHOhtGzq0WhoM1r2TKvIJY=; b=tkbnuFD9 72ehj57/f2uCjtqsf6NS5rSK0I43LATxBOIFL98gMvDL7S4qXFEILh3OGlwu/+Ti 7t3FYM9H96sTP9wtffkGrQvD/+zN4nfjyHZ6xfu1phBIMity29lfJva0GguNleyG rq7FB0gE5ZZjzW4k4Bnwl2DhlNHuCW57DBrOXP/DiItKJJBAhAraWTa615QmxNMg AGuwD9nhoOcVcAwWUl+7bGjp1koxgSvpaJOUmFT550+GyizHQwWNSn/eOgcN6bl9 6pZy/5xCu21wC/HS3jZxxCK2hvZ/K19dIzeefqmc+Fh0sB1/iXa0hPYiGGhwf1l7 0I8g285JfWiMTg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 10:41:02 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, vadimp@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next 2/7] cmis: Fix wrong define name Date: Fri, 17 Sep 2021 17:40:38 +0300 Message-Id: <20210917144043.566049-3-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210917144043.566049-1-idosch@idosch.org> References: <20210917144043.566049-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel Offset 0x10 in the Lower Memory stores the "VccMonVoltage". Signed-off-by: Ido Schimmel --- cmis.c | 2 +- cmis.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmis.c b/cmis.c index 2a48c1a1d56a..7fa7da87a92a 100644 --- a/cmis.c +++ b/cmis.c @@ -271,7 +271,7 @@ static void cmis_show_mod_lvl_monitors(const __u8 *id) PRINT_TEMP("Module temperature", OFFSET_TO_TEMP(CMIS_CURR_TEMP_OFFSET)); PRINT_VCC("Module voltage", - OFFSET_TO_U16(CMIS_CURR_CURR_OFFSET)); + OFFSET_TO_U16(CMIS_CURR_VCC_OFFSET)); } static void cmis_show_link_len_from_page(const __u8 *page_one_data) diff --git a/cmis.h b/cmis.h index d365252baa48..5fb2efe08265 100644 --- a/cmis.h +++ b/cmis.h @@ -11,7 +11,7 @@ /* Module-Level Monitors (Page 0) */ #define CMIS_CURR_TEMP_OFFSET 0x0E -#define CMIS_CURR_CURR_OFFSET 0x10 +#define CMIS_CURR_VCC_OFFSET 0x10 #define CMIS_CTOR_OFFSET 0xCB From patchwork Fri Sep 17 14:40:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12502329 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17DEDC433F5 for ; Fri, 17 Sep 2021 14:41:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 021C460F5B for ; Fri, 17 Sep 2021 14:41:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233355AbhIQOme (ORCPT ); Fri, 17 Sep 2021 10:42:34 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:50889 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244786AbhIQOm3 (ORCPT ); Fri, 17 Sep 2021 10:42:29 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 22FEF5C0039; Fri, 17 Sep 2021 10:41:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 17 Sep 2021 10:41:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=DBEJzUDOaGSBgbiqu7unRQ7qCihUgz9H///DUtD+Bwo=; b=O+zhk0Ei sOO9JAyVtK0lm3hsn5w5fFMtnygxUnMOh+COHIrZq+qo0k6cxwopCZIvv3uD0A/+ Hzzrk2MKqvo6rc4Gr1jndCZkKzOg8NNF/NO+tblqx4tNP5pVUsJ1+mhB9DMkOK4E hA5xf2S+SR04jFjZOen+95WOSnPE8igiWlxnmYnXMgeBpZ5+iAaRXq8VZhu5BbWZ 8T4RVxCx5V0oPyPQ7r7+fQ7+fm3ItXvIbIPpFEb3Y1apjbf6PfFRG0sjPTUlFm8d VhPFBl8h5CRLujSdNPXiJ3DONgkB1h+0MUsdTxbwjdBRkwbfvgN/oe1h/bwo5VE8 gdN9Vkran65iaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 10:41:04 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, vadimp@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next 3/7] cmis: Correct comment Date: Fri, 17 Sep 2021 17:40:39 +0300 Message-Id: <20210917144043.566049-4-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210917144043.566049-1-idosch@idosch.org> References: <20210917144043.566049-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel The file is concerned with CMIS support, not QSFP-DD which is the physical form factor. Signed-off-by: Ido Schimmel --- cmis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmis.c b/cmis.c index 7fa7da87a92a..b85250a96a95 100644 --- a/cmis.c +++ b/cmis.c @@ -1,7 +1,7 @@ /** * Description: * - * This module adds QSFP-DD support to ethtool. The changes are similar to + * This module adds CMIS support to ethtool. The changes are similar to * the ones already existing in qsfp.c, but customized to use the memory * addresses and logic as defined in the specification's document. * From patchwork Fri Sep 17 14:40:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12502331 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEEC5C433F5 for ; Fri, 17 Sep 2021 14:41:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8F4660F5B for ; Fri, 17 Sep 2021 14:41:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343819AbhIQOmk (ORCPT ); Fri, 17 Sep 2021 10:42:40 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:52523 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343539AbhIQOmc (ORCPT ); Fri, 17 Sep 2021 10:42:32 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 80C265C01CF; Fri, 17 Sep 2021 10:41:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 17 Sep 2021 10:41:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=JJIeBqEx0vh8sMu7xDyH85/7PXTPW1rsvs7aQcd3Gy8=; b=ETb1kRqU Llyav/3S09cetcpR+NXnMbrwqABLR1rmacv6rataUQbjsBaR6r93vzQqXCksj6+9 rdbgQV5kiaBxpTiyVkDeHN7Me/4LyLBkfKRBiMyc1TQhB2zhh8/Nv8sPgeCL+3fG cRaJkvg+dCdGfBnM+imo/2G4Ng0yMGdwxZ9es09+PW+FTIc3C4m8M7bw5aldM5kr tyTNi9au7HI6GVAHuPvIwgjTrofpnwZ5kah18Mx7NsffsXYCTXrTGzXNlxKBJ94c BFj7ky41Jc1k7eJLP3diyU9m2idAo0P8PgBwG9LAQDZ5yVNX+fHZ9eW7FYKO73I0 yUYMXnzcjM41hw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgepudenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 10:41:07 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, vadimp@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next 4/7] sff-8636: Remove incorrect comment Date: Fri, 17 Sep 2021 17:40:40 +0300 Message-Id: <20210917144043.566049-5-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210917144043.566049-1-idosch@idosch.org> References: <20210917144043.566049-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel The comment was copied from SFF-8472 (i.e., sfpdiag.c) where the diagnostic page is at I2C address 0x51. SFF-8636 only uses I2C address 0x50. Signed-off-by: Ido Schimmel --- qsfp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qsfp.c b/qsfp.c index e84226bc1554..263cf188377d 100644 --- a/qsfp.c +++ b/qsfp.c @@ -64,7 +64,7 @@ static struct sff8636_aw_flags { const char *str; /* Human-readable string, null at the end */ - int offset; /* A2-relative address offset */ + int offset; __u8 value; /* Alarm is on if (offset & value) != 0. */ } sff8636_aw_flags[] = { { "Laser bias current high alarm (Chan 1)", From patchwork Fri Sep 17 14:40:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12502333 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27D1EC433F5 for ; Fri, 17 Sep 2021 14:41:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B439603E5 for ; Fri, 17 Sep 2021 14:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343820AbhIQOml (ORCPT ); Fri, 17 Sep 2021 10:42:41 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:33821 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243755AbhIQOmf (ORCPT ); Fri, 17 Sep 2021 10:42:35 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id F05E85C003E; Fri, 17 Sep 2021 10:41:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 17 Sep 2021 10:41:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=+NgSVV9rm0SMMf7ijt/zYMOjC5lAdnDUsSNmgCsSwGY=; b=gD0vP0fu 0wObVa0SY1m00aHN1LsQ5ZR50ydEiRi3EZB9ul57JBpKgWCA47PnJ6MjvNN9IHjn Kfz1VYG4TrQUUqrRbnR/kIQ1O730bdvcb6TF21ViJLXzZv0byyBfVQZoqVTUEYPo c7RBDwrJ9Oqw7Rv22Dg2HXPW3/ZfhoD4CpmQd/HRi7yktpChoRXjvsYBp/FoSyIg dOz8iZ+XOCHPKSbDPBNLH8Gybh0iTLKaKajREQ5KLmbh1VjfjpjyMUFAvMxcO7jj iXTeg7Z+aq/wwLNfWPZ8BYeSrGTbZKA6ieotlB88hOnmxj0f0rTQGdzz8TBCcsDO QeNqZo6efqNHnA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgepudenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 10:41:10 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, vadimp@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next 5/7] sff-8636: Fix incorrect function name Date: Fri, 17 Sep 2021 17:40:41 +0300 Message-Id: <20210917144043.566049-6-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210917144043.566049-1-idosch@idosch.org> References: <20210917144043.566049-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel The specification is called SFF-8636, not SFF-6836. Rename the function accordingly. Signed-off-by: Ido Schimmel --- qsfp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qsfp.c b/qsfp.c index 263cf188377d..3401db84352d 100644 --- a/qsfp.c +++ b/qsfp.c @@ -820,7 +820,7 @@ static void sff8636_show_dom(const __u8 *id, const __u8 *page_three, __u32 eepro } -static void sff6836_show_page_zero(const __u8 *id) +static void sff8636_show_page_zero(const __u8 *id) { sff8636_show_ext_identifier(id); sff8636_show_connector(id); @@ -866,7 +866,7 @@ void sff8636_show_all(const __u8 *id, __u32 eeprom_len) if ((id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP) || (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_PLUS) || (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP28)) { - sff6836_show_page_zero(id); + sff8636_show_page_zero(id); sff8636_show_dom(id, id + 3 * 0x80, eeprom_len); } } @@ -875,7 +875,7 @@ void sff8636_show_all_paged(const struct ethtool_module_eeprom *page_zero, const struct ethtool_module_eeprom *page_three) { sff8636_show_identifier(page_zero->data); - sff6836_show_page_zero(page_zero->data); + sff8636_show_page_zero(page_zero->data); if (page_three) sff8636_show_dom(page_zero->data, page_three->data - 0x80, ETH_MODULE_SFF_8636_MAX_LEN); From patchwork Fri Sep 17 14:40:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12502335 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F96C433EF for ; Fri, 17 Sep 2021 14:41:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FE96603E5 for ; Fri, 17 Sep 2021 14:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343828AbhIQOmp (ORCPT ); Fri, 17 Sep 2021 10:42:45 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:42967 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245668AbhIQOmh (ORCPT ); Fri, 17 Sep 2021 10:42:37 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 65C1B5C0054; Fri, 17 Sep 2021 10:41:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 17 Sep 2021 10:41:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=x4J8reGaSF8uDtTVxmggr85GwMO34kOnvq4DCaJfDv0=; b=wPHqZ2uz f6Si+JDm+dxvUnAQS9dQd6/3j40vyax3naw0N/Mfo3Fxmi1bV28pxn7l/3EKyzmD 4Ocr7FWari154iaftJXoJJuZcWdKPf/Ic5RLjsL3riQUQqTA9bK/pF/viQGpCWpz aPRo4xXKOkpJ/pYBoDfz64pTb276N0ny+JjiclyaYV7HdPisiUjZKkqGpKESvx2J cWNyaWMPggHVkyQfj1gwqsvcu80Hvr+B5jxw6oW177CPWnYN0VAI7k6qgtp89j3U /s/S+7IeRRzjQuEfzV86G1IciSS2GpE/Fl3RgBVYbh/mMVQaBO/4kap0wiJTjC/i /uKf917zTw5rCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 10:41:13 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, vadimp@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next 6/7] sff-8636: Convert if statement to switch-case Date: Fri, 17 Sep 2021 17:40:42 +0300 Message-Id: <20210917144043.566049-7-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210917144043.566049-1-idosch@idosch.org> References: <20210917144043.566049-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel The indentation is wrong and the statement can be more clearly represented using a switch-case statement. Convert it. Signed-off-by: Ido Schimmel --- qsfp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qsfp.c b/qsfp.c index 3401db84352d..d1464cb50fdc 100644 --- a/qsfp.c +++ b/qsfp.c @@ -863,11 +863,13 @@ void sff8636_show_all(const __u8 *id, __u32 eeprom_len) } sff8636_show_identifier(id); - if ((id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP) || - (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_PLUS) || - (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP28)) { + switch (id[SFF8636_ID_OFFSET]) { + case SFF8024_ID_QSFP: + case SFF8024_ID_QSFP_PLUS: + case SFF8024_ID_QSFP28: sff8636_show_page_zero(id); sff8636_show_dom(id, id + 3 * 0x80, eeprom_len); + break; } } From patchwork Fri Sep 17 14:40:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12502337 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 586FCC433F5 for ; Fri, 17 Sep 2021 14:41:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F3F760F5B for ; Fri, 17 Sep 2021 14:41:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243645AbhIQOmr (ORCPT ); Fri, 17 Sep 2021 10:42:47 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:55621 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243717AbhIQOmk (ORCPT ); Fri, 17 Sep 2021 10:42:40 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0742F5C01CF; Fri, 17 Sep 2021 10:41:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 17 Sep 2021 10:41:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=wMgHWGEFDtQMgyF9iJhX0MHEQhexcToVkFgOADVIAoA=; b=cxq6TmkN yDddZzupevmoBusnvJCFun+oHOrE1n+qG+jXyEQLwJaCWJX5T/Vm31N3gou4t4XS 9DXDXpv8w8570Dp8qsdK8LSIB7XhzMCTgwCMWQwhnPAok3vWt9oBW4hqFo011ILa xQpjU5TPqQFSzd8L5NevP1knrrXEM5PoIq5tzuqjMVrXaY0cVKKe23TrTwsJ6m6f YPTKEscOUso39HPm2sPefTKUCKN6sbxlm8uKVHsBwz4UHQll5ojT1D+77mvo1il3 7fei3YITVq/auMsudaFRDECGVc0wtpW9UvKE03r1+8Lr8HUOeIRKQEQ2pCFkA/Xf b6xGedslynwbMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 10:41:15 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, vadimp@nvidia.com, moshe@nvidia.com, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next 7/7] sff-8636: Remove extra blank lines Date: Fri, 17 Sep 2021 17:40:43 +0300 Message-Id: <20210917144043.566049-8-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210917144043.566049-1-idosch@idosch.org> References: <20210917144043.566049-1-idosch@idosch.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel Not needed, so remove them. Signed-off-by: Ido Schimmel --- qsfp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/qsfp.c b/qsfp.c index d1464cb50fdc..3f37f1036e96 100644 --- a/qsfp.c +++ b/qsfp.c @@ -738,7 +738,6 @@ static void sff8636_dom_parse(const __u8 *id, const __u8 *page_three, struct sff sd->scd[i].rx_power = OFFSET_TO_U16(rx_power_offset); sd->scd[i].tx_power = OFFSET_TO_U16(tx_power_offset); } - } static void sff8636_show_dom(const __u8 *id, const __u8 *page_three, __u32 eeprom_len) @@ -819,7 +818,6 @@ static void sff8636_show_dom(const __u8 *id, const __u8 *page_three, __u32 eepro } } - static void sff8636_show_page_zero(const __u8 *id) { sff8636_show_ext_identifier(id);