diff options
author | Felix Beck <felix.beck@de.ibm.com> | 2011-01-05 06:47:47 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2011-01-05 06:47:27 -0500 |
commit | c2567f8ffa2704f6f2f81013e9a590deca5a865f (patch) | |
tree | 83c71b7139d21b51166f085f08bcefcaaa808b93 /drivers/s390/crypto/zcrypt_cex2a.c | |
parent | 2ade1fab026b4a103f0105ec4b47654fc2f729c7 (diff) |
[S390] zcrypt: cope with cca restriction of cex3
The cca on the crypto adapter has a restriction in the size of the
exponent if a key with a modulus bigger than 2048 bit is used. Thus
in that case we have to avoid that the crypto device driver thinks
the adapter is defect and sets it offline. Therfore a new member for
the zcrypt_device struct called max_exp_bit_length is introduced. This
will be set the first time the cca returns the error code function
not implemented. If this is done with an adapter twice it will return
-EINVAL.
Signed-off-by: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/zcrypt_cex2a.c')
-rw-r--r-- | drivers/s390/crypto/zcrypt_cex2a.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/s390/crypto/zcrypt_cex2a.c b/drivers/s390/crypto/zcrypt_cex2a.c index def0901767de..2176d00b395e 100644 --- a/drivers/s390/crypto/zcrypt_cex2a.c +++ b/drivers/s390/crypto/zcrypt_cex2a.c | |||
@@ -441,6 +441,7 @@ static int zcrypt_cex2a_probe(struct ap_device *ap_dev) | |||
441 | zdev->max_mod_size = CEX2A_MAX_MOD_SIZE; | 441 | zdev->max_mod_size = CEX2A_MAX_MOD_SIZE; |
442 | zdev->short_crt = 1; | 442 | zdev->short_crt = 1; |
443 | zdev->speed_rating = CEX2A_SPEED_RATING; | 443 | zdev->speed_rating = CEX2A_SPEED_RATING; |
444 | zdev->max_exp_bit_length = CEX2A_MAX_MOD_SIZE; | ||
444 | break; | 445 | break; |
445 | case AP_DEVICE_TYPE_CEX3A: | 446 | case AP_DEVICE_TYPE_CEX3A: |
446 | zdev = zcrypt_device_alloc(CEX3A_MAX_RESPONSE_SIZE); | 447 | zdev = zcrypt_device_alloc(CEX3A_MAX_RESPONSE_SIZE); |
@@ -450,8 +451,11 @@ static int zcrypt_cex2a_probe(struct ap_device *ap_dev) | |||
450 | zdev->type_string = "CEX3A"; | 451 | zdev->type_string = "CEX3A"; |
451 | zdev->min_mod_size = CEX2A_MIN_MOD_SIZE; | 452 | zdev->min_mod_size = CEX2A_MIN_MOD_SIZE; |
452 | zdev->max_mod_size = CEX2A_MAX_MOD_SIZE; | 453 | zdev->max_mod_size = CEX2A_MAX_MOD_SIZE; |
453 | if (ap_4096_commands_available(ap_dev->qid)) | 454 | zdev->max_exp_bit_length = CEX2A_MAX_MOD_SIZE; |
455 | if (ap_4096_commands_available(ap_dev->qid)) { | ||
454 | zdev->max_mod_size = CEX3A_MAX_MOD_SIZE; | 456 | zdev->max_mod_size = CEX3A_MAX_MOD_SIZE; |
457 | zdev->max_exp_bit_length = CEX3A_MAX_MOD_SIZE; | ||
458 | } | ||
455 | zdev->short_crt = 1; | 459 | zdev->short_crt = 1; |
456 | zdev->speed_rating = CEX3A_SPEED_RATING; | 460 | zdev->speed_rating = CEX3A_SPEED_RATING; |
457 | break; | 461 | break; |