Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
hash_core.c File Reference
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/klist.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/crypto.h>
#include <linux/regulator/consumer.h>
#include <linux/dmaengine.h>
#include <linux/bitops.h>
#include <crypto/internal/hash.h>
#include <crypto/sha.h>
#include <crypto/scatterwalk.h>
#include <crypto/algapi.h>
#include <linux/platform_data/crypto-ux500.h>
#include <mach/hardware.h>
#include "hash_alg.h"

Go to the source code of this file.

Data Structures

struct  hash_driver_data
 
struct  hash_algo_template
 

Macros

#define DEV_DBG_NAME   "hashX hashX:"
 

Functions

 module_param (hash_mode, int, 0)
 
 MODULE_PARM_DESC (hash_mode,"CPU or DMA mode. CPU = 0 (default), DMA = 1")
 
int hash_setconfiguration (struct hash_device_data *device_data, struct hash_config *config)
 
void hash_begin (struct hash_device_data *device_data, struct hash_ctx *ctx)
 
int hash_process_data (struct hash_device_data *device_data, struct hash_ctx *ctx, struct hash_req_ctx *req_ctx, int msg_length, u8 *data_buffer, u8 *buffer, u8 *index)
 
int hash_hw_final (struct ahash_request *req)
 
int hash_hw_update (struct ahash_request *req)
 
int hash_resume_state (struct hash_device_data *device_data, const struct hash_state *device_state)
 
int hash_save_state (struct hash_device_data *device_data, struct hash_state *device_state)
 
int hash_check_hw (struct hash_device_data *device_data)
 
void hash_get_digest (struct hash_device_data *device_data, u8 *digest, int algorithm)
 
 module_init (ux500_hash_mod_init)
 
 module_exit (ux500_hash_mod_fini)
 
 MODULE_DESCRIPTION ("Driver for ST-Ericsson UX500 HASH engine.")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("sha1-all")
 
 MODULE_ALIAS ("sha256-all")
 
 MODULE_ALIAS ("hmac-sha1-all")
 
 MODULE_ALIAS ("hmac-sha256-all")
 

Macro Definition Documentation

#define DEV_DBG_NAME   "hashX hashX:"

Definition at line 39 of file hash_core.c.

Function Documentation

void hash_begin ( struct hash_device_data device_data,
struct hash_ctx ctx 
)

hash_begin - This routine resets some globals and initializes the hash hardware. : Structure for the hash device. : Hash context.

Definition at line 766 of file hash_core.c.

int hash_check_hw ( struct hash_device_data device_data)

hash_check_hw - This routine checks for peripheral Ids and PCell Ids. :

Definition at line 1261 of file hash_core.c.

void hash_get_digest ( struct hash_device_data device_data,
u8 digest,
int  algorithm 
)

hash_get_digest - Gets the digest. : Pointer to the device structure. : User allocated byte array for the calculated digest. : The algorithm in use.

Definition at line 1287 of file hash_core.c.

int hash_hw_final ( struct ahash_request req)

hash_hw_final - The final hash calculation function : The hash request for the job.

Use a pre-calculated empty message digest (workaround since hw return zeroes, hw bug!?)

Allocated in setkey, and only used in HMAC.

Definition at line 985 of file hash_core.c.

int hash_hw_update ( struct ahash_request req)

hash_hw_update - Updates current HASH computation hashing another part of the message. : Byte array containing the message to be hashed (caller allocated).

Definition at line 1086 of file hash_core.c.

int hash_process_data ( struct hash_device_data device_data,
struct hash_ctx ctx,
struct hash_req_ctx req_ctx,
int  msg_length,
u8 data_buffer,
u8 buffer,
u8 index 
)

Definition at line 787 of file hash_core.c.

int hash_resume_state ( struct hash_device_data device_data,
const struct hash_state device_state 
)

hash_resume_state - Function that resumes the state of an calculation. : Pointer to the device structure. : The state to be restored in the hash hardware

Definition at line 1151 of file hash_core.c.

int hash_save_state ( struct hash_device_data device_data,
struct hash_state device_state 
)

hash_save_state - Function that saves the state of hardware. : Pointer to the device structure. : The strucure where the hardware state should be saved.

Definition at line 1209 of file hash_core.c.

int hash_setconfiguration ( struct hash_device_data device_data,
struct hash_config config 
)

hash_setconfiguration - Sets the required configuration for the hash hardware. : Structure for the hash device. : Pointer to a configuration structure.

Definition at line 698 of file hash_core.c.

MODULE_ALIAS ( "sha1-all"  )
MODULE_ALIAS ( "sha256-all"  )
MODULE_ALIAS ( "hmac-sha1-all"  )
MODULE_ALIAS ( "hmac-sha256-all"  )
MODULE_DESCRIPTION ( "Driver for ST-Ericsson UX500 HASH engine."  )
module_exit ( ux500_hash_mod_fini  )
module_init ( ux500_hash_mod_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( hash_mode  ,
int  ,
 
)
MODULE_PARM_DESC ( hash_mode  ,
"CPU or DMA mode.  CPU = 0 (default) 
)