Commit 42f4dd61 authored by Ingo Tuchscherer's avatar Ingo Tuchscherer Committed by Martin Schwidefsky

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: default avatarIngo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Signed-off-by: default avatarHarald Freudenberger <freude@linux.vnet.ibm.com>
parent b5f87f15
...@@ -664,6 +664,17 @@ static ssize_t ap_hwtype_show(struct device *dev, ...@@ -664,6 +664,17 @@ static ssize_t ap_hwtype_show(struct device *dev,
} }
static DEVICE_ATTR(hwtype, 0444, ap_hwtype_show, NULL); static DEVICE_ATTR(hwtype, 0444, ap_hwtype_show, NULL);
static ssize_t ap_raw_hwtype_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct ap_device *ap_dev = to_ap_dev(dev);
return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->raw_hwtype);
}
static DEVICE_ATTR(raw_hwtype, 0444, ap_raw_hwtype_show, NULL);
static ssize_t ap_depth_show(struct device *dev, struct device_attribute *attr, static ssize_t ap_depth_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
...@@ -734,6 +745,7 @@ static DEVICE_ATTR(ap_functions, 0444, ap_functions_show, NULL); ...@@ -734,6 +745,7 @@ static DEVICE_ATTR(ap_functions, 0444, ap_functions_show, NULL);
static struct attribute *ap_dev_attrs[] = { static struct attribute *ap_dev_attrs[] = {
&dev_attr_hwtype.attr, &dev_attr_hwtype.attr,
&dev_attr_raw_hwtype.attr,
&dev_attr_depth.attr, &dev_attr_depth.attr,
&dev_attr_request_count.attr, &dev_attr_request_count.attr,
&dev_attr_requestq_count.attr, &dev_attr_requestq_count.attr,
...@@ -1417,9 +1429,13 @@ static void ap_scan_bus(struct work_struct *unused) ...@@ -1417,9 +1429,13 @@ static void ap_scan_bus(struct work_struct *unused)
continue; continue;
} }
break; break;
case 11:
ap_dev->device_type = 10;
break;
default: default:
ap_dev->device_type = device_type; ap_dev->device_type = device_type;
} }
ap_dev->raw_hwtype = device_type;
rc = ap_query_functions(qid, &device_functions); rc = ap_query_functions(qid, &device_functions);
if (!rc) if (!rc)
......
...@@ -161,6 +161,7 @@ struct ap_device { ...@@ -161,6 +161,7 @@ struct ap_device {
ap_qid_t qid; /* AP queue id. */ ap_qid_t qid; /* AP queue id. */
int queue_depth; /* AP queue depth.*/ int queue_depth; /* AP queue depth.*/
int device_type; /* AP device type. */ int device_type; /* AP device type. */
int raw_hwtype; /* AP raw hardware type. */
unsigned int functions; /* AP device function bitfield. */ unsigned int functions; /* AP device function bitfield. */
int unregistered; /* marks AP device as unregistered */ int unregistered; /* marks AP device as unregistered */
struct timer_list timeout; /* Timer for request timeouts. */ struct timer_list timeout; /* Timer for request timeouts. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment