[PATCH 1/2] hw/net/opencores_eth: Use definitions instead of magic values

Philippe Mathieu-Daudé posted 2 patches 5 years, 8 months ago
[PATCH 1/2] hw/net/opencores_eth: Use definitions instead of magic values
Posted by Philippe Mathieu-Daudé 5 years, 8 months ago
Use definitions from "hw/net/mii.h".
This also helps when using git-grep.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/net/opencores_eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c
index 2ba0dc8c2f..90d3846bb7 100644
--- a/hw/net/opencores_eth.c
+++ b/hw/net/opencores_eth.c
@@ -86,8 +86,8 @@ static void mii_reset(Mii *s)
     s->regs[MII_BMSR] = MII_BMSR_100TX_FD | MII_BMSR_100TX_HD |
         MII_BMSR_10T_FD | MII_BMSR_10T_HD | MII_BMSR_MFPS |
         MII_BMSR_AN_COMP | MII_BMSR_AUTONEG;
-    s->regs[MII_PHYID1] = 0x2000;
-    s->regs[MII_PHYID2] = 0x5c90;
+    s->regs[MII_PHYID1] = DP83848_PHYID1;
+    s->regs[MII_PHYID2] = DP83848_PHYID2;
     s->regs[MII_ANAR] = MII_ANAR_TXFD | MII_ANAR_TX |
         MII_ANAR_10FD | MII_ANAR_10 | MII_ANAR_CSMACD;
     mii_set_link(s, s->link_ok);
-- 
2.21.3


Re: [PATCH 1/2] hw/net/opencores_eth: Use definitions instead of magic values
Posted by Max Filippov 5 years, 8 months ago
On Mon, Jun 8, 2020 at 2:15 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Use definitions from "hw/net/mii.h".
> This also helps when using git-grep.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/net/opencores_eth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Max Filippov <jcmvbkbc@gmail.com>

-- 
Thanks.
-- Max