From 50630195bbdfe1ca775d94cd68a5f18bc1b717e4 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 13 Dec 2005 02:29:45 -0500 Subject: [libata] mark certain hardware (or drivers) with a no-atapi flag Some hardware does not support the PACKET command at all. Other hardware supports ATAPI, but the driver does something nasty such as calling BUG() when an ATAPI command is issued. For these such cases, we mark them with a new flag, ATA_FLAG_NO_ATAPI. Initial version contributed by Ben Collins. --- drivers/scsi/libata-scsi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/libata-scsi.c') diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 379e8708976..72ddba98f8f 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c @@ -2173,9 +2173,12 @@ ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev) if (unlikely(!ata_dev_present(dev))) return NULL; - if (!atapi_enabled) { - if (unlikely(dev->class == ATA_DEV_ATAPI)) + if (!atapi_enabled || (ap->flags & ATA_FLAG_NO_ATAPI)) { + if (unlikely(dev->class == ATA_DEV_ATAPI)) { + printk(KERN_WARNING "ata%u(%u): WARNING: ATAPI is %s, device ignored.\n", + ap->id, dev->devno, atapi_enabled ? "not supported with this driver" : "disabled"); return NULL; + } } return dev; -- cgit v1.2.3