From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net-next 1/2] net: phy: use phy_id_mask value zero for exact match Date: Thu, 8 Nov 2018 21:53:49 +0100 Message-ID: <20181108205349.GG5259@lunn.ch> References: <08d52675-f308-4ebb-4ec4-f6c7ac0b6b06@gmail.com> <827c53cd-c9f5-7b1c-84fd-af1a49317fe7@gmail.com> <072cad0e-f5c0-2f40-b18d-8801834e2676@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Florian Fainelli , David Miller , "netdev@vger.kernel.org" To: Heiner Kallweit Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:55810 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725723AbeKIGbG (ORCPT ); Fri, 9 Nov 2018 01:31:06 -0500 Content-Disposition: inline In-Reply-To: <072cad0e-f5c0-2f40-b18d-8801834e2676@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: > > 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. Andrew