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