From patchwork Tue Mar 2 21:37:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 46719 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 7D320B7D5A for ; Wed, 3 Mar 2010 09:04:33 +1100 (EST) Received: from localhost ([127.0.0.1]:38296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmaCC-0000pG-19 for incoming@patchwork.ozlabs.org; Tue, 02 Mar 2010 17:04:04 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmZpc-0004lb-UC for qemu-devel@nongnu.org; Tue, 02 Mar 2010 16:40:45 -0500 Received: from [199.232.76.173] (port=37840 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmZpc-0004lG-E8 for qemu-devel@nongnu.org; Tue, 02 Mar 2010 16:40:44 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmZpb-0004zB-2r for qemu-devel@nongnu.org; Tue, 02 Mar 2010 16:40:44 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:51161) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NmZpa-0004yz-JK for qemu-devel@nongnu.org; Tue, 02 Mar 2010 16:40:42 -0500 Received: from flocke.weilnetz.de (p54ADFEFD.dip.t-dialin.net [84.173.254.253]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LlrOO-1NDF0b1pJY-00Zp8M; Tue, 02 Mar 2010 22:40:25 +0100 Received: from stefan by flocke.weilnetz.de with local (Exim 4.71) (envelope-from ) id 1NmZp7-00052W-RG; Tue, 02 Mar 2010 22:40:13 +0100 From: Stefan Weil To: QEMU Developers X-Mailer: git-send-email 1.7.0 In-Reply-To: <4B7821AC.6080400@mail.berlios.de> References: <4B7821AC.6080400@mail.berlios.de> X-Provags-ID: V01U2FsdGVkX196VSW15AAwxXVWScJO5GRRnwz0cpEF6ZR60He IhgMl3Q1bvwRG7sljgauDzuR1hZd2WMWd5AMXVL5SVizJ3z4PZ K6noDrqi4yMH1maaDOHFBgK3YhRv0B/2MzWuN1S4L6FXYHzfre W5A== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: mst@redhat.com Subject: [Qemu-devel] [PATCHv3 14/20] eepro100: Fix CU Start command 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 CU Start is allowed when the CU is in the idle or suspended state. Signed-off-by: Stefan Weil --- hw/eepro100.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index 40d8db5..a9bf7a0 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -976,17 +976,17 @@ static void action_command(EEPRO100State *s) static void eepro100_cu_command(EEPRO100State * s, uint8_t val) { + cu_state_t cu_state; switch (val) { case CU_NOP: /* No operation. */ break; case CU_START: - if (get_cu_state(s) != cu_idle) { - /* Intel documentation says that CU must be idle for the CU - * start command. Intel driver for Linux also starts the CU - * from suspended state. */ - logout("CU state is %u, should be %u\n", get_cu_state(s), cu_idle); - //~ assert(!"wrong CU state"); + cu_state = get_cu_state(s); + if (cu_state != cu_idle && cu_state != cu_suspended) { + /* Intel documentation says that CU must be idle or suspended + * for the CU start command. */ + logout("unexpected CU state is %u\n", cu_state); } set_cu_state(s, cu_active); s->cu_offset = s->pointer;