From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: David Miller <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 1/2] net: phy: use phy_id_mask value zero for exact match
Date: Thu, 8 Nov 2018 15:06:28 -0800 [thread overview]
Message-ID: <1bf2d057-4152-cc7c-095c-ce0eadb6aa5e@gmail.com> (raw)
In-Reply-To: <20181108205349.GG5259@lunn.ch>
On 11/8/18 12:53 PM, Andrew Lunn wrote:
>>> Maybe we can find a clever way with a macro to specify only the PHY OUI
>>> and compute a suitable mask automatically?
>>>
>> I don't think so. For Realtek each driver is specific even to a model
>> revision (therefore mask 0xffffffff). Same applies to intel-xway.
>> In broadcom.c we have masks 0xfffffff0, so for each model, independent
>> of revision number. There is no general rule.
>> Also we can't simply check for the first-bit-set to derive a mask.
>
> I'm crystal ball gazing, but i think Florian was meaning something like
>
> #define PHY_ID_UNIQUE(_id) \
> .phy_id = _id_; \
> .phy_id_mask = 0xffffffff;
>
> It is the boilerplate setting .phy_id_mask which you don't like. This removes that boilerplate.
Your crystal ball gazing skills are good, that is what I meant, we could
also define another macro which does not match the revision bits, and
that would likely cover everything that is already out there.
--
Florian
next prev parent reply other threads:[~2018-11-09 8:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 20:52 [PATCH net-next 0/2] net: phy: use phy_id_mask value zero for exact match Heiner Kallweit
2018-11-07 20:53 ` [PATCH net-next 1/2] " Heiner Kallweit
2018-11-08 18:34 ` Andrew Lunn
2018-11-08 19:44 ` Florian Fainelli
2018-11-08 20:06 ` Heiner Kallweit
2018-11-08 20:53 ` Andrew Lunn
2018-11-08 23:06 ` Florian Fainelli [this message]
2018-11-07 20:54 ` [PATCH net-next 2/2] net: phy: realtek: remove boilerplate code from driver configs Heiner Kallweit
2018-11-08 18:37 ` Andrew Lunn
2018-11-08 19:38 ` Heiner Kallweit
2018-11-08 23:05 ` [PATCH net-next 0/2] net: phy: use phy_id_mask value zero for exact match David Miller
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=1bf2d057-4152-cc7c-095c-ce0eadb6aa5e@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=netdev@vger.kernel.org \
/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).