Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
cryptocop.c File Reference
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
#include <linux/stddef.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/atomic.h>
#include <linux/list.h>
#include <linux/interrupt.h>
#include <asm/signal.h>
#include <asm/irq.h>
#include <dma.h>
#include <hwregs/dma.h>
#include <hwregs/reg_map.h>
#include <hwregs/reg_rdwr.h>
#include <hwregs/intr_vect_defs.h>
#include <hwregs/strcop.h>
#include <hwregs/strcop_defs.h>
#include <cryptocop.h>

Go to the source code of this file.

Data Structures

struct  cryptocop_dma_desc
 
struct  cryptocop_int_operation
 
struct  cryptocop_tfrm_ctx
 
struct  cryptocop_private
 
struct  cryptocop_transform_ctx
 
struct  cryptocop_session
 
struct  cryptocop_prio_queue
 
struct  cryptocop_prio_job
 
struct  ioctl_job_cb_ctx
 

Macros

#define IN_DMA   3
 
#define OUT_DMA   2
 
#define IN_DMA_INST   regi_dma3
 
#define OUT_DMA_INST   regi_dma2
 
#define DMA_IRQ   DMA3_INTR_VECT
 
#define DESCR_ALLOC_PAD   (31)
 
#define MEM2MEM_DISCARD_BUF_LENGTH   (512)
 
#define CRYPTOCOP_DESCRIPTOR_POOL_SIZE   (100)
 
#define DEBUG(s)
 
#define DEBUG_API(s)
 
#define assert(s)
 
#define DES_BLOCK_LENGTH   (8)
 
#define AES_BLOCK_LENGTH   (16)
 
#define MD5_BLOCK_LENGTH   (64)
 
#define SHA1_BLOCK_LENGTH   (64)
 
#define CSUM_BLOCK_LENGTH   (2)
 
#define MD5_STATE_LENGTH   (16)
 
#define SHA1_STATE_LENGTH   (20)
 
#define CRYPTOCOP_MAJOR   (254)
 
#define CRYPTOCOP_MINOR   (0)
 
#define MD5_MIN_PAD_LENGTH   (9)
 
#define MD5_PAD_LENGTH_FIELD_LENGTH   (8)
 
#define SHA1_MIN_PAD_LENGTH   (9)
 
#define SHA1_PAD_LENGTH_FIELD_LENGTH   (8)
 
#define CRYPTOCOP_IOCTL_CIPHER_TID   (1)
 
#define CRYPTOCOP_IOCTL_DIGEST_TID   (2)
 
#define CRYPTOCOP_IOCTL_CSUM_TID   (3)
 

Enumerations

enum  cryptocop_queue_priority { cryptocop_prio_kernel_csum = 0, cryptocop_prio_kernel = 1, cryptocop_prio_user = 2, cryptocop_prio_no_prios = 3 }
 

Functions

 DECLARE_WAIT_QUEUE_HEAD (cryptocop_ioc_process_wq)
 
int cryptocop_new_session (cryptocop_session_id *sid, struct cryptocop_transform_init *tinit, int alloc_flag)
 
int cryptocop_free_session (cryptocop_session_id sid)
 
int cryptocop_job_queue_insert_csum (struct cryptocop_operation *operation)
 
int cryptocop_job_queue_insert_crypto (struct cryptocop_operation *operation)
 
int cryptocop_job_queue_insert_user_job (struct cryptocop_operation *operation)
 
 DECLARE_TASKLET (cryptocop_tasklet, cryptocop_do_tasklet, 0)
 
 module_init (init_stream_coprocessor)
 
 module_exit (exit_stream_coprocessor)
 

Variables

spinlock_t cryptocop_sessions_lock
 
spinlock_t cryptocop_process_lock
 
struct file_operations cryptocop_fops
 

Macro Definition Documentation

#define AES_BLOCK_LENGTH   (16)

Definition at line 267 of file cryptocop.c.

#define assert (   s)

Definition at line 261 of file cryptocop.c.

#define CRYPTOCOP_DESCRIPTOR_POOL_SIZE   (100)

Definition at line 190 of file cryptocop.c.

#define CRYPTOCOP_IOCTL_CIPHER_TID   (1)

Definition at line 2380 of file cryptocop.c.

#define CRYPTOCOP_IOCTL_CSUM_TID   (3)

Definition at line 2382 of file cryptocop.c.

#define CRYPTOCOP_IOCTL_DIGEST_TID   (2)

Definition at line 2381 of file cryptocop.c.

#define CRYPTOCOP_MAJOR   (254)

Definition at line 275 of file cryptocop.c.

#define CRYPTOCOP_MINOR   (0)

Definition at line 276 of file cryptocop.c.

#define CSUM_BLOCK_LENGTH   (2)

Definition at line 270 of file cryptocop.c.

#define DEBUG (   s)

Definition at line 259 of file cryptocop.c.

#define DEBUG_API (   s)

Definition at line 260 of file cryptocop.c.

#define DES_BLOCK_LENGTH   (8)

Definition at line 266 of file cryptocop.c.

#define DESCR_ALLOC_PAD   (31)

Definition at line 51 of file cryptocop.c.

#define DMA_IRQ   DMA3_INTR_VECT

Definition at line 48 of file cryptocop.c.

#define IN_DMA   3

Definition at line 44 of file cryptocop.c.

#define IN_DMA_INST   regi_dma3

Definition at line 46 of file cryptocop.c.

#define MD5_BLOCK_LENGTH   (64)

Definition at line 268 of file cryptocop.c.

#define MD5_MIN_PAD_LENGTH   (9)

Definition at line 1385 of file cryptocop.c.

#define MD5_PAD_LENGTH_FIELD_LENGTH   (8)

Definition at line 1386 of file cryptocop.c.

#define MD5_STATE_LENGTH   (16)

Definition at line 271 of file cryptocop.c.

#define MEM2MEM_DISCARD_BUF_LENGTH   (512)

Definition at line 185 of file cryptocop.c.

#define OUT_DMA   2

Definition at line 45 of file cryptocop.c.

#define OUT_DMA_INST   regi_dma2

Definition at line 47 of file cryptocop.c.

#define SHA1_BLOCK_LENGTH   (64)

Definition at line 269 of file cryptocop.c.

#define SHA1_MIN_PAD_LENGTH   (9)

Definition at line 1416 of file cryptocop.c.

#define SHA1_PAD_LENGTH_FIELD_LENGTH   (8)

Definition at line 1417 of file cryptocop.c.

#define SHA1_STATE_LENGTH   (20)

Definition at line 272 of file cryptocop.c.

Enumeration Type Documentation

Enumerator:
cryptocop_prio_kernel_csum 
cryptocop_prio_kernel 
cryptocop_prio_user 
cryptocop_prio_no_prios 

Definition at line 150 of file cryptocop.c.

Function Documentation

int cryptocop_free_session ( cryptocop_session_id  sid)

Definition at line 1578 of file cryptocop.c.

int cryptocop_job_queue_insert_crypto ( struct cryptocop_operation *  operation)

Definition at line 1823 of file cryptocop.c.

int cryptocop_job_queue_insert_csum ( struct cryptocop_operation *  operation)

Definition at line 1818 of file cryptocop.c.

int cryptocop_job_queue_insert_user_job ( struct cryptocop_operation *  operation)

Definition at line 1828 of file cryptocop.c.

int cryptocop_new_session ( cryptocop_session_id sid,
struct cryptocop_transform_init *  tinit,
int  alloc_flag 
)

Definition at line 1504 of file cryptocop.c.

DECLARE_TASKLET ( cryptocop_tasklet  ,
cryptocop_do_tasklet  ,
 
)
DECLARE_WAIT_QUEUE_HEAD ( cryptocop_ioc_process_wq  )
module_exit ( exit_stream_coprocessor  )
module_init ( init_stream_coprocessor  )

Variable Documentation

struct file_operations cryptocop_fops
Initial value:
= {
.owner = THIS_MODULE,
.open = cryptocop_open,
.release = cryptocop_release,
.unlocked_ioctl = cryptocop_ioctl,
.llseek = noop_llseek,
}

Definition at line 280 of file cryptocop.c.

spinlock_t cryptocop_process_lock

Definition at line 198 of file cryptocop.c.

spinlock_t cryptocop_sessions_lock

Definition at line 176 of file cryptocop.c.