From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMhJ-0001Zx-J3 for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:20:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLMhH-0000Oq-Hp for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:20:45 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:49516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMhH-0000Oc-CT for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:20:43 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Nov 2011 16:20:42 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA1MKNSX048412 for ; Tue, 1 Nov 2011 16:20:24 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA1MKN1A032456 for ; Tue, 1 Nov 2011 16:20:23 -0600 Message-ID: <4EB070A6.1090300@us.ibm.com> Date: Tue, 01 Nov 2011 17:20:22 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E8ED40D.5010105@siemens.com> In-Reply-To: <4E8ED40D.5010105@siemens.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pcnet: Add link state support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel On 10/07/2011 05:27 AM, Jan Kiszka wrote: > 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 Applied. Thanks. Regards, Anthony Liguori > --- > hw/lance.c | 1 + > hw/pcnet-pci.c | 1 + > hw/pcnet.c | 7 +++++++ > hw/pcnet.h | 1 + > 4 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/hw/lance.c b/hw/lance.c > index d83e7f5..93d5fda 100644 > --- a/hw/lance.c > +++ b/hw/lance.c > @@ -97,6 +97,7 @@ static NetClientInfo net_lance_info = { > .size = sizeof(NICState), > .can_receive = pcnet_can_receive, > .receive = pcnet_receive, > + .link_status_changed = pcnet_set_link_status, > .cleanup = lance_cleanup, > }; > > diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c > index cab1116..548bb50 100644 > --- a/hw/pcnet-pci.c > +++ b/hw/pcnet-pci.c > @@ -287,6 +287,7 @@ static NetClientInfo net_pci_pcnet_info = { > .size = sizeof(NICState), > .can_receive = pcnet_can_receive, > .receive = pcnet_receive, > + .link_status_changed = pcnet_set_link_status, > .cleanup = pci_pcnet_cleanup, > }; > > diff --git a/hw/pcnet.c b/hw/pcnet.c > index add3ec2..cba253b 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; > diff --git a/hw/pcnet.h b/hw/pcnet.h > index 52cc52e..edc81c9 100644 > --- a/hw/pcnet.h > +++ b/hw/pcnet.h > @@ -58,6 +58,7 @@ uint32_t pcnet_ioport_readl(void *opaque, uint32_t addr); > uint32_t pcnet_bcr_readw(PCNetState *s, uint32_t rap); > int pcnet_can_receive(VLANClientState *nc); > ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_); > +void pcnet_set_link_status(VLANClientState *nc); > void pcnet_common_cleanup(PCNetState *d); > int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info); > extern const VMStateDescription vmstate_pcnet;