| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * libata.h - helper library for ATA |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2003-2004 Red Hat, Inc. All rights reserved. |
|---|
| 5 | 6 | * Copyright 2003-2004 Jeff Garzik |
|---|
| 6 | 7 | * |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2, or (at your option) |
|---|
| 11 | | - * any later version. |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 | | - * GNU General Public License for more details. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License |
|---|
| 19 | | - * along with this program; see the file COPYING. If not, write to |
|---|
| 20 | | - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 21 | | - * |
|---|
| 22 | | - * |
|---|
| 23 | 8 | * libata documentation is available via 'make {ps|pdf}docs', |
|---|
| 24 | 9 | * as Documentation/driver-api/libata.rst |
|---|
| 25 | | - * |
|---|
| 26 | 10 | */ |
|---|
| 27 | 11 | |
|---|
| 28 | 12 | #ifndef __LIBATA_H__ |
|---|
| .. | .. |
|---|
| 53 | 37 | extern int libata_allow_tpm; |
|---|
| 54 | 38 | extern const struct device_type ata_port_type; |
|---|
| 55 | 39 | extern struct ata_link *ata_dev_phys_link(struct ata_device *dev); |
|---|
| 40 | +#ifdef CONFIG_ATA_FORCE |
|---|
| 56 | 41 | extern void ata_force_cbl(struct ata_port *ap); |
|---|
| 42 | +#else |
|---|
| 43 | +static inline void ata_force_cbl(struct ata_port *ap) { } |
|---|
| 44 | +#endif |
|---|
| 57 | 45 | extern u64 ata_tf_to_lba(const struct ata_taskfile *tf); |
|---|
| 58 | 46 | extern u64 ata_tf_to_lba48(const struct ata_taskfile *tf); |
|---|
| 59 | 47 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag); |
|---|
| .. | .. |
|---|
| 103 | 91 | |
|---|
| 104 | 92 | #define to_ata_port(d) container_of(d, struct ata_port, tdev) |
|---|
| 105 | 93 | |
|---|
| 94 | +/* libata-sata.c */ |
|---|
| 95 | +#ifdef CONFIG_SATA_HOST |
|---|
| 96 | +int ata_sas_allocate_tag(struct ata_port *ap); |
|---|
| 97 | +void ata_sas_free_tag(unsigned int tag, struct ata_port *ap); |
|---|
| 98 | +#else |
|---|
| 99 | +static inline int ata_sas_allocate_tag(struct ata_port *ap) |
|---|
| 100 | +{ |
|---|
| 101 | + return -EOPNOTSUPP; |
|---|
| 102 | +} |
|---|
| 103 | +static inline void ata_sas_free_tag(unsigned int tag, struct ata_port *ap) { } |
|---|
| 104 | +#endif |
|---|
| 105 | + |
|---|
| 106 | 106 | /* libata-acpi.c */ |
|---|
| 107 | 107 | #ifdef CONFIG_ATA_ACPI |
|---|
| 108 | 108 | extern unsigned int ata_acpi_gtf_filter; |
|---|
| .. | .. |
|---|
| 128 | 128 | #endif |
|---|
| 129 | 129 | |
|---|
| 130 | 130 | /* libata-scsi.c */ |
|---|
| 131 | +extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap, |
|---|
| 132 | + const struct scsi_device *scsidev); |
|---|
| 131 | 133 | extern int ata_scsi_add_hosts(struct ata_host *host, |
|---|
| 132 | 134 | struct scsi_host_template *sht); |
|---|
| 133 | 135 | extern void ata_scsi_scan_host(struct ata_port *ap, int sync); |
|---|
| .. | .. |
|---|
| 144 | 146 | extern int ata_bus_probe(struct ata_port *ap); |
|---|
| 145 | 147 | extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, |
|---|
| 146 | 148 | unsigned int id, u64 lun); |
|---|
| 147 | | -int ata_sas_allocate_tag(struct ata_port *ap); |
|---|
| 148 | | -void ata_sas_free_tag(unsigned int tag, struct ata_port *ap); |
|---|
| 149 | | - |
|---|
| 149 | +void ata_scsi_sdev_config(struct scsi_device *sdev); |
|---|
| 150 | +int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev); |
|---|
| 151 | +void ata_scsi_dump_cdb(struct ata_port *ap, struct scsi_cmnd *cmd); |
|---|
| 152 | +int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev); |
|---|
| 150 | 153 | |
|---|
| 151 | 154 | /* libata-eh.c */ |
|---|
| 152 | 155 | extern unsigned long ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd); |
|---|