Example #1
0
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;
        }
    }
}
Example #2
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;
		}
	}
}
Example #3
0
File: chp.c Project: 19Dan01/linux
static ssize_t chp_configure_write(struct device *dev,
				   struct device_attribute *attr,
				   const char *buf, size_t count)
{
	struct channel_path *cp;
	int val;
	char delim;

	if (sscanf(buf, "%d %c", &val, &delim) != 1)
		return -EINVAL;
	if (val != 0 && val != 1)
		return -EINVAL;
	cp = to_channelpath(dev);
	chp_cfg_schedule(cp->chpid, val);
	cfg_wait_idle();

	return count;
}