]> err.no Git - linux-2.6/blobdiff - include/linux/libata.h
Merge branch 'atmel'
[linux-2.6] / include / linux / libata.h
index 6225b78fa65b30dffdc76d674a014ce0595441df..6f0752219f64052018f9663b62930329c722b888 100644 (file)
@@ -214,7 +214,7 @@ struct ata_probe_ent {
        struct list_head        node;
        struct device           *dev;
        const struct ata_port_operations *port_ops;
-       Scsi_Host_Template      *sht;
+       struct scsi_host_template *sht;
        struct ata_ioports      port[ATA_MAX_PORTS];
        unsigned int            n_ports;
        unsigned int            hard_port_no;
@@ -398,7 +398,7 @@ struct ata_port_operations {
 };
 
 struct ata_port_info {
-       Scsi_Host_Template      *sht;
+       struct scsi_host_template *sht;
        unsigned long           host_flags;
        unsigned long           pio_mask;
        unsigned long           mwdma_mask;
@@ -433,7 +433,7 @@ extern void ata_pci_remove_one (struct pci_dev *pdev);
 #endif /* CONFIG_PCI */
 extern int ata_device_add(const struct ata_probe_ent *ent);
 extern void ata_host_set_remove(struct ata_host_set *host_set);
-extern int ata_scsi_detect(Scsi_Host_Template *sht);
+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 int ata_scsi_error(struct Scsi_Host *host);
@@ -777,4 +777,17 @@ static inline unsigned int __ac_err_mask(u8 status)
        return mask;
 }
 
+static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev)
+{
+       ap->pad_dma = 0;
+       ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
+                                    &ap->pad_dma, GFP_KERNEL);
+       return (ap->pad == NULL) ? -ENOMEM : 0;
+}
+
+static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
+{
+       dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
+}
+
 #endif /* __LINUX_LIBATA_H__ */