2 * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
20 * struct qce_device - crypto engine device structure
21 * @queue: crypto request queue
22 * @lock: the lock protects queue and req
23 * @done_tasklet: done tasklet object
24 * @req: current active request
25 * @result: result of current transform
26 * @base: virtual IO base
27 * @dev: pointer to device structure
28 * @core: core device clock
29 * @iface: interface clock
31 * @dma: pointer to dma data
32 * @burst_size: the crypto burst size
33 * @pipe_pair_id: which pipe pair id the device using
34 * @async_req_enqueue: invoked by every algorithm to enqueue a request
35 * @async_req_done: invoked by every algorithm to finish its request
38 struct crypto_queue queue
;
40 struct tasklet_struct done_tasklet
;
41 struct crypto_async_request
*req
;
45 struct clk
*core
, *iface
, *bus
;
46 struct qce_dma_data dma
;
48 unsigned int pipe_pair_id
;
49 int (*async_req_enqueue
)(struct qce_device
*qce
,
50 struct crypto_async_request
*req
);
51 void (*async_req_done
)(struct qce_device
*qce
, int ret
);
55 * struct qce_algo_ops - algorithm operations per crypto type
56 * @type: should be CRYPTO_ALG_TYPE_XXX
57 * @register_algs: invoked by core to register the algorithms
58 * @unregister_algs: invoked by core to unregister the algorithms
59 * @async_req_handle: invoked by core to handle enqueued request
63 int (*register_algs
)(struct qce_device
*qce
);
64 void (*unregister_algs
)(struct qce_device
*qce
);
65 int (*async_req_handle
)(struct crypto_async_request
*async_req
);