diff options
author | erik-smit <erik.lucas.smit@gmail.com> | 2020-06-28 16:26:59 +0200 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2020-07-15 21:00:13 +0800 |
commit | a134321ef676723768973537bb9b49365ae2062e (patch) | |
tree | d6ac022d9ea0ca2efaf2bd861d0ab4a7a9c003e1 | |
parent | e7b347d0bf640adb1c998d317eaf44d2d7cbd973 (diff) | |
download | qemu-a134321ef676723768973537bb9b49365ae2062e.zip qemu-a134321ef676723768973537bb9b49365ae2062e.tar.gz qemu-a134321ef676723768973537bb9b49365ae2062e.tar.bz2 |
ftgmac100: fix dblac write test
The test of the write of the dblac register was testing the old value
instead of the new value. This would accept the write of an invalid value
but subsequently refuse any following valid writes.
Signed-off-by: erik-smit <erik.lucas.smit@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
-rw-r--r-- | hw/net/ftgmac100.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 043ba61..5f4b26f 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -810,16 +810,18 @@ static void ftgmac100_write(void *opaque, hwaddr addr, s->phydata = value & 0xffff; break; case FTGMAC100_DBLAC: /* DMA Burst Length and Arbitration Control */ - if (FTGMAC100_DBLAC_TXDES_SIZE(s->dblac) < sizeof(FTGMAC100Desc)) { + if (FTGMAC100_DBLAC_TXDES_SIZE(value) < sizeof(FTGMAC100Desc)) { qemu_log_mask(LOG_GUEST_ERROR, - "%s: transmit descriptor too small : %d bytes\n", - __func__, FTGMAC100_DBLAC_TXDES_SIZE(s->dblac)); + "%s: transmit descriptor too small: %" PRIx64 + " bytes\n", __func__, + FTGMAC100_DBLAC_TXDES_SIZE(value)); break; } - if (FTGMAC100_DBLAC_RXDES_SIZE(s->dblac) < sizeof(FTGMAC100Desc)) { + if (FTGMAC100_DBLAC_RXDES_SIZE(value) < sizeof(FTGMAC100Desc)) { qemu_log_mask(LOG_GUEST_ERROR, - "%s: receive descriptor too small : %d bytes\n", - __func__, FTGMAC100_DBLAC_RXDES_SIZE(s->dblac)); + "%s: receive descriptor too small : %" PRIx64 + " bytes\n", __func__, + FTGMAC100_DBLAC_RXDES_SIZE(value)); break; } s->dblac = value; |