Thomas Gleixner | 1a59d1b8 | 2019-05-27 08:55:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Darrick J. Wong | 338ec57 | 2006-10-18 14:43:37 -0700 | [diff] [blame] | 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 |
Darrick J. Wong | 338ec57 | 2006-10-18 14:43:37 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef _SAS_ATA_H_ |
| 11 | #define _SAS_ATA_H_ |
| 12 | |
| 13 | #include <linux/libata.h> |
| 14 | #include <scsi/libsas.h> |
| 15 | |
James Bottomley | b914217 | 2007-07-22 13:15:55 -0500 | [diff] [blame] | 16 | #ifdef CONFIG_SCSI_SAS_ATA |
| 17 | |
Darrick J. Wong | 338ec57 | 2006-10-18 14:43:37 -0700 | [diff] [blame] | 18 | static inline int dev_is_sata(struct domain_device *dev) |
| 19 | { |
James Bottomley | aa9f832 | 2013-05-07 14:44:06 -0700 | [diff] [blame] | 20 | return dev->dev_type == SAS_SATA_DEV || dev->dev_type == SAS_SATA_PM || |
| 21 | dev->dev_type == SAS_SATA_PM_PORT || dev->dev_type == SAS_SATA_PENDING; |
Darrick J. Wong | 338ec57 | 2006-10-18 14:43:37 -0700 | [diff] [blame] | 22 | } |
| 23 | |
Dan Williams | 354cf82 | 2012-01-12 17:57:35 -0800 | [diff] [blame] | 24 | int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy); |
Dan Williams | b202445 | 2012-03-21 21:09:07 -0700 | [diff] [blame] | 25 | int sas_ata_init(struct domain_device *dev); |
Darrick J. Wong | 3a2755a | 2007-01-30 01:18:58 -0800 | [diff] [blame] | 26 | void sas_ata_task_abort(struct sas_task *task); |
James Bottomley | 00dd499 | 2011-01-23 09:44:12 -0600 | [diff] [blame] | 27 | void sas_ata_strategy_handler(struct Scsi_Host *shost); |
Dan Williams | d230ce6 | 2012-01-11 12:08:36 -0800 | [diff] [blame] | 28 | void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, |
| 29 | struct list_head *done_q); |
Dan Williams | b52df41 | 2011-11-30 23:23:33 -0800 | [diff] [blame] | 30 | void sas_ata_schedule_reset(struct domain_device *dev); |
Dan Williams | 81c757b | 2011-12-02 16:07:01 -0800 | [diff] [blame] | 31 | void sas_ata_wait_eh(struct domain_device *dev); |
Dan Williams | 9508a66 | 2012-01-18 20:47:01 -0800 | [diff] [blame] | 32 | void sas_probe_sata(struct asd_sas_port *port); |
Dan Williams | 303694e | 2012-06-21 23:41:51 -0700 | [diff] [blame] | 33 | void sas_suspend_sata(struct asd_sas_port *port); |
| 34 | void sas_resume_sata(struct asd_sas_port *port); |
Dan Williams | e4a9c37 | 2012-06-21 23:25:27 -0700 | [diff] [blame] | 35 | void sas_ata_end_eh(struct ata_port *ap); |
James Bottomley | b914217 | 2007-07-22 13:15:55 -0500 | [diff] [blame] | 36 | #else |
| 37 | |
| 38 | |
| 39 | static inline int dev_is_sata(struct domain_device *dev) |
| 40 | { |
| 41 | return 0; |
| 42 | } |
Dan Williams | b202445 | 2012-03-21 21:09:07 -0700 | [diff] [blame] | 43 | static inline int sas_ata_init(struct domain_device *dev) |
James Bottomley | b914217 | 2007-07-22 13:15:55 -0500 | [diff] [blame] | 44 | { |
| 45 | return 0; |
| 46 | } |
James Bottomley | 79bc148 | 2008-04-03 09:04:31 -0500 | [diff] [blame] | 47 | static inline void sas_ata_task_abort(struct sas_task *task) |
James Bottomley | b914217 | 2007-07-22 13:15:55 -0500 | [diff] [blame] | 48 | { |
| 49 | } |
James Bottomley | 00dd499 | 2011-01-23 09:44:12 -0600 | [diff] [blame] | 50 | |
| 51 | static inline void sas_ata_strategy_handler(struct Scsi_Host *shost) |
| 52 | { |
| 53 | } |
| 54 | |
Dan Williams | d230ce6 | 2012-01-11 12:08:36 -0800 | [diff] [blame] | 55 | static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, |
| 56 | struct list_head *done_q) |
James Bottomley | 00dd499 | 2011-01-23 09:44:12 -0600 | [diff] [blame] | 57 | { |
James Bottomley | 00dd499 | 2011-01-23 09:44:12 -0600 | [diff] [blame] | 58 | } |
| 59 | |
Dan Williams | b52df41 | 2011-11-30 23:23:33 -0800 | [diff] [blame] | 60 | static inline void sas_ata_schedule_reset(struct domain_device *dev) |
| 61 | { |
| 62 | } |
| 63 | |
Dan Williams | 81c757b | 2011-12-02 16:07:01 -0800 | [diff] [blame] | 64 | static inline void sas_ata_wait_eh(struct domain_device *dev) |
| 65 | { |
| 66 | } |
Dan Williams | 354cf82 | 2012-01-12 17:57:35 -0800 | [diff] [blame] | 67 | |
Dan Williams | 9508a66 | 2012-01-18 20:47:01 -0800 | [diff] [blame] | 68 | static inline void sas_probe_sata(struct asd_sas_port *port) |
| 69 | { |
| 70 | } |
| 71 | |
Dan Williams | 303694e | 2012-06-21 23:41:51 -0700 | [diff] [blame] | 72 | static inline void sas_suspend_sata(struct asd_sas_port *port) |
| 73 | { |
| 74 | } |
| 75 | |
| 76 | static inline void sas_resume_sata(struct asd_sas_port *port) |
| 77 | { |
| 78 | } |
| 79 | |
Dan Williams | 354cf82 | 2012-01-12 17:57:35 -0800 | [diff] [blame] | 80 | static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy) |
| 81 | { |
| 82 | return 0; |
| 83 | } |
Dan Williams | e4a9c37 | 2012-06-21 23:25:27 -0700 | [diff] [blame] | 84 | |
| 85 | static inline void sas_ata_end_eh(struct ata_port *ap) |
| 86 | { |
| 87 | } |
James Bottomley | b914217 | 2007-07-22 13:15:55 -0500 | [diff] [blame] | 88 | #endif |
| 89 | |
Darrick J. Wong | 338ec57 | 2006-10-18 14:43:37 -0700 | [diff] [blame] | 90 | #endif /* _SAS_ATA_H_ */ |