diff options
author | Harald Freudenberger <freude@linux.vnet.ibm.com> | 2016-10-27 08:57:39 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-12-14 16:33:39 +0100 |
commit | 148784246ef2d85f000713cf56e1c90b405228e8 (patch) | |
tree | e90dba07f8ee0ec52d4da9b62f3476a1e544e913 /drivers/s390/crypto/ap_bus.c | |
parent | e47de21dd35bad6d1e71482a66699cd04e83ea40 (diff) | |
download | talos-op-linux-148784246ef2d85f000713cf56e1c90b405228e8.tar.gz talos-op-linux-148784246ef2d85f000713cf56e1c90b405228e8.zip |
s390/zcrypt: Correct function bits for CEX2x and CEX3x cards.
For the older CEX2x and CEX3x cards the function bits returned
by TAPQ do not reflect the functions of the card. Instead the
functionality is implicit by the type of the card. The reworked
zcrypt requires to have the function bits set correct, so this
patch fixes this. The queue selection is not only based on these
function bits but also on function pointers set by the individual
drivers.
Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.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.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index ac6c258300cf..b15013234c77 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -273,6 +273,23 @@ static int ap_query_queue(ap_qid_t qid, int *queue_depth, int *device_type, nd = (info >> 16) & 0xff; if ((info & (1UL << 57)) && nd > 0) ap_max_domain_id = nd; + switch (*device_type) { + /* For CEX2 and CEX3 the available functions + * are not refrected by the facilities bits. + * Instead it is coded into the type. So here + * modify the function bits based on the type. + */ + case AP_DEVICE_TYPE_CEX2A: + case AP_DEVICE_TYPE_CEX3A: + *facilities |= 0x08000000; + break; + case AP_DEVICE_TYPE_CEX2C: + case AP_DEVICE_TYPE_CEX3C: + *facilities |= 0x10000000; + break; + default: + break; + } return 0; case AP_RESPONSE_Q_NOT_AVAIL: case AP_RESPONSE_DECONFIGURED: |