static int css_add_virtual_chpid(uint8_t cssid, uint8_t chpid, uint8_t type)

{

    CssImage *css;



    trace_css_chpid_add(cssid, chpid, type);

    if (cssid > MAX_CSSID) {

        return -EINVAL;

    }

    css = channel_subsys.css[cssid];

    if (!css) {

        return -EINVAL;

    }

    if (css->chpids[chpid].in_use) {

        return -EEXIST;

    }

    css->chpids[chpid].in_use = 1;

    css->chpids[chpid].type = type;

    css->chpids[chpid].is_virtual = 1;



    css_generate_chp_crws(cssid, chpid);



    return 0;

}

static int css_add_virtual_chpid(uint8_t cssid, uint8_t chpid, uint8_t type)

{

    CssImage *css;



    trace_css_chpid_add(cssid, chpid, type);

    if (cssid > MAX_CSSID) {

        return -EINVAL;

    }

    css = channel_subsys.css[cssid];

    if (!css) {

        return -EINVAL;

    }

    if (css->chpids[chpid].in_use) {

        return -EEXIST;

    }

    css->chpids[chpid].in_use = 1;

    css->chpids[chpid].type = type;

    css->chpids[chpid].is_virtual = 1;



    css_generate_chp_crws(cssid, chpid);



    return 0;

}

    if (cssid > MAX_CSSID) {     if (cssid > MAX_CSSID) {         return -EINVAL;
static int FUNC_0(uint8_t VAR_0, uint8_t VAR_1, uint8_t VAR_2)

{

    CssImage *css;



    trace_css_chpid_add(VAR_0, VAR_1, VAR_2);

    if (VAR_0 > MAX_CSSID) {

        return -EINVAL;

    }

    css = channel_subsys.css[VAR_0];

    if (!css) {

        return -EINVAL;

    }

    if (css->chpids[VAR_1].in_use) {

        return -EEXIST;

    }

    css->chpids[VAR_1].in_use = 1;

    css->chpids[VAR_1].VAR_2 = VAR_2;

    css->chpids[VAR_1].is_virtual = 1;



    css_generate_chp_crws(VAR_0, VAR_1);



    return 0;

}

static int FUNC_0(uint8_t VAR_0, uint8_t VAR_1, uint8_t VAR_2)
{ CssImage *css; trace_css_chpid_add(VAR_0, VAR_1, VAR_2); if (VAR_0 > MAX_CSSID) { return -EINVAL; } css = channel_subsys.css[VAR_0]; if (!css) { return -EINVAL; } if (css->chpids[VAR_1].in_use) { return -EEXIST; } css->chpids[VAR_1].in_use = 1; css->chpids[VAR_1].VAR_2 = VAR_2; css->chpids[VAR_1].is_virtual = 1; css_generate_chp_crws(VAR_0, VAR_1); return 0; }