Lines Matching refs:scsi
14 #include <scsi/fc/fc_els.h>
15 #include <scsi/fc/fc_fcp.h>
16 #include <scsi/fc/fc_ns.h>
17 #include <scsi/scsi_cmnd.h>
18 #include <scsi/scsi_tcq.h>
226 * @scsi: scsi_cmnd where to get LUN, task attributes/flags and CDB
229 void zfcp_fc_scsi_to_fcp(struct fcp_cmnd *fcp, struct scsi_cmnd *scsi)
233 int_to_scsilun(scsi->device->lun, (struct scsi_lun *) &fcp->fc_lun);
237 if (scsi->sc_data_direction == DMA_FROM_DEVICE)
239 if (scsi->sc_data_direction == DMA_TO_DEVICE)
242 memcpy(fcp->fc_cdb, scsi->cmnd, scsi->cmd_len);
244 datalen = scsi_bufflen(scsi);
247 if (scsi_get_prot_type(scsi) == SCSI_PROT_DIF_TYPE1) {
248 datalen += datalen / scsi->device->sector_size * 8;
269 * @scsi: SCSI command where to update status and sense buffer
273 struct scsi_cmnd *scsi)
280 scsi->result |= fcp_rsp->resp.fr_status;
287 set_host_byte(scsi, DID_OK);
289 set_host_byte(scsi, DID_ERROR);
300 memcpy(scsi->sense_buffer, sense, sense_len);
305 scsi_set_resid(scsi, resid);
306 if (scsi_bufflen(scsi) - resid < scsi->underflow &&
309 set_host_byte(scsi, DID_ERROR);
313 set_host_byte(scsi, DID_ERROR);