diff options
author | Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com> | 2014-10-02 08:48:46 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-10-09 03:14:05 -0400 |
commit | 42f4dd613fe808676126472bbe1283e452201148 (patch) | |
tree | 0ad7eafe02f39820ad03d6cf717f52f696e5df4b /drivers/s390 | |
parent | b5f87f15e20092c060f465b283b07a76af7f2e5f (diff) |
s390/zcrypt: Toleration of new crypto hardware
The zcrypt device driver will accept the new crypto adapter
in toleration mode. A new sysfs attribute 'raw_hwtype' will
expose the raw hardware type.
Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/crypto/ap_bus.c | 16 | ||||
-rw-r--r-- | drivers/s390/crypto/ap_bus.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 51e6aa0e2e58..99485415dcc2 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -664,6 +664,17 @@ static ssize_t ap_hwtype_show(struct device *dev, | |||
664 | } | 664 | } |
665 | 665 | ||
666 | static DEVICE_ATTR(hwtype, 0444, ap_hwtype_show, NULL); | 666 | static DEVICE_ATTR(hwtype, 0444, ap_hwtype_show, NULL); |
667 | |||
668 | static ssize_t ap_raw_hwtype_show(struct device *dev, | ||
669 | struct device_attribute *attr, char *buf) | ||
670 | { | ||
671 | struct ap_device *ap_dev = to_ap_dev(dev); | ||
672 | |||
673 | return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->raw_hwtype); | ||
674 | } | ||
675 | |||
676 | static DEVICE_ATTR(raw_hwtype, 0444, ap_raw_hwtype_show, NULL); | ||
677 | |||
667 | static ssize_t ap_depth_show(struct device *dev, struct device_attribute *attr, | 678 | static ssize_t ap_depth_show(struct device *dev, struct device_attribute *attr, |
668 | char *buf) | 679 | char *buf) |
669 | { | 680 | { |
@@ -734,6 +745,7 @@ static DEVICE_ATTR(ap_functions, 0444, ap_functions_show, NULL); | |||
734 | 745 | ||
735 | static struct attribute *ap_dev_attrs[] = { | 746 | static struct attribute *ap_dev_attrs[] = { |
736 | &dev_attr_hwtype.attr, | 747 | &dev_attr_hwtype.attr, |
748 | &dev_attr_raw_hwtype.attr, | ||
737 | &dev_attr_depth.attr, | 749 | &dev_attr_depth.attr, |
738 | &dev_attr_request_count.attr, | 750 | &dev_attr_request_count.attr, |
739 | &dev_attr_requestq_count.attr, | 751 | &dev_attr_requestq_count.attr, |
@@ -1417,9 +1429,13 @@ static void ap_scan_bus(struct work_struct *unused) | |||
1417 | continue; | 1429 | continue; |
1418 | } | 1430 | } |
1419 | break; | 1431 | break; |
1432 | case 11: | ||
1433 | ap_dev->device_type = 10; | ||
1434 | break; | ||
1420 | default: | 1435 | default: |
1421 | ap_dev->device_type = device_type; | 1436 | ap_dev->device_type = device_type; |
1422 | } | 1437 | } |
1438 | ap_dev->raw_hwtype = device_type; | ||
1423 | 1439 | ||
1424 | rc = ap_query_functions(qid, &device_functions); | 1440 | rc = ap_query_functions(qid, &device_functions); |
1425 | if (!rc) | 1441 | if (!rc) |
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h index db92e9fa5c07..055a0f956d17 100644 --- a/drivers/s390/crypto/ap_bus.h +++ b/drivers/s390/crypto/ap_bus.h | |||
@@ -161,6 +161,7 @@ struct ap_device { | |||
161 | ap_qid_t qid; /* AP queue id. */ | 161 | ap_qid_t qid; /* AP queue id. */ |
162 | int queue_depth; /* AP queue depth.*/ | 162 | int queue_depth; /* AP queue depth.*/ |
163 | int device_type; /* AP device type. */ | 163 | int device_type; /* AP device type. */ |
164 | int raw_hwtype; /* AP raw hardware type. */ | ||
164 | unsigned int functions; /* AP device function bitfield. */ | 165 | unsigned int functions; /* AP device function bitfield. */ |
165 | int unregistered; /* marks AP device as unregistered */ | 166 | int unregistered; /* marks AP device as unregistered */ |
166 | struct timer_list timeout; /* Timer for request timeouts. */ | 167 | struct timer_list timeout; /* Timer for request timeouts. */ |