Lines Matching refs:ac
454 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_busy() local
455 int fifo_count = ac->pending_count; in artpec6_crypto_busy()
462 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_submit() local
465 spin_lock_bh(&ac->queue_lock); in artpec6_crypto_submit()
468 list_add_tail(&req->list, &ac->pending); in artpec6_crypto_submit()
472 list_add_tail(&req->list, &ac->queue); in artpec6_crypto_submit()
477 spin_unlock_bh(&ac->queue_lock); in artpec6_crypto_submit()
484 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_start_dma() local
485 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_start_dma()
486 void __iomem *base = ac->base; in artpec6_crypto_start_dma()
515 ac->pending_count++; in artpec6_crypto_start_dma()
1048 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_common_init() local
1054 common->dma = kmem_cache_alloc(ac->dma_cache, flags); in artpec6_crypto_common_init()
1077 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_common_destroy() local
1081 kmem_cache_free(ac->dma_cache, common->dma); in artpec6_crypto_common_destroy()
1323 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_hash() local
1324 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_hash()
1392 error = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_hash()
1689 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_crypto() local
1690 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_crypto()
1794 ret = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_crypto()
1824 ac->pad_buffer, in artpec6_crypto_prepare_crypto()
1830 ac->pad_buffer, pad, in artpec6_crypto_prepare_crypto()
1857 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_prepare_aead() local
1858 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_prepare_aead()
1920 ret = artpec6_crypto_setup_in_descr(common, ac->pad_buffer, 4, false); in artpec6_crypto_prepare_aead()
1960 ac->zero_buffer, in artpec6_crypto_prepare_aead()
1977 ac->zero_buffer, in artpec6_crypto_prepare_aead()
2011 ac->pad_buffer, in artpec6_crypto_prepare_aead()
2049 static void artpec6_crypto_process_queue(struct artpec6_crypto *ac) in artpec6_crypto_process_queue() argument
2053 while (!list_empty(&ac->queue) && !artpec6_crypto_busy()) { in artpec6_crypto_process_queue()
2054 req = list_first_entry(&ac->queue, in artpec6_crypto_process_queue()
2057 list_move_tail(&req->list, &ac->pending); in artpec6_crypto_process_queue()
2070 if (ac->pending_count) in artpec6_crypto_process_queue()
2071 mod_timer(&ac->timer, jiffies + msecs_to_jiffies(100)); in artpec6_crypto_process_queue()
2073 del_timer(&ac->timer); in artpec6_crypto_process_queue()
2078 struct artpec6_crypto *ac = from_timer(ac, t, timer); in artpec6_crypto_timeout() local
2082 tasklet_schedule(&ac->task); in artpec6_crypto_timeout()
2087 struct artpec6_crypto *ac = (struct artpec6_crypto *)data; in artpec6_crypto_task() local
2091 if (list_empty(&ac->pending)) { in artpec6_crypto_task()
2096 spin_lock_bh(&ac->queue_lock); in artpec6_crypto_task()
2098 list_for_each_entry_safe(req, n, &ac->pending, list) { in artpec6_crypto_task()
2128 ac->pending_count--; in artpec6_crypto_task()
2133 artpec6_crypto_process_queue(ac); in artpec6_crypto_task()
2135 spin_unlock_bh(&ac->queue_lock); in artpec6_crypto_task()
2252 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_init_hash() local
2253 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_init_hash()
2510 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_hash_export() local
2511 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_hash_export()
2538 struct artpec6_crypto *ac = dev_get_drvdata(artpec6_crypto_dev); in artpec6_crypto_hash_import() local
2539 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_hash_import()
2560 static int init_crypto_hw(struct artpec6_crypto *ac) in init_crypto_hw() argument
2562 enum artpec6_crypto_variant variant = ac->variant; in init_crypto_hw()
2563 void __iomem *base = ac->base; in init_crypto_hw()
2620 static void artpec6_crypto_disable_hw(struct artpec6_crypto *ac) in artpec6_crypto_disable_hw() argument
2622 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_disable_hw()
2623 void __iomem *base = ac->base; in artpec6_crypto_disable_hw()
2641 struct artpec6_crypto *ac = dev_id; in artpec6_crypto_irq() local
2642 enum artpec6_crypto_variant variant = ac->variant; in artpec6_crypto_irq()
2643 void __iomem *base = ac->base; in artpec6_crypto_irq()
2684 tasklet_schedule(&ac->task); in artpec6_crypto_irq()
3024 struct artpec6_crypto *ac; in artpec6_crypto_probe() local
3049 ac = devm_kzalloc(&pdev->dev, sizeof(struct artpec6_crypto), in artpec6_crypto_probe()
3051 if (!ac) in artpec6_crypto_probe()
3054 platform_set_drvdata(pdev, ac); in artpec6_crypto_probe()
3055 ac->variant = variant; in artpec6_crypto_probe()
3057 spin_lock_init(&ac->queue_lock); in artpec6_crypto_probe()
3058 INIT_LIST_HEAD(&ac->queue); in artpec6_crypto_probe()
3059 INIT_LIST_HEAD(&ac->pending); in artpec6_crypto_probe()
3060 timer_setup(&ac->timer, artpec6_crypto_timeout, 0); in artpec6_crypto_probe()
3062 ac->base = base; in artpec6_crypto_probe()
3064 ac->dma_cache = kmem_cache_create("artpec6_crypto_dma", in artpec6_crypto_probe()
3069 if (!ac->dma_cache) in artpec6_crypto_probe()
3076 tasklet_init(&ac->task, artpec6_crypto_task, in artpec6_crypto_probe()
3077 (unsigned long)ac); in artpec6_crypto_probe()
3079 ac->pad_buffer = devm_kzalloc(&pdev->dev, 2 * ARTPEC_CACHE_LINE_MAX, in artpec6_crypto_probe()
3081 if (!ac->pad_buffer) in artpec6_crypto_probe()
3083 ac->pad_buffer = PTR_ALIGN(ac->pad_buffer, ARTPEC_CACHE_LINE_MAX); in artpec6_crypto_probe()
3085 ac->zero_buffer = devm_kzalloc(&pdev->dev, 2 * ARTPEC_CACHE_LINE_MAX, in artpec6_crypto_probe()
3087 if (!ac->zero_buffer) in artpec6_crypto_probe()
3089 ac->zero_buffer = PTR_ALIGN(ac->zero_buffer, ARTPEC_CACHE_LINE_MAX); in artpec6_crypto_probe()
3091 err = init_crypto_hw(ac); in artpec6_crypto_probe()
3096 "artpec6-crypto", ac); in artpec6_crypto_probe()
3140 artpec6_crypto_disable_hw(ac); in artpec6_crypto_probe()
3142 kmem_cache_destroy(ac->dma_cache); in artpec6_crypto_probe()
3148 struct artpec6_crypto *ac = platform_get_drvdata(pdev); in artpec6_crypto_remove() local
3152 if (ac->variant != ARTPEC6_CRYPTO) in artpec6_crypto_remove()
3158 tasklet_disable(&ac->task); in artpec6_crypto_remove()
3159 devm_free_irq(&pdev->dev, irq, ac); in artpec6_crypto_remove()
3160 tasklet_kill(&ac->task); in artpec6_crypto_remove()
3161 del_timer_sync(&ac->timer); in artpec6_crypto_remove()
3163 artpec6_crypto_disable_hw(ac); in artpec6_crypto_remove()
3165 kmem_cache_destroy(ac->dma_cache); in artpec6_crypto_remove()