0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _SAS_ATA_H_
0011 #define _SAS_ATA_H_
0012
0013 #include <linux/libata.h>
0014 #include <scsi/libsas.h>
0015
0016 #ifdef CONFIG_SCSI_SAS_ATA
0017
0018 static inline int dev_is_sata(struct domain_device *dev)
0019 {
0020 return dev->dev_type == SAS_SATA_DEV || dev->dev_type == SAS_SATA_PM ||
0021 dev->dev_type == SAS_SATA_PM_PORT || dev->dev_type == SAS_SATA_PENDING;
0022 }
0023
0024 int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy);
0025 int sas_ata_init(struct domain_device *dev);
0026 void sas_ata_task_abort(struct sas_task *task);
0027 void sas_ata_strategy_handler(struct Scsi_Host *shost);
0028 void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q);
0029 void sas_ata_schedule_reset(struct domain_device *dev);
0030 void sas_ata_wait_eh(struct domain_device *dev);
0031 void sas_probe_sata(struct asd_sas_port *port);
0032 void sas_suspend_sata(struct asd_sas_port *port);
0033 void sas_resume_sata(struct asd_sas_port *port);
0034 void sas_ata_end_eh(struct ata_port *ap);
0035 int sas_execute_ata_cmd(struct domain_device *device, u8 *fis,
0036 int force_phy_id);
0037 int sas_ata_wait_after_reset(struct domain_device *dev, unsigned long deadline);
0038 #else
0039
0040
0041 static inline int dev_is_sata(struct domain_device *dev)
0042 {
0043 return 0;
0044 }
0045 static inline int sas_ata_init(struct domain_device *dev)
0046 {
0047 return 0;
0048 }
0049 static inline void sas_ata_task_abort(struct sas_task *task)
0050 {
0051 }
0052
0053 static inline void sas_ata_strategy_handler(struct Scsi_Host *shost)
0054 {
0055 }
0056
0057 static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q)
0058 {
0059 }
0060
0061 static inline void sas_ata_schedule_reset(struct domain_device *dev)
0062 {
0063 }
0064
0065 static inline void sas_ata_wait_eh(struct domain_device *dev)
0066 {
0067 }
0068
0069 static inline void sas_probe_sata(struct asd_sas_port *port)
0070 {
0071 }
0072
0073 static inline void sas_suspend_sata(struct asd_sas_port *port)
0074 {
0075 }
0076
0077 static inline void sas_resume_sata(struct asd_sas_port *port)
0078 {
0079 }
0080
0081 static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
0082 {
0083 return 0;
0084 }
0085
0086 static inline void sas_ata_end_eh(struct ata_port *ap)
0087 {
0088 }
0089
0090 static inline int sas_execute_ata_cmd(struct domain_device *device, u8 *fis,
0091 int force_phy_id)
0092 {
0093 return 0;
0094 }
0095
0096 static inline int sas_ata_wait_after_reset(struct domain_device *dev,
0097 unsigned long deadline)
0098 {
0099 return -ETIMEDOUT;
0100 }
0101 #endif
0102
0103 #endif