qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] e1000: CTRL.RST emulation


From: Andy Gospodarek
Subject: Re: [Qemu-devel] [PATCH 2/2] e1000: CTRL.RST emulation
Date: Tue, 27 Sep 2011 11:33:47 -0400

On Tue, Sep 27, 2011 at 8:58 AM, Michael S. Tsirkin <address@hidden> wrote:
> e1000 spec says CTRL.RST write should have the same effect
> as bus reset, except that is preserves PCI Config.
> Reset device registers and interrupts.
>
> Fix suggested by Andy Gospodarek <address@hidden>
> Similar fix proposed by Anthony PERARD <address@hidden>
>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> ---
>  hw/e1000.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/hw/e1000.c b/hw/e1000.c
> index 87a1104..b51e089 100644
> --- a/hw/e1000.c
> +++ b/hw/e1000.c
> @@ -241,8 +241,13 @@ static void e1000_reset(void *opaque)
>  static void
>  set_ctrl(E1000State *s, int index, uint32_t val)
>  {
> -    /* RST is self clearing */
> -    s->mac_reg[CTRL] = val & ~E1000_CTRL_RST;
> +    if (val & E1000_CTRL_RST) {
> +        e1000_reset(s);
> +        qemu_set_irq(s->dev.irq[0], 0);
> +        return;
> +    }
> +
> +    s->mac_reg[CTRL] = val;
>  }
>
>  static void
> --
> 1.7.5.53.gc233e
>

Looks good to me.  Thanks for following up with this, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]