static void set_sensor_evt_enable(IPMIBmcSim *ibs,

                                  uint8_t *cmd, unsigned int cmd_len,

                                  uint8_t *rsp, unsigned int *rsp_len,

                                  unsigned int max_rsp_len)

{

    IPMISensor *sens;



    IPMI_CHECK_CMD_LEN(4);

    if ((cmd[2] > MAX_SENSORS) ||

            !IPMI_SENSOR_GET_PRESENT(ibs->sensors + cmd[2])) {

        rsp[2] = IPMI_CC_REQ_ENTRY_NOT_PRESENT;

        return;

    }

    sens = ibs->sensors + cmd[2];

    switch ((cmd[3] >> 4) & 0x3) {

    case 0: /* Do not change */

        break;

    case 1: /* Enable bits */

        if (cmd_len > 4) {

            sens->assert_enable |= cmd[4];

        }

        if (cmd_len > 5) {

            sens->assert_enable |= cmd[5] << 8;

        }

        if (cmd_len > 6) {

            sens->deassert_enable |= cmd[6];

        }

        if (cmd_len > 7) {

            sens->deassert_enable |= cmd[7] << 8;

        }

        break;

    case 2: /* Disable bits */

        if (cmd_len > 4) {

            sens->assert_enable &= ~cmd[4];

        }

        if (cmd_len > 5) {

            sens->assert_enable &= ~(cmd[5] << 8);

        }

        if (cmd_len > 6) {

            sens->deassert_enable &= ~cmd[6];

        }

        if (cmd_len > 7) {

            sens->deassert_enable &= ~(cmd[7] << 8);

        }

        break;

    case 3:

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

    IPMI_SENSOR_SET_RET_STATUS(sens, cmd[3]);

}

static void set_sensor_evt_enable(IPMIBmcSim *ibs,

                                  uint8_t *cmd, unsigned int cmd_len,

                                  uint8_t *rsp, unsigned int *rsp_len,

                                  unsigned int max_rsp_len)

{

    IPMISensor *sens;



    IPMI_CHECK_CMD_LEN(4);

    if ((cmd[2] > MAX_SENSORS) ||

            !IPMI_SENSOR_GET_PRESENT(ibs->sensors + cmd[2])) {

        rsp[2] = IPMI_CC_REQ_ENTRY_NOT_PRESENT;

        return;

    }

    sens = ibs->sensors + cmd[2];

    switch ((cmd[3] >> 4) & 0x3) {

    case 0: 

        break;

    case 1: 

        if (cmd_len > 4) {

            sens->assert_enable |= cmd[4];

        }

        if (cmd_len > 5) {

            sens->assert_enable |= cmd[5] << 8;

        }

        if (cmd_len > 6) {

            sens->deassert_enable |= cmd[6];

        }

        if (cmd_len > 7) {

            sens->deassert_enable |= cmd[7] << 8;

        }

        break;

    case 2: 

        if (cmd_len > 4) {

            sens->assert_enable &= ~cmd[4];

        }

        if (cmd_len > 5) {

            sens->assert_enable &= ~(cmd[5] << 8);

        }

        if (cmd_len > 6) {

            sens->deassert_enable &= ~cmd[6];

        }

        if (cmd_len > 7) {

            sens->deassert_enable &= ~(cmd[7] << 8);

        }

        break;

    case 3:

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

    IPMI_SENSOR_SET_RET_STATUS(sens, cmd[3]);

}

    if ((cmd[2] > MAX_SENSORS) ||     if ((cmd[2] > MAX_SENSORS) ||     if ((cmd[2] > MAX_SENSORS) ||     if ((cmd[2] > MAX_SENSORS) ||     if ((cmd[2] > MAX_SENSORS) ||     if ((cmd[2] > MAX_SENSORS) ||     if ((cmd[2] > MAX_SENSORS) ||
static void FUNC_0(IPMIBmcSim *VAR_0,

                                  uint8_t *VAR_1, unsigned int VAR_2,

                                  uint8_t *VAR_3, unsigned int *VAR_4,

                                  unsigned int VAR_5)

{

    IPMISensor *sens;



    IPMI_CHECK_CMD_LEN(4);

    if ((VAR_1[2] > MAX_SENSORS) ||

            !IPMI_SENSOR_GET_PRESENT(VAR_0->sensors + VAR_1[2])) {

        VAR_3[2] = IPMI_CC_REQ_ENTRY_NOT_PRESENT;

        return;

    }

    sens = VAR_0->sensors + VAR_1[2];

    switch ((VAR_1[3] >> 4) & 0x3) {

    case 0: 

        break;

    case 1: 

        if (VAR_2 > 4) {

            sens->assert_enable |= VAR_1[4];

        }

        if (VAR_2 > 5) {

            sens->assert_enable |= VAR_1[5] << 8;

        }

        if (VAR_2 > 6) {

            sens->deassert_enable |= VAR_1[6];

        }

        if (VAR_2 > 7) {

            sens->deassert_enable |= VAR_1[7] << 8;

        }

        break;

    case 2: 

        if (VAR_2 > 4) {

            sens->assert_enable &= ~VAR_1[4];

        }

        if (VAR_2 > 5) {

            sens->assert_enable &= ~(VAR_1[5] << 8);

        }

        if (VAR_2 > 6) {

            sens->deassert_enable &= ~VAR_1[6];

        }

        if (VAR_2 > 7) {

            sens->deassert_enable &= ~(VAR_1[7] << 8);

        }

        break;

    case 3:

        VAR_3[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

    IPMI_SENSOR_SET_RET_STATUS(sens, VAR_1[3]);

}

static void FUNC_0(IPMIBmcSim *VAR_0,
uint8_t *VAR_1, unsigned int VAR_2,
uint8_t *VAR_3, unsigned int *VAR_4,
unsigned int VAR_5)
{ IPMISensor *sens; IPMI_CHECK_CMD_LEN(4); if ((VAR_1[2] > MAX_SENSORS) ||
!IPMI_SENSOR_GET_PRESENT(VAR_0->sensors + VAR_1[2])) { VAR_3[2] = IPMI_CC_REQ_ENTRY_NOT_PRESENT; return; } sens = VAR_0->sensors + VAR_1[2]; switch ((VAR_1[3] >> 4) & 0x3) { case 0:
break; case 1:
if (VAR_2 > 4) { sens->assert_enable |= VAR_1[4]; } if (VAR_2 > 5) { sens->assert_enable |= VAR_1[5] << 8; } if (VAR_2 > 6) { sens->deassert_enable |= VAR_1[6]; } if (VAR_2 > 7) { sens->deassert_enable |= VAR_1[7] << 8; } break; case 2:
if (VAR_2 > 4) { sens->assert_enable &= ~VAR_1[4]; } if (VAR_2 > 5) { sens->assert_enable &= ~(VAR_1[5] << 8); } if (VAR_2 > 6) { sens->deassert_enable &= ~VAR_1[6]; } if (VAR_2 > 7) { sens->deassert_enable &= ~(VAR_1[7] << 8); } break; case 3:
VAR_3[2] = IPMI_CC_INVALID_DATA_FIELD; return; } IPMI_SENSOR_SET_RET_STATUS(sens, VAR_1[3]); }