From nobody Fri Oct 3 19:11:40 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 CEA972F6572; Tue, 26 Aug 2025 23:05:57 +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=1756249560; cv=none; b=swJskkITk7NpbDboKsOFH8J7WymGQeYHTnfb8W03n3GKIX61HYjVxYyykhdfkcajJQBF0TcUtO6rR4hLEoOFEcPv8I0DZwkbV2+sPYXDw1yDSwZyXfNAWEYWz59IYG07DHBVTR+9FnYjEhZtta+WB0UlczYs3bwAU4asXn/BEGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756249560; c=relaxed/simple; bh=etPr2X04naESy1hvIvXKnN6BbYwyA7t3PyBkpF74tOQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mZCxxhMxnn8HwYisd1lbuPjxBn4o2ErhK8jqZKRt5LJHBTDaOfztIphjU1C/naBJSYXRNQIcVjrUoWVPUDCGa55lBCezXEQmkiRuaBezNNtuUhiaYzW+4lbZo/WnkSkqiIXKsqF8PtcRowu46OjsF8k6bT1solpkJjGbcwFO06s= 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 1ur2jh-000000001si-0q9I; Tue, 26 Aug 2025 23:05:53 +0000 Date: Wed, 27 Aug 2025 00:05:49 +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 v2 2/6] net: dsa: lantiq_gswip: support model-specific mac_select_pcs() Message-ID: <1291bfe0609de9ce3b54d6c17ac13e39eff26144.1756228750.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 --- v2: no changes 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