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->cmd_type = REQ_TYPE_SPECIAL; in carm_array_info()
624 crq->rq->special = crq; in carm_array_info()
625 blk_execute_rq_nowait(host->oob_q, NULL, crq->rq, true, NULL); in carm_array_info()
640 struct carm_request *crq; in carm_send_special() local
646 crq = carm_get_special(host); in carm_send_special()
647 if (!crq) in carm_send_special()
650 idx = crq->tag; in carm_send_special()
657 crq->msg_type = ioc->type; in carm_send_special()
658 crq->msg_subtype = ioc->subtype; in carm_send_special()
661 crq->msg_bucket = (u32) rc; in carm_send_special()
664 crq->rq->cmd_type = REQ_TYPE_SPECIAL; in carm_send_special()
665 crq->rq->special = crq; in carm_send_special()
666 blk_execute_rq_nowait(host->oob_q, NULL, crq->rq, true, NULL); in carm_send_special()
750 struct carm_request *crq, in carm_end_request_queued() argument
753 struct request *req = crq->rq; in carm_end_request_queued()
758 rc = carm_put_request(host, crq); in carm_end_request_queued()
796 static inline void carm_end_rq(struct carm_host *host, struct carm_request *crq, in carm_end_rq() argument
799 carm_end_request_queued(host, crq, error); in carm_end_rq()
811 struct carm_request *crq; in carm_oob_rq_fn() local
821 crq = rq->special; in carm_oob_rq_fn()
822 assert(crq != NULL); in carm_oob_rq_fn()
823 assert(crq->rq == rq); in carm_oob_rq_fn()
825 crq->n_elem = 0; in carm_oob_rq_fn()
828 rc = carm_send_msg(host, crq); in carm_oob_rq_fn()
842 struct carm_request *crq; in carm_rq_fn() local
855 crq = carm_get_request(host); in carm_rq_fn()
856 if (!crq) { in carm_rq_fn()
860 crq->rq = rq; in carm_rq_fn()
872 sg = &crq->sg[0]; in carm_rq_fn()
875 carm_end_rq(host, crq, -EIO); in carm_rq_fn()
882 carm_end_rq(host, crq, -EIO); in carm_rq_fn()
885 crq->n_elem = n_elem; in carm_rq_fn()
886 crq->port = port; in carm_rq_fn()
894 msg = (struct carm_msg_rw *) carm_ref_msg(host, crq->tag); in carm_rq_fn()
898 crq->msg_type = CARM_MSG_WRITE; in carm_rq_fn()
901 crq->msg_type = CARM_MSG_READ; in carm_rq_fn()
907 msg->handle = cpu_to_le32(TAG_ENCODE(crq->tag)); in carm_rq_fn()
916 carm_sg->start = cpu_to_le32(sg_dma_address(&crq->sg[i])); in carm_rq_fn()
917 carm_sg->len = cpu_to_le32(sg_dma_len(&crq->sg[i])); in carm_rq_fn()
923 crq->msg_bucket = (u32) rc; in carm_rq_fn()
929 VPRINTK("send msg, tag == %u\n", crq->tag); in carm_rq_fn()
930 rc = carm_send_msg(host, crq); in carm_rq_fn()
932 carm_put_request(host, crq); in carm_rq_fn()
942 struct carm_request *crq, u8 *mem, in carm_handle_array_info() argument
954 carm_end_rq(host, crq, error); in carm_handle_array_info()
1002 struct carm_request *crq, u8 *mem, in carm_handle_scan_chan() argument
1011 carm_end_rq(host, crq, error); in carm_handle_scan_chan()
1035 struct carm_request *crq, int error, in carm_handle_generic() argument
1040 carm_end_rq(host, crq, error); in carm_handle_generic()
1051 struct carm_request *crq, int error) in carm_handle_rw() argument
1057 if (rq_data_dir(crq->rq) == WRITE) in carm_handle_rw()
1062 pci_unmap_sg(host->pdev, &crq->sg[0], crq->n_elem, pci_dir); in carm_handle_rw()
1064 carm_end_rq(host, crq, error); in carm_handle_rw()
1072 struct carm_request *crq; in carm_handle_resp() local
1087 crq = &host->req[msg_idx]; in carm_handle_resp()
1090 if (likely(crq->msg_type == CARM_MSG_READ || in carm_handle_resp()
1091 crq->msg_type == CARM_MSG_WRITE)) { in carm_handle_resp()
1092 carm_handle_rw(host, crq, error); in carm_handle_resp()
1098 switch (crq->msg_type) { in carm_handle_resp()
1100 switch (crq->msg_subtype) { in carm_handle_resp()
1102 carm_handle_scan_chan(host, crq, mem, error); in carm_handle_resp()
1112 switch (crq->msg_subtype) { in carm_handle_resp()
1114 carm_handle_generic(host, crq, error, in carm_handle_resp()
1118 carm_handle_generic(host, crq, error, in carm_handle_resp()
1128 carm_handle_generic(host, crq, error, in carm_handle_resp()
1140 switch (crq->msg_subtype) { in carm_handle_resp()
1142 carm_handle_array_info(host, crq, mem, error); in carm_handle_resp()
1160 pci_name(host->pdev), crq->msg_type, crq->msg_subtype); in carm_handle_resp()
1161 carm_end_rq(host, crq, -EIO); in carm_handle_resp()