diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 09:47:22 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:25 -0400 |
commit | 88fcd5627563722483427a55113c0a83f56e8080 (patch) | |
tree | 6a596e33d6497fbed58147e8fdb59b611d956c12 /include/linux/libata.h | |
parent | 071f44b1d2c051641b62a3571223314737ccbe59 (diff) |
libata: make PMP support optional
Make PMP support optional by adding CONFIG_SATA_PMP and leaving out
libata-pmp.c if it isn't set. PMP helpers return constant values if
PMP support is not enabled and PMP declarations alias non-PMP
counterparts. This makes the compiler to leave out PMP related part
out and LLDs to use non-PMP counterparts automatically.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 1908bf484743..165734a2dd47 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1092,6 +1092,7 @@ extern const struct ata_port_operations sata_port_ops; | |||
1092 | /* | 1092 | /* |
1093 | * PMP helpers | 1093 | * PMP helpers |
1094 | */ | 1094 | */ |
1095 | #ifdef CONFIG_SATA_PMP | ||
1095 | static inline bool sata_pmp_supported(struct ata_port *ap) | 1096 | static inline bool sata_pmp_supported(struct ata_port *ap) |
1096 | { | 1097 | { |
1097 | return ap->flags & ATA_FLAG_PMP; | 1098 | return ap->flags & ATA_FLAG_PMP; |
@@ -1106,6 +1107,22 @@ static inline int ata_is_host_link(const struct ata_link *link) | |||
1106 | { | 1107 | { |
1107 | return link == &link->ap->link; | 1108 | return link == &link->ap->link; |
1108 | } | 1109 | } |
1110 | #else /* CONFIG_SATA_PMP */ | ||
1111 | static inline bool sata_pmp_supported(struct ata_port *ap) | ||
1112 | { | ||
1113 | return false; | ||
1114 | } | ||
1115 | |||
1116 | static inline bool sata_pmp_attached(struct ata_port *ap) | ||
1117 | { | ||
1118 | return false; | ||
1119 | } | ||
1120 | |||
1121 | static inline int ata_is_host_link(const struct ata_link *link) | ||
1122 | { | ||
1123 | return 1; | ||
1124 | } | ||
1125 | #endif /* CONFIG_SATA_PMP */ | ||
1109 | 1126 | ||
1110 | static inline int sata_srst_pmp(struct ata_link *link) | 1127 | static inline int sata_srst_pmp(struct ata_link *link) |
1111 | { | 1128 | { |
@@ -1369,11 +1386,21 @@ static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) | |||
1369 | /************************************************************************** | 1386 | /************************************************************************** |
1370 | * PMP - drivers/ata/libata-pmp.c | 1387 | * PMP - drivers/ata/libata-pmp.c |
1371 | */ | 1388 | */ |
1389 | #ifdef CONFIG_SATA_PMP | ||
1390 | |||
1372 | extern const struct ata_port_operations sata_pmp_port_ops; | 1391 | extern const struct ata_port_operations sata_pmp_port_ops; |
1373 | 1392 | ||
1374 | extern int sata_pmp_qc_defer_cmd_switch(struct ata_queued_cmd *qc); | 1393 | extern int sata_pmp_qc_defer_cmd_switch(struct ata_queued_cmd *qc); |
1375 | extern void sata_pmp_error_handler(struct ata_port *ap); | 1394 | extern void sata_pmp_error_handler(struct ata_port *ap); |
1376 | 1395 | ||
1396 | #else /* CONFIG_SATA_PMP */ | ||
1397 | |||
1398 | #define sata_pmp_port_ops sata_port_ops | ||
1399 | #define sata_pmp_qc_defer_cmd_switch ata_std_qc_defer | ||
1400 | #define sata_pmp_error_handler ata_std_error_handler | ||
1401 | |||
1402 | #endif /* CONFIG_SATA_PMP */ | ||
1403 | |||
1377 | 1404 | ||
1378 | /************************************************************************** | 1405 | /************************************************************************** |
1379 | * SFF - drivers/ata/libata-sff.c | 1406 | * SFF - drivers/ata/libata-sff.c |