From nobody Fri Oct 3 14:34:18 2025 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (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 4E39B6A33B; Sat, 30 Aug 2025 02:33:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756521189; cv=none; b=XJtEtaTPqpv9qUozWEAFxQdNs9XoCOwh+2BnytfYQTK2EAwU2Om1+JNtgMYvH4UDwmHb5kukZ6R03QzfR7lq0XQsbOnbceElHBa453l6vxFYXiz8MF4lbzEjB9+Vd97nN1LZVQEwfgE/EZ5DErQkFR4oobX3HP0W26+vgi+hskE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756521189; c=relaxed/simple; bh=Aiix0wd3aN1HL1lzKifMGpHRS7aRk9w71FF05DOlACY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sEtlLkGFN4FaRw9oALVaJOX1DRr4AQ0cmzkBSxjTl6CXg0Tgu12IhqfzzLYNG13+otNzcWnudhe5iw1/Nbi0PDZM8Lq7KjCcb8UPOI2uOKCmKmFjkIl0+XXGBiq1+MeDxwOTfUPtU/WVp24Gxzl7hd/no2r5n8oa1jqkWHaEF2E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.98.2) (envelope-from ) id 1usBOp-000000005va-2UPJ; Sat, 30 Aug 2025 02:33:03 +0000 Date: Sat, 30 Aug 2025 03:33:00 +0100 From: Daniel Golle To: Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hauke Mehrtens , Russell King , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Andreas Schirm , Lukas Stockmann , Alexander Sverdlin , Peter Christen , Avinash Jayaraman , Bing tao Xu , Liang Xu , Juraj Povazanec , "Fanni (Fang-Yi) Chan" , "Benny (Ying-Tsan) Weng" , "Livia M. Rosu" , John Crispin Subject: [PATCH net-next v4 2/6] net: dsa: lantiq_gswip: support model-specific mac_select_pcs() Message-ID: <7668666aa51e43e7f2a6cbcf36eb5a0a3020998f.1756520811.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Call mac_select_pcs() function if provided in struct gswip_hwinfo. The MaxLinear GSW1xx series got one port wired to a SerDes PCS and PHY which can do 1000Base-X, 2500Base-X and SGMII. Support for the SerDes port will be provided using phylink_pcs, so provide a convenient way for mac_select_pcs() to differ based on the hardware model. Signed-off-by: Daniel Golle Reviewed-by: Hauke Mehrtens --- v3: no changes v2: fix accidental change from 'static const struct' to 'const struct' reported by the kbuild bot drivers/net/dsa/lantiq/lantiq_gswip.c | 19 ++++++++++++++++--- drivers/net/dsa/lantiq/lantiq_gswip.h | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq= /lantiq_gswip.c index 67919c3935e4..acb6996356e9 100644 --- a/drivers/net/dsa/lantiq/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq/lantiq_gswip.c @@ -1592,10 +1592,23 @@ static int gswip_get_sset_count(struct dsa_switch *= ds, int port, int sset) return ARRAY_SIZE(gswip_rmon_cnt); } =20 +static struct phylink_pcs *gswip_phylink_mac_select_pcs(struct phylink_con= fig *config, + phy_interface_t interface) +{ + struct dsa_port *dp =3D dsa_phylink_to_port(config); + struct gswip_priv *priv =3D dp->ds->priv; + + if (priv->hw_info->mac_select_pcs) + return priv->hw_info->mac_select_pcs(config, interface); + + return NULL; +} + static const struct phylink_mac_ops gswip_phylink_mac_ops =3D { - .mac_config =3D gswip_phylink_mac_config, - .mac_link_down =3D gswip_phylink_mac_link_down, - .mac_link_up =3D gswip_phylink_mac_link_up, + .mac_config =3D gswip_phylink_mac_config, + .mac_link_down =3D gswip_phylink_mac_link_down, + .mac_link_up =3D gswip_phylink_mac_link_up, + .mac_select_pcs =3D gswip_phylink_mac_select_pcs, }; =20 static const struct dsa_switch_ops gswip_switch_ops =3D { diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.h b/drivers/net/dsa/lantiq= /lantiq_gswip.h index 620c2d560cbe..19bbe6fddf04 100644 --- a/drivers/net/dsa/lantiq/lantiq_gswip.h +++ b/drivers/net/dsa/lantiq/lantiq_gswip.h @@ -4,6 +4,7 @@ =20 #include #include +#include #include #include #include @@ -237,6 +238,8 @@ struct gswip_hw_info { enum dsa_tag_protocol tag_protocol; void (*phylink_get_caps)(struct dsa_switch *ds, int port, struct phylink_config *config); + struct phylink_pcs *(*mac_select_pcs)(struct phylink_config *config, + phy_interface_t interface); }; =20 struct gswip_gphy_fw { --=20 2.51.0