From patchwork Tue Apr 5 14:34:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atsushi Nemoto X-Patchwork-Id: 89876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BF314B6F72 for ; Wed, 6 Apr 2011 00:34:55 +1000 (EST) Received: from localhost ([127.0.0.1]:55669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q77LH-0007R7-Tm for incoming@patchwork.ozlabs.org; Tue, 05 Apr 2011 10:34:51 -0400 Received: from [140.186.70.92] (port=59702 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q77Kf-0007R2-PX for qemu-devel@nongnu.org; Tue, 05 Apr 2011 10:34:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q77Kd-0003ZO-0G for qemu-devel@nongnu.org; Tue, 05 Apr 2011 10:34:13 -0400 Received: from mv-drv-hcb003.ocn.ad.jp ([118.23.109.133]:57046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q77Kc-0003Ys-OG for qemu-devel@nongnu.org; Tue, 05 Apr 2011 10:34:10 -0400 Received: from vcmba.ocn.ne.jp (localhost.localdomain [127.0.0.1]) by mv-drv-hcb003.ocn.ad.jp (Postfix) with ESMTP id E42FB56421D; Tue, 5 Apr 2011 23:34:04 +0900 (JST) Received: from localhost (softbank221040169135.bbtec.net [221.40.169.135]) by vcmba.ocn.ne.jp (Postfix) with ESMTP; Tue, 5 Apr 2011 23:34:04 +0900 (JST) Date: Tue, 05 Apr 2011 23:34:04 +0900 (JST) Message-Id: <20110405.233404.189723896.anemo@mba.ocn.ne.jp> To: aurelien@aurel32.net Subject: Re: [Qemu-devel] [PATCH] lan9118: Ignore write to MAC_VLAN1 register From: Atsushi Nemoto In-Reply-To: <20110404181530.GC23034@volta.aurel32.net> References: <1301406072-8649-1-git-send-email-anemo@mba.ocn.ne.jp> <20110404181530.GC23034@volta.aurel32.net> X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A B746 CA77 FE94 2874 D52F X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F X-Mailer: Mew version 5.2 on Emacs 22.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 118.23.109.133 Cc: qemu-devel@nongnu.org, paul@codesourcery.com X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Mon, 4 Apr 2011 20:15:30 +0200, Aurelien Jarno wrote: > Is it really safe ignoring write to this register? If yes, it's probably > a good idea to explain why in a comment. In any case, if supporting this > register is easy to do, it would be the best option. I think it is safe. Please see an updated comment below. And though implementing this register might be possible, I suppose it is not worth to supporting FrameTooLong detection, for now at least. Thank you for comments. >8--------------------------------------------------------------------- From: Atsushi Nemoto Date: Tue, 5 Apr 2011 23:12:07 +0900 Subject: [PATCH] lan9118: Ignore write to MAC_VLAN1 register Since linux 2.6.38, smsc911x driver writes to VLAN1 registger. Since this register only affects FrameTooLong detection, ignoring write to this register should be safe. Signed-off-by: Atsushi Nemoto --- hw/lan9118.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/lan9118.c b/hw/lan9118.c index af6949f..2dc8d18 100644 --- a/hw/lan9118.c +++ b/hw/lan9118.c @@ -785,6 +785,12 @@ static void do_mac_write(lan9118_state *s, int reg, uint32_t val) case MAC_FLOW: s->mac_flow = val & 0xffff0000; break; + case MAC_VLAN1: + /* Writing to this register changes a condition for + * FrameTooLong bit in rx_status. Since we do not set + * FrameTooLong anyway, just ignore write to this. + */ + break; default: hw_error("lan9118: Unimplemented MAC register write: %d = 0x%x\n", s->mac_cmd & 0xf, val);