static void read_event_data(SCLPEventFacility *ef, SCCB *sccb)

{

    unsigned int sclp_active_selection_mask;

    unsigned int sclp_cp_receive_mask;



    ReadEventData *red = (ReadEventData *) sccb;



    if (be16_to_cpu(sccb->h.length) != SCCB_SIZE) {

        sccb->h.response_code = cpu_to_be16(SCLP_RC_INSUFFICIENT_SCCB_LENGTH);

        goto out;

    }



    sclp_cp_receive_mask = ef->receive_mask;



    /* get active selection mask */

    switch (sccb->h.function_code) {

    case SCLP_UNCONDITIONAL_READ:

        sclp_active_selection_mask = sclp_cp_receive_mask;

        break;

    case SCLP_SELECTIVE_READ:

        if (!(sclp_cp_receive_mask & be32_to_cpu(red->mask))) {

            sccb->h.response_code =

                    cpu_to_be16(SCLP_RC_INVALID_SELECTION_MASK);

            goto out;

        }

        sclp_active_selection_mask = be32_to_cpu(red->mask);

        break;

    default:

        sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION);

        goto out;

    }

    sccb->h.response_code = cpu_to_be16(

            handle_sccb_read_events(ef, sccb, sclp_active_selection_mask));



out:

    return;

}

static void read_event_data(SCLPEventFacility *ef, SCCB *sccb)

{

    unsigned int sclp_active_selection_mask;

    unsigned int sclp_cp_receive_mask;



    ReadEventData *red = (ReadEventData *) sccb;



    if (be16_to_cpu(sccb->h.length) != SCCB_SIZE) {

        sccb->h.response_code = cpu_to_be16(SCLP_RC_INSUFFICIENT_SCCB_LENGTH);

        goto out;

    }



    sclp_cp_receive_mask = ef->receive_mask;



    

    switch (sccb->h.function_code) {

    case SCLP_UNCONDITIONAL_READ:

        sclp_active_selection_mask = sclp_cp_receive_mask;

        break;

    case SCLP_SELECTIVE_READ:

        if (!(sclp_cp_receive_mask & be32_to_cpu(red->mask))) {

            sccb->h.response_code =

                    cpu_to_be16(SCLP_RC_INVALID_SELECTION_MASK);

            goto out;

        }

        sclp_active_selection_mask = be32_to_cpu(red->mask);

        break;

    default:

        sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION);

        goto out;

    }

    sccb->h.response_code = cpu_to_be16(

            handle_sccb_read_events(ef, sccb, sclp_active_selection_mask));



out:

    return;

}

static void FUNC_0(SCLPEventFacility *VAR_0, SCCB *VAR_1)

{

    unsigned int VAR_2;

    unsigned int VAR_3;



    ReadEventData *red = (ReadEventData *) VAR_1;



    if (be16_to_cpu(VAR_1->h.length) != SCCB_SIZE) {

        VAR_1->h.response_code = cpu_to_be16(SCLP_RC_INSUFFICIENT_SCCB_LENGTH);

        goto out;

    }



    VAR_3 = VAR_0->receive_mask;



    

    switch (VAR_1->h.function_code) {

    case SCLP_UNCONDITIONAL_READ:

        VAR_2 = VAR_3;

        break;

    case SCLP_SELECTIVE_READ:

        if (!(VAR_3 & be32_to_cpu(red->mask))) {

            VAR_1->h.response_code =

                    cpu_to_be16(SCLP_RC_INVALID_SELECTION_MASK);

            goto out;

        }

        VAR_2 = be32_to_cpu(red->mask);

        break;

    default:

        VAR_1->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION);

        goto out;

    }

    VAR_1->h.response_code = cpu_to_be16(

            handle_sccb_read_events(VAR_0, VAR_1, VAR_2));



out:

    return;

}

static void FUNC_0(SCLPEventFacility *VAR_0, SCCB *VAR_1)
{ unsigned int VAR_2; unsigned int VAR_3; ReadEventData *red = (ReadEventData *) VAR_1; if (be16_to_cpu(VAR_1->h.length) != SCCB_SIZE) { VAR_1->h.response_code = cpu_to_be16(SCLP_RC_INSUFFICIENT_SCCB_LENGTH); goto out; } VAR_3 = VAR_0->receive_mask; switch (VAR_1->h.function_code) { case SCLP_UNCONDITIONAL_READ:
VAR_2 = VAR_3; break; case SCLP_SELECTIVE_READ:
if (!(VAR_3 & be32_to_cpu(red->mask))) { VAR_1->h.response_code =
cpu_to_be16(SCLP_RC_INVALID_SELECTION_MASK); goto out; } VAR_2 = be32_to_cpu(red->mask); break; default:
VAR_1->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION); goto out; } VAR_1->h.response_code = cpu_to_be16(
handle_sccb_read_events(VAR_0, VAR_1, VAR_2)); out:
return; }