From e1c2008af64487e7d3cec615612b7f467ebe9bc8 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 7 Oct 2011 12:27:25 +0200 Subject: pcnet: Add link state support Update lnkst on link state changes so that guests can obtain this information via reading back the LED output pin. Works for Linux but not for guests that depend on the missing PHY. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- hw/pcnet.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hw/pcnet.c') diff --git a/hw/pcnet.c b/hw/pcnet.c index add3ec255..cba253ba7 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1197,6 +1197,13 @@ ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_) return size_; } +void pcnet_set_link_status(VLANClientState *nc) +{ + PCNetState *d = DO_UPCAST(NICState, nc, nc)->opaque; + + d->lnkst = nc->link_down ? 0 : 0x40; +} + static void pcnet_transmit(PCNetState *s) { target_phys_addr_t xmit_cxda = 0; -- cgit v1.2.3