From patchwork Fri Oct 1 15:06:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12530819 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFDD7C433FE for ; Fri, 1 Oct 2021 15:06:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93F9F61139 for ; Fri, 1 Oct 2021 15:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354694AbhJAPIm (ORCPT ); Fri, 1 Oct 2021 11:08:42 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:41855 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354964AbhJAPIg (ORCPT ); Fri, 1 Oct 2021 11:08:36 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0361E5C0101; Fri, 1 Oct 2021 11:06:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 01 Oct 2021 11:06:51 -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=M8wYl+e+ESzswgsA5o2loHZs0TD9do/fA253uUv7uWI=; b=GbtKqTvE JbXnuq0He1zZ5jsYRWNhw8JxTfGUxLAE+UYbs7TJq6RKkYhlr6h2Ot4PB9IDALK8 r1hkFpnmArWtObUs8it/puPdDIz/HI4lbcEmlfD0xPoImbc9YX1UYV0oegMU9TFx /xpVRHRvs0Kr3qgCdz7e47XAjQER0G5ooNjQg8bAzTiuBbZQjvDxeblQoAXgrqHH x4e2nXoZWUFN3+Sta3FxC4VuABY9Nu0BNJpXEfsbyK3T4OoMSxiefpX8NkY/jpJA ewvuNZy+mI1d4Y3vljQBq/cGqcBjc1KryUdJ7CkWDo72koUsfwN+B27qe6+muGst ewSrNAscFlRb3w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekiedgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Oct 2021 11:06:49 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next v2 1/7] cmis: Fix CLEI code parsing Date: Fri, 1 Oct 2021 18:06:21 +0300 Message-Id: <20211001150627.1353209-2-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001150627.1353209-1-idosch@idosch.org> References: <20211001150627.1353209-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 | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmis.c b/cmis.c index 1a91e798e4b8..499355d0e024 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 (*clei && strncmp(clei, CMIS_CLEI_BLANK, CMIS_CLEI_LEN)) + 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..cfac08f42904 100644 --- a/cmis.h +++ b/cmis.h @@ -34,10 +34,10 @@ #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 " " +#define CMIS_CLEI_LEN 0x0A /* Cable assembly length */ #define CMIS_CBL_ASM_LEN_OFFSET 0xCA From patchwork Fri Oct 1 15:06:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12530823 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30B47C433FE for ; Fri, 1 Oct 2021 15:07:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C42E61139 for ; Fri, 1 Oct 2021 15:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354978AbhJAPIp (ORCPT ); Fri, 1 Oct 2021 11:08:45 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:34597 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354883AbhJAPIh (ORCPT ); Fri, 1 Oct 2021 11:08:37 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D4F645C00FF; Fri, 1 Oct 2021 11:06:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 01 Oct 2021 11:06:52 -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=WCYu8x1gJNSS3ONEg0VlhSKpT5m5gUuOR2veIVDg0c0=; b=NskM7diM kK2JHcq1qcPOzDdlpLZmetk3qHO4beIjZ5yaJTnP9sYWkG9eToqIP82cZByZQFL1 XKpI7CKJym+fg0sKNGBPRlMD/jbwOZk1CXKfbm/UryT3dEi/dtQcGhJ5bycDIEsf 1mDL5NCMBEAuywLC0UaY9kXCx8xA5D23tCbR662coDfjESAhAccYjkV74yN5BSpB TltW61vmGIGCd+LbtrkRdVkT1JLwPVFOf74LOEN8RxGOfH5j0Pzylbupbs5M0n9X mazyybIg3CHL74v1+ljyPL6t2JA+UelgqG1ZVlyHLkv0nNUGaDyH1bipIA3M4bll zRHKVjkUN+6eVQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekiedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Oct 2021 11:06:51 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next v2 2/7] cmis: Fix wrong define name Date: Fri, 1 Oct 2021 18:06:22 +0300 Message-Id: <20211001150627.1353209-3-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001150627.1353209-1-idosch@idosch.org> References: <20211001150627.1353209-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 499355d0e024..408db6f26c3b 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 cfac08f42904..e3012ccfdd79 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 Oct 1 15:06:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12530827 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35AF0C433F5 for ; Fri, 1 Oct 2021 15:07:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B195611C0 for ; Fri, 1 Oct 2021 15:07:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354920AbhJAPIt (ORCPT ); Fri, 1 Oct 2021 11:08:49 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:52505 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354928AbhJAPIj (ORCPT ); Fri, 1 Oct 2021 11:08:39 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 985BE5C010C; Fri, 1 Oct 2021 11:06:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 01 Oct 2021 11:06:54 -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=zLIS/hTj/HKHMWnSaxvMoogtTMk5af1V4BQ4ZGCD/9I=; b=diUTGukL mAjrCkTlW4oEIfec1MO4x9go6WJQqtpRlU5GGnKnNyixGDrM9+f095Bo6dgLn3G2 UYfbNZHRhqX0UCVpMtzBgRrIfMnjJMPX6wVfCxiSJCdDwaFN78/b9dHOuZsUOyt7 J+iW+7vPE44a81szQhFz/HXPIxx/ZxeGyPathRDhd+xlcgxVfw3iznjbuAhHoiQc XhVdnQjWJ61JDb1ue9nbTowZN1Y26ACQvUo8bWXRScSt0rPt5t/QuQy0gY6UxMe0 3VifL42YaMfhGF7hmrFdQTsU2gAQAIxER28arNYEh9Q4RiorQwFZ6Ux/IUuTGQCS C6lY1WeeTH5iGw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekiedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Oct 2021 11:06:53 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next v2 3/7] cmis: Correct comment Date: Fri, 1 Oct 2021 18:06:23 +0300 Message-Id: <20211001150627.1353209-4-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001150627.1353209-1-idosch@idosch.org> References: <20211001150627.1353209-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 408db6f26c3b..591cc72953b7 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 Oct 1 15:06:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12530829 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6384EC4332F for ; Fri, 1 Oct 2021 15:07:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 494B76187D for ; Fri, 1 Oct 2021 15:07:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355019AbhJAPIu (ORCPT ); Fri, 1 Oct 2021 11:08:50 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:44647 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354744AbhJAPIk (ORCPT ); Fri, 1 Oct 2021 11:08:40 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5EB5F5C00F2; Fri, 1 Oct 2021 11:06:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 01 Oct 2021 11:06:56 -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=jlCtk4ok rfaLhb/v6jYW4d4axQfiXgAcV8zGGa2EDHJMFpsTmRRndhFxVzoolI00dybgnCzB vus4leTJk0rOXtAlfIuVM/urnL29DVW78HzDo77M3spdbzvIKH53/cD2scIgcYp1 F2HGmLylQFvqql3GwmCphaIzXareLd+Yt8jCgHiKkleAzFoc2Qrhwl7xDwDCKj2T KwxJ1aMJPddzg1ENQ9DfhtqbPw8eln2gpoHNjpcWMQAVxEm5C0iO4Tkx5blViMN0 86PaQLHUzAXTnR9v0EU9/qc3WqMUMvl+K5tqEj+VDV40FkRwFY72s1jWGXYzDOFz 4EYHWG6/6VXIGw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekiedgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Oct 2021 11:06:54 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next v2 4/7] sff-8636: Remove incorrect comment Date: Fri, 1 Oct 2021 18:06:24 +0300 Message-Id: <20211001150627.1353209-5-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001150627.1353209-1-idosch@idosch.org> References: <20211001150627.1353209-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 Oct 1 15:06:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12530833 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E43D5C433EF for ; Fri, 1 Oct 2021 15:07:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1A3961A38 for ; Fri, 1 Oct 2021 15:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355043AbhJAPIx (ORCPT ); Fri, 1 Oct 2021 11:08:53 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42687 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354962AbhJAPIm (ORCPT ); Fri, 1 Oct 2021 11:08:42 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E7DCB5C0105; Fri, 1 Oct 2021 11:06:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 01 Oct 2021 11:06:57 -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=HNY5nTi4 niBZdWq96zPpy2Jca9Bvvi8GJAzy4ZxvOKs85dLmabI+/n6bok3IuthGS3kuPhlo lfNhO1x55UiJy7li22GEvSCjQfSOc+hkQafvepd45TuiPVb7hXv0IXq0K/TWKV+1 P3UkllpLamwZcDr84nFe7tYmu6iLiyK+uQ0a56q30QMkjfnS5jEfFmHu+oMrbv8U MPFBdhibXaJaRkPmPxT6UL4VXmT/bb8bVOsXA+PqzCRFdm5Ly4F95tC/pwrcb52I 7StRbgm70LrifBV8/lWBxh8JpHOJEHeBAnv5wueJsLMK9jqpjXyEIBQAbcmU4sZT jNYK08/ICdbIAg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekiedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgepudenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Oct 2021 11:06:56 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next v2 5/7] sff-8636: Fix incorrect function name Date: Fri, 1 Oct 2021 18:06:25 +0300 Message-Id: <20211001150627.1353209-6-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001150627.1353209-1-idosch@idosch.org> References: <20211001150627.1353209-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 Oct 1 15:06:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12530835 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63DE7C433F5 for ; Fri, 1 Oct 2021 15:07:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B7AA61A38 for ; Fri, 1 Oct 2021 15:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355055AbhJAPIz (ORCPT ); Fri, 1 Oct 2021 11:08:55 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:39597 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354973AbhJAPIn (ORCPT ); Fri, 1 Oct 2021 11:08:43 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 50D2A5C00FF; Fri, 1 Oct 2021 11:06:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 01 Oct 2021 11:06:59 -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=BM7hBnQU 1bkWOV+nELVOtugqbOJ7LFathOcS4GN2YdEW0eGTAWSP3d51a451MWhnPH24hy0X CIIIKfLZAzO2kWBFapf2/lUdzdx2U2wPlIaVzDT5u3wqq+RD719S460n9bhCSdhq uwu2IqD/yhRFnaYSnc1VJcMDHFdk4IhusQXE9wPLi13TFlxBOzUreicxxumzNjs9 33xvzBiWoj7IFi2cft1A55C4RpgXof0Mgr/dtaAN5cs/qQTaxWTQtEYrIGevyFzS GCgVlO0mpjiNaMhxnfNKIC5EiJUscLzO4kR1NrJ6N1tzkJxLzfqZzoPr6oqMdTqF x6dQ0ZKnzPbnHA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekiedgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgepudenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Oct 2021 11:06:58 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next v2 6/7] sff-8636: Convert if statement to switch-case Date: Fri, 1 Oct 2021 18:06:26 +0300 Message-Id: <20211001150627.1353209-7-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001150627.1353209-1-idosch@idosch.org> References: <20211001150627.1353209-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 Oct 1 15:06:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12530837 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 604BFC433F5 for ; Fri, 1 Oct 2021 15:07:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 468BB61A38 for ; Fri, 1 Oct 2021 15:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354755AbhJAPI7 (ORCPT ); Fri, 1 Oct 2021 11:08:59 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:44647 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354938AbhJAPIp (ORCPT ); Fri, 1 Oct 2021 11:08:45 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AAC3B5C0117; Fri, 1 Oct 2021 11:07:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 01 Oct 2021 11:07:00 -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=iUndApsK 23XBJ7WC3MmY5VG7VEnGyrinjmb2n4bxQv/3WiJVFmnVPD35l80QIg4g/Y2h13Yc 1ppJbFy544Om/rdqcewFZmBnxrI6lpb9bd6Tviy85UEnLlLs9ft7nwiv43EKF7DJ oc0Skpt3ix2CXcCQeeJQbnxT18M0THZfCOjHF0TmgSqwvLMEDXgC5H4kJVTC+4ya bdQO0uakkro3FVy/z7Deld4TCUHu+RzZ1LJGRjaoVektwJRCFZpUF8YMrVQumDab QZg31Et3Nx4opjZ8PyrYVSokp8evf3mud+lFSbulqEaOGRMMbJfCJFSFxqpY/eYu nFIf70e2oVqFJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekiedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepkfguohcuufgthhhimhhmvghluceoihguohhstghhsehiugho shgthhdrohhrgheqnecuggftrfgrthhtvghrnhepudetieevffffveelkeeljeffkefhke ehgfdtffethfelvdejgffghefgveejkefhnecuvehluhhsthgvrhfuihiivgepvdenucfr rghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Oct 2021 11:06:59 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, popadrian1996@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool-next v2 7/7] sff-8636: Remove extra blank lines Date: Fri, 1 Oct 2021 18:06:27 +0300 Message-Id: <20211001150627.1353209-8-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001150627.1353209-1-idosch@idosch.org> References: <20211001150627.1353209-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);