Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
crypto4xx_core.c File Reference
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/spinlock_types.h>
#include <linux/random.h>
#include <linux/scatterlist.h>
#include <linux/crypto.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/of_platform.h>
#include <linux/slab.h>
#include <asm/dcr.h>
#include <asm/dcr-regs.h>
#include <asm/cacheflush.h>
#include <crypto/aes.h>
#include <crypto/sha.h>
#include "crypto4xx_reg_def.h"
#include "crypto4xx_core.h"
#include "crypto4xx_sa.h"

Go to the source code of this file.

Macros

#define PPC4XX_SEC_VERSION_STR   "0.5"
 

Functions

int crypto4xx_alloc_sa (struct crypto4xx_ctx *ctx, u32 size)
 
void crypto4xx_free_sa (struct crypto4xx_ctx *ctx)
 
u32 crypto4xx_alloc_state_record (struct crypto4xx_ctx *ctx)
 
void crypto4xx_free_state_record (struct crypto4xx_ctx *ctx)
 
u32 crypto4xx_get_n_gd (struct crypto4xx_device *dev, int n)
 
void crypto4xx_memcpy_le (unsigned int *dst, const unsigned char *buf, int len)
 
void crypto4xx_return_pd (struct crypto4xx_device *dev, u32 pd_entry, struct ce_pd *pd, struct pd_uinfo *pd_uinfo)
 
u32 crypto4xx_build_pd (struct crypto_async_request *req, struct crypto4xx_ctx *ctx, struct scatterlist *src, struct scatterlist *dst, unsigned int datalen, void *iv, u32 iv_len)
 
int crypto4xx_register_alg (struct crypto4xx_device *sec_dev, struct crypto4xx_alg_common *crypto_alg, int array_size)
 
 module_platform_driver (crypto4xx_driver)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("James Hsiao <[email protected]>")
 
 MODULE_DESCRIPTION ("Driver for AMCC PPC4xx crypto accelerator")
 

Variables

struct crypto4xx_alg_common crypto4xx_alg []
 

Macro Definition Documentation

#define PPC4XX_SEC_VERSION_STR   "0.5"

AMCC SoC PPC4xx Crypto Driver

Copyright (c) 2008 Applied Micro Circuits Corporation. All rights reserved. James Hsiao jhsia.nosp@m.o@am.nosp@m.cc.co.nosp@m.m

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

This file implements AMCC crypto offload Linux device driver for use with Linux CryptoAPI.

Definition at line 41 of file crypto4xx_core.c.

Function Documentation

int crypto4xx_alloc_sa ( struct crypto4xx_ctx ctx,
u32  size 
)

Definition at line 124 of file crypto4xx_core.c.

u32 crypto4xx_alloc_state_record ( struct crypto4xx_ctx ctx)

Definition at line 161 of file crypto4xx_core.c.

u32 crypto4xx_build_pd ( struct crypto_async_request req,
struct crypto4xx_ctx ctx,
struct scatterlist src,
struct scatterlist dst,
unsigned int  datalen,
void iv,
u32  iv_len 
)

Definition at line 777 of file crypto4xx_core.c.

void crypto4xx_free_sa ( struct crypto4xx_ctx ctx)

Definition at line 147 of file crypto4xx_core.c.

void crypto4xx_free_state_record ( struct crypto4xx_ctx ctx)

Definition at line 173 of file crypto4xx_core.c.

u32 crypto4xx_get_n_gd ( struct crypto4xx_device dev,
int  n 
)

Definition at line 326 of file crypto4xx_core.c.

void crypto4xx_memcpy_le ( unsigned int dst,
const unsigned char buf,
int  len 
)

Note: Only use this function to copy items that is word aligned.

Definition at line 686 of file crypto4xx_core.c.

int crypto4xx_register_alg ( struct crypto4xx_device sec_dev,
struct crypto4xx_alg_common crypto_alg,
int  array_size 
)

Definition at line 1024 of file crypto4xx_core.c.

void crypto4xx_return_pd ( struct crypto4xx_device dev,
u32  pd_entry,
struct ce_pd pd,
struct pd_uinfo pd_uinfo 
)

Definition at line 730 of file crypto4xx_core.c.

MODULE_AUTHOR ( "James Hsiao <[email protected]>"  )
MODULE_DESCRIPTION ( "Driver for AMCC PPC4xx crypto accelerator"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( crypto4xx_driver  )

Variable Documentation

Initial value:
= {
{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
.cra_name = "cbc(aes)",
.cra_driver_name = "cbc-aes-ppc4xx",
.cra_priority = CRYPTO4XX_CRYPTO_PRIORITY,
.cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type,
.cra_init = crypto4xx_alg_init,
.cra_exit = crypto4xx_alg_exit,
.cra_module = THIS_MODULE,
.cra_u = {
.ablkcipher = {
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_IV_SIZE,
.encrypt = crypto4xx_encrypt,
.decrypt = crypto4xx_decrypt,
}
}
}},
}

Supported Crypto Algorithms

Definition at line 1127 of file crypto4xx_core.c.