From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzCrB-0005hD-AA for qemu-devel@nongnu.org; Mon, 23 Jun 2014 18:37:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzCr6-0000xN-Fa for qemu-devel@nongnu.org; Mon, 23 Jun 2014 18:36:57 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:54322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzCr6-0000x8-8d for qemu-devel@nongnu.org; Mon, 23 Jun 2014 18:36:52 -0400 Received: by mail-lb0-f177.google.com with SMTP id u10so5353187lbd.22 for ; Mon, 23 Jun 2014 15:36:51 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1402326188-23869-1-git-send-email-peter.maydell@linaro.org> References: <1402326188-23869-1-git-send-email-peter.maydell@linaro.org> From: Peter Maydell Date: Mon, 23 Jun 2014 23:36:30 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2] hw/net/eepro100: Implement read-only bits in MDI registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Stefan Hajnoczi , Patch Tracking Ping! Stefan, you said you were going to take this via the net queue? thanks -- PMM On 9 June 2014 16:03, Peter Maydell wrote: > Although we defined an eepro100_mdi_mask[] array indicating which bits > in the registers are read-only, we weren't actually doing anything with > it. Make the MDI register-write code use it rather than manually making > register 1 read-only and leaving the rest as reads-as-written. (The > special-case handling of register 0 remains as before since its mask is > all-zeros and the special casing happens before we apply the masking.) > > Signed-off-by: Peter Maydell > Message-id: 1402159924-13853-1-git-send-email-peter.maydell@linaro.org > --- > No code change, but I fixed the errors in the commit message. > > hw/net/eepro100.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c > index 3b891ca..9c70cce 100644 > --- a/hw/net/eepro100.c > +++ b/hw/net/eepro100.c > @@ -1217,7 +1217,6 @@ static void eepro100_write_mdi(EEPRO100State *s) > break; > case 1: /* Status Register */ > missing("not writable"); > - data = s->mdimem[reg]; > break; > case 2: /* PHY Identification Register (Word 1) */ > case 3: /* PHY Identification Register (Word 2) */ > @@ -1230,7 +1229,8 @@ static void eepro100_write_mdi(EEPRO100State *s) > default: > missing("not implemented"); > } > - s->mdimem[reg] = data; > + s->mdimem[reg] &= eepro100_mdi_mask[reg]; > + s->mdimem[reg] |= data & ~eepro100_mdi_mask[reg]; > } else if (opcode == 2) { > /* MDI read */ > switch (reg) { > -- > 1.9.2