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
810 cmdqs->cmdq[cmdq_type].hwdev = hwdev; in init_cmdqs_ctxt()
811 err = init_cmdq(&cmdqs->cmdq[cmdq_type], in init_cmdqs_ctxt()
812 &cmdqs->saved_wqs[cmdq_type], cmdq_type, in init_cmdqs_ctxt()
820 &cmdqs->cmdq[cmdq_type], in init_cmdqs_ctxt()
821 &cmdqs->cmdq_pages); in init_cmdqs_ctxt()
847 free_cmdq(&cmdqs->cmdq[type]); in init_cmdqs_ctxt()
880 int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, in hinic_init_cmdqs() argument
883 struct hinic_func_to_io *func_to_io = cmdqs_to_func_to_io(cmdqs); in hinic_init_cmdqs()
889 cmdqs->hwif = hwif; in hinic_init_cmdqs()
890 cmdqs->cmdq_buf_pool = dma_pool_create("hinic_cmdq", &pdev->dev, in hinic_init_cmdqs()
893 if (!cmdqs->cmdq_buf_pool) in hinic_init_cmdqs()
896 cmdqs->saved_wqs = devm_kcalloc(&pdev->dev, HINIC_MAX_CMDQ_TYPES, in hinic_init_cmdqs()
897 sizeof(*cmdqs->saved_wqs), GFP_KERNEL); in hinic_init_cmdqs()
898 if (!cmdqs->saved_wqs) { in hinic_init_cmdqs()
904 err = hinic_wqs_cmdq_alloc(&cmdqs->cmdq_pages, cmdqs->saved_wqs, hwif, in hinic_init_cmdqs()
913 err = init_cmdqs_ctxt(hwdev, cmdqs, db_area); in hinic_init_cmdqs()
919 hinic_ceq_register_cb(&func_to_io->ceqs, HINIC_CEQ_CMDQ, cmdqs, in hinic_init_cmdqs()
932 free_cmdq(&cmdqs->cmdq[HINIC_CMDQ_SYNC]); in hinic_init_cmdqs()
934 hinic_wqs_cmdq_free(&cmdqs->cmdq_pages, cmdqs->saved_wqs, in hinic_init_cmdqs()
938 devm_kfree(&pdev->dev, cmdqs->saved_wqs); in hinic_init_cmdqs()
941 dma_pool_destroy(cmdqs->cmdq_buf_pool); in hinic_init_cmdqs()
949 void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs) in hinic_free_cmdqs() argument
951 struct hinic_func_to_io *func_to_io = cmdqs_to_func_to_io(cmdqs); in hinic_free_cmdqs()
952 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_free_cmdqs()
960 free_cmdq(&cmdqs->cmdq[cmdq_type]); in hinic_free_cmdqs()
962 hinic_wqs_cmdq_free(&cmdqs->cmdq_pages, cmdqs->saved_wqs, in hinic_free_cmdqs()
965 devm_kfree(&pdev->dev, cmdqs->saved_wqs); in hinic_free_cmdqs()
967 dma_pool_destroy(cmdqs->cmdq_buf_pool); in hinic_free_cmdqs()