crypto.c (158702) | crypto.c (158716) |
---|---|
1/* $OpenBSD: crypto.c,v 1.38 2002/06/11 11:14:29 beck Exp $ */ 2/*- 3 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) 4 * 5 * This code was written by Angelos D. Keromytis in Athens, Greece, in 6 * February 2000. Network Security Technologies Inc. (NSTI) kindly 7 * supported the development of this code. 8 * --- 7 unchanged lines hidden (view full) --- 16 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY 18 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE 19 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR 20 * PURPOSE. 21 */ 22 23#include <sys/cdefs.h> | 1/* $OpenBSD: crypto.c,v 1.38 2002/06/11 11:14:29 beck Exp $ */ 2/*- 3 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) 4 * 5 * This code was written by Angelos D. Keromytis in Athens, Greece, in 6 * February 2000. Network Security Technologies Inc. (NSTI) kindly 7 * supported the development of this code. 8 * --- 7 unchanged lines hidden (view full) --- 16 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY 18 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE 19 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR 20 * PURPOSE. 21 */ 22 23#include <sys/cdefs.h> |
24__FBSDID("$FreeBSD: head/sys/opencrypto/crypto.c 158702 2006-05-17 18:12:44Z pjd $"); | 24__FBSDID("$FreeBSD: head/sys/opencrypto/crypto.c 158716 2006-05-18 06:28:39Z pjd $"); |
25 26#define CRYPTO_TIMING /* enable timing support */ 27 28#include <sys/param.h> 29#include <sys/systm.h> 30#include <sys/eventhandler.h> 31#include <sys/kernel.h> 32#include <sys/kthread.h> --- 1033 unchanged lines hidden (view full) --- 1066 hint = 0; 1067 TAILQ_FOREACH(crp, &crp_q, crp_next) { 1068 hid = CRYPTO_SESID2HID(crp->crp_sid); 1069 cap = crypto_checkdriver(hid); 1070 /* 1071 * Driver cannot disappeared when there is an active 1072 * session. 1073 */ | 25 26#define CRYPTO_TIMING /* enable timing support */ 27 28#include <sys/param.h> 29#include <sys/systm.h> 30#include <sys/eventhandler.h> 31#include <sys/kernel.h> 32#include <sys/kthread.h> --- 1033 unchanged lines hidden (view full) --- 1066 hint = 0; 1067 TAILQ_FOREACH(crp, &crp_q, crp_next) { 1068 hid = CRYPTO_SESID2HID(crp->crp_sid); 1069 cap = crypto_checkdriver(hid); 1070 /* 1071 * Driver cannot disappeared when there is an active 1072 * session. 1073 */ |
1074 KASSERT(cap != NULL, ("%s: Driver disappeared.", 1075 __func__)); | 1074 KASSERT(cap != NULL, ("%s:%u Driver disappeared.", 1075 __func__, __LINE__)); |
1076 if (cap == NULL || cap->cc_process == NULL) { 1077 /* Op needs to be migrated, process it. */ 1078 if (submit == NULL) 1079 submit = crp; 1080 break; 1081 } 1082 if (!cap->cc_qblocked) { 1083 if (submit != NULL) { --- 16 unchanged lines hidden (view full) --- 1100 } 1101 } 1102 } 1103 if (submit != NULL) { 1104 TAILQ_REMOVE(&crp_q, submit, crp_next); 1105 CRYPTO_Q_UNLOCK(); 1106 hid = CRYPTO_SESID2HID(submit->crp_sid); 1107 cap = crypto_checkdriver(hid); | 1076 if (cap == NULL || cap->cc_process == NULL) { 1077 /* Op needs to be migrated, process it. */ 1078 if (submit == NULL) 1079 submit = crp; 1080 break; 1081 } 1082 if (!cap->cc_qblocked) { 1083 if (submit != NULL) { --- 16 unchanged lines hidden (view full) --- 1100 } 1101 } 1102 } 1103 if (submit != NULL) { 1104 TAILQ_REMOVE(&crp_q, submit, crp_next); 1105 CRYPTO_Q_UNLOCK(); 1106 hid = CRYPTO_SESID2HID(submit->crp_sid); 1107 cap = crypto_checkdriver(hid); |
1108 KASSERT(cap != NULL, ("%s:%u Driver disappeared.", 1109 __func__, __LINE__)); |
|
1108 result = crypto_invoke(cap, submit, hint); 1109 CRYPTO_Q_LOCK(); 1110 if (result == ERESTART) { 1111 /* 1112 * The driver ran out of resources, mark the 1113 * driver ``blocked'' for cryptop's and put 1114 * the request back in the queue. It would 1115 * best to put the request back where we got --- 129 unchanged lines hidden --- | 1110 result = crypto_invoke(cap, submit, hint); 1111 CRYPTO_Q_LOCK(); 1112 if (result == ERESTART) { 1113 /* 1114 * The driver ran out of resources, mark the 1115 * driver ``blocked'' for cryptop's and put 1116 * the request back in the queue. It would 1117 * best to put the request back where we got --- 129 unchanged lines hidden --- |