Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ingo Tuchscherer and committed by
Martin Schwidefsky
42f4dd61 b5f87f15

+17
+16
drivers/s390/crypto/ap_bus.c
··· 664 664 } 665 665 666 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 678 static ssize_t ap_depth_show(struct device *dev, struct device_attribute *attr, 668 679 char *buf) 669 680 { ··· 745 734 746 735 static struct attribute *ap_dev_attrs[] = { 747 736 &dev_attr_hwtype.attr, 737 + &dev_attr_raw_hwtype.attr, 748 738 &dev_attr_depth.attr, 749 739 &dev_attr_request_count.attr, 750 740 &dev_attr_requestq_count.attr, ··· 1429 1417 continue; 1430 1418 } 1431 1419 break; 1420 + case 11: 1421 + ap_dev->device_type = 10; 1422 + break; 1432 1423 default: 1433 1424 ap_dev->device_type = device_type; 1434 1425 } 1426 + ap_dev->raw_hwtype = device_type; 1435 1427 1436 1428 rc = ap_query_functions(qid, &device_functions); 1437 1429 if (!rc)
+1
drivers/s390/crypto/ap_bus.h
··· 161 161 ap_qid_t qid; /* AP queue id. */ 162 162 int queue_depth; /* AP queue depth.*/ 163 163 int device_type; /* AP device type. */ 164 + int raw_hwtype; /* AP raw hardware type. */ 164 165 unsigned int functions; /* AP device function bitfield. */ 165 166 int unregistered; /* marks AP device as unregistered */ 166 167 struct timer_list timeout; /* Timer for request timeouts. */