* Sebastian Siewior | 2007-05-22 17:16:57 [+0200]:
>+static int async_d_init(struct crypto_tfm *tfm)
>+{
>+ /* important to save request specific data */
>+ tfm->crt_ablkcipher.reqsize = sizeof(struct async_d_request);
>+ return 0;
>+}
..
>+static int process_requests_thread(void *data) {
..
>+ if (backlog) {
>+ ablk_req =
>ablkcipher_request_cast(backlog);
>+ a_d_backreq =
>ablkcipher_request_ctx(ablk_req);
>+ a_d_backreq->crypto_complete(backlog,
>-EINPROGRESS);
>+ }
>+
>+ ablk_req = ablkcipher_request_cast(req);
>+ a_d_ctx = ablkcipher_request_ctx(ablk_req);
>+ a_d_ctx->crypto_complete(req, 0);
>+ }
...
Currently the crypto driver has to allocate a structure in order to
remember later whether encrypt or decrypt is requested.
Isn't it better to add a operation field into the request struct which
contains the requested operation (set but the crypto user)? This would
then replace encrypt & decrypt function with a crypt function which
queues the request.
Sebastian
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html