diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/e1000.c | 5 | ||||
-rw-r--r-- | hw/pcnet.c | 3 | ||||
-rw-r--r-- | hw/qdev-properties.c | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/hw/e1000.c b/hw/e1000.c index 86c5416bd1..76e736f171 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1133,6 +1133,11 @@ static void e1000_reset(void *opaque) memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init); d->rxbuf_min_shift = 1; memset(&d->tx, 0, sizeof d->tx); + + if (d->nic->nc.link_down) { + d->mac_reg[STATUS] &= ~E1000_STATUS_LU; + d->phy_reg[PHY_STATUS] &= ~MII_SR_LINK_STATUS; + } } static NetClientInfo net_e1000_info = { diff --git a/hw/pcnet.c b/hw/pcnet.c index 306dc6ed7e..6aa48e0d24 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -688,7 +688,6 @@ static void pcnet_s_reset(PCNetState *s) printf("pcnet_s_reset\n"); #endif - s->lnkst = 0x40; s->rdra = 0; s->tdra = 0; s->rap = 0; @@ -1751,5 +1750,7 @@ int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info) } *(uint16_t *)&s->prom[12] = cpu_to_le16(checksum); + s->lnkst = 0x40; /* initial link state: up */ + return 0; } diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index 02f0dae0bc..ea3b2df35a 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -40,9 +40,9 @@ static void qdev_prop_cpy(DeviceState *dev, Property *props, void *src) /* Bit */ static int parse_bit(DeviceState *dev, Property *prop, const char *str) { - if (!strncasecmp(str, "on", 2)) + if (!strcasecmp(str, "on")) bit_prop_set(dev, prop, true); - else if (!strncasecmp(str, "off", 3)) + else if (!strcasecmp(str, "off")) bit_prop_set(dev, prop, false); else return -EINVAL; |