Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx> Cc: Adaptec OEM Raid Solutions <aacraid@xxxxxxxxxxx> --- drivers/scsi/dpt_i2o.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 0bf9769..9bab86c 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -2240,26 +2240,17 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d * Note: Do not have to verify index is less than 0 since * cmd->cmnd[0] is an unsigned char */ - switch(cmd->sc_data_direction){ - case DMA_FROM_DEVICE: - scsidir =0x40000000; // DATA IN (iop<--dev) - break; - case DMA_TO_DEVICE: - direction=0x04000000; // SGL OUT - scsidir =0x80000000; // DATA OUT (iop-->dev) - break; - case DMA_NONE: - break; - case DMA_BIDIRECTIONAL: - scsidir =0x40000000; // DATA IN (iop<--dev) - // Assume In - and continue; - break; - default: + if (scsi_bidi_cmnd(cmd)) { printk(KERN_WARNING"%s: scsi opcode 0x%x not supported.\n", pHba->name, cmd->cmnd[0]); cmd->result = (DID_OK <<16) | (INITIATOR_ERROR << 8); cmd->scsi_done(cmd); return 0; + } else if (cmd->sc_data_direction == DMA_FROM_DEVICE) { + scsidir =0x40000000; // DATA IN (iop<--dev) + } else if (cmd->sc_data_direction == DMA_TO_DEVICE) { + direction=0x04000000; // SGL OUT + scsidir =0x80000000; // DATA OUT (iop-->dev) } } // msg[0] is set later -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html