Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3355181lqp; Tue, 26 Mar 2024 07:08:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEjdovNY586U3hdC1mIxX/OPPLmFlkJLEGq3/0oElfr74Pv9Tkwmb+tcmRssgGryQUVTt45X5tdVdzC7y4VWcZ7dQZXxzGdKoJZQ2LKw== X-Google-Smtp-Source: AGHT+IFH+2yBPMP6/o1Qk87jxejztkvIdPEvt3BJJt/sihBZW8UD78YzXpFOn0nAdhFipZ17Cs01 X-Received: by 2002:a05:6a20:9187:b0:1a3:6364:bd10 with SMTP id v7-20020a056a20918700b001a36364bd10mr1176539pzd.49.1711462123967; Tue, 26 Mar 2024 07:08:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711462123; cv=pass; d=google.com; s=arc-20160816; b=HIsddC3+kZTKGSXhEKshVq7ktUqE03/+03NadssfsAFstFxJ9G3OBtN2ieckOvd6CA pwXCNXo7cgv72aPTumtrl/RPhA1BDwba28G/jm+zNEMtn8cy2/ZtSeeh/ycFord9SZe+ sw0fut035vkoNVS7Sw1wE2scEczv25fEulJLkJDZZhtIwN9UE/dDYoKi4zrbvobpIW+f 2dnORLyp7ptXFvsZWinzuFR0DoRi4h5QqYQCxmLaV0TDHFJIxs77zkbMFMGJPB5wM0/Z G51Uea5iz0NxEK45sEa65C8IKYqm8Qq/dbgyAV7NHdfliAbR05fOrZE01EskIBcWn2ar c9gA== 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=MbDRmYduAN77h42QpA8nZn2u553fvZh3kA4TeVc+KqY=; fh=7S+YztZcCxZKIOm2mMOwIzm96FjMcKQ7LjGMKaNLlnQ=; b=zOzfyf2SurL9HESBFfOB997Ah596Mm+2bexYXdzAkTznfGoMmVXyPXNKYCNviQod0d QAsoEO0TcwY4JbcnfzRTiq7Kyv2UazU9a6+lBTp3fcyAIhl68Kug3aHLlCInTCRoBjBu mRL/1Qr1MMc4ovmwcsYbPcgLPdo0FXQkQF3uOjpjsTG6xBh8erNTqdjvI7QBZ3RjtO61 y+rJSLFlpfuf1UtejQwmOz0JnoIwsaAhFrcvtDRv5S/Np9oTokB8sovV5cj9LzKlQmnl NFhsWZWjUPckcaH9z9cJEpFZ0B3/sUEFFnjL26vtXl+oQwS/nqauDHtxIDWAVhfmtOBj Hv+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="NGPKy/lX"; 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-119129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y11-20020a63494b000000b005be09b723b7si9616305pgk.636.2024.03.26.07.08.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 07:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="NGPKy/lX"; 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-119129-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119129-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E49B5302460 for ; Tue, 26 Mar 2024 14:08:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C8D112BF3C; Tue, 26 Mar 2024 14:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NGPKy/lX" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (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 3F3B0129A94; Tue, 26 Mar 2024 14:05:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711461906; cv=none; b=al8rSiSxRxZrr8/ZTnIzaUIHG0HUdCXlAk0noStHlg10IG/fma7JyxjiHB03j2AxOQvmdus07YE7j6G/nR7P3LU4CjvHriqMPexdsbp7lOySIhSY5aXuJ74lWMiuYbRZ85v/M5iUNIlS/uVVAeEdBWEbXBorN+c0s82wk9bDUXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711461906; c=relaxed/simple; bh=+rtiD1ToUIGXBWPFqwrNJw9MP3ELvUpMCh05kFr7RIQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UoBrC74sA/bm6SygIFNGsv0pvjlqN6E2x//DjKb1l/ni9/1rcMJNOLTsdFEdZObUHjQb7tZ6kkCe89WI2kXogLkGsHaaFj736D6NUoZAL+BLr/ZqE+p7j7yOtWAqGIjGhsEu7FauWh/WXMI92cIw//6b1elWMs3JKCY9aKf0qz8= 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=NGPKy/lX; arc=none smtp.client-ip=217.70.183.197 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 6882E1C001A; Tue, 26 Mar 2024 14:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1711461902; 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=MbDRmYduAN77h42QpA8nZn2u553fvZh3kA4TeVc+KqY=; b=NGPKy/lXlp0xNedE+I1Rra+azOo0XX3MQkcyUNJFYuQInYoGh13yI5Wx2WOiuPStyHtmUp pkP8Sk5ejTBIta5OBL5to9649XBdHEJRQ/KQ/Pm/edJV1XTMFqA4DIkMW9wXXWytYMY5t9 eTInFmcdhzY/1flDJc0+OF2MkuSFGDJQFr7fU1MEXKJYUcN0XOLPE7SMF8RKkuxhITFihj 0ad+d9V/6kGwFC7bnbZFjOTOEEIhHwr25f+5LEHnLWSZQrhWSht4EgcbPKzCyEdTz3xhL+ u/aOPfCRhorXVD66XyOGwWfNLgZKdVBE9bBMU0cS5K0vc9mX0QYEarbrPsWqaQ== From: Kory Maincent Date: Tue, 26 Mar 2024 15:04:49 +0100 Subject: [PATCH net-next v6 12/17] net: pse-pd: Add support for setup_pi_matrix callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240326-feature_poe-v6-12-c1011b6ea1cb@bootlin.com> References: <20240326-feature_poe-v6-0-c1011b6ea1cb@bootlin.com> In-Reply-To: <20240326-feature_poe-v6-0-c1011b6ea1cb@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 , Oleksij Rempel , Mark Brown , Frank Rowand , Andrew Lunn , Heiner Kallweit , Russell King Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, Dent Project , Kory Maincent X-Mailer: b4 0.14-dev X-GND-Sasl: kory.maincent@bootlin.com From: Kory Maincent (Dent Project) 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. Signed-off-by: Kory Maincent --- 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 5d1bf197c067..78513bda5bbb 100644 --- a/drivers/net/pse-pd/pse_core.c +++ b/drivers/net/pse-pd/pse_core.c @@ -215,6 +215,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 e7ac48ef9f95..caa2e9bce3a3 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; -- 2.25.1