提交 95de719a 编写于 作者: A Albert Lee 提交者: Jeff Garzik

[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: NAlbert Lee <albertcc@tw.ibm.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 c16226a1
...@@ -76,6 +76,10 @@ int atapi_enabled = 1; ...@@ -76,6 +76,10 @@ int atapi_enabled = 1;
module_param(atapi_enabled, int, 0444); module_param(atapi_enabled, int, 0444);
MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)"); 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; int libata_fua = 0;
module_param_named(fua, libata_fua, int, 0444); module_param_named(fua, libata_fua, int, 0444);
MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)"); MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)");
......
...@@ -2163,11 +2163,9 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc, const u8 *scsicmd) ...@@ -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.protocol = ATA_PROT_ATAPI_DMA;
qc->tf.feature |= ATAPI_PKT_DMA; qc->tf.feature |= ATAPI_PKT_DMA;
#ifdef ATAPI_ENABLE_DMADIR if (atapi_dmadir && (cmd->sc_data_direction != DMA_TO_DEVICE))
/* some SATA bridges need us to indicate data xfer direction */ /* some SATA bridges need us to indicate data xfer direction */
if (cmd->sc_data_direction != DMA_TO_DEVICE)
qc->tf.feature |= ATAPI_DMADIR; qc->tf.feature |= ATAPI_DMADIR;
#endif
} }
qc->nbytes = cmd->bufflen; qc->nbytes = cmd->bufflen;
......
...@@ -41,6 +41,7 @@ struct ata_scsi_args { ...@@ -41,6 +41,7 @@ struct ata_scsi_args {
/* libata-core.c */ /* libata-core.c */
extern int atapi_enabled; extern int atapi_enabled;
extern int atapi_dmadir;
extern int libata_fua; extern int libata_fua;
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
struct ata_device *dev); struct ata_device *dev);
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#undef ATA_NDEBUG /* define to disable quick runtime checks */ #undef ATA_NDEBUG /* define to disable quick runtime checks */
#undef ATA_ENABLE_PATA /* define to enable PATA support in some #undef ATA_ENABLE_PATA /* define to enable PATA support in some
* low-level drivers */ * low-level drivers */
#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
/* note: prints function name for you */ /* note: prints function name for you */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册