qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: QEMU-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] e1000: Do reset when E1000_CTRL_RST bit is set.
Date: Fri, 05 Aug 2011 11:53:19 -0500	[thread overview]
Message-ID: <4E3C1FFF.8070409@codemonkey.ws> (raw)
In-Reply-To: <1312554976-5822-1-git-send-email-anthony.perard@citrix.com>

On 08/05/2011 09:36 AM, Anthony PERARD wrote:
> Signed-off-by: Anthony PERARD<anthony.perard@citrix.com>
> ---
>   hw/e1000.c |   10 ++++++++--
>   1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/hw/e1000.c b/hw/e1000.c
> index 96d84f9..a1388e9 100644
> --- a/hw/e1000.c
> +++ b/hw/e1000.c
> @@ -150,6 +150,8 @@ static const char phy_regcap[0x20] = {
>       [PHY_ID2] = PHY_R,		[M88E1000_PHY_SPEC_STATUS] = PHY_R
>   };
>
> +static void e1000_reset(void *opaque);
> +
>   static void
>   ioport_map(PCIDevice *pci_dev, int region_num, pcibus_t addr,
>              pcibus_t size, int type)
> @@ -202,8 +204,12 @@ rxbufsize(uint32_t v)
>   static void
>   set_ctrl(E1000State *s, int index, uint32_t val)
>   {
> -    /* RST is self clearing */
> -    s->mac_reg[CTRL] = val&  ~E1000_CTRL_RST;
> +    DBGOUT(IO, "set ctrl = %08x\n", val);
> +    if (val&  E1000_CTRL_RST) {

You'll break some GCCs with -Wall -Werror with this.  Please do:

if ((val & E1000_CTRL_RST)) {

Regards,

Anthony Liguori

> +        e1000_reset(s);
> +        return;
> +    }
> +    s->mac_reg[CTRL] = val;
>   }
>
>   static void

  reply	other threads:[~2011-08-05 16:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 14:36 [Qemu-devel] [PATCH] e1000: Do reset when E1000_CTRL_RST bit is set Anthony PERARD
2011-08-05 16:53 ` Anthony Liguori [this message]
2011-08-05 18:34   ` Richard Henderson
2011-08-05 18:44   ` Peter Maydell
2011-08-09 14:10   ` Anthony PERARD
2011-08-09 17:10     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E3C1FFF.8070409@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=anthony.perard@citrix.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).