Lines Matching refs:crq
480 struct carm_request *crq) in carm_send_msg() argument
483 u32 msg = (u32) carm_ref_msg_dma(host, crq->tag); in carm_send_msg()
484 u32 cm_bucket = crq->msg_bucket; in carm_send_msg()
518 struct carm_request *crq = &host->req[i]; in carm_get_request() local
519 crq->port = NULL; in carm_get_request()
520 crq->n_elem = 0; in carm_get_request()
526 sg_init_table(crq->sg, CARM_MAX_REQ_SG); in carm_get_request()
527 return crq; in carm_get_request()
534 static int carm_put_request(struct carm_host *host, struct carm_request *crq) in carm_put_request() argument
536 assert(crq->tag < max_queue); in carm_put_request()
538 if (unlikely((host->msg_alloc & (1ULL << crq->tag)) == 0)) in carm_put_request()
541 assert(host->hw_sg_used >= crq->n_elem); in carm_put_request()
543 host->msg_alloc &= ~(1ULL << crq->tag); in carm_put_request()
544 host->hw_sg_used -= crq->n_elem; in carm_put_request()
553 struct carm_request *crq = NULL; in carm_get_special() local
559 crq = carm_get_request(host); in carm_get_special()
562 if (crq) in carm_get_special()
567 if (!crq) in carm_get_special()
573 carm_put_request(host, crq); in carm_get_special()
578 crq->rq = rq; in carm_get_special()
579 return crq; in carm_get_special()
588 struct carm_request *crq; in carm_array_info() local
591 crq = carm_get_special(host); in carm_array_info()
592 if (!crq) { in carm_array_info()
597 idx = crq->tag; in carm_array_info()
603 crq->msg_type = CARM_MSG_ARRAY; in carm_array_info()
604 crq->msg_subtype = CARM_ARRAY_INFO; in carm_array_info()
608 crq->msg_bucket = (u32) rc; in carm_array_info()
623 crq->rq->special = crq; in carm_array_info()
624 blk_execute_rq_nowait(host->oob_q, NULL, crq->rq, true, NULL); in carm_array_info()
639 struct carm_request *crq; in carm_send_special() local
645 crq = carm_get_special(host); in carm_send_special()
646 if (!crq) in carm_send_special()
649 idx = crq->tag; in carm_send_special()
656 crq->msg_type = ioc->type; in carm_send_special()
657 crq->msg_subtype = ioc->subtype; in carm_send_special()
660 crq->msg_bucket = (u32) rc; in carm_send_special()
663 crq->rq->special = crq; in carm_send_special()
664 blk_execute_rq_nowait(host->oob_q, NULL, crq->rq, true, NULL); in carm_send_special()
747 struct carm_request *crq, in carm_end_request_queued() argument
750 struct request *req = crq->rq; in carm_end_request_queued()
755 rc = carm_put_request(host, crq); in carm_end_request_queued()
793 static inline void carm_end_rq(struct carm_host *host, struct carm_request *crq, in carm_end_rq() argument
796 carm_end_request_queued(host, crq, error); in carm_end_rq()
808 struct carm_request *crq; in carm_oob_rq_fn() local
818 crq = rq->special; in carm_oob_rq_fn()
819 assert(crq != NULL); in carm_oob_rq_fn()
820 assert(crq->rq == rq); in carm_oob_rq_fn()
822 crq->n_elem = 0; in carm_oob_rq_fn()
825 rc = carm_send_msg(host, crq); in carm_oob_rq_fn()
839 struct carm_request *crq; in carm_rq_fn() local
852 crq = carm_get_request(host); in carm_rq_fn()
853 if (!crq) { in carm_rq_fn()
857 crq->rq = rq; in carm_rq_fn()
869 sg = &crq->sg[0]; in carm_rq_fn()
872 carm_end_rq(host, crq, BLK_STS_IOERR); in carm_rq_fn()
879 carm_end_rq(host, crq, BLK_STS_IOERR); in carm_rq_fn()
882 crq->n_elem = n_elem; in carm_rq_fn()
883 crq->port = port; in carm_rq_fn()
891 msg = (struct carm_msg_rw *) carm_ref_msg(host, crq->tag); in carm_rq_fn()
895 crq->msg_type = CARM_MSG_WRITE; in carm_rq_fn()
898 crq->msg_type = CARM_MSG_READ; in carm_rq_fn()
904 msg->handle = cpu_to_le32(TAG_ENCODE(crq->tag)); in carm_rq_fn()
913 carm_sg->start = cpu_to_le32(sg_dma_address(&crq->sg[i])); in carm_rq_fn()
914 carm_sg->len = cpu_to_le32(sg_dma_len(&crq->sg[i])); in carm_rq_fn()
920 crq->msg_bucket = (u32) rc; in carm_rq_fn()
926 VPRINTK("send msg, tag == %u\n", crq->tag); in carm_rq_fn()
927 rc = carm_send_msg(host, crq); in carm_rq_fn()
929 carm_put_request(host, crq); in carm_rq_fn()
939 struct carm_request *crq, u8 *mem, in carm_handle_array_info() argument
951 carm_end_rq(host, crq, error); in carm_handle_array_info()
999 struct carm_request *crq, u8 *mem, in carm_handle_scan_chan() argument
1008 carm_end_rq(host, crq, error); in carm_handle_scan_chan()
1032 struct carm_request *crq, blk_status_t error, in carm_handle_generic() argument
1037 carm_end_rq(host, crq, error); in carm_handle_generic()
1048 struct carm_request *crq, blk_status_t error) in carm_handle_rw() argument
1054 if (rq_data_dir(crq->rq) == WRITE) in carm_handle_rw()
1059 pci_unmap_sg(host->pdev, &crq->sg[0], crq->n_elem, pci_dir); in carm_handle_rw()
1061 carm_end_rq(host, crq, error); in carm_handle_rw()
1069 struct carm_request *crq; in carm_handle_resp() local
1084 crq = &host->req[msg_idx]; in carm_handle_resp()
1087 if (likely(crq->msg_type == CARM_MSG_READ || in carm_handle_resp()
1088 crq->msg_type == CARM_MSG_WRITE)) { in carm_handle_resp()
1089 carm_handle_rw(host, crq, error); in carm_handle_resp()
1095 switch (crq->msg_type) { in carm_handle_resp()
1097 switch (crq->msg_subtype) { in carm_handle_resp()
1099 carm_handle_scan_chan(host, crq, mem, error); in carm_handle_resp()
1109 switch (crq->msg_subtype) { in carm_handle_resp()
1111 carm_handle_generic(host, crq, error, in carm_handle_resp()
1115 carm_handle_generic(host, crq, error, in carm_handle_resp()
1125 carm_handle_generic(host, crq, error, in carm_handle_resp()
1137 switch (crq->msg_subtype) { in carm_handle_resp()
1139 carm_handle_array_info(host, crq, mem, error); in carm_handle_resp()
1157 pci_name(host->pdev), crq->msg_type, crq->msg_subtype); in carm_handle_resp()
1158 carm_end_rq(host, crq, BLK_STS_IOERR); in carm_handle_resp()