Commit 48515f6c authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata: separate PMP support code from core code

Most of PMP support code is already in libata-pmp.c.  All that are in
libata-core.c are sata_pmp_port_ops and EXPORTs.  Move them to
libata-pmp.c.  Also, collect PMP related prototypes and declarations
in header files and move them right above of SFF stuff.

This change is to make PMP support optional.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent 127102ae
...@@ -86,15 +86,6 @@ const struct ata_port_operations sata_port_ops = { ...@@ -86,15 +86,6 @@ const struct ata_port_operations sata_port_ops = {
.hardreset = sata_std_hardreset, .hardreset = sata_std_hardreset,
}; };
const struct ata_port_operations sata_pmp_port_ops = {
.inherits = &sata_port_ops,
.pmp_prereset = ata_std_prereset,
.pmp_hardreset = sata_std_hardreset,
.pmp_postreset = ata_std_postreset,
.error_handler = sata_pmp_error_handler,
};
static unsigned int ata_dev_init_params(struct ata_device *dev, static unsigned int ata_dev_init_params(struct ata_device *dev,
u16 heads, u16 sectors); u16 heads, u16 sectors);
static unsigned int ata_dev_set_xfermode(struct ata_device *dev); static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
...@@ -6192,7 +6183,6 @@ EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug); ...@@ -6192,7 +6183,6 @@ EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug);
EXPORT_SYMBOL_GPL(sata_deb_timing_long); EXPORT_SYMBOL_GPL(sata_deb_timing_long);
EXPORT_SYMBOL_GPL(ata_base_port_ops); EXPORT_SYMBOL_GPL(ata_base_port_ops);
EXPORT_SYMBOL_GPL(sata_port_ops); EXPORT_SYMBOL_GPL(sata_port_ops);
EXPORT_SYMBOL_GPL(sata_pmp_port_ops);
EXPORT_SYMBOL_GPL(ata_dummy_port_ops); EXPORT_SYMBOL_GPL(ata_dummy_port_ops);
EXPORT_SYMBOL_GPL(ata_dummy_port_info); EXPORT_SYMBOL_GPL(ata_dummy_port_info);
EXPORT_SYMBOL_GPL(ata_std_bios_param); EXPORT_SYMBOL_GPL(ata_std_bios_param);
...@@ -6272,9 +6262,6 @@ EXPORT_SYMBOL_GPL(ata_pci_device_resume); ...@@ -6272,9 +6262,6 @@ EXPORT_SYMBOL_GPL(ata_pci_device_resume);
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
EXPORT_SYMBOL_GPL(sata_pmp_qc_defer_cmd_switch);
EXPORT_SYMBOL_GPL(sata_pmp_error_handler);
EXPORT_SYMBOL_GPL(__ata_ehi_push_desc); EXPORT_SYMBOL_GPL(__ata_ehi_push_desc);
EXPORT_SYMBOL_GPL(ata_ehi_push_desc); EXPORT_SYMBOL_GPL(ata_ehi_push_desc);
EXPORT_SYMBOL_GPL(ata_ehi_clear_desc); EXPORT_SYMBOL_GPL(ata_ehi_clear_desc);
......
...@@ -11,6 +11,14 @@ ...@@ -11,6 +11,14 @@
#include <linux/libata.h> #include <linux/libata.h>
#include "libata.h" #include "libata.h"
const struct ata_port_operations sata_pmp_port_ops = {
.inherits = &sata_port_ops,
.pmp_prereset = ata_std_prereset,
.pmp_hardreset = sata_std_hardreset,
.pmp_postreset = ata_std_postreset,
.error_handler = sata_pmp_error_handler,
};
/** /**
* sata_pmp_read - read PMP register * sata_pmp_read - read PMP register
* @link: link to read PMP register for * @link: link to read PMP register for
...@@ -1012,3 +1020,7 @@ void sata_pmp_error_handler(struct ata_port *ap) ...@@ -1012,3 +1020,7 @@ void sata_pmp_error_handler(struct ata_port *ap)
sata_pmp_eh_recover(ap); sata_pmp_eh_recover(ap);
ata_eh_finish(ap); ata_eh_finish(ap);
} }
EXPORT_SYMBOL_GPL(sata_pmp_port_ops);
EXPORT_SYMBOL_GPL(sata_pmp_qc_defer_cmd_switch);
EXPORT_SYMBOL_GPL(sata_pmp_error_handler);
...@@ -179,11 +179,6 @@ extern void ata_schedule_scsi_eh(struct Scsi_Host *shost); ...@@ -179,11 +179,6 @@ extern void ata_schedule_scsi_eh(struct Scsi_Host *shost);
extern void ata_scsi_dev_rescan(struct work_struct *work); extern void ata_scsi_dev_rescan(struct work_struct *work);
extern int ata_bus_probe(struct ata_port *ap); extern int ata_bus_probe(struct ata_port *ap);
/* libata-pmp.c */
extern int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *val);
extern int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val);
extern int sata_pmp_attach(struct ata_device *dev);
/* libata-eh.c */ /* libata-eh.c */
extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd); extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd);
extern void ata_scsi_error(struct Scsi_Host *host); extern void ata_scsi_error(struct Scsi_Host *host);
...@@ -207,6 +202,11 @@ extern int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, ...@@ -207,6 +202,11 @@ extern int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
struct ata_link **r_failed_disk); struct ata_link **r_failed_disk);
extern void ata_eh_finish(struct ata_port *ap); extern void ata_eh_finish(struct ata_port *ap);
/* libata-pmp.c */
extern int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *val);
extern int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val);
extern int sata_pmp_attach(struct ata_device *dev);
/* libata-sff.c */ /* libata-sff.c */
#ifdef CONFIG_ATA_SFF #ifdef CONFIG_ATA_SFF
extern void ata_dev_select(struct ata_port *ap, unsigned int device, extern void ata_dev_select(struct ata_port *ap, unsigned int device,
......
...@@ -1026,12 +1026,6 @@ static inline int ata_acpi_cbl_80wire(struct ata_port *ap, ...@@ -1026,12 +1026,6 @@ static inline int ata_acpi_cbl_80wire(struct ata_port *ap,
} }
#endif #endif
/*
* PMP - drivers/ata/libata-pmp.c
*/
extern int sata_pmp_qc_defer_cmd_switch(struct ata_queued_cmd *qc);
extern void sata_pmp_error_handler(struct ata_port *ap);
/* /*
* EH - drivers/ata/libata-eh.c * EH - drivers/ata/libata-eh.c
*/ */
...@@ -1075,7 +1069,6 @@ extern void ata_std_error_handler(struct ata_port *ap); ...@@ -1075,7 +1069,6 @@ extern void ata_std_error_handler(struct ata_port *ap);
*/ */
extern const struct ata_port_operations ata_base_port_ops; extern const struct ata_port_operations ata_base_port_ops;
extern const struct ata_port_operations sata_port_ops; extern const struct ata_port_operations sata_port_ops;
extern const struct ata_port_operations sata_pmp_port_ops;
#define ATA_BASE_SHT(drv_name) \ #define ATA_BASE_SHT(drv_name) \
.module = THIS_MODULE, \ .module = THIS_MODULE, \
...@@ -1352,6 +1345,16 @@ static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) ...@@ -1352,6 +1345,16 @@ static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
return *(struct ata_port **)&host->hostdata[0]; return *(struct ata_port **)&host->hostdata[0];
} }
/**************************************************************************
* PMP - drivers/ata/libata-pmp.c
*/
extern const struct ata_port_operations sata_pmp_port_ops;
extern int sata_pmp_qc_defer_cmd_switch(struct ata_queued_cmd *qc);
extern void sata_pmp_error_handler(struct ata_port *ap);
/************************************************************************** /**************************************************************************
* SFF - drivers/ata/libata-sff.c * SFF - drivers/ata/libata-sff.c
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment