From patchwork Thu Feb 1 18:53:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 10195917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3914860380 for ; Thu, 1 Feb 2018 18:57:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14ABC28965 for ; Thu, 1 Feb 2018 18:57:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0561D289D5; Thu, 1 Feb 2018 18:57:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 758FA28965 for ; Thu, 1 Feb 2018 18:57:21 +0000 (UTC) Received: from localhost ([::1]:54768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehK2y-0006rq-LM for patchwork-qemu-devel@patchwork.kernel.org; Thu, 01 Feb 2018 13:57:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJz2-0003H7-AO for qemu-devel@nongnu.org; Thu, 01 Feb 2018 13:53:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJz1-0000CA-7Q for qemu-devel@nongnu.org; Thu, 01 Feb 2018 13:53:16 -0500 Received: from mail-ot0-x244.google.com ([2607:f8b0:4003:c0f::244]:34090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJz1-0000BX-2g for qemu-devel@nongnu.org; Thu, 01 Feb 2018 13:53:15 -0500 Received: by mail-ot0-x244.google.com with SMTP id x15so17899154ote.1 for ; Thu, 01 Feb 2018 10:53:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hk71D2cKmjGEt9+hv0BtowJB2yGT305RFq6k2wxJ06U=; b=vD/qse8f6vx7GvBa5NRLuNmd07oRlW1omHl7Ts5w5nwfYBVtqw36gsSlCurs7hV92r xQIqpdCtUdIMW93BmBp+njOz7vtMHN87ah8s6cGTwFLmBl0ECAprGaeyW2MdKmxwYK4S ihNyZ8qaejxUs4uxOzMSGLPjwLhbb1Tyyh6r2ZSEzMzo5n6W8wymQ9pLGjYai2yQ3YLd yDsM7aO1lpOGCLRMcenMm5GqgBPCTy7ft2nS1vy+85lxjG94igGtL73txNjtSS+SEfqK TAGHbC7BAYjAPNHmp4m4zSH7R06Eb9i+ssOtKXrmkSufbmJzM3P++rqq6b8gLG6JdI6G uChA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hk71D2cKmjGEt9+hv0BtowJB2yGT305RFq6k2wxJ06U=; b=GaT9ysLmQEMOI/K+GJ8R17nejpAJEHFOHLPw8uMvldM+/BmuvtD+F/q3QKa5q6G4WX GGESr6GgBPeIUirLBYlFMLar6gj0wjTzyZfSeLbm5nUoCmoxcoNus7jD3Vp5jlWFWW1V 7OSD+laFmSxX6foO1tz6Qu0BYWQvfkhD4VNhXkZjyb67DJvZ4PMxxQL48RfGsau/Njr4 YZZu1a5lEL+B10++1GhgApwmcYAPnq4S58/wcrFV4AxvNd+4oq29hy216VgHSrw5eFSn 4mfsWJn7rBoiCNhJAHl1pZ+s4izhazws0juMmiMUH1mRIJMxR0WAmOHyo8RVKs4PVusn OUuA== X-Gm-Message-State: AKwxytc+HDWMaJsV8hF+3pJKFMfkQquZGdEq1H00tuwZfInDS2v1ewdp zh4BA4WiWTaN+drKtGmVOGVdbKA= X-Google-Smtp-Source: AH8x224UhrXmoVCBe9EfaEqDbfDXhMfAhEm9wqWEAuKTww111mynbkD2uRaeM3OO4IjQGM+QFRRDGQ== X-Received: by 10.157.66.236 with SMTP id c41mr7984012otj.382.1517511194195; Thu, 01 Feb 2018 10:53:14 -0800 (PST) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id p66sm115820oia.3.2018.02.01.10.53.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:53:11 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 4A798E1B; Thu, 1 Feb 2018 12:53:07 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 21C7B300967; Thu, 1 Feb 2018 12:53:04 -0600 (CST) From: minyard@acm.org To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 1 Feb 2018 12:53:02 -0600 Message-Id: <1517511182-9944-8-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517511182-9944-1-git-send-email-minyard@acm.org> References: <1517511182-9944-1-git-send-email-minyard@acm.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::244 Subject: [Qemu-devel] [PATCH 7/7] ipmi: Allow BMC device properties to be set X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Corey Minyard Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Corey Minyard Signed-off-by: Corey Minyard Reviewed-by: Marc-André Lureau --- hw/ipmi/ipmi_bmc_sim.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index e84d710..9b509f8 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -214,8 +214,8 @@ struct IPMIBmcSim { uint8_t device_rev; uint8_t fwrev1; uint8_t fwrev2; - uint8_t mfg_id[3]; - uint8_t product_id[2]; + uint32_t mfg_id; + uint16_t product_id; uint8_t restart_cause; @@ -867,11 +867,11 @@ static void get_device_id(IPMIBmcSim *ibs, rsp_buffer_push(rsp, ibs->fwrev2); rsp_buffer_push(rsp, ibs->ipmi_version); rsp_buffer_push(rsp, 0x07); /* sensor, SDR, and SEL. */ - rsp_buffer_push(rsp, ibs->mfg_id[0]); - rsp_buffer_push(rsp, ibs->mfg_id[1]); - rsp_buffer_push(rsp, ibs->mfg_id[2]); - rsp_buffer_push(rsp, ibs->product_id[0]); - rsp_buffer_push(rsp, ibs->product_id[1]); + rsp_buffer_push(rsp, ibs->mfg_id & 0xff); + rsp_buffer_push(rsp, (ibs->mfg_id >> 8) & 0xff); + rsp_buffer_push(rsp, (ibs->mfg_id >> 16) & 0xff); + rsp_buffer_push(rsp, ibs->product_id & 0xff); + rsp_buffer_push(rsp, (ibs->product_id >> 8) & 0xff); } static void set_global_enables(IPMIBmcSim *ibs, uint8_t val) @@ -1997,6 +1997,13 @@ static Property ipmi_sim_properties[] = { DEFINE_PROP_UINT16("fruareasize", IPMIBmcSim, fru.areasize, 1024), DEFINE_PROP_STRING("frudatafile", IPMIBmcSim, fru.filename), DEFINE_PROP_STRING("sdrfile", IPMIBmcSim, sdr_filename), + DEFINE_PROP_UINT8("device_id", IPMIBmcSim, device_id, 0x20), + DEFINE_PROP_UINT8("ipmi_version", IPMIBmcSim, ipmi_version, 0x02), + DEFINE_PROP_UINT8("device_rev", IPMIBmcSim, device_rev, 0), + DEFINE_PROP_UINT8("fwrev1", IPMIBmcSim, fwrev1, 0), + DEFINE_PROP_UINT8("fwrev2", IPMIBmcSim, fwrev2, 0), + DEFINE_PROP_UINT32("mfg_id", IPMIBmcSim, mfg_id, 0), + DEFINE_PROP_UINT16("product_id", IPMIBmcSim, product_id, 0), DEFINE_PROP_END_OF_LIST(), };