From patchwork Sat Jun 7 16:52:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 31520 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8E3912100A for ; Sat, 7 Jun 2014 16:52:06 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id j17sf1300725oag.8 for ; Sat, 07 Jun 2014 09:52:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=a95IOFCYstLbQtK1/eZjnuzIOGv+l69VAtrWLUj32+o=; b=ODYh4MyIwiFIzP53KngXspoqK+2IcVa6gpRQNMhf5boBZgm9n0QrihHb7S3GHmp6t8 wrCNXz0YsJ8zoUAx7qj62G8y4SRNyyi2gn7EMQ260ud2etaGLIy969vgAPm507e25CD2 W8d2HqM8cEhfkT8zcEQvOwz2RuaI/irenhm0dy0gcrlMQXQqs8u8HFkc5Jo1b3X0cdEL eh71kd5cfUD7u3yAd6D7o/AxJyvRUSBV38FN9k65HTNhldsvM/4/APsETd1jvPs+zEtd RGdz4+DAq4LAuIqQ8QKmXNRP2qDsjCNbOh1S3+EATJiyjCidRDk5V23zYPCStUrN5hIG AoSQ== X-Gm-Message-State: ALoCoQm7B2pwsFYMvHkoR6i2Kgb0aT7jZZsgLE/Rdimo3wxNCpAkzJAKdq9k0WWNCboQLTCx5Rh+ X-Received: by 10.182.109.231 with SMTP id hv7mr7310118obb.2.1402159926117; Sat, 07 Jun 2014 09:52:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.195 with SMTP id 61ls1080986qgz.77.gmail; Sat, 07 Jun 2014 09:52:06 -0700 (PDT) X-Received: by 10.58.29.198 with SMTP id m6mr14122963veh.15.1402159925983; Sat, 07 Jun 2014 09:52:05 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id tx9si8052613vcb.102.2014.06.07.09.52.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Jun 2014 09:52:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id lf12so938042vcb.22 for ; Sat, 07 Jun 2014 09:52:05 -0700 (PDT) X-Received: by 10.58.196.81 with SMTP id ik17mr12886755vec.14.1402159925872; Sat, 07 Jun 2014 09:52:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp29476vcb; Sat, 7 Jun 2014 09:52:05 -0700 (PDT) X-Received: by 10.180.13.113 with SMTP id g17mr15060837wic.48.1402159924985; Sat, 07 Jun 2014 09:52:04 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ex6si3412563wib.79.2014.06.07.09.52.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 07 Jun 2014 09:52:04 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WtJqe-0003bu-5g; Sat, 07 Jun 2014 17:52:04 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org Subject: [PATCH] hw/net/eepro100: Implement read-only bits in MDI registers Date: Sat, 7 Jun 2014 17:52:04 +0100 Message-Id: <1402159924-13853-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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-read code use it rather than manually making registers 2 and 3 totally read-only and the rest totally read-write. Signed-off-by: Peter Maydell --- This seemed a better fix for the unused variable than just deleting it... 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) {