qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] e1000: Preserve link state across device reset
@ 2012-01-24 12:47 Jan Kiszka
  2012-01-24 12:50 ` Jan Kiszka
  2012-01-27  6:21 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Kiszka @ 2012-01-24 12:47 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori; +Cc: qemu-stable

A device reset does not affect the link state, only set_link does.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/e1000.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index 86c5416..76e736f 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 = {
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] e1000: Preserve link state across device reset
  2012-01-24 12:47 [Qemu-devel] [PATCH] e1000: Preserve link state across device reset Jan Kiszka
@ 2012-01-24 12:50 ` Jan Kiszka
  2012-01-27  6:21 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2012-01-24 12:50 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori; +Cc: qemu-trivial, qemu-stable

On 2012-01-24 13:47, Jan Kiszka wrote:
> A device reset does not affect the link state, only set_link does.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  hw/e1000.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/e1000.c b/hw/e1000.c
> index 86c5416..76e736f 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 = {

May rather go via trivial, sorry.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] e1000: Preserve link state across device reset
  2012-01-24 12:47 [Qemu-devel] [PATCH] e1000: Preserve link state across device reset Jan Kiszka
  2012-01-24 12:50 ` Jan Kiszka
@ 2012-01-27  6:21 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2012-01-27  6:21 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Anthony Liguori, qemu-devel, qemu-stable

On Tue, Jan 24, 2012 at 01:47:46PM +0100, Jan Kiszka wrote:
> A device reset does not affect the link state, only set_link does.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  hw/e1000.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-27  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-24 12:47 [Qemu-devel] [PATCH] e1000: Preserve link state across device reset Jan Kiszka
2012-01-24 12:50 ` Jan Kiszka
2012-01-27  6:21 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).