qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: jacek burghardt <jaceksburghardt@gmail.com>
Cc: qemu-devel@nongnu.org, qemu-discuss <qemu-discuss@nongnu.org>
Subject: Re: [Qemu-devel] e1000 patch for osx
Date: Thu, 31 Oct 2013 01:27:42 +0100	[thread overview]
Message-ID: <5271A3FE.7030005@redhat.com> (raw)
In-Reply-To: <CAHyyzzTKL_yic2aTV7vo-5aKaqzHEocu2as1nd6ytbQvL9c9HQ@mail.gmail.com>

Il 31/10/2013 01:21, jacek burghardt ha scritto:
> I am in process of recompiling qemu right now 
> I came up with this patch is this correct
> diff -Naur qemu/hw/net/e1000.c qemu-a/hw/net/e1000.c
> --- qemu/hw/net/e1000.c 2013-10-27 15:36:05.496526538 -0600
> +++ qemu-a/hw/net/e1000.c       2013-10-30 18:09:03.101711694 -0600
> @@ -203,6 +203,12 @@
>          DBGOUT(PHY, "Start link auto negotiation\n");
>          timer_mod(s->autoneg_timer,
> qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 500);
>      }
> +
> +     if (val & 0x8000) {
> +         val &= 0x7fff;
> +         set_ics(s, 0, E1000_ICR_LSC);
> +     }
> +     s->phy_reg[PHY_CTRL] = val;
>  }
> 
>  static void
> @@ -390,6 +396,8 @@
>      d->rxbuf_min_shift = 1;
>      memset(&d->tx, 0, sizeof d->tx);
> 
> +    d->mac_reg[RA+0] = (macaddr[3] << 24) | (macaddr[2] << 16) |
> (macaddr[1] << 8) | macaddr[0];
> +    d->mac_reg[RA+1] = E1000_RAH_AV | (macaddr[5] << 8) | macaddr[4];
>      if (qemu_get_queue(d->nic)->link_down) {
>          e1000_link_down(d);
>      }
> @@ -409,6 +417,8 @@
>  {
>      /* RST is self clearing */
>      s->mac_reg[CTRL] = val & ~E1000_CTRL_RST;
> +    if (val & E1000_CTRL_RST)
> +       set_ics(s, 0, E1000_ICR_LSC);

Are these two lines necessary?

>  }
> 
>  static void
> @@ -446,7 +456,15 @@
>              if (addr < NPHYWRITEOPS && phyreg_writeops[addr]) {
>                  phyreg_writeops[addr](s, index, data);
>              }
> -            s->phy_reg[addr] = data;
> +            switch (addr) {
> +           case PHY_CTRL:
> +               s->phy_reg[addr] = data & 0x7eff;

Does it work if you put 0x7fff here?

Paolo

  parent reply	other threads:[~2013-10-31  0:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25 13:53 [Qemu-devel] e1000 patch for osx jacek burghardt
2013-10-25 14:21 ` Paolo Bonzini
2013-10-25 14:27   ` jacek burghardt
2013-10-30  9:41     ` Stefan Hajnoczi
2013-10-30 13:26       ` jacek burghardt
2013-10-30 13:35         ` Andreas Färber
2013-10-30 23:54     ` jacek burghardt
2013-10-31  0:00       ` Paolo Bonzini
2013-10-31  0:21         ` jacek burghardt
2013-10-31  0:24           ` jacek burghardt
2013-10-31  0:27           ` Paolo Bonzini [this message]
2013-10-31  0:31             ` jacek burghardt
2013-10-31  0:51               ` jacek burghardt
2013-10-31 15:06                 ` Gabriel L. Somlo
2013-10-31 21:38                   ` jacek burghardt
2013-11-07 18:04                   ` [Qemu-devel] [PATCH v1] e1000: initial link negotiation on mac osx Gabriel L. Somlo
2013-11-07 19:28                     ` Paolo Bonzini
2013-11-07 19:44                       ` jacek burghardt
2013-11-07 20:28                       ` [Qemu-devel] [PATCH v2] " Gabriel L. Somlo
2013-11-07 23:12                         ` Alexander Graf
2013-11-08 13:39                           ` Stefan Hajnoczi
2013-11-08 15:52                             ` Gabriel L. Somlo
2013-11-11  9:48                               ` Stefan Hajnoczi
2013-10-30 16:52 ` [Qemu-devel] e1000 patch for osx Paolo Bonzini
2013-10-30 17:29   ` Peter Maydell
2013-10-30 17:50     ` jacek burghardt
2013-10-30 18:00     ` Paolo Bonzini

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=5271A3FE.7030005@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jaceksburghardt@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-discuss@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).