aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.vnet.ibm.com>2018-04-04 07:25:40 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-04-10 01:39:01 -0400
commit2a80786d477a3811c1a5410ddf08d0f981e53cf3 (patch)
tree22ad7822b6fdd1ab6c58e537c4e81ac266c50e1a
parentefda7adec7a5ad7aa3745df7c6740727b00ac8ba (diff)
s390/zcrypt: Remove deprecated ioctls.
This patch removes the old status calls which have been marked as deprecated since at least 2 years now. There is no known application or library relying on these ioctls any more. Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/include/uapi/asm/zcrypt.h41
-rw-r--r--drivers/s390/crypto/zcrypt_api.c62
-rw-r--r--drivers/s390/crypto/zcrypt_api.h24
3 files changed, 2 insertions, 125 deletions
diff --git a/arch/s390/include/uapi/asm/zcrypt.h b/arch/s390/include/uapi/asm/zcrypt.h
index d568307321fc..2e061b664b5c 100644
--- a/arch/s390/include/uapi/asm/zcrypt.h
+++ b/arch/s390/include/uapi/asm/zcrypt.h
@@ -303,38 +303,6 @@ struct zcrypt_device_matrix {
303 * 303 *
304 * Z90STAT_DOMAIN_INDEX 304 * Z90STAT_DOMAIN_INDEX
305 * Return the integer value of the Cryptographic Domain. 305 * Return the integer value of the Cryptographic Domain.
306 *
307 * The following ioctls are deprecated and should be no longer used:
308 *
309 * Z90STAT_TOTALCOUNT
310 * Return an integer count of all device types together.
311 *
312 * Z90STAT_PCICACOUNT
313 * Return an integer count of all PCICAs.
314 *
315 * Z90STAT_PCICCCOUNT
316 * Return an integer count of all PCICCs.
317 *
318 * Z90STAT_PCIXCCMCL2COUNT
319 * Return an integer count of all MCL2 PCIXCCs.
320 *
321 * Z90STAT_PCIXCCMCL3COUNT
322 * Return an integer count of all MCL3 PCIXCCs.
323 *
324 * Z90STAT_CEX2CCOUNT
325 * Return an integer count of all CEX2Cs.
326 *
327 * Z90STAT_CEX2ACOUNT
328 * Return an integer count of all CEX2As.
329 *
330 * ICAZ90STATUS
331 * Return some device driver status in a ica_z90_status struct
332 * This takes an ica_z90_status struct as its arg.
333 *
334 * Z90STAT_PCIXCCCOUNT
335 * Return an integer count of all PCIXCCs (MCL2 + MCL3).
336 * This is DEPRECATED now that MCL3 PCIXCCs are treated differently from
337 * MCL2 PCIXCCs.
338 */ 306 */
339 307
340/** 308/**
@@ -346,14 +314,7 @@ struct zcrypt_device_matrix {
346#define ZSENDEP11CPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x04, 0) 314#define ZSENDEP11CPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x04, 0)
347#define ZDEVICESTATUS _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x4f, 0) 315#define ZDEVICESTATUS _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x4f, 0)
348 316
349/* New status calls */ 317/* Status ioctl calls */
350#define Z90STAT_TOTALCOUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x40, int)
351#define Z90STAT_PCICACOUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x41, int)
352#define Z90STAT_PCICCCOUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x42, int)
353#define Z90STAT_PCIXCCMCL2COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x4b, int)
354#define Z90STAT_PCIXCCMCL3COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x4c, int)
355#define Z90STAT_CEX2CCOUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x4d, int)
356#define Z90STAT_CEX2ACOUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x4e, int)
357#define Z90STAT_REQUESTQ_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x44, int) 318#define Z90STAT_REQUESTQ_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x44, int)
358#define Z90STAT_PENDINGQ_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x45, int) 319#define Z90STAT_PENDINGQ_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x45, int)
359#define Z90STAT_TOTALOPEN_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x46, int) 320#define Z90STAT_TOTALOPEN_COUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x46, int)
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index ce15f101ee28..5df90cd0ecdd 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -760,35 +760,6 @@ static int zcrypt_count_type(int type)
760 return device_count; 760 return device_count;
761} 761}
762 762
763/**
764 * zcrypt_ica_status(): Old, depracted combi status call.
765 *
766 * Old, deprecated combi status call.
767 */
768static long zcrypt_ica_status(struct file *filp, unsigned long arg)
769{
770 struct ica_z90_status *pstat;
771 int ret;
772
773 pstat = kzalloc(sizeof(*pstat), GFP_KERNEL);
774 if (!pstat)
775 return -ENOMEM;
776 pstat->totalcount = zcrypt_device_count;
777 pstat->leedslitecount = zcrypt_count_type(ZCRYPT_PCICA);
778 pstat->leeds2count = zcrypt_count_type(ZCRYPT_PCICC);
779 pstat->requestqWaitCount = zcrypt_requestq_count();
780 pstat->pendingqWaitCount = zcrypt_pendingq_count();
781 pstat->totalOpenCount = atomic_read(&zcrypt_open_count);
782 pstat->cryptoDomain = ap_domain_index;
783 zcrypt_status_mask(pstat->status);
784 zcrypt_qdepth_mask(pstat->qdepth);
785 ret = 0;
786 if (copy_to_user((void __user *) arg, pstat, sizeof(*pstat)))
787 ret = -EFAULT;
788 kfree(pstat);
789 return ret;
790}
791
792static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd, 763static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd,
793 unsigned long arg) 764 unsigned long arg)
794{ 765{
@@ -923,39 +894,8 @@ static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd,
923 (int __user *) arg); 894 (int __user *) arg);
924 case Z90STAT_DOMAIN_INDEX: 895 case Z90STAT_DOMAIN_INDEX:
925 return put_user(ap_domain_index, (int __user *) arg); 896 return put_user(ap_domain_index, (int __user *) arg);
926 /* 897 /* unknown ioctl number */
927 * Deprecated ioctls. Don't add another device count ioctl,
928 * you can count them yourself in the user space with the
929 * output of the Z90STAT_STATUS_MASK ioctl.
930 */
931 case ICAZ90STATUS:
932 return zcrypt_ica_status(filp, arg);
933 case Z90STAT_TOTALCOUNT:
934 return put_user(zcrypt_device_count, (int __user *) arg);
935 case Z90STAT_PCICACOUNT:
936 return put_user(zcrypt_count_type(ZCRYPT_PCICA),
937 (int __user *) arg);
938 case Z90STAT_PCICCCOUNT:
939 return put_user(zcrypt_count_type(ZCRYPT_PCICC),
940 (int __user *) arg);
941 case Z90STAT_PCIXCCMCL2COUNT:
942 return put_user(zcrypt_count_type(ZCRYPT_PCIXCC_MCL2),
943 (int __user *) arg);
944 case Z90STAT_PCIXCCMCL3COUNT:
945 return put_user(zcrypt_count_type(ZCRYPT_PCIXCC_MCL3),
946 (int __user *) arg);
947 case Z90STAT_PCIXCCCOUNT:
948 return put_user(zcrypt_count_type(ZCRYPT_PCIXCC_MCL2) +
949 zcrypt_count_type(ZCRYPT_PCIXCC_MCL3),
950 (int __user *) arg);
951 case Z90STAT_CEX2CCOUNT:
952 return put_user(zcrypt_count_type(ZCRYPT_CEX2C),
953 (int __user *) arg);
954 case Z90STAT_CEX2ACOUNT:
955 return put_user(zcrypt_count_type(ZCRYPT_CEX2A),
956 (int __user *) arg);
957 default: 898 default:
958 /* unknown ioctl number */
959 return -ENOIOCTLCMD; 899 return -ENOIOCTLCMD;
960 } 900 }
961} 901}
diff --git a/drivers/s390/crypto/zcrypt_api.h b/drivers/s390/crypto/zcrypt_api.h
index 9fff8912f6e3..8cc5f8055d24 100644
--- a/drivers/s390/crypto/zcrypt_api.h
+++ b/drivers/s390/crypto/zcrypt_api.h
@@ -21,30 +21,6 @@
21#include <asm/zcrypt.h> 21#include <asm/zcrypt.h>
22#include "ap_bus.h" 22#include "ap_bus.h"
23 23
24/* deprecated status calls */
25#define ICAZ90STATUS _IOR(ZCRYPT_IOCTL_MAGIC, 0x10, struct ica_z90_status)
26#define Z90STAT_PCIXCCCOUNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x43, int)
27
28/**
29 * This structure is deprecated and the corresponding ioctl() has been
30 * replaced with individual ioctl()s for each piece of data!
31 */
32struct ica_z90_status {
33 int totalcount;
34 int leedslitecount; // PCICA
35 int leeds2count; // PCICC
36 // int PCIXCCCount; is not in struct for backward compatibility
37 int requestqWaitCount;
38 int pendingqWaitCount;
39 int totalOpenCount;
40 int cryptoDomain;
41 // status: 0=not there, 1=PCICA, 2=PCICC, 3=PCIXCC_MCL2, 4=PCIXCC_MCL3,
42 // 5=CEX2C
43 unsigned char status[64];
44 // qdepth: # work elements waiting for each device
45 unsigned char qdepth[64];
46};
47
48/** 24/**
49 * device type for an actual device is either PCICA, PCICC, PCIXCC_MCL2, 25 * device type for an actual device is either PCICA, PCICC, PCIXCC_MCL2,
50 * PCIXCC_MCL3, CEX2C, or CEX2A 26 * PCIXCC_MCL3, CEX2C, or CEX2A