Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
talitos.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/crypto.h>
#include <linux/hw_random.h>
#include <linux/of_platform.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/spinlock.h>
#include <linux/rtnetlink.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <crypto/algapi.h>
#include <crypto/aes.h>
#include <crypto/des.h>
#include <crypto/sha.h>
#include <crypto/md5.h>
#include <crypto/aead.h>
#include <crypto/authenc.h>
#include <crypto/skcipher.h>
#include <crypto/hash.h>
#include <crypto/internal/hash.h>
#include <crypto/scatterwalk.h>
#include "talitos.h"

Go to the source code of this file.

Data Structures

struct  talitos_ctx
 
struct  talitos_ahash_req_ctx
 
struct  talitos_edesc
 
struct  keyhash_result
 
struct  talitos_alg_template
 
struct  talitos_crypto_alg
 

Macros

#define DEF_TALITOS_DONE(name, ch_done_mask)
 
#define DEF_TALITOS_INTERRUPT(name, ch_done_mask, ch_err_mask, tlet)
 
#define TALITOS_CRA_PRIORITY   3000
 
#define TALITOS_MAX_KEY_SIZE   96
 
#define TALITOS_MAX_IV_LENGTH   16 /* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */
 
#define MD5_BLOCK_SIZE   64
 
#define HASH_MAX_BLOCK_SIZE   SHA512_BLOCK_SIZE
 
#define TALITOS_MDEU_MAX_CONTEXT_SIZE   TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512
 

Functions

int talitos_submit (struct device *dev, int ch, struct talitos_desc *desc, void(*callback)(struct device *dev, struct talitos_desc *desc, void *context, int error), void *context)
 
 EXPORT_SYMBOL (talitos_submit)
 
 MODULE_DEVICE_TABLE (of, talitos_match)
 
 module_platform_driver (talitos_driver)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Kim Phillips <[email protected]>")
 
 MODULE_DESCRIPTION ("Freescale integrated security engine (SEC) driver")
 

Macro Definition Documentation

#define DEF_TALITOS_DONE (   name,
  ch_done_mask 
)
Value:
static void talitos_done_##name(unsigned long data) \
{ \
struct device *dev = (struct device *)data; \
unsigned long flags; \
if (ch_done_mask & 1) \
flush_channel(dev, 0, 0, 0); \
if (priv->num_channels == 1) \
goto out; \
if (ch_done_mask & (1 << 2)) \
flush_channel(dev, 1, 0, 0); \
if (ch_done_mask & (1 << 4)) \
flush_channel(dev, 2, 0, 0); \
if (ch_done_mask & (1 << 6)) \
flush_channel(dev, 3, 0, 0); \
\
out: \
/* At this point, all completed channels have been processed */ \
/* Unmask done interrupts for channels completed later on. */ \
spin_lock_irqsave(&priv->reg_lock, flags); \
setbits32(priv->reg + TALITOS_IMR, ch_done_mask); \
setbits32(priv->reg + TALITOS_IMR_LO, TALITOS_IMR_LO_INIT); \
spin_unlock_irqrestore(&priv->reg_lock, flags); \
}

Definition at line 304 of file talitos.c.

#define DEF_TALITOS_INTERRUPT (   name,
  ch_done_mask,
  ch_err_mask,
  tlet 
)

Definition at line 513 of file talitos.c.

#define HASH_MAX_BLOCK_SIZE   SHA512_BLOCK_SIZE

Definition at line 644 of file talitos.c.

#define MD5_BLOCK_SIZE   64

Definition at line 630 of file talitos.c.

#define TALITOS_CRA_PRIORITY   3000

Definition at line 626 of file talitos.c.

#define TALITOS_MAX_IV_LENGTH   16 /* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */

Definition at line 628 of file talitos.c.

#define TALITOS_MAX_KEY_SIZE   96

Definition at line 627 of file talitos.c.

#define TALITOS_MDEU_MAX_CONTEXT_SIZE   TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512

Definition at line 645 of file talitos.c.

Function Documentation

EXPORT_SYMBOL ( talitos_submit  )
MODULE_AUTHOR ( "Kim Phillips <[email protected]>"  )
MODULE_DESCRIPTION ( "Freescale integrated security engine (SEC) driver )
MODULE_DEVICE_TABLE ( of  ,
talitos_match   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( talitos_driver  )
int talitos_submit ( struct device dev,
int  ch,
struct talitos_desc desc,
void(*)(struct device *dev, struct talitos_desc *desc, void *context, int error callback,
void context 
)

talitos_submit - submits a descriptor to the device for processing : the SEC device to be used : the SEC device channel to be used : the descriptor to be processed by the device : whom to call when processing is complete : a handle for use by caller (optional)

desc must contain valid dma-mapped (bus physical) address pointers. callback must check err and feedback in descriptor header for device processing status.

Definition at line 196 of file talitos.c.