From patchwork Tue Jan 16 00:57:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 10165615 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 BA9B5601E7 for ; Tue, 16 Jan 2018 01:05:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9CC326E51 for ; Tue, 16 Jan 2018 01:05:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CB5227F7F; Tue, 16 Jan 2018 01:05:12 +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 EA77126E51 for ; Tue, 16 Jan 2018 01:05:11 +0000 (UTC) Received: from localhost ([::1]:49856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebFgd-0004HZ-9Z for patchwork-qemu-devel@patchwork.kernel.org; Mon, 15 Jan 2018 20:05:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebFZu-0007s7-9R for qemu-devel@nongnu.org; Mon, 15 Jan 2018 19:58:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebFZs-0000lh-W3 for qemu-devel@nongnu.org; Mon, 15 Jan 2018 19:58:14 -0500 Received: from mail-ot0-x242.google.com ([2607:f8b0:4003:c0f::242]:35505) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebFZs-0000lY-Qx for qemu-devel@nongnu.org; Mon, 15 Jan 2018 19:58:12 -0500 Received: by mail-ot0-x242.google.com with SMTP id 53so12200695otj.2 for ; Mon, 15 Jan 2018 16:58:12 -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=HfmK2u1OX7Od4FCuJAZgmKvZIj3nYBvz44397ErN7a36zlATqvPMyoBhVhLfKGAkZC AYwek0/RKaatG4luoOH6UrewXtdx0zT/VPK7n/mi1GCDBnQ8/0c4QngNheOaPwq3CA/H L+N8sNBtgtxA5SbmpaBzrdjIqIiF7hrxq7h4mE9y4bu7KU2ZC1CYrLD2on91o4Av8PkC hkIPLMsuDFwLjg9TBvz54pDo/+Y7WvnFez7L+9pdB7ywmkagBTqSSijLF2iLozyH7twk 1BslVJiTruTAt7anDM1xapNhU2c+cqzk2sDdQcQmCWDdKUQ6Cp3aM9FCt01YLsY0Uwg5 +m9Q== 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=OnKj9mfd32mHRZxQetrrgSNaY6BvuDgy38bDNdmeaajGKltinhbk/UGsqodJIEuC7Q 0CYkItOR0/XhAzXzwjFfKCoBWdevTPNfJPQG7QqgrBdVassr9NBfeF4lzXaSYb2i3JsO +WAXCIwtfY4jLFT6tHo04YDbcPZ+5g3TZ9jPd7BYSjEc6UJhMWA7MBgnQJnwSpNk1Cyo 6Xti+4SIpgKgcJdnNC6UT7fj1Zn6EednMji3azWTPDVXPlGoF3IKGbiqhxbIFJHX5vXH pgzkdK3WzYL08zYshtrj0w5pvI/xn8xa6rtUCj3fT4RocoLstwetY+mTBTmXTN+bUEzr qOeQ== X-Gm-Message-State: AKwxytf1Bs5Fec7jnHJmaP35OOZVbA3hkn6dpz5wz54KZHt7fNmzdijb Mic75CED1W9gz1DDB8TEC58ecbQ= X-Google-Smtp-Source: ACJfBotFHxGadCYS+1IMOgJEUg7QZA0iNYf71GCx7qgmAYUZvYIfsdH5GzxpRsTkEau6kj8308Mjkw== X-Received: by 10.157.8.21 with SMTP id 21mr9896230oty.42.1516064292036; Mon, 15 Jan 2018 16:58:12 -0800 (PST) Received: from serve.minyard.net ([47.184.168.85]) by smtp.gmail.com with ESMTPSA id q13sm480808ota.56.2018.01.15.16.58.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jan 2018 16:58:09 -0800 (PST) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 6185097E; Mon, 15 Jan 2018 18:58:07 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 0E1823000A8; Mon, 15 Jan 2018 18:58:04 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Mon, 15 Jan 2018 18:57:59 -0600 Message-Id: <1516064279-14816-8-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516064279-14816-1-git-send-email-minyard@acm.org> References: <1516064279-14816-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::242 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , 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(), };