summaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2005-12-12 23:03:24 -0500
committerJody McIntyre <scjody@modernduck.com>2005-12-12 23:03:24 -0500
commit43863eba763e0c91e33e342ce5b7650fea594a53 (patch)
treea353684ea6e69b906f9fc987f5ff74770867e914 /drivers/ieee1394/sbp2.c
parent51c1d80e929bace26d2d795bd77fcc14b02ba3bb (diff)
downloadop-kernel-dev-43863eba763e0c91e33e342ce5b7650fea594a53.zip
op-kernel-dev-43863eba763e0c91e33e342ce5b7650fea594a53.tar.gz
sbp2: delete sbp2scsi_direction_table
DMA_BIDIRECTIONAL data direction may be handled properly by Linux in the future. For now, reject it instead to convert it to another direction. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jody McIntyre <scjody@modernduck.com>
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r--drivers/ieee1394/sbp2.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index f0763b7..372a772 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -1740,28 +1740,15 @@ static int sbp2_create_command_orb(struct scsi_id_instance_data *scsi_id,
command_orb->misc |= ORB_SET_SPEED(scsi_id->speed_code);
command_orb->misc |= ORB_SET_NOTIFY(1); /* Notify us when complete */
- /*
- * Get the direction of the transfer. If the direction is unknown, then use our
- * goofy table as a back-up.
- */
- switch (dma_dir) {
- case DMA_NONE:
+ if (dma_dir == DMA_NONE)
orb_direction = ORB_DIRECTION_NO_DATA_TRANSFER;
- break;
- case DMA_TO_DEVICE:
+ else if (dma_dir == DMA_TO_DEVICE && scsi_request_bufflen)
orb_direction = ORB_DIRECTION_WRITE_TO_MEDIA;
- break;
- case DMA_FROM_DEVICE:
+ else if (dma_dir == DMA_FROM_DEVICE && scsi_request_bufflen)
orb_direction = ORB_DIRECTION_READ_FROM_MEDIA;
- break;
- case DMA_BIDIRECTIONAL:
- default:
- SBP2_ERR("SCSI data transfer direction not specified. "
- "Update the SBP2 direction table in sbp2.h if "
- "necessary for your application");
- __scsi_print_command(scsi_cmd);
- orb_direction = sbp2scsi_direction_table[*scsi_cmd];
- break;
+ else {
+ SBP2_WARN("Falling back to DMA_NONE");
+ orb_direction = ORB_DIRECTION_NO_DATA_TRANSFER;
}
/*
@@ -1880,16 +1867,6 @@ static int sbp2_create_command_orb(struct scsi_id_instance_data *scsi_id,
command_orb->misc |= ORB_SET_DATA_SIZE(scsi_request_bufflen);
command_orb->misc |= ORB_SET_DIRECTION(orb_direction);
- /*
- * Sanity, in case our direction table is not
- * up-to-date
- */
- if (!scsi_request_bufflen) {
- command_orb->data_descriptor_hi = 0x0;
- command_orb->data_descriptor_lo = 0x0;
- command_orb->misc |= ORB_SET_DIRECTION(1);
- }
-
} else {
/*
* Need to turn this into page tables, since the
@@ -2371,6 +2348,16 @@ static int sbp2scsi_queuecommand(struct scsi_cmnd *SCpnt,
}
/*
+ * Bidirectional commands are not yet implemented,
+ * and unknown transfer direction not handled.
+ */
+ if (SCpnt->sc_data_direction == DMA_BIDIRECTIONAL) {
+ SBP2_ERR("Cannot handle DMA_BIDIRECTIONAL - rejecting command");
+ result = DID_ERROR << 16;
+ goto done;
+ }
+
+ /*
* Try and send our SCSI command
*/
if (sbp2_send_command(scsi_id, SCpnt, done)) {
OpenPOWER on IntegriCloud