提交 bdea1f1b 编写于 作者: I Ingo Tuchscherer 提交者: Martin Schwidefsky

s390/zcrypt: Add support for new crypto express (CEX5S) adapter.

Extends the generic cryptographic device driver (zcrypt)
to support the Crypto Express 5S adapter.
Signed-off-by: NIngo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 5bc334bf
...@@ -1489,9 +1489,6 @@ static void ap_scan_bus(struct work_struct *unused) ...@@ -1489,9 +1489,6 @@ 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;
} }
......
...@@ -117,6 +117,7 @@ static inline int ap_test_bit(unsigned int *ptr, unsigned int nr) ...@@ -117,6 +117,7 @@ static inline int ap_test_bit(unsigned int *ptr, unsigned int nr)
#define AP_DEVICE_TYPE_CEX3A 8 #define AP_DEVICE_TYPE_CEX3A 8
#define AP_DEVICE_TYPE_CEX3C 9 #define AP_DEVICE_TYPE_CEX3C 9
#define AP_DEVICE_TYPE_CEX4 10 #define AP_DEVICE_TYPE_CEX4 10
#define AP_DEVICE_TYPE_CEX5 11
/* /*
* Known function facilities * Known function facilities
......
...@@ -75,6 +75,7 @@ struct ica_z90_status { ...@@ -75,6 +75,7 @@ struct ica_z90_status {
#define ZCRYPT_CEX3C 7 #define ZCRYPT_CEX3C 7
#define ZCRYPT_CEX3A 8 #define ZCRYPT_CEX3A 8
#define ZCRYPT_CEX4 10 #define ZCRYPT_CEX4 10
#define ZCRYPT_CEX5 11
/** /**
* Large random numbers are pulled in 4096 byte chunks from the crypto cards * Large random numbers are pulled in 4096 byte chunks from the crypto cards
......
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
#define CEX4A_SPEED_RATING 900 /* TODO new card, new speed rating */ #define CEX4A_SPEED_RATING 900 /* TODO new card, new speed rating */
#define CEX4C_SPEED_RATING 6500 /* TODO new card, new speed rating */ #define CEX4C_SPEED_RATING 6500 /* TODO new card, new speed rating */
#define CEX4P_SPEED_RATING 7000 /* TODO new card, new speed rating */
#define CEX5A_SPEED_RATING 450 /* TODO new card, new speed rating */
#define CEX5C_SPEED_RATING 3250 /* TODO new card, new speed rating */
#define CEX5P_SPEED_RATING 3500 /* TODO new card, new speed rating */
#define CEX4A_MAX_MESSAGE_SIZE MSGTYPE50_CRB3_MAX_MSG_SIZE #define CEX4A_MAX_MESSAGE_SIZE MSGTYPE50_CRB3_MAX_MSG_SIZE
#define CEX4C_MAX_MESSAGE_SIZE MSGTYPE06_MAX_MSG_SIZE #define CEX4C_MAX_MESSAGE_SIZE MSGTYPE06_MAX_MSG_SIZE
...@@ -39,6 +43,7 @@ ...@@ -39,6 +43,7 @@
static struct ap_device_id zcrypt_cex4_ids[] = { static struct ap_device_id zcrypt_cex4_ids[] = {
{ AP_DEVICE(AP_DEVICE_TYPE_CEX4) }, { AP_DEVICE(AP_DEVICE_TYPE_CEX4) },
{ AP_DEVICE(AP_DEVICE_TYPE_CEX5) },
{ /* end of list */ }, { /* end of list */ },
}; };
...@@ -70,11 +75,18 @@ static int zcrypt_cex4_probe(struct ap_device *ap_dev) ...@@ -70,11 +75,18 @@ static int zcrypt_cex4_probe(struct ap_device *ap_dev)
switch (ap_dev->device_type) { switch (ap_dev->device_type) {
case AP_DEVICE_TYPE_CEX4: case AP_DEVICE_TYPE_CEX4:
case AP_DEVICE_TYPE_CEX5:
if (ap_test_bit(&ap_dev->functions, AP_FUNC_ACCEL)) { if (ap_test_bit(&ap_dev->functions, AP_FUNC_ACCEL)) {
zdev = zcrypt_device_alloc(CEX4A_MAX_MESSAGE_SIZE); zdev = zcrypt_device_alloc(CEX4A_MAX_MESSAGE_SIZE);
if (!zdev) if (!zdev)
return -ENOMEM; return -ENOMEM;
zdev->type_string = "CEX4A"; if (ap_dev->device_type == AP_DEVICE_TYPE_CEX4) {
zdev->type_string = "CEX4A";
zdev->speed_rating = CEX4A_SPEED_RATING;
} else {
zdev->type_string = "CEX5A";
zdev->speed_rating = CEX5A_SPEED_RATING;
}
zdev->user_space_type = ZCRYPT_CEX3A; zdev->user_space_type = ZCRYPT_CEX3A;
zdev->min_mod_size = CEX4A_MIN_MOD_SIZE; zdev->min_mod_size = CEX4A_MIN_MOD_SIZE;
if (ap_test_bit(&ap_dev->functions, AP_FUNC_MEX4K) && if (ap_test_bit(&ap_dev->functions, AP_FUNC_MEX4K) &&
...@@ -90,33 +102,42 @@ static int zcrypt_cex4_probe(struct ap_device *ap_dev) ...@@ -90,33 +102,42 @@ static int zcrypt_cex4_probe(struct ap_device *ap_dev)
CEX4A_MAX_MOD_SIZE_2K; CEX4A_MAX_MOD_SIZE_2K;
} }
zdev->short_crt = 1; zdev->short_crt = 1;
zdev->speed_rating = CEX4A_SPEED_RATING;
zdev->ops = zcrypt_msgtype_request(MSGTYPE50_NAME, zdev->ops = zcrypt_msgtype_request(MSGTYPE50_NAME,
MSGTYPE50_VARIANT_DEFAULT); MSGTYPE50_VARIANT_DEFAULT);
} else if (ap_test_bit(&ap_dev->functions, AP_FUNC_COPRO)) { } else if (ap_test_bit(&ap_dev->functions, AP_FUNC_COPRO)) {
zdev = zcrypt_device_alloc(CEX4C_MAX_MESSAGE_SIZE); zdev = zcrypt_device_alloc(CEX4C_MAX_MESSAGE_SIZE);
if (!zdev) if (!zdev)
return -ENOMEM; return -ENOMEM;
zdev->type_string = "CEX4C"; if (ap_dev->device_type == AP_DEVICE_TYPE_CEX4) {
zdev->type_string = "CEX4C";
zdev->speed_rating = CEX4C_SPEED_RATING;
} else {
zdev->type_string = "CEX5C";
zdev->speed_rating = CEX5C_SPEED_RATING;
}
zdev->user_space_type = ZCRYPT_CEX3C; zdev->user_space_type = ZCRYPT_CEX3C;
zdev->min_mod_size = CEX4C_MIN_MOD_SIZE; zdev->min_mod_size = CEX4C_MIN_MOD_SIZE;
zdev->max_mod_size = CEX4C_MAX_MOD_SIZE; zdev->max_mod_size = CEX4C_MAX_MOD_SIZE;
zdev->max_exp_bit_length = CEX4C_MAX_MOD_SIZE; zdev->max_exp_bit_length = CEX4C_MAX_MOD_SIZE;
zdev->short_crt = 0; zdev->short_crt = 0;
zdev->speed_rating = CEX4C_SPEED_RATING;
zdev->ops = zcrypt_msgtype_request(MSGTYPE06_NAME, zdev->ops = zcrypt_msgtype_request(MSGTYPE06_NAME,
MSGTYPE06_VARIANT_DEFAULT); MSGTYPE06_VARIANT_DEFAULT);
} else if (ap_test_bit(&ap_dev->functions, AP_FUNC_EP11)) { } else if (ap_test_bit(&ap_dev->functions, AP_FUNC_EP11)) {
zdev = zcrypt_device_alloc(CEX4C_MAX_MESSAGE_SIZE); zdev = zcrypt_device_alloc(CEX4C_MAX_MESSAGE_SIZE);
if (!zdev) if (!zdev)
return -ENOMEM; return -ENOMEM;
zdev->type_string = "CEX4P"; if (ap_dev->device_type == AP_DEVICE_TYPE_CEX4) {
zdev->type_string = "CEX4P";
zdev->speed_rating = CEX4P_SPEED_RATING;
} else {
zdev->type_string = "CEX5P";
zdev->speed_rating = CEX5P_SPEED_RATING;
}
zdev->user_space_type = ZCRYPT_CEX4; zdev->user_space_type = ZCRYPT_CEX4;
zdev->min_mod_size = CEX4C_MIN_MOD_SIZE; zdev->min_mod_size = CEX4C_MIN_MOD_SIZE;
zdev->max_mod_size = CEX4C_MAX_MOD_SIZE; zdev->max_mod_size = CEX4C_MAX_MOD_SIZE;
zdev->max_exp_bit_length = CEX4C_MAX_MOD_SIZE; zdev->max_exp_bit_length = CEX4C_MAX_MOD_SIZE;
zdev->short_crt = 0; zdev->short_crt = 0;
zdev->speed_rating = CEX4C_SPEED_RATING;
zdev->ops = zcrypt_msgtype_request(MSGTYPE06_NAME, zdev->ops = zcrypt_msgtype_request(MSGTYPE06_NAME,
MSGTYPE06_VARIANT_EP11); MSGTYPE06_VARIANT_EP11);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册