Lines Matching refs:vfc_cmd
150 struct ibmvfc_cmd *vfc_cmd = &evt->iu.cmd;
162 entry->op_code = vfc_cmd->iu.cdb[0];
163 entry->scsi_id = be64_to_cpu(vfc_cmd->tgt_scsi_id);
164 entry->lun = scsilun_to_int(&vfc_cmd->iu.lun);
165 entry->tmf_flags = vfc_cmd->iu.tmf_flags;
166 entry->u.start.xfer_len = be32_to_cpu(vfc_cmd->iu.xfer_len);
184 struct ibmvfc_cmd *vfc_cmd = &evt->xfer_iu->cmd;
195 entry->op_code = vfc_cmd->iu.cdb[0];
196 entry->scsi_id = be64_to_cpu(vfc_cmd->tgt_scsi_id);
197 entry->lun = scsilun_to_int(&vfc_cmd->iu.lun);
198 entry->tmf_flags = vfc_cmd->iu.tmf_flags;
199 entry->u.end.status = be16_to_cpu(vfc_cmd->status);
200 entry->u.end.error = be16_to_cpu(vfc_cmd->error);
201 entry->u.end.fcp_rsp_flags = vfc_cmd->rsp.flags;
202 entry->u.end.rsp_code = vfc_cmd->rsp.data.info.rsp_code;
203 entry->u.end.scsi_status = vfc_cmd->rsp.scsi_status;
258 * @vfc_cmd: ibmvfc command struct
263 static int ibmvfc_get_err_result(struct ibmvfc_cmd *vfc_cmd)
266 struct ibmvfc_fcp_rsp *rsp = &vfc_cmd->rsp;
274 err = ibmvfc_get_err_index(be16_to_cpu(vfc_cmd->status), be16_to_cpu(vfc_cmd->error));
1372 * @vfc_cmd: vfc_cmd that contains the memory descriptor
1380 struct ibmvfc_cmd *vfc_cmd, struct device *dev)
1384 struct srp_direct_buf *data = &vfc_cmd->ioba;
1388 vfc_cmd->flags |= cpu_to_be16(IBMVFC_CLASS_3_ERR);
1392 vfc_cmd->flags |= cpu_to_be16(IBMVFC_NO_MEM_DESC);
1401 vfc_cmd->flags |= cpu_to_be16(IBMVFC_WRITE);
1402 vfc_cmd->iu.add_cdb_len |= IBMVFC_WRDATA;
1404 vfc_cmd->flags |= cpu_to_be16(IBMVFC_READ);
1405 vfc_cmd->iu.add_cdb_len |= IBMVFC_RDDATA;
1413 vfc_cmd->flags |= cpu_to_be16(IBMVFC_SCATTERLIST);
1522 struct ibmvfc_cmd *vfc_cmd = &evt->xfer_iu->cmd;
1524 struct ibmvfc_fcp_rsp *rsp = &vfc_cmd->rsp;
1527 int index = ibmvfc_get_err_index(be16_to_cpu(vfc_cmd->status), be16_to_cpu(vfc_cmd->error));
1544 cmnd->cmnd[0], err, be16_to_cpu(vfc_cmd->status), be16_to_cpu(vfc_cmd->error),
1577 struct ibmvfc_cmd *vfc_cmd = &evt->xfer_iu->cmd;
1578 struct ibmvfc_fcp_rsp *rsp = &vfc_cmd->rsp;
1584 if (be16_to_cpu(vfc_cmd->response_flags) & IBMVFC_ADAPTER_RESID_VALID)
1585 scsi_set_resid(cmnd, be32_to_cpu(vfc_cmd->adapter_resid));
1591 if (vfc_cmd->status) {
1592 cmnd->result = ibmvfc_get_err_result(vfc_cmd);
1600 if ((be16_to_cpu(vfc_cmd->status) & IBMVFC_VIOS_FAILURE) &&
1601 (be16_to_cpu(vfc_cmd->error) == IBMVFC_PLOGI_REQUIRED))
1667 struct ibmvfc_cmd *vfc_cmd;
1683 vfc_cmd = &evt->iu.cmd;
1684 memset(vfc_cmd, 0, sizeof(*vfc_cmd));
1685 vfc_cmd->resp.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) + offsetof(struct ibmvfc_cmd, rsp));
1686 vfc_cmd->resp.len = cpu_to_be32(sizeof(vfc_cmd->rsp));
1687 vfc_cmd->frame_type = cpu_to_be32(IBMVFC_SCSI_FCP_TYPE);
1688 vfc_cmd->payload_len = cpu_to_be32(sizeof(vfc_cmd->iu));
1689 vfc_cmd->resp_len = cpu_to_be32(sizeof(vfc_cmd->rsp));
1690 vfc_cmd->cancel_key = cpu_to_be32((unsigned long)cmnd->device->hostdata);
1691 vfc_cmd->tgt_scsi_id = cpu_to_be64(rport->port_id);
1692 vfc_cmd->iu.xfer_len = cpu_to_be32(scsi_bufflen(cmnd));
1693 int_to_scsilun(cmnd->device->lun, &vfc_cmd->iu.lun);
1694 memcpy(vfc_cmd->iu.cdb, cmnd->cmnd, cmnd->cmd_len);
1697 vfc_cmd->task_tag = cpu_to_be64(cmnd->tag);
1698 vfc_cmd->iu.pri_task_attr = IBMVFC_SIMPLE_TASK;
1701 if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev))))