diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/Kconfig | 21 | ||||
-rw-r--r-- | drivers/s390/crypto/Makefile | 13 | ||||
-rw-r--r-- | drivers/s390/crypto/zcrypt_mono.c | 100 |
3 files changed, 134 insertions, 0 deletions
diff --git a/drivers/s390/Kconfig b/drivers/s390/Kconfig index f0ea550d39bc..bc4261e8b606 100644 --- a/drivers/s390/Kconfig +++ b/drivers/s390/Kconfig | |||
@@ -217,4 +217,25 @@ endmenu | |||
217 | 217 | ||
218 | menu "Cryptographic devices" | 218 | menu "Cryptographic devices" |
219 | 219 | ||
220 | config ZCRYPT | ||
221 | tristate "Support for PCI-attached cryptographic adapters" | ||
222 | select ZCRYPT_MONOLITHIC if ZCRYPT="y" | ||
223 | default "m" | ||
224 | help | ||
225 | Select this option if you want to use a PCI-attached cryptographic | ||
226 | adapter like: | ||
227 | + PCI Cryptographic Accelerator (PCICA) | ||
228 | + PCI Cryptographic Coprocessor (PCICC) | ||
229 | + PCI-X Cryptographic Coprocessor (PCIXCC) | ||
230 | + Crypto Express2 Coprocessor (CEX2C) | ||
231 | + Crypto Express2 Accelerator (CEX2A) | ||
232 | |||
233 | config ZCRYPT_MONOLITHIC | ||
234 | bool "Monolithic zcrypt module" | ||
235 | depends on ZCRYPT="m" | ||
236 | help | ||
237 | Select this option if you want to have a single module z90crypt.ko | ||
238 | that contains all parts of the crypto device driver (ap bus, | ||
239 | request router and all the card drivers). | ||
240 | |||
220 | endmenu | 241 | endmenu |
diff --git a/drivers/s390/crypto/Makefile b/drivers/s390/crypto/Makefile index 67e75be8e4e4..f0a12d2eb780 100644 --- a/drivers/s390/crypto/Makefile +++ b/drivers/s390/crypto/Makefile | |||
@@ -2,3 +2,16 @@ | |||
2 | # S/390 crypto devices | 2 | # S/390 crypto devices |
3 | # | 3 | # |
4 | 4 | ||
5 | ifdef CONFIG_ZCRYPT_MONOLITHIC | ||
6 | |||
7 | z90crypt-objs := zcrypt_mono.o ap_bus.o zcrypt_api.o \ | ||
8 | zcrypt_pcica.o zcrypt_pcicc.o zcrypt_pcixcc.o zcrypt_cex2a.o | ||
9 | obj-$(CONFIG_ZCRYPT) += z90crypt.o | ||
10 | |||
11 | else | ||
12 | |||
13 | ap-objs := ap_bus.o | ||
14 | obj-$(CONFIG_ZCRYPT) += ap.o zcrypt_api.o zcrypt_pcicc.o zcrypt_pcixcc.o | ||
15 | obj-$(CONFIG_ZCRYPT) += zcrypt_pcica.o zcrypt_cex2a.o | ||
16 | |||
17 | endif | ||
diff --git a/drivers/s390/crypto/zcrypt_mono.c b/drivers/s390/crypto/zcrypt_mono.c new file mode 100644 index 000000000000..f48b61a6126c --- /dev/null +++ b/drivers/s390/crypto/zcrypt_mono.c | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | * linux/drivers/s390/crypto/zcrypt_mono.c | ||
3 | * | ||
4 | * zcrypt 2.0.0 | ||
5 | * | ||
6 | * Copyright (C) 2001, 2006 IBM Corporation | ||
7 | * Author(s): Robert Burroughs | ||
8 | * Eric Rossman (edrossma@us.ibm.com) | ||
9 | * | ||
10 | * Hotplug & misc device support: Jochen Roehrig (roehrig@de.ibm.com) | ||
11 | * Major cleanup & driver split: Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License as published by | ||
15 | * the Free Software Foundation; either version 2, or (at your option) | ||
16 | * any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the Free Software | ||
25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | */ | ||
27 | |||
28 | #include <linux/module.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/interrupt.h> | ||
31 | #include <linux/miscdevice.h> | ||
32 | #include <linux/fs.h> | ||
33 | #include <linux/proc_fs.h> | ||
34 | #include <linux/compat.h> | ||
35 | #include <asm/atomic.h> | ||
36 | #include <asm/uaccess.h> | ||
37 | |||
38 | #include "ap_bus.h" | ||
39 | #include "zcrypt_api.h" | ||
40 | #include "zcrypt_pcica.h" | ||
41 | #include "zcrypt_pcicc.h" | ||
42 | #include "zcrypt_pcixcc.h" | ||
43 | #include "zcrypt_cex2a.h" | ||
44 | |||
45 | /** | ||
46 | * The module initialization code. | ||
47 | */ | ||
48 | int __init zcrypt_init(void) | ||
49 | { | ||
50 | int rc; | ||
51 | |||
52 | rc = ap_module_init(); | ||
53 | if (rc) | ||
54 | goto out; | ||
55 | rc = zcrypt_api_init(); | ||
56 | if (rc) | ||
57 | goto out_ap; | ||
58 | rc = zcrypt_pcica_init(); | ||
59 | if (rc) | ||
60 | goto out_api; | ||
61 | rc = zcrypt_pcicc_init(); | ||
62 | if (rc) | ||
63 | goto out_pcica; | ||
64 | rc = zcrypt_pcixcc_init(); | ||
65 | if (rc) | ||
66 | goto out_pcicc; | ||
67 | rc = zcrypt_cex2a_init(); | ||
68 | if (rc) | ||
69 | goto out_pcixcc; | ||
70 | return 0; | ||
71 | |||
72 | out_pcixcc: | ||
73 | zcrypt_pcixcc_exit(); | ||
74 | out_pcicc: | ||
75 | zcrypt_pcicc_exit(); | ||
76 | out_pcica: | ||
77 | zcrypt_pcica_exit(); | ||
78 | out_api: | ||
79 | zcrypt_api_exit(); | ||
80 | out_ap: | ||
81 | ap_module_exit(); | ||
82 | out: | ||
83 | return rc; | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | * The module termination code. | ||
88 | */ | ||
89 | void __exit zcrypt_exit(void) | ||
90 | { | ||
91 | zcrypt_cex2a_exit(); | ||
92 | zcrypt_pcixcc_exit(); | ||
93 | zcrypt_pcicc_exit(); | ||
94 | zcrypt_pcica_exit(); | ||
95 | zcrypt_api_exit(); | ||
96 | ap_module_exit(); | ||
97 | } | ||
98 | |||
99 | module_init(zcrypt_init); | ||
100 | module_exit(zcrypt_exit); | ||