sas_ata.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Support for SATA devices on Serial Attached SCSI (SAS) controllers
  4. *
  5. * Copyright (C) 2006 IBM Corporation
  6. *
  7. * Written by: Darrick J. Wong <[email protected]>, IBM Corporation
  8. */
  9. #ifndef _SAS_ATA_H_
  10. #define _SAS_ATA_H_
  11. #include <linux/libata.h>
  12. #include <scsi/libsas.h>
  13. #ifdef CONFIG_SCSI_SAS_ATA
  14. static inline int dev_is_sata(struct domain_device *dev)
  15. {
  16. return dev->dev_type == SAS_SATA_DEV || dev->dev_type == SAS_SATA_PM ||
  17. dev->dev_type == SAS_SATA_PM_PORT || dev->dev_type == SAS_SATA_PENDING;
  18. }
  19. int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy);
  20. int sas_ata_init(struct domain_device *dev);
  21. void sas_ata_task_abort(struct sas_task *task);
  22. void sas_ata_strategy_handler(struct Scsi_Host *shost);
  23. void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q);
  24. void sas_ata_schedule_reset(struct domain_device *dev);
  25. void sas_ata_wait_eh(struct domain_device *dev);
  26. void sas_probe_sata(struct asd_sas_port *port);
  27. void sas_suspend_sata(struct asd_sas_port *port);
  28. void sas_resume_sata(struct asd_sas_port *port);
  29. void sas_ata_end_eh(struct ata_port *ap);
  30. void sas_ata_device_link_abort(struct domain_device *dev, bool force_reset);
  31. int sas_execute_ata_cmd(struct domain_device *device, u8 *fis,
  32. int force_phy_id);
  33. int sas_ata_wait_after_reset(struct domain_device *dev, unsigned long deadline);
  34. int smp_ata_check_ready_type(struct ata_link *link);
  35. #else
  36. static inline int dev_is_sata(struct domain_device *dev)
  37. {
  38. return 0;
  39. }
  40. static inline int sas_ata_init(struct domain_device *dev)
  41. {
  42. return 0;
  43. }
  44. static inline void sas_ata_task_abort(struct sas_task *task)
  45. {
  46. }
  47. static inline void sas_ata_strategy_handler(struct Scsi_Host *shost)
  48. {
  49. }
  50. static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q)
  51. {
  52. }
  53. static inline void sas_ata_schedule_reset(struct domain_device *dev)
  54. {
  55. }
  56. static inline void sas_ata_wait_eh(struct domain_device *dev)
  57. {
  58. }
  59. static inline void sas_probe_sata(struct asd_sas_port *port)
  60. {
  61. }
  62. static inline void sas_suspend_sata(struct asd_sas_port *port)
  63. {
  64. }
  65. static inline void sas_resume_sata(struct asd_sas_port *port)
  66. {
  67. }
  68. static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
  69. {
  70. return 0;
  71. }
  72. static inline void sas_ata_end_eh(struct ata_port *ap)
  73. {
  74. }
  75. static inline void sas_ata_device_link_abort(struct domain_device *dev,
  76. bool force_reset)
  77. {
  78. }
  79. static inline int sas_execute_ata_cmd(struct domain_device *device, u8 *fis,
  80. int force_phy_id)
  81. {
  82. return 0;
  83. }
  84. static inline int sas_ata_wait_after_reset(struct domain_device *dev,
  85. unsigned long deadline)
  86. {
  87. return -ETIMEDOUT;
  88. }
  89. static inline int smp_ata_check_ready_type(struct ata_link *link)
  90. {
  91. return 0;
  92. }
  93. #endif
  94. #endif /* _SAS_ATA_H_ */