Lines Matching refs:vfc_cmd

189 						   struct ibmvfc_cmd *vfc_cmd)  in ibmvfc_get_fcp_iu()  argument
192 return &vfc_cmd->v2.iu; in ibmvfc_get_fcp_iu()
194 return &vfc_cmd->v1.iu; in ibmvfc_get_fcp_iu()
198 struct ibmvfc_cmd *vfc_cmd) in ibmvfc_get_fcp_rsp() argument
201 return &vfc_cmd->v2.rsp; in ibmvfc_get_fcp_rsp()
203 return &vfc_cmd->v1.rsp; in ibmvfc_get_fcp_rsp()
215 struct ibmvfc_cmd *vfc_cmd = &evt->iu.cmd; in ibmvfc_trc_start() local
217 struct ibmvfc_fcp_cmd_iu *iu = ibmvfc_get_fcp_iu(vhost, vfc_cmd); in ibmvfc_trc_start()
230 entry->scsi_id = be64_to_cpu(vfc_cmd->tgt_scsi_id); in ibmvfc_trc_start()
251 struct ibmvfc_cmd *vfc_cmd = &evt->xfer_iu->cmd; in ibmvfc_trc_end() local
253 struct ibmvfc_fcp_cmd_iu *iu = ibmvfc_get_fcp_iu(vhost, vfc_cmd); in ibmvfc_trc_end()
254 struct ibmvfc_fcp_rsp *rsp = ibmvfc_get_fcp_rsp(vhost, vfc_cmd); in ibmvfc_trc_end()
267 entry->scsi_id = be64_to_cpu(vfc_cmd->tgt_scsi_id); in ibmvfc_trc_end()
270 entry->u.end.status = be16_to_cpu(vfc_cmd->status); in ibmvfc_trc_end()
271 entry->u.end.error = be16_to_cpu(vfc_cmd->error); in ibmvfc_trc_end()
335 static int ibmvfc_get_err_result(struct ibmvfc_host *vhost, struct ibmvfc_cmd *vfc_cmd) in ibmvfc_get_err_result() argument
338 struct ibmvfc_fcp_rsp *rsp = ibmvfc_get_fcp_rsp(vhost, vfc_cmd); in ibmvfc_get_err_result()
346 err = ibmvfc_get_err_index(be16_to_cpu(vfc_cmd->status), be16_to_cpu(vfc_cmd->error)); in ibmvfc_get_err_result()
1604 struct ibmvfc_cmd *vfc_cmd, struct device *dev) in ibmvfc_map_sg_data() argument
1608 struct srp_direct_buf *data = &vfc_cmd->ioba; in ibmvfc_map_sg_data()
1610 struct ibmvfc_fcp_cmd_iu *iu = ibmvfc_get_fcp_iu(evt->vhost, vfc_cmd); in ibmvfc_map_sg_data()
1613 vfc_cmd->flags |= cpu_to_be16(IBMVFC_CLASS_3_ERR); in ibmvfc_map_sg_data()
1617 vfc_cmd->flags |= cpu_to_be16(IBMVFC_NO_MEM_DESC); in ibmvfc_map_sg_data()
1626 vfc_cmd->flags |= cpu_to_be16(IBMVFC_WRITE); in ibmvfc_map_sg_data()
1629 vfc_cmd->flags |= cpu_to_be16(IBMVFC_READ); in ibmvfc_map_sg_data()
1638 vfc_cmd->flags |= cpu_to_be16(IBMVFC_SCATTERLIST); in ibmvfc_map_sg_data()
1764 struct ibmvfc_cmd *vfc_cmd = &evt->xfer_iu->cmd; in ibmvfc_log_error() local
1766 struct ibmvfc_fcp_rsp *rsp = ibmvfc_get_fcp_rsp(vhost, vfc_cmd); in ibmvfc_log_error()
1769 int index = ibmvfc_get_err_index(be16_to_cpu(vfc_cmd->status), be16_to_cpu(vfc_cmd->error)); in ibmvfc_log_error()
1786 cmnd->cmnd[0], err, be16_to_cpu(vfc_cmd->status), be16_to_cpu(vfc_cmd->error), in ibmvfc_log_error()
1822 struct ibmvfc_cmd *vfc_cmd = &evt->xfer_iu->cmd; in ibmvfc_scsi_done() local
1823 struct ibmvfc_fcp_rsp *rsp = ibmvfc_get_fcp_rsp(evt->vhost, vfc_cmd); in ibmvfc_scsi_done()
1829 if (be16_to_cpu(vfc_cmd->response_flags) & IBMVFC_ADAPTER_RESID_VALID) in ibmvfc_scsi_done()
1830 scsi_set_resid(cmnd, be32_to_cpu(vfc_cmd->adapter_resid)); in ibmvfc_scsi_done()
1836 if (vfc_cmd->status) { in ibmvfc_scsi_done()
1837 cmnd->result = ibmvfc_get_err_result(evt->vhost, vfc_cmd); in ibmvfc_scsi_done()
1845 if ((be16_to_cpu(vfc_cmd->status) & IBMVFC_VIOS_FAILURE) && in ibmvfc_scsi_done()
1846 (be16_to_cpu(vfc_cmd->error) == IBMVFC_PLOGI_REQUIRED)) in ibmvfc_scsi_done()
1900 struct ibmvfc_cmd *vfc_cmd = &evt->iu.cmd; in ibmvfc_init_vfc_cmd() local
1901 struct ibmvfc_fcp_cmd_iu *iu = ibmvfc_get_fcp_iu(vhost, vfc_cmd); in ibmvfc_init_vfc_cmd()
1902 struct ibmvfc_fcp_rsp *rsp = ibmvfc_get_fcp_rsp(vhost, vfc_cmd); in ibmvfc_init_vfc_cmd()
1905 memset(vfc_cmd, 0, sizeof(*vfc_cmd)); in ibmvfc_init_vfc_cmd()
1908 vfc_cmd->target_wwpn = cpu_to_be64(rport->port_name); in ibmvfc_init_vfc_cmd()
1911 vfc_cmd->resp.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) + offset); in ibmvfc_init_vfc_cmd()
1912 vfc_cmd->resp.len = cpu_to_be32(sizeof(*rsp)); in ibmvfc_init_vfc_cmd()
1913 vfc_cmd->frame_type = cpu_to_be32(IBMVFC_SCSI_FCP_TYPE); in ibmvfc_init_vfc_cmd()
1914 vfc_cmd->payload_len = cpu_to_be32(sizeof(*iu)); in ibmvfc_init_vfc_cmd()
1915 vfc_cmd->resp_len = cpu_to_be32(sizeof(*rsp)); in ibmvfc_init_vfc_cmd()
1916 vfc_cmd->cancel_key = cpu_to_be32((unsigned long)sdev->hostdata); in ibmvfc_init_vfc_cmd()
1917 vfc_cmd->tgt_scsi_id = cpu_to_be64(rport->port_id); in ibmvfc_init_vfc_cmd()
1920 return vfc_cmd; in ibmvfc_init_vfc_cmd()
1935 struct ibmvfc_cmd *vfc_cmd; in ibmvfc_queuecommand() local
1967 vfc_cmd = ibmvfc_init_vfc_cmd(evt, cmnd->device); in ibmvfc_queuecommand()
1968 iu = ibmvfc_get_fcp_iu(vhost, vfc_cmd); in ibmvfc_queuecommand()
1974 vfc_cmd->task_tag = cpu_to_be64(scsi_cmd_to_rq(cmnd)->tag); in ibmvfc_queuecommand()
1978 vfc_cmd->correlation = cpu_to_be64((u64)evt); in ibmvfc_queuecommand()
1980 if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev)))) in ibmvfc_queuecommand()