aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-05-19 16:10:24 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-05-25 19:41:12 -0400
commit9a7780c9acb821fe1c2b6fc53f74cc2556ff5364 (patch)
tree9590f79a1a0631120322ecfa8a86f610859d7aec /include/linux
parentd6b0de8c28ef32d081cfee938e443ce2a2429cfe (diff)
libata-sff: make BMDMA optional
Make BMDMA optional depending on new config variable CONFIG_ATA_BMDMA. In Kconfig, drivers are grouped into five groups - non-SFF native, SFF w/ custom DMA interface, SFF w/ BMDMA, PIO-only SFF, and generic fallback / legacy ones. Kconfig and Makefile are reorganized according to the groups and ordered alphabetically inside each group. ata_ioports.bmdma_addr and ata_port.bmdma_prd[_dma] are put into CONFIG_ATA_BMDMA, as are all bmdma related ops, variables and functions. This increase the binary size slightly when BMDMA is enabled but on both native-only and PIO-only configurations the size is slightly reduced. Either way, the size difference is insignificant. This change is more meaningful to signify the separation between SFF and BMDMA and as a tool to verify the separation. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/libata.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index fe2be88bc266..4c5eca4e663b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -513,7 +513,9 @@ struct ata_ioports {
513 void __iomem *command_addr; 513 void __iomem *command_addr;
514 void __iomem *altstatus_addr; 514 void __iomem *altstatus_addr;
515 void __iomem *ctl_addr; 515 void __iomem *ctl_addr;
516#ifdef CONFIG_ATA_BMDMA
516 void __iomem *bmdma_addr; 517 void __iomem *bmdma_addr;
518#endif /* CONFIG_ATA_BMDMA */
517 void __iomem *scr_addr; 519 void __iomem *scr_addr;
518}; 520};
519#endif /* CONFIG_ATA_SFF */ 521#endif /* CONFIG_ATA_SFF */
@@ -721,8 +723,10 @@ struct ata_port {
721 u8 ctl; /* cache of ATA control register */ 723 u8 ctl; /* cache of ATA control register */
722 u8 last_ctl; /* Cache last written value */ 724 u8 last_ctl; /* Cache last written value */
723 struct delayed_work sff_pio_task; 725 struct delayed_work sff_pio_task;
726#ifdef CONFIG_ATA_BMDMA
724 struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */ 727 struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */
725 dma_addr_t bmdma_prd_dma; /* and its DMA mapping */ 728 dma_addr_t bmdma_prd_dma; /* and its DMA mapping */
729#endif /* CONFIG_ATA_BMDMA */
726#endif /* CONFIG_ATA_SFF */ 730#endif /* CONFIG_ATA_SFF */
727 731
728 unsigned int pio_mask; 732 unsigned int pio_mask;
@@ -856,10 +860,12 @@ struct ata_port_operations {
856 void (*sff_irq_clear)(struct ata_port *); 860 void (*sff_irq_clear)(struct ata_port *);
857 void (*sff_drain_fifo)(struct ata_queued_cmd *qc); 861 void (*sff_drain_fifo)(struct ata_queued_cmd *qc);
858 862
863#ifdef CONFIG_ATA_BMDMA
859 void (*bmdma_setup)(struct ata_queued_cmd *qc); 864 void (*bmdma_setup)(struct ata_queued_cmd *qc);
860 void (*bmdma_start)(struct ata_queued_cmd *qc); 865 void (*bmdma_start)(struct ata_queued_cmd *qc);
861 void (*bmdma_stop)(struct ata_queued_cmd *qc); 866 void (*bmdma_stop)(struct ata_queued_cmd *qc);
862 u8 (*bmdma_status)(struct ata_port *ap); 867 u8 (*bmdma_status)(struct ata_port *ap);
868#endif /* CONFIG_ATA_BMDMA */
863#endif /* CONFIG_ATA_SFF */ 869#endif /* CONFIG_ATA_SFF */
864 870
865 ssize_t (*em_show)(struct ata_port *ap, char *buf); 871 ssize_t (*em_show)(struct ata_port *ap, char *buf);
@@ -1555,7 +1561,6 @@ extern void sata_pmp_error_handler(struct ata_port *ap);
1555#ifdef CONFIG_ATA_SFF 1561#ifdef CONFIG_ATA_SFF
1556 1562
1557extern const struct ata_port_operations ata_sff_port_ops; 1563extern const struct ata_port_operations ata_sff_port_ops;
1558extern const struct ata_port_operations ata_bmdma_port_ops;
1559extern const struct ata_port_operations ata_bmdma32_port_ops; 1564extern const struct ata_port_operations ata_bmdma32_port_ops;
1560 1565
1561/* PIO only, sg_tablesize and dma_boundary limits can be removed */ 1566/* PIO only, sg_tablesize and dma_boundary limits can be removed */
@@ -1564,11 +1569,6 @@ extern const struct ata_port_operations ata_bmdma32_port_ops;
1564 .sg_tablesize = LIBATA_MAX_PRD, \ 1569 .sg_tablesize = LIBATA_MAX_PRD, \
1565 .dma_boundary = ATA_DMA_BOUNDARY 1570 .dma_boundary = ATA_DMA_BOUNDARY
1566 1571
1567#define ATA_BMDMA_SHT(drv_name) \
1568 ATA_BASE_SHT(drv_name), \
1569 .sg_tablesize = LIBATA_MAX_PRD, \
1570 .dma_boundary = ATA_DMA_BOUNDARY
1571
1572extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); 1572extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device);
1573extern u8 ata_sff_check_status(struct ata_port *ap); 1573extern u8 ata_sff_check_status(struct ata_port *ap);
1574extern void ata_sff_pause(struct ata_port *ap); 1574extern void ata_sff_pause(struct ata_port *ap);
@@ -1625,6 +1625,15 @@ extern int ata_pci_sff_init_one(struct pci_dev *pdev,
1625 struct scsi_host_template *sht, void *host_priv, int hflags); 1625 struct scsi_host_template *sht, void *host_priv, int hflags);
1626#endif /* CONFIG_PCI */ 1626#endif /* CONFIG_PCI */
1627 1627
1628#ifdef CONFIG_ATA_BMDMA
1629
1630extern const struct ata_port_operations ata_bmdma_port_ops;
1631
1632#define ATA_BMDMA_SHT(drv_name) \
1633 ATA_BASE_SHT(drv_name), \
1634 .sg_tablesize = LIBATA_MAX_PRD, \
1635 .dma_boundary = ATA_DMA_BOUNDARY
1636
1628extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc); 1637extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc);
1629extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc); 1638extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc);
1630extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc); 1639extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc);
@@ -1652,6 +1661,7 @@ extern int ata_pci_bmdma_init_one(struct pci_dev *pdev,
1652 struct scsi_host_template *sht, 1661 struct scsi_host_template *sht,
1653 void *host_priv, int hflags); 1662 void *host_priv, int hflags);
1654#endif /* CONFIG_PCI */ 1663#endif /* CONFIG_PCI */
1664#endif /* CONFIG_ATA_BMDMA */
1655 1665
1656/** 1666/**
1657 * ata_sff_busy_wait - Wait for a port status register 1667 * ata_sff_busy_wait - Wait for a port status register