Lines Matching refs:cmdqs
81 #define cmdqs_to_func_to_io(cmdqs) container_of(cmdqs, \ argument
83 cmdqs)
126 int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs, in hinic_alloc_cmdq_buf() argument
129 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_alloc_cmdq_buf()
132 cmdq_buf->buf = dma_pool_alloc(cmdqs->cmdq_buf_pool, GFP_KERNEL, in hinic_alloc_cmdq_buf()
147 void hinic_free_cmdq_buf(struct hinic_cmdqs *cmdqs, in hinic_free_cmdq_buf() argument
150 dma_pool_free(cmdqs->cmdq_buf_pool, cmdq_buf->buf, cmdq_buf->dma_addr); in hinic_free_cmdq_buf()
481 int hinic_cmdq_direct_resp(struct hinic_cmdqs *cmdqs, in hinic_cmdq_direct_resp() argument
485 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_cmdq_direct_resp()
495 return cmdq_sync_cmd_direct_resp(&cmdqs->cmdq[HINIC_CMDQ_SYNC], in hinic_cmdq_direct_resp()
507 static int hinic_set_arm_bit(struct hinic_cmdqs *cmdqs, in hinic_set_arm_bit() argument
510 struct hinic_cmdq *cmdq = &cmdqs->cmdq[HINIC_CMDQ_SYNC]; in hinic_set_arm_bit()
511 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_set_arm_bit()
642 struct hinic_cmdqs *cmdqs = (struct hinic_cmdqs *)handle; in cmdq_ceq_handler() local
643 struct hinic_cmdq *cmdq = &cmdqs->cmdq[cmdq_type]; in cmdq_ceq_handler()
677 struct hinic_hwif *hwif = cmdqs->hwif; in cmdq_ceq_handler()
680 err = hinic_set_arm_bit(cmdqs, HINIC_SET_ARM_CMDQ, cmdq_type); in cmdq_ceq_handler()
698 struct hinic_cmdqs *cmdqs = cmdq_to_cmdqs(cmdq); in cmdq_init_queue_ctxt() local
724 cmdq_ctxt->func_idx = HINIC_HWIF_FUNC_IDX(cmdqs->hwif); in cmdq_init_queue_ctxt()
725 cmdq_ctxt->ppf_idx = HINIC_HWIF_PPF_IDX(cmdqs->hwif); in cmdq_init_queue_ctxt()
787 struct hinic_cmdqs *cmdqs, void __iomem **db_area) in init_cmdqs_ctxt() argument
805 cmdqs->cmdq[cmdq_type].hwdev = hwdev; in init_cmdqs_ctxt()
806 err = init_cmdq(&cmdqs->cmdq[cmdq_type], in init_cmdqs_ctxt()
807 &cmdqs->saved_wqs[cmdq_type], cmdq_type, in init_cmdqs_ctxt()
815 &cmdqs->cmdq[cmdq_type], in init_cmdqs_ctxt()
816 &cmdqs->cmdq_pages); in init_cmdqs_ctxt()
842 free_cmdq(&cmdqs->cmdq[type]); in init_cmdqs_ctxt()
875 int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, in hinic_init_cmdqs() argument
878 struct hinic_func_to_io *func_to_io = cmdqs_to_func_to_io(cmdqs); in hinic_init_cmdqs()
884 cmdqs->hwif = hwif; in hinic_init_cmdqs()
885 cmdqs->cmdq_buf_pool = dma_pool_create("hinic_cmdq", &pdev->dev, in hinic_init_cmdqs()
888 if (!cmdqs->cmdq_buf_pool) in hinic_init_cmdqs()
891 cmdqs->saved_wqs = devm_kcalloc(&pdev->dev, HINIC_MAX_CMDQ_TYPES, in hinic_init_cmdqs()
892 sizeof(*cmdqs->saved_wqs), GFP_KERNEL); in hinic_init_cmdqs()
893 if (!cmdqs->saved_wqs) { in hinic_init_cmdqs()
899 err = hinic_wqs_cmdq_alloc(&cmdqs->cmdq_pages, cmdqs->saved_wqs, hwif, in hinic_init_cmdqs()
908 err = init_cmdqs_ctxt(hwdev, cmdqs, db_area); in hinic_init_cmdqs()
914 hinic_ceq_register_cb(&func_to_io->ceqs, HINIC_CEQ_CMDQ, cmdqs, in hinic_init_cmdqs()
927 free_cmdq(&cmdqs->cmdq[HINIC_CMDQ_SYNC]); in hinic_init_cmdqs()
929 hinic_wqs_cmdq_free(&cmdqs->cmdq_pages, cmdqs->saved_wqs, in hinic_init_cmdqs()
933 devm_kfree(&pdev->dev, cmdqs->saved_wqs); in hinic_init_cmdqs()
936 dma_pool_destroy(cmdqs->cmdq_buf_pool); in hinic_init_cmdqs()
944 void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs) in hinic_free_cmdqs() argument
946 struct hinic_func_to_io *func_to_io = cmdqs_to_func_to_io(cmdqs); in hinic_free_cmdqs()
947 struct hinic_hwif *hwif = cmdqs->hwif; in hinic_free_cmdqs()
955 free_cmdq(&cmdqs->cmdq[cmdq_type]); in hinic_free_cmdqs()
957 hinic_wqs_cmdq_free(&cmdqs->cmdq_pages, cmdqs->saved_wqs, in hinic_free_cmdqs()
960 devm_kfree(&pdev->dev, cmdqs->saved_wqs); in hinic_free_cmdqs()
962 dma_pool_destroy(cmdqs->cmdq_buf_pool); in hinic_free_cmdqs()