Thread (8 messages) flat view 8 messages, 3 authors, 2017-05-23

Re: [PATCH v2 4/4] net-next: stmmac: rework the speed selection

From: Corentin Labbe <clabbe.montjoie@gmail.com>
Date: 2017-05-23 07:10:27
Also in: lkml

On Mon, May 22, 2017 at 02:49:44PM -0400, David Miller wrote:
From: Corentin Labbe <clabbe.montjoie@gmail.com>
Date: Mon, 22 May 2017 14:33:47 +0200
quoted
-	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help