Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3295289rdb; Thu, 16 Nov 2023 06:02:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJolFqsH2GNbqmczwFWXGrkugwAbBb3TAvNDspv9W6vmtRq8S3dUhJXsfW1pgqu4E8kk2a X-Received: by 2002:a17:90b:1650:b0:280:fc4a:cbca with SMTP id il16-20020a17090b165000b00280fc4acbcamr2685156pjb.5.1700143340439; Thu, 16 Nov 2023 06:02:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700143340; cv=none; d=google.com; s=arc-20160816; b=Vk8PiO2ioe4rwzEVUlIlxi8UfuaHgVxRLR+OaWlXi1NiNAQxlVI5qpDh+5FIZ2tUHh 2NqIedPKG2P1YCGgCHTMq2TEnRlY8Y23dBvEt3dEPbxVWQap6dyCd2SdpbjBZB6FemPz RO641hUQkaPskLCAIPXCqYtowmEY1V8KOYKz0kdT5r9Ije6yohfE4kxnH1qgqiZNTJKV pi42DcanSV6Epeyi3Q+O/WPmAqGWx4srWyiqKJh2jpcgszHejUqz0Y5Kp7JlQ9lPQrer SobRsmfVaOzWc2UWR957S3O7hxQMET9WzAYCdMPOUTkFKrkiG/bkbQORBtSS26UdRLC8 rGKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=m+Kjez/OBWgjbzrVAxSpudxqYu2NdZR8Bv+C+qH5eZ8=; fh=Pq7utEzs3KbaBDGtrjfUXzjEIBPT1l1o0fhVtCU5Oyc=; b=Dwql8S70wAiqw+DpPIOrVju1X5Fgo0M5jR57AooCGrG8naV4AcF7JCfdgipBl866ES EH/n7MhDuq2ypBOLQFaDf6FjXnBZUZkm2nSXu5G51SMDGFfvEHSu1g3T1cdUKKQVtOpd an5JgNMW2O+IhZmAmyk7PUhiAyHhyfGfFJie+XdG+QVYWX17BeQkFt8XkcxOYnVLgFEz 6+y5JzQpXU7KLEUULzzokdC8WGvow9twrjLL8c3jMoXZV/Kdf0uWCAl1Gj5K8+IAGspa 91zJ9yRahCdahW9Yvlx0ysb0bf60JdtZOV2G+owDq62BTf4wm14xm3UpVeKzM7tpDWD9 QBlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QJ44GfTe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id oo5-20020a17090b1c8500b0028018c82e52si2259813pjb.183.2023.11.16.06.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 06:02:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QJ44GfTe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5A10E8213F2A; Thu, 16 Nov 2023 06:02:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345309AbjKPOCJ (ORCPT + 99 others); Thu, 16 Nov 2023 09:02:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345287AbjKPOCC (ORCPT ); Thu, 16 Nov 2023 09:02:02 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF5F12F; Thu, 16 Nov 2023 06:01:58 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4FD2B20011; Thu, 16 Nov 2023 14:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700143317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m+Kjez/OBWgjbzrVAxSpudxqYu2NdZR8Bv+C+qH5eZ8=; b=QJ44GfTeiDc+kuPwExXXQzqDTa/zRCiFpLgCOuWrXuNGPMchFQVuOA41c0QCcivJ/35GfJ nzyPubQR0R+MthigSQJSplVXTZJAsflJoxR3fETcNHwFY7GwX+CuCmiKstLDb0FWqZJCBn iFYNj9Kg7czmvYALjkkX+ZnC1r0xVdtgMN2+PihfAOWcB1bsqSpFq4mrgJzjSp1DVICy+6 3ifVVCql7UoN2LwAVGNgCz1gnePDJPzxMqKrjXcIdilUVofufiVmJi2/FvUseLMlzjN6ZQ vUuZV5Yp7J6s6ePj6LpU2VkBXj4JVfDoir3E5ReVsJMLspk7/xxOnaGJ5HXTmQ== From: Kory Maincent Date: Thu, 16 Nov 2023 15:01:34 +0100 Subject: [PATCH net-next 2/9] ethtool: Expand Ethernet Power Equipment with PoE alongside PoDL MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231116-feature_poe-v1-2-be48044bf249@bootlin.com> References: <20231116-feature_poe-v1-0-be48044bf249@bootlin.com> In-Reply-To: <20231116-feature_poe-v1-0-be48044bf249@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Luis Chamberlain , Russ Weight , Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, Kory Maincent X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 06:02:15 -0800 (PST) In the current PSE interface for Ethernet Power Equipment, support is limited to PoDL. This patch extends the interface to accommodate the objects specified in IEEE 802.3-2022 145.2 for Power sourcing Equipment (PSE). The following objects are now supported and considered mandatory: - IEEE 802.3-2022 30.9.1.1.5 aPSEPowerDetectionStatus - IEEE 802.3-2022 30.9.1.1.2 aPSEAdminState - IEEE 802.3-2022 30.9.1.2.1 aPSEAdminControl To avoid confusion between "PoDL PSE" and "PSE", which have similar names but distinct values, we have followed the suggestion of Oleksij Rempel to maintain separate naming schemes for each. You can find more details in the discussion thread here: https://lore.kernel.org/netdev/20230912110637.GI780075@pengutronix.de/ Signed-off-by: Kory Maincent --- include/linux/pse-pd/pse.h | 9 ++++++++ include/uapi/linux/ethtool.h | 43 ++++++++++++++++++++++++++++++++++++ include/uapi/linux/ethtool_netlink.h | 3 +++ 3 files changed, 55 insertions(+) diff --git a/include/linux/pse-pd/pse.h b/include/linux/pse-pd/pse.h index 199cf4ae3cf2..25490d0c682d 100644 --- a/include/linux/pse-pd/pse.h +++ b/include/linux/pse-pd/pse.h @@ -17,9 +17,12 @@ struct pse_controller_dev; * * @podl_admin_control: set PoDL PSE admin control as described in * IEEE 802.3-2018 30.15.1.2.1 acPoDLPSEAdminControl + * @admin_control: set PSE admin control as described in + * IEEE 802.3-2022 30.9.1.2.1 acPSEAdminControl */ struct pse_control_config { enum ethtool_podl_pse_admin_state podl_admin_control; + enum ethtool_pse_admin_state admin_control; }; /** @@ -29,10 +32,16 @@ struct pse_control_config { * functions. IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState * @podl_pw_status: power detection status of the PoDL PSE. * IEEE 802.3-2018 30.15.1.1.3 aPoDLPSEPowerDetectionStatus: + * @admin_state: operational state of the PSE + * functions. IEEE 802.3-2022 30.9.1.1.2 aPSEAdminState + * @pw_status: power detection status of the PSE. + * IEEE 802.3-2022 30.9.1.1.5 aPSEPowerDetectionStatus: */ struct pse_control_status { enum ethtool_podl_pse_admin_state podl_admin_state; enum ethtool_podl_pse_pw_d_status podl_pw_status; + enum ethtool_pse_admin_state admin_state; + enum ethtool_pse_pw_d_status pw_status; }; /** diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index f7fba0dc87e5..eaf7f7ff41f1 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -752,6 +752,49 @@ enum ethtool_module_power_mode { ETHTOOL_MODULE_POWER_MODE_HIGH, }; +/** + * enum ethtool_pse_admin_state - operational state of the PoDL PSE + * functions. IEEE 802.3-2022 30.9.1.1.2 aPSEAdminState + * @ETHTOOL_PSE_ADMIN_STATE_UNKNOWN: state of PSE functions is unknown + * @ETHTOOL_PSE_ADMIN_STATE_DISABLED: PSE functions are disabled + * @ETHTOOL_PSE_ADMIN_STATE_ENABLED: PSE functions are enabled + */ +enum ethtool_pse_admin_state { + ETHTOOL_PSE_ADMIN_STATE_UNKNOWN = 1, + ETHTOOL_PSE_ADMIN_STATE_DISABLED, + ETHTOOL_PSE_ADMIN_STATE_ENABLED, +}; + +/** + * enum ethtool_pse_pw_d_status - power detection status of the PSE. + * IEEE 802.3-2022 30.9.1.1.3 aPoDLPSEPowerDetectionStatus: + * @ETHTOOL_PSE_PW_D_STATUS_UNKNOWN: PSE status is unknown + * @ETHTOOL_PSE_PW_D_STATUS_DISABLED: "The enumeration “disabled” + * indicates that the PSE State diagram is in the state DISABLED." + * @ETHTOOL_PSE_PW_D_STATUS_SEARCHING: "The enumeration “searching” + * indicates the PSE State diagram is in a state other than those + * listed." + * @ETHTOOL_PSE_PW_D_STATUS_DELIVERING: "The enumeration + * “deliveringPower” indicates that the PSE State diagram is in the + * state POWER_ON." + * @ETHTOOL_PSE_PW_D_STATUS_TEST: "The enumeration “test” indicates that + * the PSE State diagram is in the state TEST_MODE." + * @ETHTOOL_PSE_PW_D_STATUS_FAULT: "The enumeration “fault” indicates that + * the PSE State diagram is in the state TEST_ERROR." + * @ETHTOOL_PSE_PW_D_STATUS_OTHERFAULT: "The enumeration “otherFault” + * indicates that the PSE State diagram is in the state IDLE due to + * the variable error_condition = true." + */ +enum ethtool_pse_pw_d_status { + ETHTOOL_PSE_PW_D_STATUS_UNKNOWN = 1, + ETHTOOL_PSE_PW_D_STATUS_DISABLED, + ETHTOOL_PSE_PW_D_STATUS_SEARCHING, + ETHTOOL_PSE_PW_D_STATUS_DELIVERING, + ETHTOOL_PSE_PW_D_STATUS_TEST, + ETHTOOL_PSE_PW_D_STATUS_FAULT, + ETHTOOL_PSE_PW_D_STATUS_OTHERFAULT, +}; + /** * enum ethtool_podl_pse_admin_state - operational state of the PoDL PSE * functions. IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h index 73e2c10dc2cc..2a27f37c71f7 100644 --- a/include/uapi/linux/ethtool_netlink.h +++ b/include/uapi/linux/ethtool_netlink.h @@ -895,6 +895,9 @@ enum { ETHTOOL_A_PODL_PSE_ADMIN_STATE, /* u32 */ ETHTOOL_A_PODL_PSE_ADMIN_CONTROL, /* u32 */ ETHTOOL_A_PODL_PSE_PW_D_STATUS, /* u32 */ + ETHTOOL_A_PSE_ADMIN_STATE, /* u32 */ + ETHTOOL_A_PSE_ADMIN_CONTROL, /* u32 */ + ETHTOOL_A_PSE_PW_D_STATUS, /* u32 */ /* add new constants above here */ __ETHTOOL_A_PSE_CNT, -- 2.25.1