Lines Matching refs:ac
450 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_busy() local
451 int fifo_count = ac->pending_count; in artpec6_crypto_busy()
458 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_submit() local
461 spin_lock_bh(&ac->queue_lock); in artpec6_crypto_submit()
464 list_add_tail(&req->list, &ac->pending); in artpec6_crypto_submit()
468 list_add_tail(&req->list, &ac->queue); in artpec6_crypto_submit()
473 spin_unlock_bh(&ac->queue_lock); in artpec6_crypto_submit()
480 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_start_dma() local
481 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_start_dma()
482 void __iomem *base = ac->base; in artpec6_crypto_start_dma()
511 ac->pending_count++; in artpec6_crypto_start_dma()
1044 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_common_init() local
1050 common->dma = kmem_cache_alloc(ac->dma_cache, flags); in artpec6_crypto_common_init()
1073 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_common_destroy() local
1077 kmem_cache_free(ac->dma_cache, common->dma); in artpec6_crypto_common_destroy()
1318 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_hash() local
1319 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_hash()
1387 error = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_hash()
1673 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_crypto() local
1674 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_crypto()
1778 ret = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_crypto()
1808 ac->pad_buffer, in artpec6_crypto_prepare_crypto()
1814 ac->pad_buffer, pad, in artpec6_crypto_prepare_crypto()
1841 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_aead() local
1842 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_aead()
1904 ret = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_aead()
1944 ac->zero_buffer, in artpec6_crypto_prepare_aead()
1961 ac->zero_buffer, in artpec6_crypto_prepare_aead()
1995 ac->pad_buffer, in artpec6_crypto_prepare_aead()
2026 ac->pad_buffer, in artpec6_crypto_prepare_aead()
2046 static void artpec6_crypto_process_queue(struct artpec6_crypto *ac, in artpec6_crypto_process_queue() argument
2051 while (!list_empty(&ac->queue) && !artpec6_crypto_busy()) { in artpec6_crypto_process_queue()
2052 req = list_first_entry(&ac->queue, in artpec6_crypto_process_queue()
2055 list_move_tail(&req->list, &ac->pending); in artpec6_crypto_process_queue()
2068 if (ac->pending_count) in artpec6_crypto_process_queue()
2069 mod_timer(&ac->timer, jiffies + msecs_to_jiffies(100)); in artpec6_crypto_process_queue()
2071 del_timer(&ac->timer); in artpec6_crypto_process_queue()
2076 struct artpec6_crypto *ac = from_timer(ac, t, timer); in artpec6_crypto_timeout() local
2080 tasklet_schedule(&ac->task); in artpec6_crypto_timeout()
2085 struct artpec6_crypto *ac = (struct artpec6_crypto *)data; in artpec6_crypto_task() local
2094 if (list_empty(&ac->pending)) { in artpec6_crypto_task()
2099 spin_lock_bh(&ac->queue_lock); in artpec6_crypto_task()
2101 list_for_each_entry_safe(req, n, &ac->pending, list) { in artpec6_crypto_task()
2131 ac->pending_count--; in artpec6_crypto_task()
2134 artpec6_crypto_process_queue(ac, &complete_in_progress); in artpec6_crypto_task()
2136 spin_unlock_bh(&ac->queue_lock); in artpec6_crypto_task()
2269 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_init_hash() local
2270 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_init_hash()
2446 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_hash_export() local
2447 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_hash_export()
2474 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_hash_import() local
2475 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_hash_import()
2496 static int init_crypto_hw(struct artpec6_crypto *ac) in init_crypto_hw() argument
2498 enum artpec6_crypto_variant variant = ac->variant; in init_crypto_hw()
2499 void __iomem *base = ac->base; in init_crypto_hw()
2556 static void artpec6_crypto_disable_hw(struct artpec6_crypto *ac) in artpec6_crypto_disable_hw() argument
2558 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_disable_hw()
2559 void __iomem *base = ac->base; in artpec6_crypto_disable_hw()
2577 struct artpec6_crypto *ac = dev_id; in artpec6_crypto_irq() local
2578 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_irq()
2579 void __iomem *base = ac->base; in artpec6_crypto_irq()
2620 tasklet_schedule(&ac->task); in artpec6_crypto_irq()
2854 struct artpec6_crypto *ac; in artpec6_crypto_probe() local
2877 ac = devm_kzalloc(&pdev->dev, sizeof(struct artpec6_crypto), in artpec6_crypto_probe()
2879 if (!ac) in artpec6_crypto_probe()
2882 platform_set_drvdata(pdev, ac); in artpec6_crypto_probe()
2883 ac->variant = variant; in artpec6_crypto_probe()
2885 spin_lock_init(&ac->queue_lock); in artpec6_crypto_probe()
2886 INIT_LIST_HEAD(&ac->queue); in artpec6_crypto_probe()
2887 INIT_LIST_HEAD(&ac->pending); in artpec6_crypto_probe()
2888 timer_setup(&ac->timer, artpec6_crypto_timeout, 0); in artpec6_crypto_probe()
2890 ac->base = base; in artpec6_crypto_probe()
2892 ac->dma_cache = kmem_cache_create("artpec6_crypto_dma", in artpec6_crypto_probe()
2897 if (!ac->dma_cache) in artpec6_crypto_probe()
2904 tasklet_init(&ac->task, artpec6_crypto_task, in artpec6_crypto_probe()
2905 (unsigned long)ac); in artpec6_crypto_probe()
2907 ac->pad_buffer = devm_kzalloc(&pdev->dev, 2 * ARTPEC_CACHE_LINE_MAX, in artpec6_crypto_probe()
2909 if (!ac->pad_buffer) in artpec6_crypto_probe()
2911 ac->pad_buffer = PTR_ALIGN(ac->pad_buffer, ARTPEC_CACHE_LINE_MAX); in artpec6_crypto_probe()
2913 ac->zero_buffer = devm_kzalloc(&pdev->dev, 2 * ARTPEC_CACHE_LINE_MAX, in artpec6_crypto_probe()
2915 if (!ac->zero_buffer) in artpec6_crypto_probe()
2917 ac->zero_buffer = PTR_ALIGN(ac->zero_buffer, ARTPEC_CACHE_LINE_MAX); in artpec6_crypto_probe()
2919 err = init_crypto_hw(ac); in artpec6_crypto_probe()
2924 "artpec6-crypto", ac); in artpec6_crypto_probe()
2955 artpec6_crypto_disable_hw(ac); in artpec6_crypto_probe()
2957 kmem_cache_destroy(ac->dma_cache); in artpec6_crypto_probe()
2963 struct artpec6_crypto *ac = platform_get_drvdata(pdev); in artpec6_crypto_remove() local
2970 tasklet_disable(&ac->task); in artpec6_crypto_remove()
2971 devm_free_irq(&pdev->dev, irq, ac); in artpec6_crypto_remove()
2972 tasklet_kill(&ac->task); in artpec6_crypto_remove()
2973 del_timer_sync(&ac->timer); in artpec6_crypto_remove()
2975 artpec6_crypto_disable_hw(ac); in artpec6_crypto_remove()
2977 kmem_cache_destroy(ac->dma_cache); in artpec6_crypto_remove()