From nobody Sat Oct 4 09:39:54 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 AF024202F65; Tue, 19 Aug 2025 01:33:46 +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=1755567228; cv=none; b=cbgjNar420J97JXoCRM9ZtIqHAmd+2m+CFVONXg6xN+F+nmbB0hwGn8wMgIc8Fr4DJEALoN4EDwcLz5qsUrYPHSqsh+J2pJNEHmNtUpgoItCFlb5fCz4VckmMQkdC3k9muE3DExWqLNv5xfijkd3Q3PVWHxYVcCDJsYtWrWd+yE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755567228; c=relaxed/simple; bh=HwSX7XB4np0gyYue47peorJj5b6qD92i+O0m0tyug3M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=f4lexD1vzC/91kxfaqmyUPJzq9CHQV1/rGQimvOv70dpy0aLo+wCsO+fFMq7jSZ2pqbkugkyJ032lo8a1gw+wvRzRLPo4dfxAnSwFGoPF77hgKeFm7wtaJ3ShjIsOTbRUZXI5OFoj6Ippqh5onJ8nblDrEyCxDhGMtXDUWBuxwk= 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 1uoBEM-000000000CF-02AK; Tue, 19 Aug 2025 01:33:42 +0000 Date: Tue, 19 Aug 2025 02:33:38 +0100 From: Daniel Golle To: Hauke Mehrtens , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Philipp Zabel , 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 6/8] net: dsa: lantiq_gswip: make DSA tag protocol model-specific Message-ID: <9e714841c9e6540d3f83ff7961aec535c19f7b1b.1755564606.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" While the older Lantiq / Intel which are currently supported all use the DSA_TAG_GSWIP tagging protocol, newer MaxLinear GSW1xx modules use another 8-byte tagging protocol. Move the tag protocol information to struct gswip_hw_info to make it possible for new models to specify a different tagging protocol. Signed-off-by: Daniel Golle Reviewed-by: Andrew Lunn --- drivers/net/dsa/lantiq_gswip.c | 6 +++++- drivers/net/dsa/lantiq_gswip.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index 43f739db997d..d42e7625fe44 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -659,7 +659,9 @@ static enum dsa_tag_protocol gswip_get_tag_protocol(str= uct dsa_switch *ds, int port, enum dsa_tag_protocol mp) { - return DSA_TAG_PROTO_GSWIP; + struct gswip_priv *priv =3D ds->priv; + + return priv->hw_info->tag_protocol; } =20 static int gswip_vlan_active_create(struct gswip_priv *priv, @@ -2003,6 +2005,7 @@ static const struct gswip_hw_info gswip_xrx200 =3D { .phylink_get_caps =3D gswip_xrx200_phylink_get_caps, .pce_microcode =3D &gswip_pce_microcode, .pce_microcode_size =3D ARRAY_SIZE(gswip_pce_microcode), + .tag_protocol =3D DSA_TAG_PROTO_GSWIP, }; =20 static const struct gswip_hw_info gswip_xrx300 =3D { @@ -2012,6 +2015,7 @@ static const struct gswip_hw_info gswip_xrx300 =3D { .phylink_get_caps =3D gswip_xrx300_phylink_get_caps, .pce_microcode =3D &gswip_pce_microcode, .pce_microcode_size =3D ARRAY_SIZE(gswip_pce_microcode), + .tag_protocol =3D DSA_TAG_PROTO_GSWIP, }; =20 static const struct of_device_id gswip_of_match[] =3D { diff --git a/drivers/net/dsa/lantiq_gswip.h b/drivers/net/dsa/lantiq_gswip.h index 46fca97e4d83..d4603bba7e7c 100644 --- a/drivers/net/dsa/lantiq_gswip.h +++ b/drivers/net/dsa/lantiq_gswip.h @@ -227,6 +227,7 @@ struct gswip_hw_info { unsigned int mii_ports; const struct gswip_pce_microcode (*pce_microcode)[]; size_t pce_microcode_size; + enum dsa_tag_protocol tag_protocol; void (*phylink_get_caps)(struct dsa_switch *ds, int port, struct phylink_config *config); }; --=20 2.50.1