/linux-4.4.14/drivers/s390/crypto/ |
H A D | zcrypt_msgtype50.c | 186 struct ap_message *ap_msg, ICAMEX_msg_to_type50MEX_msg() 195 struct type50_meb1_msg *meb1 = ap_msg->message; ICAMEX_msg_to_type50MEX_msg() 197 ap_msg->length = sizeof(*meb1); ICAMEX_msg_to_type50MEX_msg() 205 struct type50_meb2_msg *meb2 = ap_msg->message; ICAMEX_msg_to_type50MEX_msg() 207 ap_msg->length = sizeof(*meb2); ICAMEX_msg_to_type50MEX_msg() 216 struct type50_meb3_msg *meb3 = ap_msg->message; ICAMEX_msg_to_type50MEX_msg() 218 ap_msg->length = sizeof(*meb3); ICAMEX_msg_to_type50MEX_msg() 244 struct ap_message *ap_msg, ICACRT_msg_to_type50CRT_msg() 260 struct type50_crb1_msg *crb1 = ap_msg->message; ICACRT_msg_to_type50CRT_msg() 262 ap_msg->length = sizeof(*crb1); ICACRT_msg_to_type50CRT_msg() 273 struct type50_crb2_msg *crb2 = ap_msg->message; ICACRT_msg_to_type50CRT_msg() 275 ap_msg->length = sizeof(*crb2); ICACRT_msg_to_type50CRT_msg() 287 struct type50_crb3_msg *crb3 = ap_msg->message; ICACRT_msg_to_type50CRT_msg() 289 ap_msg->length = sizeof(*crb3); ICACRT_msg_to_type50CRT_msg() 399 goto out; /* ap_msg->rc indicates the error */ zcrypt_cex2a_receive() 427 struct ap_message ap_msg; zcrypt_cex2a_modexpo() local 431 ap_init_message(&ap_msg); zcrypt_cex2a_modexpo() 433 ap_msg.message = kmalloc(MSGTYPE50_CRB2_MAX_MSG_SIZE, zcrypt_cex2a_modexpo() 436 ap_msg.message = kmalloc(MSGTYPE50_CRB3_MAX_MSG_SIZE, zcrypt_cex2a_modexpo() 438 if (!ap_msg.message) zcrypt_cex2a_modexpo() 440 ap_msg.receive = zcrypt_cex2a_receive; zcrypt_cex2a_modexpo() 441 ap_msg.psmid = (((unsigned long long) current->pid) << 32) + zcrypt_cex2a_modexpo() 443 ap_msg.private = &work; zcrypt_cex2a_modexpo() 444 rc = ICAMEX_msg_to_type50MEX_msg(zdev, &ap_msg, mex); zcrypt_cex2a_modexpo() 448 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_cex2a_modexpo() 451 rc = ap_msg.rc; zcrypt_cex2a_modexpo() 453 rc = convert_response(zdev, &ap_msg, mex->outputdata, zcrypt_cex2a_modexpo() 457 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_cex2a_modexpo() 459 kfree(ap_msg.message); zcrypt_cex2a_modexpo() 473 struct ap_message ap_msg; zcrypt_cex2a_modexpo_crt() local 477 ap_init_message(&ap_msg); zcrypt_cex2a_modexpo_crt() 479 ap_msg.message = kmalloc(MSGTYPE50_CRB2_MAX_MSG_SIZE, zcrypt_cex2a_modexpo_crt() 482 ap_msg.message = kmalloc(MSGTYPE50_CRB3_MAX_MSG_SIZE, zcrypt_cex2a_modexpo_crt() 484 if (!ap_msg.message) zcrypt_cex2a_modexpo_crt() 486 ap_msg.receive = zcrypt_cex2a_receive; zcrypt_cex2a_modexpo_crt() 487 ap_msg.psmid = (((unsigned long long) current->pid) << 32) + zcrypt_cex2a_modexpo_crt() 489 ap_msg.private = &work; zcrypt_cex2a_modexpo_crt() 490 rc = ICACRT_msg_to_type50CRT_msg(zdev, &ap_msg, crt); zcrypt_cex2a_modexpo_crt() 494 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_cex2a_modexpo_crt() 497 rc = ap_msg.rc; zcrypt_cex2a_modexpo_crt() 499 rc = convert_response(zdev, &ap_msg, crt->outputdata, zcrypt_cex2a_modexpo_crt() 503 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_cex2a_modexpo_crt() 505 kfree(ap_msg.message); zcrypt_cex2a_modexpo_crt() 185 ICAMEX_msg_to_type50MEX_msg(struct zcrypt_device *zdev, struct ap_message *ap_msg, struct ica_rsa_modexpo *mex) ICAMEX_msg_to_type50MEX_msg() argument 243 ICACRT_msg_to_type50CRT_msg(struct zcrypt_device *zdev, struct ap_message *ap_msg, struct ica_rsa_modexpo_crt *crt) ICACRT_msg_to_type50CRT_msg() argument
|
H A D | zcrypt_msgtype6.c | 156 * @ap_msg: pointer to AP message 162 struct ap_message *ap_msg, ICAMEX_msg_to_type6MEX_msgX() 187 } __packed * msg = ap_msg->message; ICAMEX_msg_to_type6MEX_msgX() 215 ap_msg->length = size; ICAMEX_msg_to_type6MEX_msgX() 223 * @ap_msg: pointer to AP message 229 struct ap_message *ap_msg, ICACRT_msg_to_type6CRT_msgX() 255 } __packed * msg = ap_msg->message; ICACRT_msg_to_type6CRT_msgX() 282 ap_msg->length = size; ICACRT_msg_to_type6CRT_msgX() 290 * @ap_msg: pointer to AP message 301 struct ap_message *ap_msg, XCRB_msg_to_type6CPRB_msgX() 311 } __packed * msg = ap_msg->message; XCRB_msg_to_type6CPRB_msgX() 315 char *req_data = ap_msg->message + sizeof(struct type6_hdr) + rcblen; XCRB_msg_to_type6CPRB_msgX() 323 ap_msg->length = sizeof(struct type6_hdr) + XCRB_msg_to_type6CPRB_msgX() 326 if (ap_msg->length > MSGTYPE06_MAX_MSG_SIZE) XCRB_msg_to_type6CPRB_msgX() 383 ap_msg->special = 1; XCRB_msg_to_type6CPRB_msgX() 385 ap_msg->special = 0; XCRB_msg_to_type6CPRB_msgX() 396 struct ap_message *ap_msg, xcrb_msg_to_type6_ep11cprb_msgx() 415 } __packed * msg = ap_msg->message; xcrb_msg_to_type6_ep11cprb_msgx() 430 ap_msg->length = sizeof(struct type6_hdr) + xcRB->req_len; xcrb_msg_to_type6_ep11cprb_msgx() 833 goto out; /* ap_msg->rc indicates the error */ zcrypt_msgtype6_receive() 882 goto out; /* ap_msg->rc indicates the error */ zcrypt_msgtype6_receive_ep11() 914 struct ap_message ap_msg; zcrypt_msgtype6_modexpo() local 920 ap_init_message(&ap_msg); zcrypt_msgtype6_modexpo() 921 ap_msg.message = (void *) get_zeroed_page(GFP_KERNEL); zcrypt_msgtype6_modexpo() 922 if (!ap_msg.message) zcrypt_msgtype6_modexpo() 924 ap_msg.receive = zcrypt_msgtype6_receive; zcrypt_msgtype6_modexpo() 925 ap_msg.psmid = (((unsigned long long) current->pid) << 32) + zcrypt_msgtype6_modexpo() 927 ap_msg.private = &resp_type; zcrypt_msgtype6_modexpo() 928 rc = ICAMEX_msg_to_type6MEX_msgX(zdev, &ap_msg, mex); zcrypt_msgtype6_modexpo() 932 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_modexpo() 935 rc = ap_msg.rc; zcrypt_msgtype6_modexpo() 937 rc = convert_response_ica(zdev, &ap_msg, zcrypt_msgtype6_modexpo() 942 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_modexpo() 944 free_page((unsigned long) ap_msg.message); zcrypt_msgtype6_modexpo() 958 struct ap_message ap_msg; zcrypt_msgtype6_modexpo_crt() local 964 ap_init_message(&ap_msg); zcrypt_msgtype6_modexpo_crt() 965 ap_msg.message = (void *) get_zeroed_page(GFP_KERNEL); zcrypt_msgtype6_modexpo_crt() 966 if (!ap_msg.message) zcrypt_msgtype6_modexpo_crt() 968 ap_msg.receive = zcrypt_msgtype6_receive; zcrypt_msgtype6_modexpo_crt() 969 ap_msg.psmid = (((unsigned long long) current->pid) << 32) + zcrypt_msgtype6_modexpo_crt() 971 ap_msg.private = &resp_type; zcrypt_msgtype6_modexpo_crt() 972 rc = ICACRT_msg_to_type6CRT_msgX(zdev, &ap_msg, crt); zcrypt_msgtype6_modexpo_crt() 976 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_modexpo_crt() 979 rc = ap_msg.rc; zcrypt_msgtype6_modexpo_crt() 981 rc = convert_response_ica(zdev, &ap_msg, zcrypt_msgtype6_modexpo_crt() 986 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_modexpo_crt() 988 free_page((unsigned long) ap_msg.message); zcrypt_msgtype6_modexpo_crt() 1002 struct ap_message ap_msg; zcrypt_msgtype6_send_cprb() local 1008 ap_init_message(&ap_msg); zcrypt_msgtype6_send_cprb() 1009 ap_msg.message = kmalloc(MSGTYPE06_MAX_MSG_SIZE, GFP_KERNEL); zcrypt_msgtype6_send_cprb() 1010 if (!ap_msg.message) zcrypt_msgtype6_send_cprb() 1012 ap_msg.receive = zcrypt_msgtype6_receive; zcrypt_msgtype6_send_cprb() 1013 ap_msg.psmid = (((unsigned long long) current->pid) << 32) + zcrypt_msgtype6_send_cprb() 1015 ap_msg.private = &resp_type; zcrypt_msgtype6_send_cprb() 1016 rc = XCRB_msg_to_type6CPRB_msgX(zdev, &ap_msg, xcRB); zcrypt_msgtype6_send_cprb() 1020 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_send_cprb() 1023 rc = ap_msg.rc; zcrypt_msgtype6_send_cprb() 1025 rc = convert_response_xcrb(zdev, &ap_msg, xcRB); zcrypt_msgtype6_send_cprb() 1028 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_send_cprb() 1030 kzfree(ap_msg.message); zcrypt_msgtype6_send_cprb() 1044 struct ap_message ap_msg; zcrypt_msgtype6_send_ep11_cprb() local 1050 ap_init_message(&ap_msg); zcrypt_msgtype6_send_ep11_cprb() 1051 ap_msg.message = kmalloc(MSGTYPE06_MAX_MSG_SIZE, GFP_KERNEL); zcrypt_msgtype6_send_ep11_cprb() 1052 if (!ap_msg.message) zcrypt_msgtype6_send_ep11_cprb() 1054 ap_msg.receive = zcrypt_msgtype6_receive_ep11; zcrypt_msgtype6_send_ep11_cprb() 1055 ap_msg.psmid = (((unsigned long long) current->pid) << 32) + zcrypt_msgtype6_send_ep11_cprb() 1057 ap_msg.private = &resp_type; zcrypt_msgtype6_send_ep11_cprb() 1058 rc = xcrb_msg_to_type6_ep11cprb_msgx(zdev, &ap_msg, xcrb); zcrypt_msgtype6_send_ep11_cprb() 1062 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_send_ep11_cprb() 1065 rc = ap_msg.rc; zcrypt_msgtype6_send_ep11_cprb() 1067 rc = convert_response_ep11_xcrb(zdev, &ap_msg, xcrb); zcrypt_msgtype6_send_ep11_cprb() 1070 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_send_ep11_cprb() 1073 kzfree(ap_msg.message); zcrypt_msgtype6_send_ep11_cprb() 1088 struct ap_message ap_msg; zcrypt_msgtype6_rng() local 1094 ap_init_message(&ap_msg); zcrypt_msgtype6_rng() 1095 ap_msg.message = kmalloc(MSGTYPE06_MAX_MSG_SIZE, GFP_KERNEL); zcrypt_msgtype6_rng() 1096 if (!ap_msg.message) zcrypt_msgtype6_rng() 1098 ap_msg.receive = zcrypt_msgtype6_receive; zcrypt_msgtype6_rng() 1099 ap_msg.psmid = (((unsigned long long) current->pid) << 32) + zcrypt_msgtype6_rng() 1101 ap_msg.private = &resp_type; zcrypt_msgtype6_rng() 1102 rng_type6CPRB_msgX(zdev->ap_dev, &ap_msg, ZCRYPT_RNG_BUFFER_SIZE); zcrypt_msgtype6_rng() 1104 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_rng() 1107 rc = ap_msg.rc; zcrypt_msgtype6_rng() 1109 rc = convert_response_rng(zdev, &ap_msg, buffer); zcrypt_msgtype6_rng() 1112 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_rng() 1113 kfree(ap_msg.message); zcrypt_msgtype6_rng() 161 ICAMEX_msg_to_type6MEX_msgX(struct zcrypt_device *zdev, struct ap_message *ap_msg, struct ica_rsa_modexpo *mex) ICAMEX_msg_to_type6MEX_msgX() argument 228 ICACRT_msg_to_type6CRT_msgX(struct zcrypt_device *zdev, struct ap_message *ap_msg, struct ica_rsa_modexpo_crt *crt) ICACRT_msg_to_type6CRT_msgX() argument 300 XCRB_msg_to_type6CPRB_msgX(struct zcrypt_device *zdev, struct ap_message *ap_msg, struct ica_xcRB *xcRB) XCRB_msg_to_type6CPRB_msgX() argument 395 xcrb_msg_to_type6_ep11cprb_msgx(struct zcrypt_device *zdev, struct ap_message *ap_msg, struct ep11_urb *xcRB) xcrb_msg_to_type6_ep11cprb_msgx() argument
|
H A D | ap_bus.h | 244 static inline void ap_init_message(struct ap_message *ap_msg) ap_init_message() argument 246 ap_msg->psmid = 0; ap_init_message() 247 ap_msg->length = 0; ap_init_message() 248 ap_msg->rc = 0; ap_init_message() 249 ap_msg->special = 0; ap_init_message() 250 ap_msg->receive = NULL; ap_init_message() 261 void ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg); 262 void ap_cancel_message(struct ap_device *ap_dev, struct ap_message *ap_msg);
|
H A D | ap_bus.c | 554 struct ap_message *ap_msg; ap_sm_recv() local 565 list_for_each_entry(ap_msg, &ap_dev->pendingq, list) { ap_sm_recv() 566 if (ap_msg->psmid != ap_dev->reply->psmid) ap_sm_recv() 568 list_del_init(&ap_msg->list); ap_sm_recv() 570 ap_msg->receive(ap_dev, ap_msg, ap_dev->reply); ap_sm_recv() 628 struct ap_message *ap_msg; ap_sm_write() local 633 ap_msg = list_entry(ap_dev->requestq.next, struct ap_message, list); ap_sm_write() 634 status = __ap_send(ap_dev->qid, ap_msg->psmid, ap_sm_write() 635 ap_msg->message, ap_msg->length, ap_msg->special); ap_sm_write() 643 list_move_tail(&ap_msg->list, &ap_dev->pendingq); ap_sm_write() 659 list_del_init(&ap_msg->list); ap_sm_write() 661 ap_msg->rc = -EINVAL; ap_sm_write() 662 ap_msg->receive(ap_dev, ap_msg, NULL); ap_sm_write() 974 * @ap_msg: The message that is to be added 976 void ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg) ap_queue_message() argument 980 BUG_ON(!ap_msg->receive); ap_queue_message() 984 list_add_tail(&ap_msg->list, &ap_dev->requestq); ap_queue_message() 996 * @ap_msg: The message that is to be removed 1003 void ap_cancel_message(struct ap_device *ap_dev, struct ap_message *ap_msg) ap_cancel_message() argument 1008 if (!list_empty(&ap_msg->list)) { ap_cancel_message() 1010 if (tmp->psmid == ap_msg->psmid) { ap_cancel_message() 1016 list_del_init(&ap_msg->list); ap_cancel_message() 1338 struct ap_message *ap_msg, *next; __ap_flush_queue() local 1340 list_for_each_entry_safe(ap_msg, next, &ap_dev->pendingq, list) { __ap_flush_queue() 1341 list_del_init(&ap_msg->list); __ap_flush_queue() 1343 ap_msg->rc = -EAGAIN; __ap_flush_queue() 1344 ap_msg->receive(ap_dev, ap_msg, NULL); __ap_flush_queue() 1346 list_for_each_entry_safe(ap_msg, next, &ap_dev->requestq, list) { __ap_flush_queue() 1347 list_del_init(&ap_msg->list); __ap_flush_queue() 1349 ap_msg->rc = -EAGAIN; __ap_flush_queue() 1350 ap_msg->receive(ap_dev, ap_msg, NULL); __ap_flush_queue()
|
H A D | zcrypt_msgtype6.h | 123 * @ap_msg: pointer to AP message 126 struct ap_message *ap_msg, rng_type6CPRB_msgX() 137 } __packed * msg = ap_msg->message; rng_type6CPRB_msgX() 165 ap_msg->length = sizeof(*msg); rng_type6CPRB_msgX() 125 rng_type6CPRB_msgX(struct ap_device *ap_dev, struct ap_message *ap_msg, unsigned random_number_length) rng_type6CPRB_msgX() argument
|
H A D | zcrypt_pcixcc.c | 216 struct ap_message ap_msg; zcrypt_pcixcc_rng_supported() local 225 ap_init_message(&ap_msg); zcrypt_pcixcc_rng_supported() 226 ap_msg.message = (void *) get_zeroed_page(GFP_KERNEL); zcrypt_pcixcc_rng_supported() 227 if (!ap_msg.message) zcrypt_pcixcc_rng_supported() 230 rng_type6CPRB_msgX(ap_dev, &ap_msg, 4); zcrypt_pcixcc_rng_supported() 231 rc = ap_send(ap_dev->qid, 0x0102030405060708ULL, ap_msg.message, zcrypt_pcixcc_rng_supported() 232 ap_msg.length); zcrypt_pcixcc_rng_supported() 239 rc = ap_recv(ap_dev->qid, &psmid, ap_msg.message, 4096); zcrypt_pcixcc_rng_supported() 250 reply = ap_msg.message; zcrypt_pcixcc_rng_supported() 256 free_page((unsigned long) ap_msg.message); zcrypt_pcixcc_rng_supported()
|