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: 126583 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1976823ljc; Thu, 1 Feb 2018 10:58:39 -0800 (PST) X-Google-Smtp-Source: AH8x227CT9E8cnjgFTh+CLBeYtqGb1aJY2Flm/r+XJ2fQzeR3btwPH2qkApfZCRxFrcqABPwp00M X-Received: by 10.129.95.87 with SMTP id t84mr25589234ywb.89.1517511519541; Thu, 01 Feb 2018 10:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517511519; cv=none; d=google.com; s=arc-20160816; b=jCoSDNwD+LG1WHtk7JTBo/O8H2KqMVFaMKj8VBal83avd1CNv/upa6nLso6lt0cjU/ 797R2DrTRBlkv4V5XZ4orQIaVA96+jAXpWWxAHBXPt7ardZl30tdG4YFbinSFUNb3PRf aqjrNLxfNo1qFsuiA0HBrAmxdE1Wz2Ju74ssQ4rHua3FOnYNamBsEjgvzJDLishESMId CzK9lu2Y/RBzP67iqPheWxSOseVtWByJF6y4tGHkz20OObkLchNP6O77ic7VwduF0R2y AaY8sK72bc33Ikm8qKXBmfk7aqNEjtjGh67oYPDtZFthN/PWBKEkiS5QIGASB1sUvpzr 2ydg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=hk71D2cKmjGEt9+hv0BtowJB2yGT305RFq6k2wxJ06U=; b=iedxQzxtTU4TJ0nrDgULvPHVOmgVaPVPOx2iy6ANTryGo07/VaDL4+c7FhMX6BVEZH A/5baoNQ972HVMGbSYuIf4/wpIG51plgVISPQU3cs4hdnOmUuyZVIWXB9jSCJzKTTLS3 mV9X3A3FdJH+zu+bl5nkUgRG+1uq5DlL/vbmx693o899S/fLAFJ2GsGQkkzAX7uBYZqN +PabwiPiyI2IKkgnPLpCJTyT2L723nkDrI4SCpoPNBGLcUct+gO0KjRbHGNb1uSBH3Y4 aoeIugwBQcnr7UcluAYyxs7XQ12WiVKZXKuoy7TypZtwGDWN1ny9h9LSHddGXpbVNN9l BK5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vD/qse8f; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i3si44445ybk.480.2018.02.01.10.58.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vD/qse8f; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:54768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehK4E-0006rq-Tk for patch@linaro.org; Thu, 01 Feb 2018 13:58:38 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.7.4 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(), };