aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/net/imx_fec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index 9055ea8..fce3661 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -459,10 +459,10 @@ static void imx_fec_write(void *opaque, hwaddr addr,
case 0x040: /* MMFR */
/* store the value */
s->mmfr = value;
- if (extract32(value, 28, 1)) {
- do_phy_write(s, extract32(value, 18, 9), extract32(value, 0, 16));
- } else {
+ if (extract32(value, 29, 1)) {
s->mmfr = do_phy_read(s, extract32(value, 18, 9));
+ } else {
+ do_phy_write(s, extract32(value, 18, 9), extract32(value, 0, 16));
}
/* raise the interrupt as the PHY operation is done */
s->eir |= FEC_INT_MII;