[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [qemu-xen master] ftgmac100: fix dblac write test
commit a134321ef676723768973537bb9b49365ae2062e Author: erik-smit <erik.lucas.smit@xxxxxxxxx> AuthorDate: Sun Jun 28 16:26:59 2020 +0200 Commit: Jason Wang <jasowang@xxxxxxxxxx> CommitDate: Wed Jul 15 21:00:13 2020 +0800 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@xxxxxxxxx> Reviewed-by: Cédric Le Goater <clg@xxxxxxxx> Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx> --- hw/net/ftgmac100.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 043ba61b86..5f4b26fc5f 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; -- generated by git-patchbot for /home/xen/git/qemu-xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |