🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #4676

Re: [PATCH net-next v6 3/9] net: dsa: realtek: rtl8365mb: set speed for family D

#4676
From: Andrew Lunn
Date: Sun, 18 Oct 2026 23:04
43 lines
7782 bytes
On Sun, Oct 18, 2026 at 07:40:47PM -0300, Luiz Angelo Daros de Luca wrote:
> > diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c
> > index 840db5a..2dabc4d 100644
> > --- a/drivers/net/dsa/realtek/rtl8365mb_main.c
> > +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c
> > @@ -344,6 +344,7 @@
> >  #define RTL8365MB_PORT_SPEED_10M       0
> >  #define RTL8365MB_PORT_SPEED_100M      1
> >  #define RTL8365MB_PORT_SPEED_1000M     2
> > +#define RTL8365MB_D_PORT_SPEED_2500M   5
> 
> I also used the same _<FAMILY>_ tag trick previously, but it gets
> confusing quickly. Does RTL8365MB_D_xxx mean something exclusive to
> family D, or family D and later? I hope a more seasoned reviewer can
> weigh in on this.

The Marvell switch driver does something similar. There are a few
families of devices, and within each family, a few devices. Within a
family, the devices are register compatible, but they either have
different number of ports, or features are not present.

The naming of functions and defines is based around the highest family
member of the family which introduced the feature. A few examples:

int mv88e6097_port_pause_limit(struct mv88e6xxx_chip *chip, int port, u8 in,
                               u8 out);
int mv88e6390_port_pause_limit(struct mv88e6xxx_chip *chip, int port, u8 in,
                               u8 out);

The feature was first introduced in mv88e6097, and this method is used
in all families until the mv88e6390 came along, which required a
different implementation because the registers changed.

So i would say RTL8365MB_D_xxx means D and later. And if you need
RTL8365MB_F_xxx, put it close by so other developers are aware it
exists.

What we also sometimes do is have a mv88e6xxx_foo function, which is
generic, but it calls mv88e6352_foo, mv88e6189_foo, mv88e6393_foo as
needed.

	Andrew
Technical Details
Message-ID: <2d26a270-fb06-4971-b9e1-3e3572a8b814@lunn.ch>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348205-linux-kernel-netdev=dewy.ru
References: <5a4715dd-89e0-4868-9ffb-c8fb73b18d04@yahoo.com> <75829f0c-69d4-4c16-8300-142023f840d7@yahoo.com> <CAJq09z5ZAxca0rRT0mSiU_3xp2wxEU4qahbDM3SBGpwe1vbMRw@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348205-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6 3/9] net: dsa: realtek: rtl8365mb: set speed
 for family D
Date: Mon, 19 Oct 2026 01:04:20 +0200
Organization: Usenet Network
Message-ID: <2d26a270-fb06-4971-b9e1-3e3572a8b814@lunn.ch>
References: <5a4715dd-89e0-4868-9ffb-c8fb73b18d04@yahoo.com>
 <75829f0c-69d4-4c16-8300-142023f840d7@yahoo.com>
 <CAJq09z5ZAxca0rRT0mSiU_3xp2wxEU4qahbDM3SBGpwe1vbMRw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3450472"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Juy8hj7ka5pAwS/3W/Ai91ySTck= sha256:OI6zGCdBUw8Yn7xFZvRjVguhfTgQEbbH4r/6bT/QNZE=
	sha1:mSXfLw6b8zvLLjsqqKJTwfPdFZE= sha256:4CR8MWYc4qmxU+CUpzT/UkUtJdEd+apxxRX4S83bSR8=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 54F181108BF; Mon, 19 Oct 2026 02:04:53 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=lunn.ch
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id i4JjDq_hTrxv;
	Mon, 19 Oct 2026 02:04:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-348205-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 340A51108A3; Mon, 19 Oct 2026 02:04:39 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id E5BD2603521; Sun, 18 Oct 2026 23:04:38 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id DEB7D3DB320;
	Sun, 18 Oct 2026 23:04:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="5hv9qdVc"
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(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 31A2834DCE3;
	Sun, 18 Oct 2026 23:04:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792364675; cv=none; b=rVNdqYcmag8Cu8J5sJN9EifN6SA/o7wj7f6BJ6SPWWW9266YypU3ZtmgJ1vlOCUvn/zKETQ4TGMKmPSIetKgB44e1P5YNq4ECxH9YmpMqZfvzJZ1an9vIzLJSD/vgREFdGPGH8DLIO1N2TpkO4KWM/EEJUhvTD6I/HBooZ8/DJ8=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792364675; c=relaxed/simple;
	bh=PAdYOJ6+VQUsob6n2jCgdqPzP2nwBnJ35YUBMcjrd2s=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=LQXuRMji1QgNY99Kc9Nwq2GnNrCRmraenRjVuVZkwmKxAvRkJF3oUvE/+JYr9EvlH4a9hHF+LcXCKbUYnfKHSb+sqe6ckBIZf3uwafMw6ekSi2LyMTeif0ZFRK5Vj5s2whxly0/A+tMEMhZ16IBc24QOq+8wg3m3HqP2Hjt9wCg=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=5hv9qdVc; arc=none smtp.client-ip=156.67.10.101
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch;
	s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject:
	Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:
	Content-ID:Content-Description:Content-Disposition:In-Reply-To:References;
	bh=saxxRacJ5hWTgsNIWolEJAGpb2rG2OONC5ywqM+ibRo=; b=5hv9qdVcTuXxc9z/5PoWMKTFcL
	DO4v4BUWrRy86imNADS8X+LnvB9mX3G40kWVE8vOnUqgZUs+I+xD5qQIK7Gx1KmRyKV/k+uoBNqKk
	yby9qzUgUb4S79ro2+htic2gjD1Oa80p0O7veT3S8N2YY+QP8rxJ40WjDsvkDLQLSnig=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xIZvQ-00BX8B-Kl; Mon, 19 Oct 2026 01:04:20 +0200
X-Cc: Mieczyslaw Nalewaj <namiltd@yahoo.com>, linusw@kernel.org,
	olteanv@gmail.com, kuba@kernel.org, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk,
	maxime.chevallier@bootlin.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <CAJq09z5ZAxca0rRT0mSiU_3xp2wxEU4qahbDM3SBGpwe1vbMRw@mail.gmail.com>