blob: 416c9c47d0e72f3a39812e3ad8a1f8e1eed10b68 [file] [log] [blame]
Thomas Gleixner1a59d1b82019-05-27 08:55:05 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Darrick J. Wong338ec572006-10-18 14:43:37 -07002/*
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. Wong338ec572006-10-18 14:43:37 -07008 */
9
10#ifndef _SAS_ATA_H_
11#define _SAS_ATA_H_
12
13#include <linux/libata.h>
14#include <scsi/libsas.h>
15
James Bottomleyb9142172007-07-22 13:15:55 -050016#ifdef CONFIG_SCSI_SAS_ATA
17
Darrick J. Wong338ec572006-10-18 14:43:37 -070018static inline int dev_is_sata(struct domain_device *dev)
19{
James Bottomleyaa9f8322013-05-07 14:44:06 -070020 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. Wong338ec572006-10-18 14:43:37 -070022}
23
Dan Williams354cf822012-01-12 17:57:35 -080024int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy);
Dan Williamsb2024452012-03-21 21:09:07 -070025int sas_ata_init(struct domain_device *dev);
Darrick J. Wong3a2755a2007-01-30 01:18:58 -080026void sas_ata_task_abort(struct sas_task *task);
James Bottomley00dd4992011-01-23 09:44:12 -060027void sas_ata_strategy_handler(struct Scsi_Host *shost);
Dan Williamsd230ce62012-01-11 12:08:36 -080028void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q,
29 struct list_head *done_q);
Dan Williamsb52df412011-11-30 23:23:33 -080030void sas_ata_schedule_reset(struct domain_device *dev);
Dan Williams81c757b2011-12-02 16:07:01 -080031void sas_ata_wait_eh(struct domain_device *dev);
Dan Williams9508a662012-01-18 20:47:01 -080032void sas_probe_sata(struct asd_sas_port *port);
Dan Williams303694e2012-06-21 23:41:51 -070033void sas_suspend_sata(struct asd_sas_port *port);
34void sas_resume_sata(struct asd_sas_port *port);
Dan Williamse4a9c372012-06-21 23:25:27 -070035void sas_ata_end_eh(struct ata_port *ap);
James Bottomleyb9142172007-07-22 13:15:55 -050036#else
37
38
39static inline int dev_is_sata(struct domain_device *dev)
40{
41 return 0;
42}
Dan Williamsb2024452012-03-21 21:09:07 -070043static inline int sas_ata_init(struct domain_device *dev)
James Bottomleyb9142172007-07-22 13:15:55 -050044{
45 return 0;
46}
James Bottomley79bc1482008-04-03 09:04:31 -050047static inline void sas_ata_task_abort(struct sas_task *task)
James Bottomleyb9142172007-07-22 13:15:55 -050048{
49}
James Bottomley00dd4992011-01-23 09:44:12 -060050
51static inline void sas_ata_strategy_handler(struct Scsi_Host *shost)
52{
53}
54
Dan Williamsd230ce62012-01-11 12:08:36 -080055static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q,
56 struct list_head *done_q)
James Bottomley00dd4992011-01-23 09:44:12 -060057{
James Bottomley00dd4992011-01-23 09:44:12 -060058}
59
Dan Williamsb52df412011-11-30 23:23:33 -080060static inline void sas_ata_schedule_reset(struct domain_device *dev)
61{
62}
63
Dan Williams81c757b2011-12-02 16:07:01 -080064static inline void sas_ata_wait_eh(struct domain_device *dev)
65{
66}
Dan Williams354cf822012-01-12 17:57:35 -080067
Dan Williams9508a662012-01-18 20:47:01 -080068static inline void sas_probe_sata(struct asd_sas_port *port)
69{
70}
71
Dan Williams303694e2012-06-21 23:41:51 -070072static inline void sas_suspend_sata(struct asd_sas_port *port)
73{
74}
75
76static inline void sas_resume_sata(struct asd_sas_port *port)
77{
78}
79
Dan Williams354cf822012-01-12 17:57:35 -080080static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
81{
82 return 0;
83}
Dan Williamse4a9c372012-06-21 23:25:27 -070084
85static inline void sas_ata_end_eh(struct ata_port *ap)
86{
87}
James Bottomleyb9142172007-07-22 13:15:55 -050088#endif
89
Darrick J. Wong338ec572006-10-18 14:43:37 -070090#endif /* _SAS_ATA_H_ */