summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlbert Lee <albertcc@tw.ibm.com>2006-04-04 10:57:18 +0800
committerJeff Garzik <jeff@garzik.org>2006-04-04 08:44:24 -0400
commit95de719adc94392a95c3c4d0a2d6b8b1ea39d236 (patch)
treed8196f39ca64a2c727ff6eff94b28d10013c6564
parentc16226a1c75042bfdc50bd2921d5919f6267ba51 (diff)
downloadkernel-crypto-95de719adc94392a95c3c4d0a2d6b8b1ea39d236.tar.gz
kernel-crypto-95de719adc94392a95c3c4d0a2d6b8b1ea39d236.tar.xz
kernel-crypto-95de719adc94392a95c3c4d0a2d6b8b1ea39d236.zip
[PATCH] libata: convert ATAPI_ENABLE_DMADIR to module parameter
Convert the ATAPI_ENABLE_DMADIR compile time option needed by some SATA-PATA bridge to runtime module parameter. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/scsi/libata-core.c4
-rw-r--r--drivers/scsi/libata-scsi.c6
-rw-r--r--drivers/scsi/libata.h1
-rw-r--r--include/linux/libata.h1
4 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 966be3034bf..3387fe35c54 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -76,6 +76,10 @@ int atapi_enabled = 1;
module_param(atapi_enabled, int, 0444);
MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)");
+int atapi_dmadir = 0;
+module_param(atapi_dmadir, int, 0444);
+MODULE_PARM_DESC(atapi_dmadir, "Enable ATAPI DMADIR bridge support (0=off, 1=on)");
+
int libata_fua = 0;
module_param_named(fua, libata_fua, int, 0444);
MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)");
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 745fc263fee..c9c00149029 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -2163,11 +2163,9 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd)
qc->tf.protocol = ATA_PROT_ATAPI_DMA;
qc->tf.feature |= ATAPI_PKT_DMA;
-#ifdef ATAPI_ENABLE_DMADIR
- /* some SATA bridges need us to indicate data xfer direction */
- if (cmd->sc_data_direction != DMA_TO_DEVICE)
+ if (atapi_dmadir && (cmd->sc_data_direction != DMA_TO_DEVICE))
+ /* some SATA bridges need us to indicate data xfer direction */
qc->tf.feature |= ATAPI_DMADIR;
-#endif
}
qc->nbytes = cmd->bufflen;
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index e3bd1ddb538..652c08e3808 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -41,6 +41,7 @@ struct ata_scsi_args {
/* libata-core.c */
extern int atapi_enabled;
+extern int atapi_dmadir;
extern int libata_fua;
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
struct ata_device *dev);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 75bdee09c30..03231cb6b40 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -44,7 +44,6 @@
#undef ATA_NDEBUG /* define to disable quick runtime checks */
#undef ATA_ENABLE_PATA /* define to enable PATA support in some
* low-level drivers */
-#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
/* note: prints function name for you */