Message ID | 20240227-feature_poe-v5-12-28f0aa48246d@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-83422-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2757903dyb; Tue, 27 Feb 2024 07:09:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU9HtNeygPyZ6KsLfS7cpcTEOn4wtP7JiF9kG9RMdociHMq7pWNUbqsKXk2LdCowYBsjwORI+Ma35fQ5VuTOOXPEx1CyA== X-Google-Smtp-Source: AGHT+IEE8J2oAsOCM4Ngl27Fz8za6CybzEYFFezjogWq+TpQGRtk4uMM4Vm88KCtjrwPSiheVaFA X-Received: by 2002:a05:6a20:6f8e:b0:1a0:e89c:38e4 with SMTP id gv14-20020a056a206f8e00b001a0e89c38e4mr2442577pzb.48.1709046576860; Tue, 27 Feb 2024 07:09:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709046576; cv=pass; d=google.com; s=arc-20160816; b=Ixt5DfqxA5MBaugTA9nhgBupIsN+XFdBcxX+ibK8Um6ALZytyzTBA2EXkc+nwmlIQW NvkSA+R6DZ2XgeEk6onCjWuY6lfAYEYph7FG1TVXKU7Inw3zIYxOayxI1cXwlfiV9AcY 3DKT4wnivQpkcBJqkYX+frjo9tn8Vq1oK/CqqFGFNfcRfTa24PgXZDHkPtyg9ZxW7GAU iY7JxVaDKNxylb/3G09S5V/ErWUI2d7BZ0Kz0xTNF+I1wvlURN6R/j+K/vOmN74gXqx8 cUcoyyUP55reW5TG2F+Gx2/MamzG/ECNfsm+tEnzHWkqHaeTfvlamn6tgfkS9Rj3pMFD EIpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=1KVffl/2BFXKFyEfZdLterxW4Hdi592VhExrmfm2rMc=; fh=7S+YztZcCxZKIOm2mMOwIzm96FjMcKQ7LjGMKaNLlnQ=; b=p+KMf8s285HMgE0lxNRGmpdI6PvdSHZDUmRWvymlIlG9pBdvv7kL1ruQp1qq7I/gvR V9jrtwraPB4wXYl6xhPbXIfzure3RSBXY69B85GubISAkSwATkbq4aEmxUta0EnKvn9f IDiCja1XmHpik++yVRlR8OANhuCsFR6ICb4wcV1iQjPRVwo61YjcAeVGEOgSgrfz69GU rr7XOjoDjX6t+iYiPGVbgwWQigsiJfvk/iZ/dj2SkgDCs7+4xH7C0ny7UGKVhocdsxkj 2d1XwTMb63N3Cb+SIc0andpbShcjwOYeZJNYlKJG9lcVEkEU4QoY2Z9xFj0+5lDWZZ5T ex4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=SPoJ3vKj; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-83422-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83422-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q22-20020a638c56000000b005cfb2c44526si5642595pgn.862.2024.02.27.07.09.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 07:09:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83422-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=SPoJ3vKj; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-83422-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83422-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 19BF7B2756E for <ouuuleilei@gmail.com>; Tue, 27 Feb 2024 14:47:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E44714F96A; Tue, 27 Feb 2024 14:43:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="SPoJ3vKj" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5A6214A4FC; Tue, 27 Feb 2024 14:43:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709045005; cv=none; b=V82OrKQH7ttF8UYSXlnA2lMTA+1TLQ3Jf428Im/gO1nX98DUnanq2nHiuU4rSco7HhDdqnropjtgv46zQI1nctwtE3Khsy2GAVKz85pF+0Qp5lxFYqIAqJshLD6mG1A0xLh9v4yb/9bTxmYBqm6OWdnkRqok3LwDkQYW2wWkyz0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709045005; c=relaxed/simple; bh=n1A97LQ0bbRroHE/OmYnJJny49H5xiu5Cp8qf+fD+ss=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ogckmf8jFpL3op4Dk4fNjOh4I8yEgVSgVm5UNpc8UvGcVHGtYKtHWHEHIl5+n5sSK81JkeRe+2jrt8SLd6aWgCigvkM14Of3KUFyq6pm14b9wCjAlce4cBNZ17zilNhq+AUnJGZzGW0ZQN+tKNPFqmwKlRTaquBEeB3ECbPAcKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=SPoJ3vKj; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id D1FDA20016; Tue, 27 Feb 2024 14:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709045001; 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=1KVffl/2BFXKFyEfZdLterxW4Hdi592VhExrmfm2rMc=; b=SPoJ3vKjPFlrwjYHN3EgUtaotWaxeUgnTqBIsCQhRLif1la0FF5EhFqoeztfs8zUMGOP5K I/gdXqUvwfgP4YTKikw1KZ6+dbKX+gfC8sMeOv0R4AiwA+lLEyqo768eY60K78W7hxfmki hC/BdwBimnfY7TynfQOemhbOc8J1hSSKg9FeWoffjHVL06XUNB5wd3IODjucuFw8ia1sF4 ki4xzG/HBQzUXhhvFxTOmMjMd0yNoihWREThYLhnXmwrT8hAvwnqKgDBV0Ucl4DECa8yu4 myIpYwsZuDfzNxkbP7LRpxYOc5FWj+OfjhckOYMJ2kSBG58bz9eFKCQWJLnnQg== From: Kory Maincent <kory.maincent@bootlin.com> Date: Tue, 27 Feb 2024 15:42:54 +0100 Subject: [PATCH net-next v5 12/17] net: pse-pd: Add support for setup_pi_matrix callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240227-feature_poe-v5-12-28f0aa48246d@bootlin.com> References: <20240227-feature_poe-v5-0-28f0aa48246d@bootlin.com> In-Reply-To: <20240227-feature_poe-v5-0-28f0aa48246d@bootlin.com> To: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jonathan Corbet <corbet@lwn.net>, Luis Chamberlain <mcgrof@kernel.org>, Russ Weight <russ.weight@linux.dev>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Oleksij Rempel <o.rempel@pengutronix.de>, Mark Brown <broonie@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, Dent Project <dentproject@linuxfoundation.org>, Kory Maincent <kory.maincent@bootlin.com> X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792065223564512145 X-GMAIL-MSGID: 1792065223564512145 |
Series |
net: Add support for Power over Ethernet (PoE)
|
|
Commit Message
Köry Maincent
Feb. 27, 2024, 2:42 p.m. UTC
Implement setup_pi_matrix callback to configure the PSE PI matrix. This
functionality is invoked before registering the PSE and following the core
parsing of the pse_pis devicetree subnode.
This patch is sponsored by Dent Project <dentproject@linuxfoundation.org>.
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
Changes in v3:
- New patch
---
drivers/net/pse-pd/pse_core.c | 6 ++++++
include/linux/pse-pd/pse.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c index 9124eb3d6492..a2eb9a424668 100644 --- a/drivers/net/pse-pd/pse_core.c +++ b/drivers/net/pse-pd/pse_core.c @@ -178,6 +178,12 @@ int pse_controller_register(struct pse_controller_dev *pcdev) if (ret) return ret; + if (pcdev->ops->setup_pi_matrix) { + ret = pcdev->ops->setup_pi_matrix(pcdev); + if (ret) + return ret; + } + mutex_lock(&pse_list_mutex); list_add(&pcdev->list, &pse_controller_list); mutex_unlock(&pse_list_mutex); diff --git a/include/linux/pse-pd/pse.h b/include/linux/pse-pd/pse.h index 01b3b9adfe2a..522115cc6cef 100644 --- a/include/linux/pse-pd/pse.h +++ b/include/linux/pse-pd/pse.h @@ -49,6 +49,7 @@ struct pse_control_status { * * @ethtool_get_status: get PSE control status for ethtool interface * @ethtool_set_config: set PSE control configuration over ethtool interface + * @setup_pi_matrix: setup PI matrix of the PSE controller */ struct pse_controller_ops { int (*ethtool_get_status)(struct pse_controller_dev *pcdev, @@ -57,6 +58,7 @@ struct pse_controller_ops { int (*ethtool_set_config)(struct pse_controller_dev *pcdev, unsigned long id, struct netlink_ext_ack *extack, const struct pse_control_config *config); + int (*setup_pi_matrix)(struct pse_controller_dev *pcdev); }; struct module;