Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107470
b: refs/heads/master
c: 2486fa5
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jul 31, 2008
1 parent 9b1f62a commit ef48fd7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfce5e0179ad059035df28558724ff60af708e09
refs/heads/master: 2486fa561a3192bbbec39c7feef87a1e07bd6342
12 changes: 11 additions & 1 deletion trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static char ata_force_param_buf[PAGE_SIZE] __initdata;
module_param_string(force, ata_force_param_buf, sizeof(ata_force_param_buf), 0);
MODULE_PARM_DESC(force, "Force ATA configurations including cable type, link speed and transfer mode (see Documentation/kernel-parameters.txt for details)");

int atapi_enabled = 1;
static int atapi_enabled = 1;
module_param(atapi_enabled, int, 0444);
MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)");

Expand Down Expand Up @@ -2142,6 +2142,16 @@ int ata_dev_configure(struct ata_device *dev)
return 0;
}

if ((!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) &&
dev->class == ATA_DEV_ATAPI) {
ata_dev_printk(dev, KERN_WARNING,
"WARNING: ATAPI is %s, device ignored.\n",
atapi_enabled ? "not supported with this driver"
: "disabled");
ata_dev_disable(dev);
return 0;
}

/* let ACPI work its magic */
rc = ata_acpi_on_devcfg(dev);
if (rc)
Expand Down
34 changes: 2 additions & 32 deletions trunk/drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2550,36 +2550,6 @@ static struct ata_device *__ata_scsi_find_dev(struct ata_port *ap,
return ata_find_dev(ap, devno);
}

/**
* ata_scsi_dev_enabled - determine if device is enabled
* @dev: ATA device
*
* Determine if commands should be sent to the specified device.
*
* LOCKING:
* spin_lock_irqsave(host lock)
*
* RETURNS:
* 0 if commands are not allowed / 1 if commands are allowed
*/

static int ata_scsi_dev_enabled(struct ata_device *dev)
{
if (unlikely(!ata_dev_enabled(dev)))
return 0;

if (!atapi_enabled || (dev->link->ap->flags & ATA_FLAG_NO_ATAPI)) {
if (unlikely(dev->class == ATA_DEV_ATAPI)) {
ata_dev_printk(dev, KERN_WARNING,
"WARNING: ATAPI is %s, device ignored.\n",
atapi_enabled ? "not supported with this driver" : "disabled");
return 0;
}
}

return 1;
}

/**
* ata_scsi_find_dev - lookup ata_device from scsi_cmnd
* @ap: ATA port to which the device is attached
Expand All @@ -2601,7 +2571,7 @@ ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev)
{
struct ata_device *dev = __ata_scsi_find_dev(ap, scsidev);

if (unlikely(!dev || !ata_scsi_dev_enabled(dev)))
if (unlikely(!dev || !ata_dev_enabled(dev)))
return NULL;

return dev;
Expand Down Expand Up @@ -3622,7 +3592,7 @@ int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),

ata_scsi_dump_cdb(ap, cmd);

if (likely(ata_scsi_dev_enabled(ap->link.device)))
if (likely(ata_dev_enabled(ap->link.device)))
rc = __ata_scsi_queuecmd(cmd, done, ap->link.device);
else {
cmd->result = (DID_BAD_TARGET << 16);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/ata/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ enum {

extern unsigned int ata_print_id;
extern struct workqueue_struct *ata_aux_wq;
extern int atapi_enabled;
extern int atapi_passthru16;
extern int libata_fua;
extern int libata_noacpi;
Expand Down

0 comments on commit ef48fd7

Please sign in to comment.