summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-05-22 07:49:42 +0000
committerpjd <pjd@FreeBSD.org>2006-05-22 07:49:42 +0000
commit61873b7dc9516a1045ef58c8c134092c12023b2e (patch)
tree02d74c444cd39224d7f6bccdcfaab74cd39cee7d /sys/opencrypto
parent161ff0f03667052d20a1d997f9e8a945563136fd (diff)
downloadFreeBSD-src-61873b7dc9516a1045ef58c8c134092c12023b2e.zip
FreeBSD-src-61873b7dc9516a1045ef58c8c134092c12023b2e.tar.gz
Document how we synchronize access to the fields in the cryptocap
structure.
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/cryptodev.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h
index 919a717..dec754a 100644
--- a/sys/opencrypto/cryptodev.h
+++ b/sys/opencrypto/cryptodev.h
@@ -305,10 +305,17 @@ struct cryptkop {
int (*krp_callback)(struct cryptkop *);
};
-/* Crypto capabilities structure */
+/*
+ * Crypto capabilities structure.
+ *
+ * Synchronization:
+ * (d) - protected by CRYPTO_DRIVER_LOCK()
+ * (q) - protected by CRYPTO_Q_LOCK()
+ * Not tagged fields are read-only.
+ */
struct cryptocap {
- u_int32_t cc_sessions;
- u_int32_t cc_koperations;
+ u_int32_t cc_sessions; /* (d) number of sessions */
+ u_int32_t cc_koperations; /* (d) number os asym operations */
/*
* Largest possible operator length (in bits) for each type of
@@ -320,12 +327,12 @@ struct cryptocap {
u_int8_t cc_kalg[CRK_ALGORITHM_MAX + 1];
- u_int8_t cc_flags;
- u_int8_t cc_qblocked; /* symmetric q blocked */
- u_int8_t cc_kqblocked; /* asymmetric q blocked */
+ u_int8_t cc_flags; /* (d) flags */
#define CRYPTOCAP_F_CLEANUP 0x01 /* needs resource cleanup */
#define CRYPTOCAP_F_SOFTWARE 0x02 /* software implementation */
#define CRYPTOCAP_F_SYNC 0x04 /* operates synchronously */
+ u_int8_t cc_qblocked; /* (q) symmetric q blocked */
+ u_int8_t cc_kqblocked; /* (q) asymmetric q blocked */
void *cc_arg; /* callback argument */
int (*cc_newsession)(void*, u_int32_t*, struct cryptoini*);
OpenPOWER on IntegriCloud