summaryrefslogtreecommitdiff
path: root/drivers/s390/crypto/ap_bus.c
diff options
context:
space:
mode:
authorIngo Tuchscherer <ingo.tuchscherer@de.ibm.com>2014-09-08 11:24:13 (GMT)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-09-25 08:51:57 (GMT)
commit170387a8877b2c12fee5ae901be1ef4693d06094 (patch)
tree3bc707f83ec1a0cb7241ff0fd21b534986112338 /drivers/s390/crypto/ap_bus.c
parent442302820356977237e32a76a211e7942255003a (diff)
downloadlinux-170387a8877b2c12fee5ae901be1ef4693d06094.tar.xz
s390/zcrypt: support for extended number of ap domains
Extends the number of ap domains within the zcrypt device driver up to 256. AP domains in the range 00..255 will be detected. Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/ap_bus.c')
-rw-r--r--drivers/s390/crypto/ap_bus.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 4038437..51e6aa0 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1188,6 +1188,10 @@ static int ap_select_domain(void)
ap_qid_t qid;
int rc, i, j;
+ /* IF APXA isn't installed, only 16 domains could be defined */
+ if (!ap_configuration->ap_extended && (ap_domain_index > 15))
+ return -EINVAL;
+
/*
* We want to use a single domain. Either the one specified with
* the "domain=" parameter or the domain with the maximum number
@@ -1900,9 +1904,15 @@ static void ap_reset_all(void)
{
int i, j;
- for (i = 0; i < AP_DOMAINS; i++)
- for (j = 0; j < AP_DEVICES; j++)
+ for (i = 0; i < AP_DOMAINS; i++) {
+ if (!ap_test_config_domain(i))
+ continue;
+ for (j = 0; j < AP_DEVICES; j++) {
+ if (!ap_test_config_card_id(j))
+ continue;
ap_reset_queue(AP_MKQID(j, i));
+ }
+ }
}
static struct reset_call ap_reset_call = {