/* * "Blacklisting" of certain devices: * Device numbers given in the commandline as cio_ignore=... won't be known * to Linux. * * These can be single devices or ranges of devices
*/
/* 65536 bits for each set to indicate if a devno is blacklisted or not */ #define __BL_DEV_WORDS ((__MAX_SUBCHANNEL + (8*sizeof(long) - 1)) / \
(8*sizeof(long))) staticunsignedlong bl_dev[__MAX_SSID + 1][__BL_DEV_WORDS]; typedefenum {add, free} range_action;
/* * Function: blacklist_range * (Un-)blacklist the devices from-to
*/ staticint blacklist_range(range_action action, unsignedint from_ssid, unsignedint to_ssid, unsignedint from, unsignedint to, int msgtrigger)
{ if ((from_ssid > to_ssid) || ((from_ssid == to_ssid) && (from > to))) { if (msgtrigger)
pr_warn("0.%x.%04x to 0.%x.%04x is not a valid range for cio_ignore\n",
from_ssid, from, to_ssid, to);
return 1;
}
while ((from_ssid < to_ssid) || ((from_ssid == to_ssid) &&
(from <= to))) { if (action == add)
set_bit(from, bl_dev[from_ssid]); else
clear_bit(from, bl_dev[from_ssid]);
from++; if (from > __MAX_SUBCHANNEL) {
from_ssid++;
from = 0;
}
}
return 0;
}
staticint pure_hex(char **cp, unsignedint *val, int min_digit, int max_digit, int max_val)
{ int diff;
diff = 0;
*val = 0;
while (diff <= max_digit) { int value = hex_to_bin(**cp);
/* * Function: is_blacklisted * Returns 1 if the given devicenumber can be found in the blacklist, * otherwise 0. * Used by validate_subchannel()
*/ int
is_blacklisted (int ssid, int devno)
{ return test_bit (devno, bl_dev[ssid]);
}
#ifdef CONFIG_PROC_FS /* * Function: blacklist_parse_proc_parameters * parse the stuff which is piped to /proc/cio_ignore
*/ staticint blacklist_parse_proc_parameters(char *buf)
{ int rc; char *parm;
parm = strsep(&buf, " ");
if (strcmp("free", parm) == 0) {
rc = blacklist_parse_parameters(buf, free, 0); /* * Evaluate the subchannels without an online device. This way, * no path-verification will be triggered on those subchannels * and it avoids unnecessary delays.
*/
css_schedule_eval_cond(CSS_EVAL_NOT_ONLINE, 0);
} elseif (strcmp("add", parm) == 0)
rc = blacklist_parse_parameters(buf, add, 0); elseif (strcmp("purge", parm) == 0) return ccw_purge_blacklisted(); else return -EINVAL;
return rc;
}
/* Iterator struct for all devices. */ struct ccwdev_iter { int devno; int ssid; int in_range;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.