예제 #1
0
파일: chsc.c 프로젝트: jay-caoj/linux-3.9.6
static void chsc_process_sei_chp_avail(struct chsc_sei_nt0_area *sei_area)
{
    struct channel_path *chp;
    struct chp_id chpid;
    u8 *data;
    int num;

    CIO_CRW_EVENT(4, "chsc: channel path availability information\n");
    if (sei_area->rs != 0)
        return;
    data = sei_area->ccdf;
    chp_id_init(&chpid);
    for (num = 0; num <= __MAX_CHPID; num++) {
        if (!chp_test_bit(data, num))
            continue;
        chpid.id = num;

        CIO_CRW_EVENT(4, "Update information for channel path "
                      "%x.%02x\n", chpid.cssid, chpid.id);
        chp = chpid_to_chp(chpid);
        if (!chp) {
            chp_new(chpid);
            continue;
        }
        mutex_lock(&chp->lock);
        chsc_determine_base_channel_path_desc(chpid, &chp->desc);
        mutex_unlock(&chp->lock);
    }
}
예제 #2
0
파일: chsc.c 프로젝트: jay-caoj/linux-3.9.6
static void chsc_process_sei_chp_config(struct chsc_sei_nt0_area *sei_area)
{
    struct chp_config_data *data;
    struct chp_id chpid;
    int num;
    char *events[3] = {"configure", "deconfigure", "cancel deconfigure"};

    CIO_CRW_EVENT(4, "chsc: channel-path-configuration notification\n");
    if (sei_area->rs != 0)
        return;
    data = (struct chp_config_data *) &(sei_area->ccdf);
    chp_id_init(&chpid);
    for (num = 0; num <= __MAX_CHPID; num++) {
        if (!chp_test_bit(data->map, num))
            continue;
        chpid.id = num;
        pr_notice("Processing %s for channel path %x.%02x\n",
                  events[data->op], chpid.cssid, chpid.id);
        switch (data->op) {
        case 0:
            chp_cfg_schedule(chpid, 1);
            break;
        case 1:
            chp_cfg_schedule(chpid, 0);
            break;
        case 2:
            chp_cfg_cancel_deconfigure(chpid);
            break;
        }
    }
}
예제 #3
0
static void chsc_process_sei_chp_config(struct chsc_sei_area *sei_area)
{
	struct chp_config_data *data;
	struct chp_id chpid;
	int num;

	CIO_CRW_EVENT(4, "chsc: channel-path-configuration notification\n");
	if (sei_area->rs != 0)
		return;
	data = (struct chp_config_data *) &(sei_area->ccdf);
	chp_id_init(&chpid);
	for (num = 0; num <= __MAX_CHPID; num++) {
		if (!chp_test_bit(data->map, num))
			continue;
		chpid.id = num;
		printk(KERN_WARNING "cio: processing configure event %d for "
		       "chpid %x.%02x\n", data->op, chpid.cssid, chpid.id);
		switch (data->op) {
		case 0:
			chp_cfg_schedule(chpid, 1);
			break;
		case 1:
			chp_cfg_schedule(chpid, 0);
			break;
		case 2:
			chp_cfg_cancel_deconfigure(chpid);
			break;
		}
	}
}
예제 #4
0
파일: chp.c 프로젝트: 19Dan01/linux
/**
 * chp_info_get_status - retrieve configure status of a channel-path
 * @chpid: channel-path ID
 *
 * On success, return 0 for standby, 1 for configured, 2 for reserved,
 * 3 for not recognized. Return negative error code on error.
 */
int chp_info_get_status(struct chp_id chpid)
{
	int rc;
	int bit;

	rc = info_update();
	if (rc)
		return rc;

	bit = info_bit_num(chpid);
	mutex_lock(&info_lock);
	if (!chp_test_bit(chp_info.recognized, bit))
		rc = CHP_STATUS_NOT_RECOGNIZED;
	else if (chp_test_bit(chp_info.configured, bit))
		rc = CHP_STATUS_CONFIGURED;
	else if (chp_test_bit(chp_info.standby, bit))
		rc = CHP_STATUS_STANDBY;
	else
		rc = CHP_STATUS_RESERVED;
	mutex_unlock(&info_lock);

	return rc;
}