aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-04-07 09:47:21 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:24 -0400
commit127102aea2ea9ec4e9ca233e2b1a75c8d3b058c4 (patch)
tree92fb528eac658adbc7307a009bd8a7558db2658a /include/linux/libata.h
parent350756f6dab6d37ef9ed3f18dec520e88969ddac (diff)
libata: make SFF support optional
Now that SFF support is completely separated out from the core layer, it can be made optional. Add CONFIG_ATA_SFF and let SFF drivers depend on it. If CONFIG_ATA_SFF isn't set, all codes in libata-sff.c and data structures for SFF support are disabled. This saves good number of bytes for small systems. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 037db1883bae..db77b90003fd 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -445,6 +445,7 @@ enum link_pm {
445}; 445};
446extern struct class_device_attribute class_device_attr_link_power_management_policy; 446extern struct class_device_attribute class_device_attr_link_power_management_policy;
447 447
448#ifdef CONFIG_ATA_SFF
448struct ata_ioports { 449struct ata_ioports {
449 void __iomem *cmd_addr; 450 void __iomem *cmd_addr;
450 void __iomem *data_addr; 451 void __iomem *data_addr;
@@ -462,6 +463,7 @@ struct ata_ioports {
462 void __iomem *bmdma_addr; 463 void __iomem *bmdma_addr;
463 void __iomem *scr_addr; 464 void __iomem *scr_addr;
464}; 465};
466#endif /* CONFIG_ATA_SFF */
465 467
466struct ata_host { 468struct ata_host {
467 spinlock_t lock; 469 spinlock_t lock;
@@ -648,7 +650,9 @@ struct ata_port {
648 struct ata_prd *prd; /* our SG list */ 650 struct ata_prd *prd; /* our SG list */
649 dma_addr_t prd_dma; /* and its DMA mapping */ 651 dma_addr_t prd_dma; /* and its DMA mapping */
650 652
653#ifdef CONFIG_ATA_SFF
651 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ 654 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
655#endif /* CONFIG_ATA_SFF */
652 656
653 u8 ctl; /* cache of ATA control register */ 657 u8 ctl; /* cache of ATA control register */
654 u8 last_ctl; /* Cache last written value */ 658 u8 last_ctl; /* Cache last written value */
@@ -760,6 +764,7 @@ struct ata_port_operations {
760 void (*port_stop)(struct ata_port *ap); 764 void (*port_stop)(struct ata_port *ap);
761 void (*host_stop)(struct ata_host *host); 765 void (*host_stop)(struct ata_host *host);
762 766
767#ifdef CONFIG_ATA_SFF
763 /* 768 /*
764 * SFF / taskfile oriented ops 769 * SFF / taskfile oriented ops
765 */ 770 */
@@ -779,6 +784,7 @@ struct ata_port_operations {
779 void (*bmdma_start)(struct ata_queued_cmd *qc); 784 void (*bmdma_start)(struct ata_queued_cmd *qc);
780 void (*bmdma_stop)(struct ata_queued_cmd *qc); 785 void (*bmdma_stop)(struct ata_queued_cmd *qc);
781 u8 (*bmdma_status)(struct ata_port *ap); 786 u8 (*bmdma_status)(struct ata_port *ap);
787#endif /* CONFIG_ATA_SFF */
782 788
783 /* 789 /*
784 * Obsolete 790 * Obsolete
@@ -1349,6 +1355,8 @@ static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
1349/************************************************************************** 1355/**************************************************************************
1350 * SFF - drivers/ata/libata-sff.c 1356 * SFF - drivers/ata/libata-sff.c
1351 */ 1357 */
1358#ifdef CONFIG_ATA_SFF
1359
1352extern const struct ata_port_operations ata_sff_port_ops; 1360extern const struct ata_port_operations ata_sff_port_ops;
1353extern const struct ata_port_operations ata_bmdma_port_ops; 1361extern const struct ata_port_operations ata_bmdma_port_ops;
1354 1362
@@ -1489,5 +1497,6 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
1489 1497
1490 return status; 1498 return status;
1491} 1499}
1500#endif /* CONFIG_ATA_SFF */
1492 1501
1493#endif /* __LINUX_LIBATA_H__ */ 1502#endif /* __LINUX_LIBATA_H__ */