From aba9e0dac9c28a999cd2d00c0bff437a7bf3d48f Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 12 Jan 2021 20:13:15 -0300 Subject: [PATCH] Fix illegal PIIX4 SMBus modes --- src/device/smbus_piix4.c | 4 ++-- src/network/net_slirp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/device/smbus_piix4.c b/src/device/smbus_piix4.c index e9156bf62..f3b14eda0 100644 --- a/src/device/smbus_piix4.c +++ b/src/device/smbus_piix4.c @@ -127,7 +127,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) smbus_addr = (dev->addr >> 1); read = dev->addr & 0x01; - cmd = (val >> 2) & 0xf; + cmd = (dev->ctl >> 2) & 0xf; smbus_piix4_log("SMBus PIIX4: addr=%02X read=%d protocol=%X cmd=%02X data0=%02X data1=%02X\n", smbus_addr, read, cmd, dev->cmd, dev->data0, dev->data1); /* Raise DEV_ERR if no device is at this address, or if the device returned NAK when starting the transfer. */ @@ -264,7 +264,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) /* block write [data0] bytes */ for (i = 0; i < dev->data0; i++) { if (!i2c_write(i2c_smbus, smbus_addr, dev->data[i & SMBUS_PIIX4_BLOCK_DATA_MASK])) - break; + break; /* write NAK behavior is unknown */ } timer_bytes += i; diff --git a/src/network/net_slirp.c b/src/network/net_slirp.c index ddfeba6cf..b4cb1657b 100644 --- a/src/network/net_slirp.c +++ b/src/network/net_slirp.c @@ -316,10 +316,10 @@ poll_thread(void *arg) struct in_addr dhcp = { .s_addr = htonl(0x0a00020f) }; /* 10.0.2.15 */ struct in_addr dns = { .s_addr = htonl(0x0a000203) }; /* 10.0.2.3 */ struct in_addr bind = { .s_addr = htonl(0x00000000) }; /* 0.0.0.0 */ - struct in6_addr ipv6dummy; /* contents don't matter; we're not using IPv6 */ + struct in6_addr ipv6_dummy; /* contents don't matter; we're not using IPv6 */ /* Initialize SLiRP. */ - slirp->slirp = slirp_init(0, 1, net, mask, host, 0, ipv6dummy, 0, ipv6dummy, NULL, NULL, NULL, NULL, dhcp, dns, ipv6dummy, NULL, NULL, &slirp_cb, arg); + slirp->slirp = slirp_init(0, 1, net, mask, host, 0, ipv6_dummy, 0, ipv6_dummy, NULL, NULL, NULL, NULL, dhcp, dns, ipv6_dummy, NULL, NULL, &slirp_cb, arg); if (!slirp->slirp) { slirp_log("SLiRP: initialization failed\n"); return;