module: icp: spi: remove crypto_control_ops_t

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12901
This commit is contained in:
наб 2021-12-22 22:03:00 +01:00 committed by Brian Behlendorf
parent 9cdf015d0a
commit 959b9d6392
7 changed files with 0 additions and 93 deletions

View File

@ -208,10 +208,6 @@ static void
allocate_ops_v1(const crypto_ops_t *src, crypto_ops_t *dst,
uint_t *mech_list_count)
{
if (src->co_control_ops != NULL)
dst->co_control_ops = kmem_alloc(sizeof (crypto_control_ops_t),
KM_SLEEP);
if (src->co_digest_ops != NULL)
dst->co_digest_ops = kmem_alloc(sizeof (crypto_digest_ops_t),
KM_SLEEP);
@ -412,11 +408,6 @@ kcf_free_provider_desc(kcf_provider_desc_t *desc)
CRYPTO_PROVIDER_DESCR_MAX_LEN + 1);
if (desc->pd_ops_vector != NULL) {
if (desc->pd_ops_vector->co_control_ops != NULL)
kmem_free(desc->pd_ops_vector->co_control_ops,
sizeof (crypto_control_ops_t));
if (desc->pd_ops_vector->co_digest_ops != NULL)
kmem_free(desc->pd_ops_vector->co_digest_ops,
sizeof (crypto_digest_ops_t));

View File

@ -509,7 +509,6 @@ typedef struct crypto_minor {
* of type kcf_prov_desc_t.
*/
#define KCF_PROV_CONTROL_OPS(pd) ((pd)->pd_ops_vector->co_control_ops)
#define KCF_PROV_CTX_OPS(pd) ((pd)->pd_ops_vector->co_ctx_ops)
#define KCF_PROV_DIGEST_OPS(pd) ((pd)->pd_ops_vector->co_digest_ops)
#define KCF_PROV_CIPHER_OPS(pd) ((pd)->pd_ops_vector->co_cipher_ops)
@ -528,17 +527,6 @@ typedef struct crypto_minor {
#define KCF_PROV_NOSTORE_KEY_OPS(pd) \
((pd)->pd_ops_vector->co_nostore_key_ops)
/*
* Wrappers for crypto_control_ops(9S) entry points.
*/
#define KCF_PROV_STATUS(pd, status) ( \
(KCF_PROV_CONTROL_OPS(pd) && \
KCF_PROV_CONTROL_OPS(pd)->provider_status) ? \
KCF_PROV_CONTROL_OPS(pd)->provider_status( \
(pd)->pd_prov_handle, status) : \
CRYPTO_NOT_SUPPORTED)
/*
* Wrappers for crypto_ctx_ops(9S) entry points.
*/

View File

@ -119,16 +119,6 @@ typedef struct crypto_ctx {
#define CRYPTO_EXTF_SO_PIN_LOCKED 0x00400000
#define CRYPTO_EXTF_SO_PIN_TO_BE_CHANGED 0x00800000
/*
* The crypto_control_ops structure contains pointers to control
* operations for cryptographic providers. It is passed through
* the crypto_ops(9S) structure when providers register with the
* kernel using crypto_register_provider(9F).
*/
typedef struct crypto_control_ops {
void (*provider_status)(crypto_provider_handle_t, uint_t *);
} __no_const crypto_control_ops_t;
/*
* The crypto_ctx_ops structure contains points to context and context
* templates management operations for cryptographic providers. It is
@ -498,7 +488,6 @@ typedef struct crypto_nostore_key_ops {
* by calling crypto_register_provider(9F).
*/
typedef struct crypto_ops_v1 {
const crypto_control_ops_t *co_control_ops;
const crypto_digest_ops_t *co_digest_ops;
const crypto_cipher_ops_t *co_cipher_ops;
const crypto_mac_ops_t *co_mac_ops;
@ -532,7 +521,6 @@ typedef struct crypto_ops {
} cou;
} crypto_ops_t;
#define co_control_ops cou.cou_v1.co_control_ops
#define co_digest_ops cou.cou_v1.co_digest_ops
#define co_cipher_ops cou.cou_v1.co_cipher_ops
#define co_mac_ops cou.cou_v1.co_mac_ops
@ -697,14 +685,6 @@ typedef struct crypto_provider_info {
#define CRYPTO_PIFLAGS_RESERVED2 0x40000000
#define CRYPTO_PIFLAGS_RESERVED1 0x80000000
/*
* Provider status passed by a provider to crypto_provider_notification(9F)
* and returned by the provider_status(9E) entry point.
*/
#define CRYPTO_PROVIDER_READY 0
#define CRYPTO_PROVIDER_BUSY 1
#define CRYPTO_PROVIDER_FAILED 2
/*
* Functions exported by Solaris to cryptographic providers. Providers
* call these functions to register and unregister, notify the kernel

View File

@ -75,12 +75,6 @@ static const crypto_mech_info_t aes_mech_info_tab[] = {
AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES}
};
static void aes_provider_status(crypto_provider_handle_t, uint_t *);
static const crypto_control_ops_t aes_control_ops = {
aes_provider_status
};
static int aes_encrypt_init(crypto_ctx_t *, crypto_mechanism_t *,
crypto_key_t *, crypto_spi_ctx_template_t, crypto_req_handle_t);
static int aes_decrypt_init(crypto_ctx_t *, crypto_mechanism_t *,
@ -150,7 +144,6 @@ static const crypto_ctx_ops_t aes_ctx_ops = {
};
static const crypto_ops_t aes_crypto_ops = {{{{{
&aes_control_ops,
NULL,
&aes_cipher_ops,
&aes_mac_ops,
@ -284,16 +277,6 @@ init_keysched(crypto_key_t *key, void *newbie)
return (CRYPTO_SUCCESS);
}
/*
* KCF software provider control entry points.
*/
static void
aes_provider_status(crypto_provider_handle_t provider, uint_t *status)
{
(void) provider;
*status = CRYPTO_PROVIDER_READY;
}
static int
aes_encrypt_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
crypto_key_t *key, crypto_spi_ctx_template_t template,

View File

@ -105,12 +105,6 @@ static const crypto_mech_info_t sha2_mech_info_tab[] = {
CRYPTO_KEYSIZE_UNIT_IN_BYTES}
};
static void sha2_provider_status(crypto_provider_handle_t, uint_t *);
static const crypto_control_ops_t sha2_control_ops = {
sha2_provider_status
};
static int sha2_digest_init(crypto_ctx_t *, crypto_mechanism_t *,
crypto_req_handle_t);
static int sha2_digest(crypto_ctx_t *, crypto_data_t *, crypto_data_t *,
@ -164,7 +158,6 @@ static const crypto_ctx_ops_t sha2_ctx_ops = {
};
static const crypto_ops_t sha2_crypto_ops = {{{{{
&sha2_control_ops,
&sha2_digest_ops,
NULL,
&sha2_mac_ops,
@ -229,16 +222,6 @@ sha2_mod_fini(void)
return (ret);
}
/*
* KCF software provider control entry points.
*/
static void
sha2_provider_status(crypto_provider_handle_t provider, uint_t *status)
{
(void) provider;
*status = CRYPTO_PROVIDER_READY;
}
/*
* KCF software provider digest entry points.
*/

View File

@ -51,12 +51,6 @@ static const crypto_mech_info_t skein_mech_info_tab[] = {
CRYPTO_KEYSIZE_UNIT_IN_BYTES}
};
static void skein_provider_status(crypto_provider_handle_t, uint_t *);
static const crypto_control_ops_t skein_control_ops = {
skein_provider_status
};
static int skein_digest_init(crypto_ctx_t *, crypto_mechanism_t *,
crypto_req_handle_t);
static int skein_digest(crypto_ctx_t *, crypto_data_t *, crypto_data_t *,
@ -102,7 +96,6 @@ static const crypto_ctx_ops_t skein_ctx_ops = {
};
static const crypto_ops_t skein_crypto_ops = {{{{{
&skein_control_ops,
&skein_digest_ops,
NULL,
&skein_mac_ops,
@ -222,16 +215,6 @@ skein_mod_fini(void)
return (0);
}
/*
* KCF software provider control entry points.
*/
static void
skein_provider_status(crypto_provider_handle_t provider, uint_t *status)
{
(void) provider;
*status = CRYPTO_PROVIDER_READY;
}
/*
* General Skein hashing helper functions.
*/

View File

@ -72,7 +72,6 @@ static const kcf_prov_stats_t kcf_stats_ks_data_template = {
static void
copy_ops_vector_v1(const crypto_ops_t *src_ops, crypto_ops_t *dst_ops)
{
KCF_SPI_COPY_OPS(src_ops, dst_ops, co_control_ops);
KCF_SPI_COPY_OPS(src_ops, dst_ops, co_digest_ops);
KCF_SPI_COPY_OPS(src_ops, dst_ops, co_cipher_ops);
KCF_SPI_COPY_OPS(src_ops, dst_ops, co_mac_ops);