* [Qemu-devel] [PATCH 3/8] ipmi: add GET_SYS_RESTART_CAUSE chassis command
@ 2016-01-05 17:29 Cédric Le Goater
2016-01-06 14:55 ` Greg Kurz
2016-01-08 20:21 ` Corey Minyard
0 siblings, 2 replies; 3+ messages in thread
From: Cédric Le Goater @ 2016-01-05 17:29 UTC (permalink / raw)
To: Corey Minyard; +Cc: Cédric Le Goater, qemu-devel, Michael S. Tsirkin
This is a simulator. Just return an unknown cause (0).
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
---
hw/ipmi/ipmi_bmc_sim.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
index 061db8437479..5db94491b130 100644
--- a/hw/ipmi/ipmi_bmc_sim.c
+++ b/hw/ipmi/ipmi_bmc_sim.c
@@ -30,11 +30,12 @@
#include "qemu/error-report.h"
#define IPMI_NETFN_CHASSIS 0x00
-#define IPMI_NETFN_CHASSIS_MAXCMD 0x03
+#define IPMI_NETFN_CHASSIS_MAXCMD 0x0a
#define IPMI_CMD_GET_CHASSIS_CAPABILITIES 0x00
#define IPMI_CMD_GET_CHASSIS_STATUS 0x01
#define IPMI_CMD_CHASSIS_CONTROL 0x02
+#define IPMI_CMD_GET_SYS_RESTART_CAUSE 0x09
#define IPMI_NETFN_SENSOR_EVENT 0x04
#define IPMI_NETFN_SENSOR_EVENT_MAXCMD 0x30
@@ -201,6 +202,8 @@ struct IPMIBmcSim {
uint8_t mfg_id[3];
uint8_t product_id[2];
+ uint8_t restart_cause;
+
IPMISel sel;
IPMISdr sdr;
IPMISensor sensors[MAX_SENSORS];
@@ -754,6 +757,17 @@ static void chassis_control(IPMIBmcSim *ibs,
return;
}
+static void chassis_get_sys_restart_cause(IPMIBmcSim *ibs,
+ uint8_t *cmd, unsigned int cmd_len,
+ uint8_t *rsp, unsigned int *rsp_len,
+ unsigned int max_rsp_len)
+{
+ IPMI_ADD_RSP_DATA(ibs->restart_cause & 0xf); /* Restart Cause */
+ IPMI_ADD_RSP_DATA(0); /* Channel 0 */
+ out:
+ return;
+}
+
static void get_device_id(IPMIBmcSim *ibs,
uint8_t *cmd, unsigned int cmd_len,
uint8_t *rsp, unsigned int *rsp_len,
@@ -1624,7 +1638,8 @@ static void get_sensor_type(IPMIBmcSim *ibs,
static const IPMICmdHandler chassis_cmds[IPMI_NETFN_CHASSIS_MAXCMD] = {
[IPMI_CMD_GET_CHASSIS_CAPABILITIES] = chassis_capabilities,
[IPMI_CMD_GET_CHASSIS_STATUS] = chassis_status,
- [IPMI_CMD_CHASSIS_CONTROL] = chassis_control
+ [IPMI_CMD_CHASSIS_CONTROL] = chassis_control,
+ [IPMI_CMD_GET_SYS_RESTART_CAUSE] = chassis_get_sys_restart_cause
};
static const IPMINetfn chassis_netfn = {
.cmd_nums = IPMI_NETFN_CHASSIS_MAXCMD,
@@ -1746,6 +1761,7 @@ static void ipmi_sim_init(Object *obj)
ibs->bmc_global_enables = (1 << IPMI_BMC_EVENT_LOG_BIT);
ibs->device_id = 0x20;
ibs->ipmi_version = 0x02; /* IPMI 2.0 */
+ ibs->restart_cause = 0;
for (i = 0; i < 4; i++) {
ibs->sel.last_addition[i] = 0xff;
ibs->sel.last_clear[i] = 0xff;
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 3/8] ipmi: add GET_SYS_RESTART_CAUSE chassis command
2016-01-05 17:29 [Qemu-devel] [PATCH 3/8] ipmi: add GET_SYS_RESTART_CAUSE chassis command Cédric Le Goater
@ 2016-01-06 14:55 ` Greg Kurz
2016-01-08 20:21 ` Corey Minyard
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2016-01-06 14:55 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: Corey Minyard, qemu-devel, Michael S. Tsirkin
On Tue, 5 Jan 2016 18:29:57 +0100
Cédric Le Goater <clg@fr.ibm.com> wrote:
> This is a simulator. Just return an unknown cause (0).
>
> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
> ---
Acked-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> hw/ipmi/ipmi_bmc_sim.c | 20 ++++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
> index 061db8437479..5db94491b130 100644
> --- a/hw/ipmi/ipmi_bmc_sim.c
> +++ b/hw/ipmi/ipmi_bmc_sim.c
> @@ -30,11 +30,12 @@
> #include "qemu/error-report.h"
>
> #define IPMI_NETFN_CHASSIS 0x00
> -#define IPMI_NETFN_CHASSIS_MAXCMD 0x03
> +#define IPMI_NETFN_CHASSIS_MAXCMD 0x0a
>
No big deal again but I guess the define would better fit...
> #define IPMI_CMD_GET_CHASSIS_CAPABILITIES 0x00
> #define IPMI_CMD_GET_CHASSIS_STATUS 0x01
> #define IPMI_CMD_CHASSIS_CONTROL 0x02
> +#define IPMI_CMD_GET_SYS_RESTART_CAUSE 0x09
>
... here.
> #define IPMI_NETFN_SENSOR_EVENT 0x04
> #define IPMI_NETFN_SENSOR_EVENT_MAXCMD 0x30
> @@ -201,6 +202,8 @@ struct IPMIBmcSim {
> uint8_t mfg_id[3];
> uint8_t product_id[2];
>
> + uint8_t restart_cause;
> +
> IPMISel sel;
> IPMISdr sdr;
> IPMISensor sensors[MAX_SENSORS];
> @@ -754,6 +757,17 @@ static void chassis_control(IPMIBmcSim *ibs,
> return;
> }
>
> +static void chassis_get_sys_restart_cause(IPMIBmcSim *ibs,
> + uint8_t *cmd, unsigned int cmd_len,
> + uint8_t *rsp, unsigned int *rsp_len,
> + unsigned int max_rsp_len)
> +{
> + IPMI_ADD_RSP_DATA(ibs->restart_cause & 0xf); /* Restart Cause */
Define a mask ?
> + IPMI_ADD_RSP_DATA(0); /* Channel 0 */
> + out:
> + return;
> +}
> +
> static void get_device_id(IPMIBmcSim *ibs,
> uint8_t *cmd, unsigned int cmd_len,
> uint8_t *rsp, unsigned int *rsp_len,
> @@ -1624,7 +1638,8 @@ static void get_sensor_type(IPMIBmcSim *ibs,
> static const IPMICmdHandler chassis_cmds[IPMI_NETFN_CHASSIS_MAXCMD] = {
> [IPMI_CMD_GET_CHASSIS_CAPABILITIES] = chassis_capabilities,
> [IPMI_CMD_GET_CHASSIS_STATUS] = chassis_status,
> - [IPMI_CMD_CHASSIS_CONTROL] = chassis_control
> + [IPMI_CMD_CHASSIS_CONTROL] = chassis_control,
> + [IPMI_CMD_GET_SYS_RESTART_CAUSE] = chassis_get_sys_restart_cause
> };
> static const IPMINetfn chassis_netfn = {
> .cmd_nums = IPMI_NETFN_CHASSIS_MAXCMD,
> @@ -1746,6 +1761,7 @@ static void ipmi_sim_init(Object *obj)
> ibs->bmc_global_enables = (1 << IPMI_BMC_EVENT_LOG_BIT);
> ibs->device_id = 0x20;
> ibs->ipmi_version = 0x02; /* IPMI 2.0 */
> + ibs->restart_cause = 0;
> for (i = 0; i < 4; i++) {
> ibs->sel.last_addition[i] = 0xff;
> ibs->sel.last_clear[i] = 0xff;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 3/8] ipmi: add GET_SYS_RESTART_CAUSE chassis command
2016-01-05 17:29 [Qemu-devel] [PATCH 3/8] ipmi: add GET_SYS_RESTART_CAUSE chassis command Cédric Le Goater
2016-01-06 14:55 ` Greg Kurz
@ 2016-01-08 20:21 ` Corey Minyard
1 sibling, 0 replies; 3+ messages in thread
From: Corey Minyard @ 2016-01-08 20:21 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-devel, Michael S. Tsirkin
Acked-by: Corey Minyard <cminyard@mvista.com>
On 01/05/2016 11:29 AM, Cédric Le Goater wrote:
> This is a simulator. Just return an unknown cause (0).
>
> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
> ---
> hw/ipmi/ipmi_bmc_sim.c | 20 ++++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
> index 061db8437479..5db94491b130 100644
> --- a/hw/ipmi/ipmi_bmc_sim.c
> +++ b/hw/ipmi/ipmi_bmc_sim.c
> @@ -30,11 +30,12 @@
> #include "qemu/error-report.h"
>
> #define IPMI_NETFN_CHASSIS 0x00
> -#define IPMI_NETFN_CHASSIS_MAXCMD 0x03
> +#define IPMI_NETFN_CHASSIS_MAXCMD 0x0a
>
> #define IPMI_CMD_GET_CHASSIS_CAPABILITIES 0x00
> #define IPMI_CMD_GET_CHASSIS_STATUS 0x01
> #define IPMI_CMD_CHASSIS_CONTROL 0x02
> +#define IPMI_CMD_GET_SYS_RESTART_CAUSE 0x09
>
> #define IPMI_NETFN_SENSOR_EVENT 0x04
> #define IPMI_NETFN_SENSOR_EVENT_MAXCMD 0x30
> @@ -201,6 +202,8 @@ struct IPMIBmcSim {
> uint8_t mfg_id[3];
> uint8_t product_id[2];
>
> + uint8_t restart_cause;
> +
> IPMISel sel;
> IPMISdr sdr;
> IPMISensor sensors[MAX_SENSORS];
> @@ -754,6 +757,17 @@ static void chassis_control(IPMIBmcSim *ibs,
> return;
> }
>
> +static void chassis_get_sys_restart_cause(IPMIBmcSim *ibs,
> + uint8_t *cmd, unsigned int cmd_len,
> + uint8_t *rsp, unsigned int *rsp_len,
> + unsigned int max_rsp_len)
> +{
> + IPMI_ADD_RSP_DATA(ibs->restart_cause & 0xf); /* Restart Cause */
> + IPMI_ADD_RSP_DATA(0); /* Channel 0 */
> + out:
> + return;
> +}
> +
> static void get_device_id(IPMIBmcSim *ibs,
> uint8_t *cmd, unsigned int cmd_len,
> uint8_t *rsp, unsigned int *rsp_len,
> @@ -1624,7 +1638,8 @@ static void get_sensor_type(IPMIBmcSim *ibs,
> static const IPMICmdHandler chassis_cmds[IPMI_NETFN_CHASSIS_MAXCMD] = {
> [IPMI_CMD_GET_CHASSIS_CAPABILITIES] = chassis_capabilities,
> [IPMI_CMD_GET_CHASSIS_STATUS] = chassis_status,
> - [IPMI_CMD_CHASSIS_CONTROL] = chassis_control
> + [IPMI_CMD_CHASSIS_CONTROL] = chassis_control,
> + [IPMI_CMD_GET_SYS_RESTART_CAUSE] = chassis_get_sys_restart_cause
> };
> static const IPMINetfn chassis_netfn = {
> .cmd_nums = IPMI_NETFN_CHASSIS_MAXCMD,
> @@ -1746,6 +1761,7 @@ static void ipmi_sim_init(Object *obj)
> ibs->bmc_global_enables = (1 << IPMI_BMC_EVENT_LOG_BIT);
> ibs->device_id = 0x20;
> ibs->ipmi_version = 0x02; /* IPMI 2.0 */
> + ibs->restart_cause = 0;
> for (i = 0; i < 4; i++) {
> ibs->sel.last_addition[i] = 0xff;
> ibs->sel.last_clear[i] = 0xff;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-08 20:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-05 17:29 [Qemu-devel] [PATCH 3/8] ipmi: add GET_SYS_RESTART_CAUSE chassis command Cédric Le Goater
2016-01-06 14:55 ` Greg Kurz
2016-01-08 20:21 ` Corey Minyard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.