summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/rtems/bsd/local/cryptodev_if.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-22 14:59:50 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-21 10:29:41 +0200
commit3489e3b6396ee9944a6a2e19e675ca54c36993b4 (patch)
treecd55cfac1c96ff4b888a9606fd6a0d8eb65bb446 /rtemsbsd/include/rtems/bsd/local/cryptodev_if.h
parentck: Define CK_MD_PPC32_LWSYNC if available (diff)
downloadrtems-libbsd-3489e3b6396ee9944a6a2e19e675ca54c36993b4.tar.bz2
Update to FreeBSD head 2018-09-17
Git mirror commit 6c2192b1ef8c50788c751f878552526800b1e319. Update #3472.
Diffstat (limited to 'rtemsbsd/include/rtems/bsd/local/cryptodev_if.h')
-rw-r--r--rtemsbsd/include/rtems/bsd/local/cryptodev_if.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/rtemsbsd/include/rtems/bsd/local/cryptodev_if.h b/rtemsbsd/include/rtems/bsd/local/cryptodev_if.h
index 752527ed..a789317b 100644
--- a/rtemsbsd/include/rtems/bsd/local/cryptodev_if.h
+++ b/rtemsbsd/include/rtems/bsd/local/cryptodev_if.h
@@ -17,27 +17,43 @@
/** @brief Unique descriptor for the CRYPTODEV_NEWSESSION() method */
extern struct kobjop_desc cryptodev_newsession_desc;
/** @brief A function implementing the CRYPTODEV_NEWSESSION() method */
-typedef int cryptodev_newsession_t(device_t dev, uint32_t *sid,
+typedef int cryptodev_newsession_t(device_t dev,
+ crypto_session_t crypto_session,
struct cryptoini *cri);
+/**
+ * Crypto driver method to initialize a new session object with the given
+ * initialization parameters (cryptoini). The driver's session memory object
+ * is already allocated and zeroed, like driver softcs. It is accessed with
+ * crypto_get_driver_session().
+ */
-static __inline int CRYPTODEV_NEWSESSION(device_t dev, uint32_t *sid,
+static __inline int CRYPTODEV_NEWSESSION(device_t dev,
+ crypto_session_t crypto_session,
struct cryptoini *cri)
{
kobjop_t _m;
+ int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,cryptodev_newsession);
- return ((cryptodev_newsession_t *) _m)(dev, sid, cri);
+ rc = ((cryptodev_newsession_t *) _m)(dev, crypto_session, cri);
+ return (rc);
}
/** @brief Unique descriptor for the CRYPTODEV_FREESESSION() method */
extern struct kobjop_desc cryptodev_freesession_desc;
/** @brief A function implementing the CRYPTODEV_FREESESSION() method */
-typedef int cryptodev_freesession_t(device_t dev, uint64_t sid);
+typedef void cryptodev_freesession_t(device_t dev,
+ crypto_session_t crypto_session);
+/**
+ * Optional crypto driver method to release any additional allocations. OCF
+ * owns session memory itself; it is zeroed before release.
+ */
-static __inline int CRYPTODEV_FREESESSION(device_t dev, uint64_t sid)
+static __inline void CRYPTODEV_FREESESSION(device_t dev,
+ crypto_session_t crypto_session)
{
kobjop_t _m;
KOBJOPLOOKUP(((kobj_t)dev)->ops,cryptodev_freesession);
- return ((cryptodev_freesession_t *) _m)(dev, sid);
+ ((cryptodev_freesession_t *) _m)(dev, crypto_session);
}
/** @brief Unique descriptor for the CRYPTODEV_PROCESS() method */
@@ -49,8 +65,10 @@ static __inline int CRYPTODEV_PROCESS(device_t dev, struct cryptop *op,
int flags)
{
kobjop_t _m;
+ int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,cryptodev_process);
- return ((cryptodev_process_t *) _m)(dev, op, flags);
+ rc = ((cryptodev_process_t *) _m)(dev, op, flags);
+ return (rc);
}
/** @brief Unique descriptor for the CRYPTODEV_KPROCESS() method */
@@ -62,8 +80,10 @@ static __inline int CRYPTODEV_KPROCESS(device_t dev, struct cryptkop *op,
int flags)
{
kobjop_t _m;
+ int rc;
KOBJOPLOOKUP(((kobj_t)dev)->ops,cryptodev_kprocess);
- return ((cryptodev_kprocess_t *) _m)(dev, op, flags);
+ rc = ((cryptodev_kprocess_t *) _m)(dev, op, flags);
+ return (rc);
}
#endif /* _cryptodev_if_h_ */