* @sg_src_left:       bytes left in src to process (scatter list)
  * @src_start:         offset to add to src start position (scatter list)
  * @crypt_len:         length of current crypt process
+ * @hw_nbytes:         total bytes to process in hw for this request
  * @sg_dst_left:       bytes left dst to process in this scatter list
  * @dst_start:         offset to add to dst start position (scatter list)
  * @total_req_bytes:   total number of bytes processed (request).
        int sg_src_left;
        int src_start;
        int crypt_len;
+       int hw_nbytes;
        /* dst mostly */
        int sg_dst_left;
        int dst_start;
        spinlock_t lock;
        struct crypto_queue queue;
        enum engine_status eng_st;
-       struct ablkcipher_request *cur_req;
+       struct crypto_async_request *cur_req;
        struct req_progress p;
        int max_req_size;
        int sram_size;
        }
 }
 
-static void setup_data_in(struct ablkcipher_request *req)
+static void setup_data_in(void)
 {
        struct req_progress *p = &cpg->p;
        p->crypt_len =
-           min((int)req->nbytes - p->total_req_bytes, cpg->max_req_size);
+           min(p->hw_nbytes - p->total_req_bytes, cpg->max_req_size);
        copy_src_to_buf(p, cpg->sram + SRAM_DATA_IN_START,
                        p->crypt_len);
 }
 
 static void mv_process_current_q(int first_block)
 {
-       struct ablkcipher_request *req = cpg->cur_req;
+       struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req);
        struct mv_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
        struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
        struct sec_accel_config op;
                ENC_P_DST(SRAM_DATA_OUT_START);
        op.enc_key_p = SRAM_DATA_KEY_P;
 
-       setup_data_in(req);
+       setup_data_in();
        op.enc_len = cpg->p.crypt_len;
        memcpy(cpg->sram + SRAM_CONFIG, &op,
                        sizeof(struct sec_accel_config));
 
 static void mv_crypto_algo_completion(void)
 {
-       struct ablkcipher_request *req = cpg->cur_req;
+       struct ablkcipher_request *req = ablkcipher_request_cast(cpg->cur_req);
        struct mv_req_ctx *req_ctx = ablkcipher_request_ctx(req);
 
        if (req_ctx->op != COP_AES_CBC)
 
 static void dequeue_complete_req(void)
 {
-       struct ablkcipher_request *req = cpg->cur_req;
+       struct crypto_async_request *req = cpg->cur_req;
        void *buf;
        int ret;
        int need_copy_len = cpg->p.crypt_len;
        } while (need_copy_len > 0);
 
        BUG_ON(cpg->eng_st != ENGINE_W_DEQUEUE);
-       if (cpg->p.total_req_bytes < req->nbytes) {
+       if (cpg->p.total_req_bytes < cpg->p.hw_nbytes) {
                /* process next scatter list entry */
                cpg->eng_st = ENGINE_BUSY;
                mv_process_current_q(0);
                mv_crypto_algo_completion();
                cpg->eng_st = ENGINE_IDLE;
                local_bh_disable();
-               req->base.complete(&req->base, 0);
+               req->complete(req, 0);
                local_bh_enable();
        }
 }
 
 static void mv_enqueue_new_req(struct ablkcipher_request *req)
 {
+       struct req_progress *p = &cpg->p;
        int num_sgs;
 
-       cpg->cur_req = req;
-       memset(&cpg->p, 0, sizeof(struct req_progress));
+       cpg->cur_req = &req->base;
+       memset(p, 0, sizeof(struct req_progress));
+       p->hw_nbytes = req->nbytes;
 
        num_sgs = count_sgs(req->src, req->nbytes);
-       sg_miter_start(&cpg->p.src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG);
+       sg_miter_start(&p->src_sg_it, req->src, num_sgs, SG_MITER_FROM_SG);
 
        num_sgs = count_sgs(req->dst, req->nbytes);
-       sg_miter_start(&cpg->p.dst_sg_it, req->dst, num_sgs, SG_MITER_TO_SG);
+       sg_miter_start(&p->dst_sg_it, req->dst, num_sgs, SG_MITER_TO_SG);
+
        mv_process_current_q(1);
 }
 
        return 0;
 }
 
-static int mv_handle_req(struct ablkcipher_request *req)
+static int mv_handle_req(struct crypto_async_request *req)
 {
        unsigned long flags;
        int ret;
 
        spin_lock_irqsave(&cpg->lock, flags);
-       ret = ablkcipher_enqueue_request(&cpg->queue, req);
+       ret = crypto_enqueue_request(&cpg->queue, req);
        spin_unlock_irqrestore(&cpg->lock, flags);
        wake_up_process(cpg->queue_th);
        return ret;
        req_ctx->op = COP_AES_ECB;
        req_ctx->decrypt = 0;
 
-       return mv_handle_req(req);
+       return mv_handle_req(&req->base);
 }
 
 static int mv_dec_aes_ecb(struct ablkcipher_request *req)
        req_ctx->decrypt = 1;
 
        compute_aes_dec_key(ctx);
-       return mv_handle_req(req);
+       return mv_handle_req(&req->base);
 }
 
 static int mv_enc_aes_cbc(struct ablkcipher_request *req)
        req_ctx->op = COP_AES_CBC;
        req_ctx->decrypt = 0;
 
-       return mv_handle_req(req);
+       return mv_handle_req(&req->base);
 }
 
 static int mv_dec_aes_cbc(struct ablkcipher_request *req)
        req_ctx->decrypt = 1;
 
        compute_aes_dec_key(ctx);
-       return mv_handle_req(req);
+       return mv_handle_req(&req->base);
 }
 
 static int mv_cra_init(struct crypto_tfm *tfm)