libata: separate out ata_ncq_enabled()
[powerpc.git] / include / linux / libata.h
index bdfe6ea..5233e47 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/ata.h>
 #include <linux/workqueue.h>
 #include <scsi/scsi_host.h>
+#include <linux/acpi.h>
 
 /*
  * Define if arch has non-standard setup.  This is a _PCI_ standard
@@ -54,8 +55,6 @@
 #undef ATA_VERBOSE_DEBUG       /* yet more debugging output */
 #undef ATA_IRQ_TRAP            /* define to ack screaming irqs */
 #undef ATA_NDEBUG              /* define to disable quick runtime checks */
-#define ATA_ENABLE_PATA                /* define to enable PATA support in some
-                                * low-level drivers */
 
 
 /* note: prints function name for you */
@@ -174,6 +173,7 @@ enum {
        ATA_FLAG_DEBUGMSG       = (1 << 13),
        ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
        ATA_FLAG_IGN_SIMPLEX    = (1 << 15), /* ignore SIMPLEX */
+       ATA_FLAG_NO_IORDY       = (1 << 16), /* controller lacks iordy */
 
        /* The following flag belongs to ap->pflags but is kept in
         * ap->flags because it's referenced in many LLDs and will be
@@ -495,7 +495,12 @@ struct ata_device {
 
        /* error history */
        struct ata_ering        ering;
+       int                     spdn_cnt;
        unsigned int            horkage;        /* List of broken features */
+#ifdef CONFIG_SATA_ACPI
+       /* ACPI objects info */
+       acpi_handle obj_handle;
+#endif
 };
 
 /* Offset into struct ata_device.  Fields above it are maintained
@@ -755,6 +760,7 @@ extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn,
 extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
                             unsigned long interval_msec,
                             unsigned long timeout_msec);
+extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *);
 
 /*
  * Default driver ops implementations
@@ -1027,6 +1033,21 @@ static inline u8 ata_chk_status(struct ata_port *ap)
        return ap->ops->check_status(ap);
 }
 
+/**
+ *     ata_ncq_enabled - Test whether NCQ is enabled
+ *     @dev: ATA device to test for
+ *
+ *     LOCKING:
+ *     spin_lock_irqsave(host lock)
+ *
+ *     RETURNS:
+ *     1 if NCQ is enabled for @dev, 0 otherwise.
+ */
+static inline int ata_ncq_enabled(struct ata_device *dev)
+{
+       return (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ_OFF |
+                             ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ;
+}
 
 /**
  *     ata_pause - Flush writes and pause 400 nanoseconds.