- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# include/block/aesblk.h

Go to the documentation of this file.

    00001
    00044 #ifndef AESBLK_H_INCLUDED
    00045 #define AESBLK_H_INCLUDED
    00046
    00047 #include <workqueue.h>
    00048 #include <block/device.h>
    00049 #include <aes.h>
    00050
    00051 struct workqueue        main_workqueue;
    00052
    00053 #define AES_BLK_STATE_LIST_ENCRYPTION_DONE      (1 << 0)
    00054 #define AES_BLK_STATE_REQ_ENCRYPTION_DONE       (1 << 1)
    00055 #define AES_BLK_STATE_LIST_DECRYPTION_DONE      (1 << 2)
    00056 #define AES_BLK_STATE_REQ_DECRYPTION_DONE       (1 << 3)
    00057 #define AES_BLK_STATE_WRITE_REQ_DONE            (1 << 4)
    00058 #define AES_BLK_STATE_WRITE_LIST_DONE           (1 << 5)
    00059 #define AES_BLK_STATE_WRITE_REQ_DONE_PENDING    (1 << 30)
    00060 #define AES_BLK_STATE_DECRYPTION_DONE_PENDING   (1 << 31)
    00061
    00062 struct aes_block_device {
    00063         struct aes_module module;
    00064         struct udc *udc;
    00065         struct block_device bdev;
    00066         struct block_device *card_bdev;
    00067 };
    00068
    00069 struct aes_block_request {
    00070         struct aes_block_device *abdev;
    00072         struct block_request breq;
    00074         struct block_request *card_breq;
    00075         struct workqueue_item worker_item;
    00076         struct slist buf_list;
    00077         unsigned int state;
    00078         int buf_counter;
    00079 };
    00080
    00081 void aesblk_update(struct aes_block_device *aes_bdev);
    00082 void aesblk_prepare_req(struct block_device *bdev,
    00083                 struct block_request *breq,
    00084                 uint32_t lba, uint32_t nr_blocks,
    00085                 enum block_operation operation);
    00086 struct block_request *aesblk_alloc_req(struct block_device *bdev);
    00087 void aesblk_free_req(struct block_device *bdev,
    00088                 struct block_request *breq);
    00089 void aesblk_init(struct aes_block_device *aes_bdev,
    00090                 struct block_device *card_bdev);
    00091
    00092 #endif /* AESBLK_H_INCLUDED */