aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.c
diff options
context:
space:
mode:
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 f0763b797238..372a7726063c 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,
1740 command_orb->misc |= ORB_SET_SPEED(scsi_id->speed_code); 1740 command_orb->misc |= ORB_SET_SPEED(scsi_id->speed_code);
1741 command_orb->misc |= ORB_SET_NOTIFY(1); /* Notify us when complete */ 1741 command_orb->misc |= ORB_SET_NOTIFY(1); /* Notify us when complete */
1742 1742
1743 /* 1743 if (dma_dir == DMA_NONE)
1744 * Get the direction of the transfer. If the direction is unknown, then use our
1745 * goofy table as a back-up.
1746 */
1747 switch (dma_dir) {
1748 case DMA_NONE:
1749 orb_direction = ORB_DIRECTION_NO_DATA_TRANSFER; 1744 orb_direction = ORB_DIRECTION_NO_DATA_TRANSFER;
1750 break; 1745 else if (dma_dir == DMA_TO_DEVICE && scsi_request_bufflen)
1751 case DMA_TO_DEVICE:
1752 orb_direction = ORB_DIRECTION_WRITE_TO_MEDIA; 1746 orb_direction = ORB_DIRECTION_WRITE_TO_MEDIA;
1753 break; 1747 else if (dma_dir == DMA_FROM_DEVICE && scsi_request_bufflen)
1754 case DMA_FROM_DEVICE:
1755 orb_direction = ORB_DIRECTION_READ_FROM_MEDIA; 1748 orb_direction = ORB_DIRECTION_READ_FROM_MEDIA;
1756 break; 1749 else {
1757 case DMA_BIDIRECTIONAL: 1750 SBP2_WARN("Falling back to DMA_NONE");
1758 default: 1751 orb_direction = ORB_DIRECTION_NO_DATA_TRANSFER;
1759 SBP2_ERR("SCSI data transfer direction not specified. "
1760 "Update the SBP2 direction table in sbp2.h if "
1761 "necessary for your application");
1762 __scsi_print_command(scsi_cmd);
1763 orb_direction = sbp2scsi_direction_table[*scsi_cmd];
1764 break;
1765 } 1752 }
1766 1753
1767 /* 1754 /*
@@ -1880,16 +1867,6 @@ static int sbp2_create_command_orb(struct scsi_id_instance_data *scsi_id,
1880 command_orb->misc |= ORB_SET_DATA_SIZE(scsi_request_bufflen); 1867 command_orb->misc |= ORB_SET_DATA_SIZE(scsi_request_bufflen);
1881 command_orb->misc |= ORB_SET_DIRECTION(orb_direction); 1868 command_orb->misc |= ORB_SET_DIRECTION(orb_direction);
1882 1869
1883 /*
1884 * Sanity, in case our direction table is not
1885 * up-to-date
1886 */
1887 if (!scsi_request_bufflen) {
1888 command_orb->data_descriptor_hi = 0x0;
1889 command_orb->data_descriptor_lo = 0x0;
1890 command_orb->misc |= ORB_SET_DIRECTION(1);
1891 }
1892
1893 } else { 1870 } else {
1894 /* 1871 /*
1895 * Need to turn this into page tables, since the 1872 * Need to turn this into page tables, since the
@@ -2371,6 +2348,16 @@ static int sbp2scsi_queuecommand(struct scsi_cmnd *SCpnt,
2371 } 2348 }
2372 2349
2373 /* 2350 /*
2351 * Bidirectional commands are not yet implemented,
2352 * and unknown transfer direction not handled.
2353 */
2354 if (SCpnt->sc_data_direction == DMA_BIDIRECTIONAL) {
2355 SBP2_ERR("Cannot handle DMA_BIDIRECTIONAL - rejecting command");
2356 result = DID_ERROR << 16;
2357 goto done;
2358 }
2359
2360 /*
2374 * Try and send our SCSI command 2361 * Try and send our SCSI command
2375 */ 2362 */
2376 if (sbp2_send_command(scsi_id, SCpnt, done)) { 2363 if (sbp2_send_command(scsi_id, SCpnt, done)) {