Skip to contentSkip to conversation

s390 (11/12): crypto device driver.

PATCH New Martin Schwidefsky 1 participant 1 message Oct 8, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390 (11/12): crypto device driver.

[PATCH] s390: crypto device driver.

From: Eric Rossman <[email protected]>

crypto driver changes:
- Add support for zero-pad and crypto express II (CEX2C).

diffstat:

 drivers/s390/crypto/z90common.h   |   69 +++-
 drivers/s390/crypto/z90crypt.h    |   73 ++--
 drivers/s390/crypto/z90hardware.c |  285 ++++++++++------
 drivers/s390/crypto/z90main.c     |  653 +++++++++++++++++++++++++++-----------
 4 files changed, 756 insertions(+), 324 deletions(-)
drivers/s390/crypto/z90common.h +54 -15
diff -urN linux-2.6/drivers/s390/crypto/z90common.h linux-2.6-patched/drivers/s390/crypto/z90common.h
@@ -1,11 +1,11 @@
 /*
  *  linux/drivers/s390/misc/z90common.h
  *
- *  z90crypt 1.3.1
+ *  z90crypt 1.3.2
  *
  *  Copyright (C)  2001, 2004 IBM Corporation
  *  Author(s): Robert Burroughs ([email protected])
- *	       Eric Rossman ([email protected])
+ *             Eric Rossman ([email protected])
  *
  *  Hotplug & misc device support: Jochen Roehrig ([email protected])
  *
@@ -16,7 +16,7 @@
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
@@ -27,12 +27,13 @@
 #ifndef _Z90COMMON_
 #define _Z90COMMON_
 
-#define VERSION_Z90COMMON_H "$Revision: 1.8 $"
+#define VERSION_Z90COMMON_H "$Revision: 1.15 $"
 
 
 #define RESPBUFFSIZE 256
 #define PCI_FUNC_KEY_DECRYPT 0x5044
 #define PCI_FUNC_KEY_ENCRYPT 0x504B
+extern int ext_bitlens;
 
 enum devstat {
 	DEV_GONE,
@@ -56,6 +57,7 @@
 	HD_TSQ_EXCEPTION
 };
 
+#define Z90C_NO_DEVICES		1
 #define Z90C_AMBIGUOUS_DOMAIN	2
 #define Z90C_INCORRECT_DOMAIN	3
 #define ENOTINIT		4
@@ -74,13 +76,13 @@
 #define REC_OPERAND_SIZE 9
 #define REC_EVEN_MOD	10
 #define REC_NO_WORK	11
-#define REC_HARDWAR_ERR 12
-#define REC_NO_RESPONSE 13
+#define REC_HARDWAR_ERR	12
+#define REC_NO_RESPONSE	13
 #define REC_RETRY_DEV	14
 #define REC_USER_GONE	15
-#define REC_BAD_MESSAGE 16
-#define REC_INVALID_PAD 17
-#define REC_RELEASED	28
+#define REC_BAD_MESSAGE	16
+#define REC_INVALID_PAD	17
+#define REC_USE_PCICA	18
 
 #define WRONG_DEVICE_TYPE 20
 
@@ -89,18 +91,55 @@
 #define TSQ_FATAL_ERROR 34
 #define RSQ_FATAL_ERROR 35
 
-#define PCICA	0
-#define PCICC	1
-#define PCIXCC	2
-#define NILDEV	-1
-#define ANYDEV	-1
+#define Z90CRYPT_NUM_TYPES	5
+#define PCICA		0
+#define PCICC		1
+#define PCIXCC_MCL2	2
+#define PCIXCC_MCL3	3
+#define CEX2C		4
+#define NILDEV		-1
+#define ANYDEV		-1
+#define PCIXCC_UNK	-2
 
 enum hdevice_type {
 	PCICC_HW  = 3,
 	PCICA_HW  = 4,
 	PCIXCC_HW = 5,
 	OTHER_HW  = 6,
-	OTHER2_HW = 7
+	CEX2C_HW  = 7
+};
+
+struct CPRBX {
+	unsigned short cprb_len;
+	unsigned char  cprb_ver_id;
+	unsigned char  pad_000[3];
+	unsigned char  func_id[2];
+	unsigned char  cprb_flags[4];
+	unsigned int   req_parml;
+	unsigned int   req_datal;
+	unsigned int   rpl_msgbl;
+	unsigned int   rpld_parml;
+	unsigned int   rpl_datal;
+	unsigned int   rpld_datal;
+	unsigned int   req_extbl;
+	unsigned char  pad_001[4];
+	unsigned int   rpld_extbl;
+	unsigned char  req_parmb[16];
+	unsigned char  req_datab[16];
+	unsigned char  rpl_parmb[16];
+	unsigned char  rpl_datab[16];
+	unsigned char  req_extb[16];
+	unsigned char  rpl_extb[16];
+	unsigned short ccp_rtcode;
+	unsigned short ccp_rscode;
+	unsigned int   mac_data_len;
+	unsigned char  logon_id[8];
+	unsigned char  mac_value[8];
+	unsigned char  mac_content_flgs;
+	unsigned char  pad_002;
+	unsigned short domain;
+	unsigned char  pad_003[12];
+	unsigned char  pad_004[36];
 };
 
 #ifndef DEV_NAME
drivers/s390/crypto/z90crypt.h +50 -23

161 lines not on this page · raw message

drivers/s390/crypto/z90hardware.c +172 -113

611 lines not on this page · raw message

drivers/s390/crypto/z90main.c +480 -173

1,186 lines not on this page · raw message