[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170523071015.GA9279@Red>
Date: Tue, 23 May 2017 09:10:15 +0200
From: Corentin Labbe <clabbe.montjoie@...il.com>
To: David Miller <davem@...emloft.net>
Cc: peppe.cavallaro@...com, alexandre.torgue@...com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] net-next: stmmac: rework the speed selection
On Mon, May 22, 2017 at 02:49:44PM -0400, David Miller wrote:
> From: Corentin Labbe <clabbe.montjoie@...il.com>
> Date: Mon, 22 May 2017 14:33:47 +0200
>
> > - mac->link.port = GMAC_CONTROL_PS;
> > mac->link.duplex = GMAC_CONTROL_DM;
> > - mac->link.speed = GMAC_CONTROL_FES;
> > + mac->link.speed10 = GMAC_CONTROL_PS;
> > + mac->link.speed100 = GMAC_CONTROL_PS | GMAC_CONTROL_FES;
> > + mac->link.speed1000 = 0;
> > + mac->link.speed_mask = GENMASK(15, 14);
>
> Neither GMAC_CONTROL_PS nor GMAC_CONTROL_FES are defined with
> the GENMASK() macro. So it is very confusing to see constant
> bit specifications here in C code.
>
> There are two ways to do this properly:
>
> 1) Use "(GMAC_CONTROL_PS | GMAC_CONTROL_FES)"
>
> 2) Define a new GMAC_CONTROL_SPDMASK to "GMAC_CONTROL_PS | GMAC_CONTROL_FES"
> and use that here.
>
Since dwmac100 use the #1, I will do the same on dwmac4/dwmac1000
Thanks.
Powered by blists - more mailing lists