# include/block/aesblk.h File Reference

AES block device interface. More...

`#include <workqueue.h>`
`#include <block/device.h>`
`#include <aes.h>`

Include dependency graph for aesblk.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
void | aesblk_update (struct aes_block_device *aes_bdev)
| 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_request * | aesblk_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.
void | aesblk_init (struct aes_block_device *aes_bdev, struct block_device *card_bdev)
| Initialize AES block device.

## Detailed Description

AES block device interface.

This is the interface of the AES block device.

- Compiler: IAR EWAVR32 and GNU GCC for AVR32
- Supported devices: All devices
- AppNote:

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

Definition in file aesblk.h.

## 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.