From patchwork Fri Dec 28 09:29:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 208425 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6D5FD2C00D7 for ; Fri, 28 Dec 2012 20:29:47 +1100 (EST) Received: from localhost ([::1]:36916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToWG9-00088p-Ht for incoming@patchwork.ozlabs.org; Fri, 28 Dec 2012 04:29:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToWFw-0007zd-FV for qemu-devel@nongnu.org; Fri, 28 Dec 2012 04:29:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ToWFu-0002US-U5 for qemu-devel@nongnu.org; Fri, 28 Dec 2012 04:29:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToWFu-0002UO-ND for qemu-devel@nongnu.org; Fri, 28 Dec 2012 04:29:30 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBS9TUxa021077 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Dec 2012 04:29:30 -0500 Received: from dhcp-8-167.nay.redhat.com ([10.66.7.126]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBS9TEE4030608; Fri, 28 Dec 2012 04:29:27 -0500 From: Amos Kong To: qemu-devel@nongnu.org Date: Fri, 28 Dec 2012 17:29:11 +0800 Message-Id: <1356686951-20305-3-git-send-email-akong@redhat.com> In-Reply-To: <1356686951-20305-1-git-send-email-akong@redhat.com> References: <1356686951-20305-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: jan.kiszka@siemens.com, jasowang@redhat.com, Amos Kong , stefanha@redhat.com Subject: [Qemu-devel] [PATCH 2/2] rtl8139: preserve link state across device reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org A device reset does not affect the link state, only set_link does. Signed-off-by: Amos Kong --- hw/rtl8139.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index c59ec6b..3e08062 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -1258,7 +1258,8 @@ static void rtl8139_reset(DeviceState *d) s->BasicModeStatus = 0x7809; //s->BasicModeStatus |= 0x0040; /* UTP medium */ s->BasicModeStatus |= 0x0020; /* autonegotiation completed */ - s->BasicModeStatus |= 0x0004; /* link is up */ + /* preserve link state */ + s->BasicModeStatus |= s->nic->nc.link_down ? 0 : 0x04; s->NWayAdvert = 0x05e1; /* all modes, full duplex */ s->NWayLPAR = 0x05e1; /* all modes, full duplex */