Lines Matching refs:ac
451 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_busy() local
452 int fifo_count = ac->pending_count; in artpec6_crypto_busy()
459 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_submit() local
462 spin_lock_bh(&ac->queue_lock); in artpec6_crypto_submit()
465 list_add_tail(&req->list, &ac->pending); in artpec6_crypto_submit()
469 list_add_tail(&req->list, &ac->queue); in artpec6_crypto_submit()
474 spin_unlock_bh(&ac->queue_lock); in artpec6_crypto_submit()
481 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_start_dma() local
482 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_start_dma()
483 void __iomem *base = ac->base; in artpec6_crypto_start_dma()
512 ac->pending_count++; in artpec6_crypto_start_dma()
1045 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_common_init() local
1051 common->dma = kmem_cache_alloc(ac->dma_cache, flags); in artpec6_crypto_common_init()
1074 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_common_destroy() local
1078 kmem_cache_free(ac->dma_cache, common->dma); in artpec6_crypto_common_destroy()
1317 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_hash() local
1318 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_hash()
1386 error = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_hash()
1668 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_crypto() local
1669 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_crypto()
1773 ret = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_crypto()
1803 ac->pad_buffer, in artpec6_crypto_prepare_crypto()
1809 ac->pad_buffer, pad, in artpec6_crypto_prepare_crypto()
1836 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_aead() local
1837 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_aead()
1899 ret = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_aead()
1939 ac->zero_buffer, in artpec6_crypto_prepare_aead()
1956 ac->zero_buffer, in artpec6_crypto_prepare_aead()
1990 ac->pad_buffer, in artpec6_crypto_prepare_aead()
2021 ac->pad_buffer, in artpec6_crypto_prepare_aead()
2041 static void artpec6_crypto_process_queue(struct artpec6_crypto *ac, in artpec6_crypto_process_queue() argument
2046 while (!list_empty(&ac->queue) && !artpec6_crypto_busy()) { in artpec6_crypto_process_queue()
2047 req = list_first_entry(&ac->queue, in artpec6_crypto_process_queue()
2050 list_move_tail(&req->list, &ac->pending); in artpec6_crypto_process_queue()
2063 if (ac->pending_count) in artpec6_crypto_process_queue()
2064 mod_timer(&ac->timer, jiffies + msecs_to_jiffies(100)); in artpec6_crypto_process_queue()
2066 del_timer(&ac->timer); in artpec6_crypto_process_queue()
2071 struct artpec6_crypto *ac = from_timer(ac, t, timer); in artpec6_crypto_timeout() local
2075 tasklet_schedule(&ac->task); in artpec6_crypto_timeout()
2080 struct artpec6_crypto *ac = (struct artpec6_crypto *)data; in artpec6_crypto_task() local
2089 if (list_empty(&ac->pending)) { in artpec6_crypto_task()
2094 spin_lock_bh(&ac->queue_lock); in artpec6_crypto_task()
2096 list_for_each_entry_safe(req, n, &ac->pending, list) { in artpec6_crypto_task()
2126 ac->pending_count--; in artpec6_crypto_task()
2129 artpec6_crypto_process_queue(ac, &complete_in_progress); in artpec6_crypto_task()
2131 spin_unlock_bh(&ac->queue_lock); in artpec6_crypto_task()
2260 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_init_hash() local
2261 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_init_hash()
2437 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_hash_export() local
2438 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_hash_export()
2465 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_hash_import() local
2466 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_hash_import()
2487 static int init_crypto_hw(struct artpec6_crypto *ac) in init_crypto_hw() argument
2489 enum artpec6_crypto_variant variant = ac->variant; in init_crypto_hw()
2490 void __iomem *base = ac->base; in init_crypto_hw()
2547 static void artpec6_crypto_disable_hw(struct artpec6_crypto *ac) in artpec6_crypto_disable_hw() argument
2549 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_disable_hw()
2550 void __iomem *base = ac->base; in artpec6_crypto_disable_hw()
2568 struct artpec6_crypto *ac = dev_id; in artpec6_crypto_irq() local
2569 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_irq()
2570 void __iomem *base = ac->base; in artpec6_crypto_irq()
2611 tasklet_schedule(&ac->task); in artpec6_crypto_irq()
2853 struct artpec6_crypto *ac; in artpec6_crypto_probe() local
2876 ac = devm_kzalloc(&pdev->dev, sizeof(struct artpec6_crypto), in artpec6_crypto_probe()
2878 if (!ac) in artpec6_crypto_probe()
2881 platform_set_drvdata(pdev, ac); in artpec6_crypto_probe()
2882 ac->variant = variant; in artpec6_crypto_probe()
2884 spin_lock_init(&ac->queue_lock); in artpec6_crypto_probe()
2885 INIT_LIST_HEAD(&ac->queue); in artpec6_crypto_probe()
2886 INIT_LIST_HEAD(&ac->pending); in artpec6_crypto_probe()
2887 timer_setup(&ac->timer, artpec6_crypto_timeout, 0); in artpec6_crypto_probe()
2889 ac->base = base; in artpec6_crypto_probe()
2891 ac->dma_cache = kmem_cache_create("artpec6_crypto_dma", in artpec6_crypto_probe()
2896 if (!ac->dma_cache) in artpec6_crypto_probe()
2903 tasklet_init(&ac->task, artpec6_crypto_task, in artpec6_crypto_probe()
2904 (unsigned long)ac); in artpec6_crypto_probe()
2906 ac->pad_buffer = devm_kzalloc(&pdev->dev, 2 * ARTPEC_CACHE_LINE_MAX, in artpec6_crypto_probe()
2908 if (!ac->pad_buffer) in artpec6_crypto_probe()
2910 ac->pad_buffer = PTR_ALIGN(ac->pad_buffer, ARTPEC_CACHE_LINE_MAX); in artpec6_crypto_probe()
2912 ac->zero_buffer = devm_kzalloc(&pdev->dev, 2 * ARTPEC_CACHE_LINE_MAX, in artpec6_crypto_probe()
2914 if (!ac->zero_buffer) in artpec6_crypto_probe()
2916 ac->zero_buffer = PTR_ALIGN(ac->zero_buffer, ARTPEC_CACHE_LINE_MAX); in artpec6_crypto_probe()
2918 err = init_crypto_hw(ac); in artpec6_crypto_probe()
2923 "artpec6-crypto", ac); in artpec6_crypto_probe()
2954 artpec6_crypto_disable_hw(ac); in artpec6_crypto_probe()
2956 kmem_cache_destroy(ac->dma_cache); in artpec6_crypto_probe()
2962 struct artpec6_crypto *ac = platform_get_drvdata(pdev); in artpec6_crypto_remove() local
2969 tasklet_disable(&ac->task); in artpec6_crypto_remove()
2970 devm_free_irq(&pdev->dev, irq, ac); in artpec6_crypto_remove()
2971 tasklet_kill(&ac->task); in artpec6_crypto_remove()
2972 del_timer_sync(&ac->timer); in artpec6_crypto_remove()
2974 artpec6_crypto_disable_hw(ac); in artpec6_crypto_remove()
2976 kmem_cache_destroy(ac->dma_cache); in artpec6_crypto_remove()