drivers/block/aesblk.c File Reference

AES block device. More...

#include <buffer.h>
#include <debug.h>
#include <dmapool.h>
#include <interrupt.h>
#include <workqueue.h>
#include <timer_tc.h>
#include <board/init.h>
#include <chip/memory-map.h>
#include <chip/clk.h>
#include <block/device.h>
#include <status-codes.h>
#include <malloc.h>
#include <string.h>
#include <aes.h>
#include <atomic.h>
#include <block/aesblk.h>

Include dependency graph for aesblk.c:

Go to the source code of this file.

Functions

void aesblk_init (struct aes_block_device *abdev, struct block_device *card_bdev)
 Initialize AES block device.
void aesblk_update (struct aes_block_device *abdev)
 Load block device descriptions from underlying device.
void aesblk_prepare_req (struct block_device *bdev, struct block_request *breq, uint32_t lba, uint32_t nr_blocks, enum block_operation operation)
 Prepare an AES block request for use.
struct block_requestaesblk_alloc_req (struct block_device *bdev)
 Allocate memory for one AES block request.
void aesblk_free_req (struct block_device *bdev, struct block_request *breq)
 Free the memory allocated by a block request.


Detailed Description

AES block device.

This is an AES block device, which adds an encryption layer to another underlying block device.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file aesblk.c.


Function Documentation

struct block_request* aesblk_alloc_req ( struct block_device bdev  )  [read]

Allocate memory for one AES block request.

This function will allocate all the memory needed by one AES block request and return a pointer to this request.

Parameters:
bdev Pointer to the block device interface of an AES block device.
Returns:
Pointer to the allocated block request.

Definition at line 547 of file aesblk.c.

References block_alloc_request(), memset(), and unlikely.

Referenced by aesblk_init().

Here is the call graph for this function:

void aesblk_free_req ( struct block_device bdev,
struct block_request breq 
)

Free the memory allocated by a block request.

Parameters:
bdev Pointer to the block device the block request was allocated for.
breq Pointer to the block request that is to be freed.

Definition at line 576 of file aesblk.c.

References block_free_request().

Referenced by aesblk_init().

Here is the call graph for this function:

void aesblk_init ( struct aes_block_device *  abdev,
struct block_device card_bdev 
)

Initialize AES block device.

This function will initialize the AES block device with the underlying block device (typically a SDMMC card).

Parameters:
abdev Pointer to the AES block device
card_bdev Pointer to the underlying block device

Definition at line 73 of file aesblk.c.

References aesblk_alloc_req(), aesblk_free_req(), aesblk_prepare_req(), block_device::alloc_req, block_device::free_req, and block_device::prepare_req.

Here is the call graph for this function:

void aesblk_prepare_req ( struct block_device bdev,
struct block_request breq,
uint32_t  lba,
uint32_t  nr_blocks,
enum block_operation  operation 
)

Prepare an AES block request for use.

This function will prepare an AES block request for submittion to the AES block driver.

Parameters:
bdev Pointer to the block device part of an AES block device.
breq Pointer to the block request to prepare.
lba Location of the blocks to operate on.
nr_blocks Number of blocks to read/write.
operation Which block operation to perform (read or write).

Definition at line 486 of file aesblk.c.

References block_request::bdev, BLK_OP_READ, BLK_OP_WRITE, block_prepare_req(), block_request::buf_list_done, block_request::bytes_xfered, block_request::context, dbg_verbose, block_request::req_done, block_request::req_submit, block_request::req_submit_buf_list, slist_init(), block_request::status, STATUS_IN_PROGRESS, unhandled_case, and workqueue_init_item().

Referenced by aesblk_init().

Here is the call graph for this function:

void aesblk_update ( struct aes_block_device *  abdev  ) 

Load block device descriptions from underlying device.

Parameters:
aes_bdev AES block device pointer

Definition at line 91 of file aesblk.c.

References block_device::block_size, block_device::flags, block_device::get_dev_id, and block_device::nr_blocks.


Generated on Tue Sep 15 10:19:05 2009 for libavr32 by  doxygen 1.5.8