From nobody Fri Oct 3 20:59:24 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 9924113957E; Tue, 26 Aug 2025 00:12:59 +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=1756167181; cv=none; b=Sq8WrVkZJzayrv7E0tnMdHzgevuZhblkol43rs7DnHOZgAZpJWGExop7ZYVLiSkCcCwUjIgjF4FUykqbXcQiCT5Mj4OIto5vQmqC7RdfY0c+LXPgcIrmev7ccuaVIK4I1PWBmfKn1MWJNwkej++F0It5TQvFwcVDlTd80PWKVR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756167181; c=relaxed/simple; bh=GWpRGVfRYZ0o9ai6+LSW4CJ8TZy/KweJErFZ2YA+nvw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QPT7+7zDHYLA8S14BPs7hvOMBRUR6Ie/BbR0/BQ9j4kNRw26k2hr1aEcxg+4DLkEeZ/lGMqhTosCUjzjpTDOLRjcVylpbEkKiVvPILLBYvh6IRNA42a6m4DWcicPcm+oIZcrF+hPWRgxhAWM6pVFKkwKIWJEOCFqHYKwiYOqWpw= 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 1uqhJ0-000000005kX-12IJ; Tue, 26 Aug 2025 00:12:54 +0000 Date: Tue, 26 Aug 2025 01:12:51 +0100 From: Daniel Golle To: Hauke Mehrtens , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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 2/6] net: dsa: lantiq_gswip: support model-specific mac_select_pcs() Message-ID: <7576c237814016ee5e18572b2788f955071a922c.1756163848.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 --- drivers/net/dsa/lantiq_gswip.c | 21 +++++++++++++++++---- drivers/net/dsa/lantiq_gswip.h | 3 +++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index 67919c3935e4..4822812bba27 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/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 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, +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; +} + +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_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_gswip.h b/drivers/net/dsa/lantiq_gswip.h index 620c2d560cbe..19bbe6fddf04 100644 --- a/drivers/net/dsa/lantiq_gswip.h +++ b/drivers/net/dsa/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.50.1