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
