Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
mv_cesa.c File Reference
#include <crypto/aes.h>
#include <crypto/algapi.h>
#include <linux/crypto.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kthread.h>
#include <linux/platform_device.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/clk.h>
#include <crypto/internal/hash.h>
#include <crypto/sha.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/of_irq.h>
#include "mv_cesa.h"

Go to the source code of this file.

Data Structures

struct  req_progress
 
struct  crypto_priv
 
struct  mv_ctx
 
struct  mv_req_ctx
 
struct  mv_tfm_hash_ctx
 
struct  mv_req_hash_ctx
 

Macros

#define MV_CESA   "MV-CESA:"
 
#define MAX_HW_HASH_SIZE   0xFFFF
 
#define MV_CESA_EXPIRE   500 /* msec */
 

Enumerations

enum  engine_status { ENGINE_IDLE, ENGINE_BUSY, ENGINE_W_DEQUEUE }
 
enum  crypto_op { COP_AES_ECB, COP_AES_CBC }
 
enum  hash_op { COP_SHA1, COP_HMAC_SHA1, HASH_OPER_MODE_HASH = 0x0, HASH_OPER_MODE_HMAC = 0x1 }
 

Functions

irqreturn_t crypto_int (int irq, void *priv)
 
 MODULE_DEVICE_TABLE (of, mv_cesa_of_match_table)
 
 MODULE_ALIAS ("platform:mv_crypto")
 
 module_platform_driver (marvell_crypto)
 
 MODULE_AUTHOR ("Sebastian Andrzej Siewior <sebastian@breakpoint.cc>")
 
 MODULE_DESCRIPTION ("Support for Marvell's cryptographic engine")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct crypto_alg mv_aes_alg_ecb
 
struct crypto_alg mv_aes_alg_cbc
 
struct ahash_alg mv_sha1_alg
 
struct ahash_alg mv_hmac_sha1_alg
 

Macro Definition Documentation

#define MAX_HW_HASH_SIZE   0xFFFF

Definition at line 29 of file mv_cesa.c.

#define MV_CESA   "MV-CESA:"

Definition at line 28 of file mv_cesa.c.

#define MV_CESA_EXPIRE   500 /* msec */

Definition at line 30 of file mv_cesa.c.

Enumeration Type Documentation

enum crypto_op
Enumerator:
COP_AES_ECB 
COP_AES_CBC 

Definition at line 112 of file mv_cesa.c.

Enumerator:
ENGINE_IDLE 
ENGINE_BUSY 
ENGINE_W_DEQUEUE 

Definition at line 42 of file mv_cesa.c.

enum hash_op
Enumerator:
COP_SHA1 
COP_HMAC_SHA1 
HASH_OPER_MODE_HASH 
HASH_OPER_MODE_HMAC 

Definition at line 122 of file mv_cesa.c.

Function Documentation

irqreturn_t crypto_int ( int  irq,
void priv 
)

Definition at line 910 of file mv_cesa.c.

MODULE_ALIAS ( "platform:mv_crypto"  )
MODULE_AUTHOR ( "Sebastian Andrzej Siewior <sebastian@breakpoint.cc>"  )
MODULE_DESCRIPTION ( "Support for Marvell's cryptographic engine"  )
MODULE_DEVICE_TABLE ( of  ,
mv_cesa_of_match_table   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( marvell_crypto  )

Variable Documentation

struct crypto_alg mv_aes_alg_cbc
Initial value:
= {
.cra_name = "cbc(aes)",
.cra_driver_name = "mv-cbc-aes",
.cra_priority = 300,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct mv_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_init = mv_cra_init,
.cra_u = {
.ablkcipher = {
.ivsize = AES_BLOCK_SIZE,
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.setkey = mv_setkey_aes,
.encrypt = mv_enc_aes_cbc,
.decrypt = mv_dec_aes_cbc,
},
},
}

Definition at line 954 of file mv_cesa.c.

struct crypto_alg mv_aes_alg_ecb
Initial value:
= {
.cra_name = "ecb(aes)",
.cra_driver_name = "mv-ecb-aes",
.cra_priority = 300,
.cra_blocksize = 16,
.cra_ctxsize = sizeof(struct mv_ctx),
.cra_alignmask = 0,
.cra_type = &crypto_ablkcipher_type,
.cra_module = THIS_MODULE,
.cra_init = mv_cra_init,
.cra_u = {
.ablkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.setkey = mv_setkey_aes,
.encrypt = mv_enc_aes_ecb,
.decrypt = mv_dec_aes_ecb,
},
},
}

Definition at line 931 of file mv_cesa.c.

struct ahash_alg mv_hmac_sha1_alg
Initial value:
= {
.init = mv_hash_init,
.update = mv_hash_update,
.final = mv_hash_final,
.finup = mv_hash_finup,
.digest = mv_hash_digest,
.setkey = mv_hash_setkey,
.halg = {
.digestsize = SHA1_DIGEST_SIZE,
.base = {
.cra_name = "hmac(sha1)",
.cra_driver_name = "mv-hmac-sha1",
.cra_priority = 300,
.cra_flags =
.cra_blocksize = SHA1_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct mv_tfm_hash_ctx),
.cra_init = mv_cra_hash_hmac_sha1_init,
.cra_exit = mv_cra_hash_exit,
.cra_module = THIS_MODULE,
}
}
}

Definition at line 1002 of file mv_cesa.c.

struct ahash_alg mv_sha1_alg
Initial value:
= {
.init = mv_hash_init,
.update = mv_hash_update,
.final = mv_hash_final,
.finup = mv_hash_finup,
.digest = mv_hash_digest,
.halg = {
.digestsize = SHA1_DIGEST_SIZE,
.base = {
.cra_name = "sha1",
.cra_driver_name = "mv-sha1",
.cra_priority = 300,
.cra_flags =
.cra_blocksize = SHA1_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct mv_tfm_hash_ctx),
.cra_init = mv_cra_hash_sha1_init,
.cra_exit = mv_cra_hash_exit,
.cra_module = THIS_MODULE,
}
}
}

Definition at line 978 of file mv_cesa.c.