sas_ata.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 bool dev_is_sata(struct domain_device *dev)
  15. {
  16. switch (dev->dev_type) {
  17. case SAS_SATA_DEV:
  18. case SAS_SATA_PENDING:
  19. case SAS_SATA_PM:
  20. case SAS_SATA_PM_PORT:
  21. return true;
  22. default:
  23. return false;
  24. }
  25. }
  26. void sas_ata_schedule_reset(struct domain_device *dev);
  27. void sas_ata_device_link_abort(struct domain_device *dev, bool force_reset);
  28. int sas_execute_ata_cmd(struct domain_device *device, u8 *fis, int force_phy_id);
  29. int smp_ata_check_ready_type(struct ata_link *link);
  30. extern const struct attribute_group sas_ata_sdev_attr_group;
  31. #else
  32. static inline bool dev_is_sata(struct domain_device *dev)
  33. {
  34. return false;
  35. }
  36. static inline void sas_ata_schedule_reset(struct domain_device *dev)
  37. {
  38. }
  39. static inline void sas_ata_device_link_abort(struct domain_device *dev,
  40. bool force_reset)
  41. {
  42. }
  43. static inline int sas_execute_ata_cmd(struct domain_device *device, u8 *fis,
  44. int force_phy_id)
  45. {
  46. return 0;
  47. }
  48. static inline int smp_ata_check_ready_type(struct ata_link *link)
  49. {
  50. return 0;
  51. }
  52. #define sas_ata_sdev_attr_group ((struct attribute_group) {})
  53. #endif
  54. #endif /* _SAS_ATA_H_ */