Lines Matching refs:cmdqs

81 #define cmdqs_to_func_to_io(cmdqs)      container_of(cmdqs, \  argument
83 cmdqs)
131 int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs, in hinic_alloc_cmdq_buf() argument
134 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_alloc_cmdq_buf()
137 cmdq_buf->buf = dma_pool_alloc(cmdqs->cmdq_buf_pool, GFP_KERNEL, in hinic_alloc_cmdq_buf()
152 void hinic_free_cmdq_buf(struct hinic_cmdqs *cmdqs, in hinic_free_cmdq_buf() argument
155 dma_pool_free(cmdqs->cmdq_buf_pool, cmdq_buf->buf, cmdq_buf->dma_addr); in hinic_free_cmdq_buf()
486 int hinic_cmdq_direct_resp(struct hinic_cmdqs *cmdqs, in hinic_cmdq_direct_resp() argument
490 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_cmdq_direct_resp()
500 return cmdq_sync_cmd_direct_resp(&cmdqs->cmdq[HINIC_CMDQ_SYNC], in hinic_cmdq_direct_resp()
512 int hinic_set_arm_bit(struct hinic_cmdqs *cmdqs, in hinic_set_arm_bit() argument
515 struct hinic_cmdq *cmdq = &cmdqs->cmdq[HINIC_CMDQ_SYNC]; in hinic_set_arm_bit()
516 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_set_arm_bit()
647 struct hinic_cmdqs *cmdqs = (struct hinic_cmdqs *)handle; in cmdq_ceq_handler() local
648 struct hinic_cmdq *cmdq = &cmdqs->cmdq[cmdq_type]; in cmdq_ceq_handler()
682 struct hinic_hwif *hwif = cmdqs->hwif; in cmdq_ceq_handler()
685 err = hinic_set_arm_bit(cmdqs, HINIC_SET_ARM_CMDQ, cmdq_type); in cmdq_ceq_handler()
703 struct hinic_cmdqs *cmdqs = cmdq_to_cmdqs(cmdq); in cmdq_init_queue_ctxt() local
729 cmdq_ctxt->func_idx = HINIC_HWIF_FUNC_IDX(cmdqs->hwif); in cmdq_init_queue_ctxt()
730 cmdq_ctxt->ppf_idx = HINIC_HWIF_PPF_IDX(cmdqs->hwif); in cmdq_init_queue_ctxt()
792 struct hinic_cmdqs *cmdqs, void __iomem **db_area) in init_cmdqs_ctxt() argument
811 cmdqs->cmdq[cmdq_type].hwdev = hwdev; in init_cmdqs_ctxt()
812 err = init_cmdq(&cmdqs->cmdq[cmdq_type], in init_cmdqs_ctxt()
813 &cmdqs->saved_wqs[cmdq_type], cmdq_type, in init_cmdqs_ctxt()
821 &cmdqs->cmdq[cmdq_type], in init_cmdqs_ctxt()
822 &cmdqs->cmdq_pages); in init_cmdqs_ctxt()
848 free_cmdq(&cmdqs->cmdq[type]); in init_cmdqs_ctxt()
881 int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, in hinic_init_cmdqs() argument
884 struct hinic_func_to_io *func_to_io = cmdqs_to_func_to_io(cmdqs); in hinic_init_cmdqs()
891 cmdqs->hwif = hwif; in hinic_init_cmdqs()
892 cmdqs->cmdq_buf_pool = dma_pool_create("hinic_cmdq", &pdev->dev, in hinic_init_cmdqs()
895 if (!cmdqs->cmdq_buf_pool) in hinic_init_cmdqs()
899 cmdqs->saved_wqs = devm_kzalloc(&pdev->dev, saved_wqs_size, GFP_KERNEL); in hinic_init_cmdqs()
900 if (!cmdqs->saved_wqs) { in hinic_init_cmdqs()
906 err = hinic_wqs_cmdq_alloc(&cmdqs->cmdq_pages, cmdqs->saved_wqs, hwif, in hinic_init_cmdqs()
915 err = init_cmdqs_ctxt(hwdev, cmdqs, db_area); in hinic_init_cmdqs()
921 hinic_ceq_register_cb(&func_to_io->ceqs, HINIC_CEQ_CMDQ, cmdqs, in hinic_init_cmdqs()
936 hinic_wqs_cmdq_free(&cmdqs->cmdq_pages, cmdqs->saved_wqs, in hinic_init_cmdqs()
940 devm_kfree(&pdev->dev, cmdqs->saved_wqs); in hinic_init_cmdqs()
943 dma_pool_destroy(cmdqs->cmdq_buf_pool); in hinic_init_cmdqs()
951 void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs) in hinic_free_cmdqs() argument
953 struct hinic_func_to_io *func_to_io = cmdqs_to_func_to_io(cmdqs); in hinic_free_cmdqs()
954 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_free_cmdqs()
962 free_cmdq(&cmdqs->cmdq[cmdq_type]); in hinic_free_cmdqs()
964 hinic_wqs_cmdq_free(&cmdqs->cmdq_pages, cmdqs->saved_wqs, in hinic_free_cmdqs()
967 devm_kfree(&pdev->dev, cmdqs->saved_wqs); in hinic_free_cmdqs()
969 dma_pool_destroy(cmdqs->cmdq_buf_pool); in hinic_free_cmdqs()