Merge branch 'upstream'
[firefly-linux-kernel-4.4.55.git] / include / linux / libata.h
index 4dff3cf9d3890f9dc1789e4ff86f1749d83f254e..c2215469a101c3d02576af0e14d855ffc3878e9e 100644 (file)
@@ -161,8 +161,10 @@ enum {
        ATA_QCFLAG_DMAMAP       = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
        ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */
 
+       /* host set flags */
+       ATA_HOST_SIMPLEX        = (1 << 0),     /* Host is simplex, one DMA channel per host_set only */
+       
        /* various lengths of time */
-       ATA_TMOUT_EDD           = 5 * HZ,       /* heuristic */
        ATA_TMOUT_PIO           = 30 * HZ,
        ATA_TMOUT_BOOT          = 30 * HZ,      /* heuristic */
        ATA_TMOUT_BOOT_QUICK    = 7 * HZ,       /* heuristic */
@@ -280,6 +282,7 @@ struct ata_probe_ent {
        unsigned long           irq;
        unsigned int            irq_flags;
        unsigned long           host_flags;
+       unsigned long           host_set_flags;
        void __iomem            *mmio_base;
        void                    *private_data;
 };
@@ -292,6 +295,9 @@ struct ata_host_set {
        unsigned int            n_ports;
        void                    *private_data;
        const struct ata_port_operations *ops;
+       unsigned long           flags;
+       int                     simplex_claimed;        /* Keep seperate in case we
+                                                          ever need to do this locked */
        struct ata_port *       ports[0];
 };
 
@@ -359,6 +365,11 @@ struct ata_device {
        unsigned int            max_sectors;    /* per-device max sectors */
        unsigned int            cdb_len;
 
+       /* per-dev xfer mask */
+       unsigned int            pio_mask;
+       unsigned int            mwdma_mask;
+       unsigned int            udma_mask;
+
        /* for CHS addressing */
        u16                     cylinders;      /* Number of cylinders */
        u16                     heads;          /* Number of heads */
@@ -396,6 +407,7 @@ struct ata_port {
 
        struct ata_host_stats   stats;
        struct ata_host_set     *host_set;
+       struct device           *dev;
 
        struct work_struct      port_task;
 
@@ -415,6 +427,7 @@ struct ata_port_operations {
 
        void (*set_piomode) (struct ata_port *, struct ata_device *);
        void (*set_dmamode) (struct ata_port *, struct ata_device *);
+       unsigned long (*mode_filter) (const struct ata_port *, struct ata_device *, unsigned long);
 
        void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf);
        void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
@@ -425,6 +438,7 @@ struct ata_port_operations {
        void (*dev_select)(struct ata_port *ap, unsigned int device);
 
        void (*phy_reset) (struct ata_port *ap); /* obsolete */
+       void (*set_mode) (struct ata_port *ap);
        int (*probe_reset) (struct ata_port *ap, unsigned int *classes);
 
        void (*post_set_mode) (struct ata_port *ap);
@@ -510,16 +524,15 @@ extern void ata_host_set_remove(struct ata_host_set *host_set);
 extern int ata_scsi_detect(struct scsi_host_template *sht);
 extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
 extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
-extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd);
 extern int ata_scsi_error(struct Scsi_Host *host);
 extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
 extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
 extern int ata_scsi_release(struct Scsi_Host *host);
 extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
 extern int ata_scsi_device_resume(struct scsi_device *);
-extern int ata_scsi_device_suspend(struct scsi_device *);
+extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
 extern int ata_device_resume(struct ata_port *, struct ata_device *);
-extern int ata_device_suspend(struct ata_port *, struct ata_device *);
+extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state);
 extern int ata_ratelimit(void);
 extern unsigned int ata_busy_sleep(struct ata_port *ap,
                                   unsigned long timeout_pat,
@@ -570,6 +583,8 @@ extern int ata_std_bios_param(struct scsi_device *sdev,
                              struct block_device *bdev,
                              sector_t capacity, int geom[]);
 extern int ata_scsi_slave_config(struct scsi_device *sdev);
+extern struct ata_device *ata_dev_pair(struct ata_port *ap, 
+                                      struct ata_device *adev);
 
 /*
  * Timing helpers