From nobody Thu Apr 2 18:49:23 2026 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADDAB3D8902; Fri, 27 Mar 2026 08:28:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774600091; cv=none; b=k/ac433LyLp60mR0s+SrQBFmtTnfgd9MkMkeq+tUzYd0LTt9FVTmqYeSRtpeXQTFB6G+ozYarbVuInPXwUyTx2MHsGLGKPhKzv+z9FcN3k8HzoW1BzDL9YB7S9fBZaHJkf32nwy8AxxLDin/c09Bjp1krjN2MnkWAo/JxnBAOaY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774600091; c=relaxed/simple; bh=qP4I8G9zNImRW0K3+hJs+IDbBZErpgqcOxRSKe0y7x8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uQr4RtAIVbiFiEACbbzcRZ+AjQA4Ib+NAHBNfsidamtZ1nZO0hL+5h2i4ECi807WGx/Y3WraHLcje8dVwpKGHj8NCwWMOpWBQSxj6tFuZYHITMEUvniALtKn4rGEEc8pwi4mptJpOAfrQZuXofH9w5SKZC5l3iZFCEbFQoG35oY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: fx2/qvqQTL+JLoesiPsZfQ== X-CSE-MsgGUID: L3sg+lsTT+OCrfQQ4Y/yCw== Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 27 Mar 2026 17:28:07 +0900 Received: from [127.0.1.1] (unknown [10.226.78.135]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id BB67D401225D; Fri, 27 Mar 2026 17:28:04 +0900 (JST) From: Michael Dege Date: Fri, 27 Mar 2026 09:27:37 +0100 Subject: [PATCH net-next v2 07/13] net: renesas: rswitch: make helper functions available to whole driver 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: quoted-printable Message-Id: <20260327-rswitch_add_vlans-v2-7-d7f4358ca57a@renesas.com> References: <20260327-rswitch_add_vlans-v2-0-d7f4358ca57a@renesas.com> In-Reply-To: <20260327-rswitch_add_vlans-v2-0-d7f4358ca57a@renesas.com> To: Yoshihiro Shimoda , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Dege X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1774600062; l=2846; i=michael.dege@renesas.com; s=20251023; h=from:subject:message-id; bh=qP4I8G9zNImRW0K3+hJs+IDbBZErpgqcOxRSKe0y7x8=; b=JkcWfWMRONYeenUZvnHEOkJOoScj0hf7hb/49s8CJZZ3dD+cMa7Lv1Si2Fl6mt4w/BzrH28QA GsTx4+bzKj8C6pbZBxSNGlocCyIqYQcVsNX8QiY6OD3fqu97XCOieba X-Developer-Key: i=michael.dege@renesas.com; a=ed25519; pk=gu1rwIcCrAxNMv2I8fIfiQvt51xzZwnQy4Ua/DscQt8= These functions will be needed in L2 and vlan handling. Remove static declaration and add function prototype to rswitch.h. Signed-off-by: Michael Dege --- drivers/net/ethernet/renesas/rswitch.h | 6 ++++-- drivers/net/ethernet/renesas/rswitch_main.c | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/renesas/rswitch.h b/drivers/net/ethernet/= renesas/rswitch.h index bf123b564ed1..ff2a84057f01 100644 --- a/drivers/net/ethernet/renesas/rswitch.h +++ b/drivers/net/ethernet/renesas/rswitch.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* Renesas Ethernet Switch device driver * - * Copyright (C) 2022-2025 Renesas Electronics Corporation + * Copyright (C) 2022-2026 Renesas Electronics Corporation */ =20 #ifndef __RSWITCH_H__ @@ -1218,5 +1218,7 @@ struct rswitch_private { =20 bool is_rdev(const struct net_device *ndev); void rswitch_modify(void __iomem *addr, enum rswitch_reg reg, u32 clear, u= 32 set); - +int rswitch_reg_wait(void __iomem *addr, u32 offs, u32 mask, u32 expected); +int rswitch_gwca_change_mode(struct rswitch_private *priv, enum rswitch_gw= ca_mode mode); +int rswitch_etha_change_mode(struct rswitch_etha *etha, enum rswitch_etha_= mode mode); #endif /* #ifndef __RSWITCH_H__ */ diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethe= rnet/renesas/rswitch_main.c index f8ceb7f66903..b16f7aca4a69 100644 --- a/drivers/net/ethernet/renesas/rswitch_main.c +++ b/drivers/net/ethernet/renesas/rswitch_main.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Renesas Ethernet Switch device driver * - * Copyright (C) 2022-2025 Renesas Electronics Corporation + * Copyright (C) 2022-2026 Renesas Electronics Corporation */ =20 #include @@ -32,7 +32,7 @@ =20 #define RSWITCH_GPTP_OFFSET_S4 0x00018000 =20 -static int rswitch_reg_wait(void __iomem *addr, u32 offs, u32 mask, u32 ex= pected) +int rswitch_reg_wait(void __iomem *addr, u32 offs, u32 mask, u32 expected) { u32 val; =20 @@ -168,8 +168,8 @@ static int rswitch_fwd_init(struct rswitch_private *pri= v) } =20 /* Gateway CPU agent block (GWCA) */ -static int rswitch_gwca_change_mode(struct rswitch_private *priv, - enum rswitch_gwca_mode mode) +int rswitch_gwca_change_mode(struct rswitch_private *priv, + enum rswitch_gwca_mode mode) { int ret; =20 @@ -1153,8 +1153,8 @@ static int rswitch_gwca_ts_request_irqs(struct rswitc= h_private *priv) } =20 /* Ethernet TSN Agent block (ETHA) and Ethernet MAC IP block (RMAC) */ -static int rswitch_etha_change_mode(struct rswitch_etha *etha, - enum rswitch_etha_mode mode) +int rswitch_etha_change_mode(struct rswitch_etha *etha, + enum rswitch_etha_mode mode) { int ret; =20 --=20 2.43.0