Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/eli/g_eli.h
Show All 37 Lines | |||||
#include <crypto/sha2/sha512.h> | #include <crypto/sha2/sha512.h> | ||||
#include <opencrypto/cryptodev.h> | #include <opencrypto/cryptodev.h> | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/bio.h> | #include <sys/bio.h> | ||||
#include <sys/libkern.h> | #include <sys/libkern.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <geom/geom.h> | #include <geom/geom.h> | ||||
#include <geom/geom_int.h> | |||||
#include <crypto/intake.h> | #include <crypto/intake.h> | ||||
#else | #else | ||||
#include <assert.h> | #include <assert.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <strings.h> | #include <strings.h> | ||||
#endif | #endif | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
#if (MAX_KEY_BYTES < G_ELI_DATAIVKEYLEN) | #if (MAX_KEY_BYTES < G_ELI_DATAIVKEYLEN) | ||||
#error "MAX_KEY_BYTES is less than G_ELI_DATAKEYLEN" | #error "MAX_KEY_BYTES is less than G_ELI_DATAKEYLEN" | ||||
#endif | #endif | ||||
extern int g_eli_debug; | extern int g_eli_debug; | ||||
extern u_int g_eli_overwrites; | extern u_int g_eli_overwrites; | ||||
extern u_int g_eli_batch; | extern u_int g_eli_batch; | ||||
#define G_ELI_DEBUG(lvl, ...) do { \ | #define G_ELI_DEBUG(lvl, ...) \ | ||||
if (g_eli_debug >= (lvl)) { \ | _GEOM_DEBUG("GEOM_ELI", g_eli_debug, (lvl), NULL, __VA_ARGS__) | ||||
printf("GEOM_ELI"); \ | #define G_ELI_LOGREQ(lvl, bp, ...) \ | ||||
if (g_eli_debug > 0) \ | _GEOM_DEBUG("GEOM_ELI", g_eli_debug, (lvl), (bp), __VA_ARGS__) | ||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
#define G_ELI_LOGREQ(lvl, bp, ...) do { \ | |||||
if (g_eli_debug >= (lvl)) { \ | |||||
printf("GEOM_ELI"); \ | |||||
if (g_eli_debug > 0) \ | |||||
printf("[%u]", lvl); \ | |||||
printf(": "); \ | |||||
printf(__VA_ARGS__); \ | |||||
printf(" "); \ | |||||
g_print_bio(bp); \ | |||||
printf("\n"); \ | |||||
} \ | |||||
} while (0) | |||||
struct g_eli_worker { | struct g_eli_worker { | ||||
struct g_eli_softc *w_softc; | struct g_eli_softc *w_softc; | ||||
struct proc *w_proc; | struct proc *w_proc; | ||||
u_int w_number; | u_int w_number; | ||||
crypto_session_t w_sid; | crypto_session_t w_sid; | ||||
boolean_t w_active; | boolean_t w_active; | ||||
LIST_ENTRY(g_eli_worker) w_next; | LIST_ENTRY(g_eli_worker) w_next; | ||||
▲ Show 20 Lines • Show All 554 Lines • Show Last 20 Lines |