sas_ata.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 <djwong@us.ibm.com>, 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. struct list_head *done_q);
  25. void sas_ata_schedule_reset(struct domain_device *dev);
  26. void sas_ata_wait_eh(struct domain_device *dev);
  27. void sas_probe_sata(struct asd_sas_port *port);
  28. void sas_suspend_sata(struct asd_sas_port *port);
  29. void sas_resume_sata(struct asd_sas_port *port);
  30. void sas_ata_end_eh(struct ata_port *ap);
  31. #else
  32. static inline int dev_is_sata(struct domain_device *dev)
  33. {
  34. return 0;
  35. }
  36. static inline int sas_ata_init(struct domain_device *dev)
  37. {
  38. return 0;
  39. }
  40. static inline void sas_ata_task_abort(struct sas_task *task)
  41. {
  42. }
  43. static inline void sas_ata_strategy_handler(struct Scsi_Host *shost)
  44. {
  45. }
  46. static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q,
  47. struct list_head *done_q)
  48. {
  49. }
  50. static inline void sas_ata_schedule_reset(struct domain_device *dev)
  51. {
  52. }
  53. static inline void sas_ata_wait_eh(struct domain_device *dev)
  54. {
  55. }
  56. static inline void sas_probe_sata(struct asd_sas_port *port)
  57. {
  58. }
  59. static inline void sas_suspend_sata(struct asd_sas_port *port)
  60. {
  61. }
  62. static inline void sas_resume_sata(struct asd_sas_port *port)
  63. {
  64. }
  65. static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
  66. {
  67. return 0;
  68. }
  69. static inline void sas_ata_end_eh(struct ata_port *ap)
  70. {
  71. }
  72. #endif
  73. #endif /* _SAS_ATA_H_ */