int css_do_rsch(SubchDev *sch)

{

    SCSW *s = &sch->curr_status.scsw;

    PMCW *p = &sch->curr_status.pmcw;

    int ret;



    if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {

        ret = -ENODEV;

        goto out;

    }



    if (s->ctrl & SCSW_STCTL_STATUS_PEND) {

        ret = -EINPROGRESS;

        goto out;

    }



    if (((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||

        (s->ctrl & SCSW_ACTL_RESUME_PEND) ||

        (!(s->ctrl & SCSW_ACTL_SUSP))) {

        ret = -EINVAL;

        goto out;

    }



    /* If monitoring is active, update counter. */

    if (channel_subsys.chnmon_active) {

        css_update_chnmon(sch);

    }



    s->ctrl |= SCSW_ACTL_RESUME_PEND;

    do_subchannel_work(sch);

    ret = 0;



out:

    return ret;

}

int css_do_rsch(SubchDev *sch)

{

    SCSW *s = &sch->curr_status.scsw;

    PMCW *p = &sch->curr_status.pmcw;

    int ret;



    if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {

        ret = -ENODEV;

        goto out;

    }



    if (s->ctrl & SCSW_STCTL_STATUS_PEND) {

        ret = -EINPROGRESS;

        goto out;

    }



    if (((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||

        (s->ctrl & SCSW_ACTL_RESUME_PEND) ||

        (!(s->ctrl & SCSW_ACTL_SUSP))) {

        ret = -EINVAL;

        goto out;

    }



    

    if (channel_subsys.chnmon_active) {

        css_update_chnmon(sch);

    }



    s->ctrl |= SCSW_ACTL_RESUME_PEND;

    do_subchannel_work(sch);

    ret = 0;



out:

    return ret;

}

    int ret;         ret = -ENODEV;     return ret;     return ret;     int ret;         ret = -ENODEV;         goto out;         ret = -EINPROGRESS;         goto out;         goto out; out:     return ret; int css_do_rsch(SubchDev *sch)     int ret;         ret = -ENODEV;         goto out;         ret = -EINPROGRESS;         goto out;         ret = -EINVAL;         goto out;     do_subchannel_work(sch);     ret = 0; out:     return ret;
int FUNC_0(SubchDev *VAR_0)

{

    SCSW *s = &VAR_0->curr_status.scsw;

    PMCW *p = &VAR_0->curr_status.pmcw;

    int VAR_1;



    if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {

        VAR_1 = -ENODEV;

        goto out;

    }



    if (s->ctrl & SCSW_STCTL_STATUS_PEND) {

        VAR_1 = -EINPROGRESS;

        goto out;

    }



    if (((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||

        (s->ctrl & SCSW_ACTL_RESUME_PEND) ||

        (!(s->ctrl & SCSW_ACTL_SUSP))) {

        VAR_1 = -EINVAL;

        goto out;

    }



    

    if (channel_subsys.chnmon_active) {

        css_update_chnmon(VAR_0);

    }



    s->ctrl |= SCSW_ACTL_RESUME_PEND;

    do_subchannel_work(VAR_0);

    VAR_1 = 0;



out:

    return VAR_1;

}

int FUNC_0(SubchDev *VAR_0)
{ SCSW *s = &VAR_0->curr_status.scsw; PMCW *p = &VAR_0->curr_status.pmcw; int VAR_1; if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) { VAR_1 = -ENODEV; goto out; } if (s->ctrl & SCSW_STCTL_STATUS_PEND) { VAR_1 = -EINPROGRESS; goto out; } if (((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||
(s->ctrl & SCSW_ACTL_RESUME_PEND) ||
(!(s->ctrl & SCSW_ACTL_SUSP))) { VAR_1 = -EINVAL; goto out; } if (channel_subsys.chnmon_active) { css_update_chnmon(VAR_0); } s->ctrl |= SCSW_ACTL_RESUME_PEND; do_subchannel_work(VAR_0); VAR_1 = 0; out:
return VAR_1; }