netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Feiyang Chen <chris.chenfeiyang@gmail.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>
Cc: netdev@vger.kernel.org
Subject: Re: Help needed: supporting new device with unique register bitfields
Date: Mon, 24 Apr 2023 12:53:57 -0700	[thread overview]
Message-ID: <20230424125357.55b50cba@kernel.org> (raw)
In-Reply-To: <CACWXhKnjyA8S56idVhSFgH1FLo-qBbpxU_ZBpdnrbvv9_kEY7A@mail.gmail.com>

On Sun, 23 Apr 2023 16:19:11 +0800 Feiyang Chen wrote:
> We are hoping to add support for a new device which shares almost
> identical logic with dwmac1000 (dwmac_lib.c, dwmac1000_core.c, and
> dwmac1000_dma.c), but with significant differences in the register
> bitfields (dwmac_dma.h and dwmac1000.h).
> 
> We are seeking guidance on the best approach to support this new
> device. Any advice on how to proceed would be greatly appreciated.
> 
> Thank you for your time and expertise.

There's no recipe on how to support devices with different register
layout :(  You'll need to find the right balance of (1) indirect calls,
(2) if conditions and (3) static description data that's right for you.

Static description data (e.g. putting register addresses in a struct
and using the members of that struct rather than #defines) is probably
the best but the least flexible.

Adding the stmmac maintainers.

  reply	other threads:[~2023-04-24 19:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23  8:19 Help needed: supporting new device with unique register bitfields Feiyang Chen
2023-04-24 19:53 ` Jakub Kicinski [this message]
2023-04-28  8:47   ` Daniel.Machon
2023-05-05  1:26     ` Feiyang Chen
2023-05-05  1:25   ` Feiyang Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230424125357.55b50cba@kernel.org \
    --to=kuba@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=chris.chenfeiyang@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).